From 0eff4fc895d538f86c7272e319f4b8a50af4bca5 Mon Sep 17 00:00:00 2001 From: Mia Koring Date: Sat, 6 Sep 2025 04:20:50 +0200 Subject: [PATCH 01/15] Added .onHover for AppKit Backend Added: - onHover(_ action: (Bool) -> Void) View Extension - OnHoverModifier TypeSafeView - createHoverTarget(wrapping: Widget) -> Widget to AppBackend Protocol - updateHoverTarget(_: Widget, environment: EnvironmentValues, action: (Bool) -> Void) to AppBackend Protocol - corresponding default implementations - AppKitBackend hover implementation - createHoverTarget implementation - updateHoverTarget implementation - NSCustomHoverTarget (NSView notifying about hovers) - HoverExample Fixed: - AppKitBackend - fixed reference removing for NSClickGestureRecognizer in NSCustomTapGestureTarget --- Examples/Bundler.toml | 5 + Examples/Package.swift | 4 + Examples/Sources/HoverExample/HoverApp.swift | 52 ++++++++ Sources/AppKitBackend/AppKitBackend.swift | 88 ++++++++++++- Sources/SwiftCrossUI/Backend/AppBackend.swift | 116 +++++++++++------- .../Modifiers/Handlers/OnHoverModifier.swift | 59 +++++++++ 6 files changed, 276 insertions(+), 48 deletions(-) create mode 100644 Examples/Sources/HoverExample/HoverApp.swift create mode 100644 Sources/SwiftCrossUI/Views/Modifiers/Handlers/OnHoverModifier.swift diff --git a/Examples/Bundler.toml b/Examples/Bundler.toml index 7d0f8864a9..3b96dc6128 100644 --- a/Examples/Bundler.toml +++ b/Examples/Bundler.toml @@ -59,3 +59,8 @@ version = '0.1.0' identifier = 'dev.swiftcrossui.WebViewExample' product = 'WebViewExample' version = '0.1.0' + +[apps.HoverExample] +identifier = 'dev.swiftcrossui.HoverExample' +product = 'HoverExample' +version = '0.1.0' diff --git a/Examples/Package.swift b/Examples/Package.swift index 11f210b821..31797fffd3 100644 --- a/Examples/Package.swift +++ b/Examples/Package.swift @@ -72,6 +72,10 @@ let package = Package( .executableTarget( name: "WebViewExample", dependencies: exampleDependencies + ), + .executableTarget( + name: "HoverExample", + dependencies: exampleDependencies ) ] ) diff --git a/Examples/Sources/HoverExample/HoverApp.swift b/Examples/Sources/HoverExample/HoverApp.swift new file mode 100644 index 0000000000..a5e141aeca --- /dev/null +++ b/Examples/Sources/HoverExample/HoverApp.swift @@ -0,0 +1,52 @@ +import DefaultBackend +import SwiftCrossUI +import Foundation + +#if canImport(SwiftBundlerRuntime) + import SwiftBundlerRuntime +#endif + +@main +struct HoverExample: App { + var body: some Scene { + WindowGroup("Hover Example") { + VStack(spacing: 0) { + ForEach([Bool](repeating: false, count: 18)) { _ in + HStack(spacing: 0) { + ForEach([Bool](repeating: false, count: 30)) { _ in + CellView() + } + } + } + } + .background(Color.black) + } + .defaultSize(width: 900, height: 540) + } +} + +struct CellView: View { + @State var timer: Timer? + @Environment(\.colorScheme) var colorScheme + @State var opacity: Float = 0.0 + + var body: some View { + Rectangle() + .foregroundColor(Color.blue.opacity(opacity)) + .onHover { hovering in + if !hovering { + timer = Timer.scheduledTimer(withTimeInterval: 0.05, repeats: true) { timer in + if opacity >= 0.05 { + opacity -= 0.05 + } else { + opacity = 0.0 + timer.invalidate() + } + } + } else { + opacity = 1.0 + timer = nil + } + } + } +} diff --git a/Sources/AppKitBackend/AppKitBackend.swift b/Sources/AppKitBackend/AppKitBackend.swift index 469a2f3bbf..e41f213578 100644 --- a/Sources/AppKitBackend/AppKitBackend.swift +++ b/Sources/AppKitBackend/AppKitBackend.swift @@ -1424,6 +1424,40 @@ public final class AppKitBackend: AppBackend { tapGestureTarget.longPressHandler = action } } + + public func createHoverTarget(wrapping child: Widget) -> Widget { + let container = NSView() + + container.addSubview(child) + child.leadingAnchor.constraint(equalTo: container.leadingAnchor) + .isActive = true + child.topAnchor.constraint(equalTo: container.topAnchor) + .isActive = true + child.translatesAutoresizingMaskIntoConstraints = false + + let tapGestureTarget = NSCustomHoverTarget() + container.addSubview(tapGestureTarget) + tapGestureTarget.leadingAnchor.constraint(equalTo: container.leadingAnchor) + .isActive = true + tapGestureTarget.topAnchor.constraint(equalTo: container.topAnchor) + .isActive = true + tapGestureTarget.trailingAnchor.constraint(equalTo: container.trailingAnchor) + .isActive = true + tapGestureTarget.bottomAnchor.constraint(equalTo: container.bottomAnchor) + .isActive = true + tapGestureTarget.translatesAutoresizingMaskIntoConstraints = false + + return container + } + + public func updateHoverTarget( + _ container: Widget, + environment: EnvironmentValues, + action: @escaping (Bool) -> Void + ) { + let tapGestureTarget = container.subviews[1] as! NSCustomHoverTarget + tapGestureTarget.hoverChangesHandler = action + } final class NSBezierPathView: NSView { var path: NSBezierPath! @@ -1663,7 +1697,7 @@ final class NSCustomTapGestureTarget: NSView { leftClickRecognizer = gestureRecognizer } else if leftClickHandler == nil, let leftClickRecognizer { removeGestureRecognizer(leftClickRecognizer) - self.leftClickHandler = nil + self.leftClickRecognizer = nil } } } @@ -1678,7 +1712,7 @@ final class NSCustomTapGestureTarget: NSView { rightClickRecognizer = gestureRecognizer } else if rightClickHandler == nil, let rightClickRecognizer { removeGestureRecognizer(rightClickRecognizer) - self.rightClickHandler = nil + self.rightClickRecognizer = nil } } } @@ -1724,6 +1758,56 @@ final class NSCustomTapGestureTarget: NSView { } } +final class NSCustomHoverTarget: NSView { + var hoverChangesHandler: ((Bool) -> Void)? { + didSet { + if hoverChangesHandler != nil && trackingArea == nil { + let options: NSTrackingArea.Options = [ + .mouseEnteredAndExited, + .activeInKeyWindow + ] + let area = NSTrackingArea(rect: self.bounds, + options: options, + owner: self, + userInfo: nil) + addTrackingArea(area) + trackingArea = area + } else if hoverChangesHandler == nil, let trackingArea { + removeTrackingArea(trackingArea) + self.trackingArea = nil + } + } + } + + private var trackingArea: NSTrackingArea? + + override func updateTrackingAreas() { + super.updateTrackingAreas() + if let trackingArea = trackingArea { + self.removeTrackingArea(trackingArea) + } + let options: NSTrackingArea.Options = [ + .mouseEnteredAndExited, + .activeInKeyWindow + ] + + trackingArea = NSTrackingArea(rect: self.bounds, + options: options, + owner: self, + userInfo: nil) + self.addTrackingArea(trackingArea!) + } + + override func mouseEntered(with event: NSEvent) { + hoverChangesHandler?(true) + } + + override func mouseExited(with event: NSEvent) { + // Mouse exited the view's bounds + hoverChangesHandler?(false) + } +} + final class NSCustomMenuItem: NSMenuItem { /// This property's only purpose is to keep a strong reference to the wrapped /// action so that it sticks around for long enough to be useful. diff --git a/Sources/SwiftCrossUI/Backend/AppBackend.swift b/Sources/SwiftCrossUI/Backend/AppBackend.swift index f1e0d2e640..3876465fbb 100644 --- a/Sources/SwiftCrossUI/Backend/AppBackend.swift +++ b/Sources/SwiftCrossUI/Backend/AppBackend.swift @@ -639,6 +639,18 @@ public protocol AppBackend: Sendable { environment: EnvironmentValues, action: @escaping () -> Void ) + + /// Wraps a view in a container that can receive mouse hover events. Some + /// backends may not have to wrap the child, in which case they may + /// just return the child as is. + func createHoverTarget(wrapping child: Widget) -> Widget + /// Update the hover target with a new action. Replaces the old + /// action. + func updateHoverTarget( + _ hoverTarget: Widget, + environment: EnvironmentValues, + action: @escaping (Bool) -> Void + ) // MARK: Paths @@ -714,49 +726,49 @@ extension AppBackend { print("\(type(of: self)): \(function) not implemented") Foundation.exit(1) } - + // MARK: System - + public func openExternalURL(_ url: URL) throws { todo() } - + public func revealFile(_ url: URL) throws { todo() } - + // MARK: Application - + public func setApplicationMenu(_ submenus: [ResolvedMenu.Submenu]) { todo() } - + public func setIncomingURLHandler(to action: @escaping (URL) -> Void) { todo() } - + // MARK: Containers - + public func createColorableRectangle() -> Widget { todo() } - + public func setColor(ofColorableRectangle widget: Widget, to color: Color) { todo() } - + public func setCornerRadius(of widget: Widget, to radius: Int) { todo() } - + public func createScrollContainer(for child: Widget) -> Widget { todo() } - + public func updateScrollContainer(_ scrollView: Widget, environment: EnvironmentValues) { todo() } - + public func setScrollBarPresence( ofScrollContainer scrollView: Widget, hasVerticalScrollBar: Bool, @@ -764,19 +776,19 @@ extension AppBackend { ) { todo() } - + public func createSelectableListView() -> Widget { todo() } - + public func baseItemPadding(ofSelectableListView listView: Widget) -> EdgeInsets { todo() } - + public func minimumRowSize(ofSelectableListView listView: Widget) -> SIMD2 { todo() } - + public func setItems( ofSelectableListView listView: Widget, to items: [Widget], @@ -784,33 +796,33 @@ extension AppBackend { ) { todo() } - + public func setSelectionHandler( forSelectableListView listView: Widget, to action: @escaping (_ selectedIndex: Int) -> Void ) { todo() } - + public func setSelectedItem(ofSelectableListView listView: Widget, toItemAt index: Int?) { todo() } - + public func createSplitView(leadingChild: Widget, trailingChild: Widget) -> Widget { todo() } - + public func setResizeHandler( ofSplitView splitView: Widget, to action: @escaping () -> Void ) { todo() } - + public func sidebarWidth(ofSplitView splitView: Widget) -> Int { todo() } - + public func setSidebarWidthBounds( ofSplitView splitView: Widget, minimum minimumWidth: Int, @@ -818,9 +830,9 @@ extension AppBackend { ) { todo() } - + // MARK: Passive views - + public func size( of text: String, whenDisplayedIn widget: Widget, @@ -829,7 +841,7 @@ extension AppBackend { ) -> SIMD2 { todo() } - + public func createTextView(content: String, shouldWrap: Bool) -> Widget { todo() } @@ -840,11 +852,11 @@ extension AppBackend { ) { todo() } - + public func createImageView() -> Widget { todo() } - + public func updateImageView( _ imageView: Widget, rgbaData: [UInt8], @@ -857,7 +869,7 @@ extension AppBackend { ) { todo() } - + public func createTable() -> Widget { todo() } @@ -878,9 +890,9 @@ extension AppBackend { ) { todo() } - + // MARK: Controls - + public func createButton() -> Widget { todo() } @@ -900,7 +912,7 @@ extension AppBackend { ) { todo() } - + public func createToggle() -> Widget { todo() } @@ -915,7 +927,7 @@ extension AppBackend { public func setState(ofToggle toggle: Widget, to state: Bool) { todo() } - + public func createSwitch() -> Widget { todo() } @@ -929,7 +941,7 @@ extension AppBackend { public func setState(ofSwitch switchWidget: Widget, to state: Bool) { todo() } - + public func createCheckbox() -> Widget { todo() } @@ -943,7 +955,7 @@ extension AppBackend { public func setState(ofCheckbox checkboxWidget: Widget, to state: Bool) { todo() } - + public func createSlider() -> Widget { todo() } @@ -960,7 +972,7 @@ extension AppBackend { public func setValue(ofSlider slider: Widget, to value: Double) { todo() } - + public func createTextField() -> Widget { todo() } @@ -979,7 +991,7 @@ extension AppBackend { public func getContent(ofTextField textField: Widget) -> String { todo() } - + public func createTextEditor() -> Widget { todo() } @@ -996,7 +1008,7 @@ extension AppBackend { public func getContent(ofTextEditor textEditor: Widget) -> String { todo() } - + public func createPicker() -> Widget { todo() } @@ -1011,11 +1023,11 @@ extension AppBackend { public func setSelectedOption(ofPicker picker: Widget, to selectedOption: Int?) { todo() } - + public func createProgressSpinner() -> Widget { todo() } - + public func createProgressBar() -> Widget { todo() } @@ -1026,7 +1038,7 @@ extension AppBackend { ) { todo() } - + public func createPopoverMenu() -> Menu { todo() } @@ -1045,7 +1057,7 @@ extension AppBackend { ) { todo() } - + public func createAlert() -> Alert { todo() } @@ -1067,7 +1079,7 @@ extension AppBackend { public func dismissAlert(_ alert: Alert, window: Window?) { todo() } - + public func showOpenDialog( fileDialogOptions: FileDialogOptions, openDialogOptions: OpenDialogOptions, @@ -1084,7 +1096,7 @@ extension AppBackend { ) { todo() } - + public func createTapGestureTarget(wrapping child: Widget, gesture: TapGesture) -> Widget { todo() } @@ -1096,7 +1108,7 @@ extension AppBackend { ) { todo() } - + // MARK: Paths public func createPathWidget() -> Widget { todo() @@ -1122,7 +1134,7 @@ extension AppBackend { ) { todo() } - + public func createWebView() -> Widget { todo() } @@ -1139,4 +1151,16 @@ extension AppBackend { ) { todo() } + + + public func createHoverTarget(wrapping child: Widget) { + todo() + } + public func updateHoverTarget( + _ hoverTarget: Widget, + environment: EnvironmentValues, + action: @escaping () -> Void + ) { + todo() + } } diff --git a/Sources/SwiftCrossUI/Views/Modifiers/Handlers/OnHoverModifier.swift b/Sources/SwiftCrossUI/Views/Modifiers/Handlers/OnHoverModifier.swift new file mode 100644 index 0000000000..0d1d000f84 --- /dev/null +++ b/Sources/SwiftCrossUI/Views/Modifiers/Handlers/OnHoverModifier.swift @@ -0,0 +1,59 @@ +extension View { + /// Adds an action to perform when the user's pointer enters/leaves this view. + public func onHover(perform action: @escaping (_ hovering: Bool) -> Void) + -> some View + { + OnHoverModifier(body: TupleView1(self), action: action) + } +} + +struct OnHoverModifier: TypeSafeView { + typealias Children = TupleView1.Children + + var body: TupleView1 + var action: (Bool) -> Void + + func children( + backend: Backend, + snapshots: [ViewGraphSnapshotter.NodeSnapshot]?, + environment: EnvironmentValues + ) -> Children { + body.children( + backend: backend, + snapshots: snapshots, + environment: environment + ) + } + + func asWidget( + _ children: Children, + backend: Backend + ) -> Backend.Widget { + backend.createHoverTarget(wrapping: children.child0.widget.into()) + } + + func update( + _ widget: Backend.Widget, + children: Children, + proposedSize: SIMD2, + environment: EnvironmentValues, + backend: Backend, + dryRun: Bool + ) -> ViewUpdateResult { + let childResult = children.child0.update( + with: body.view0, + proposedSize: proposedSize, + environment: environment, + dryRun: dryRun + ) + if !dryRun { + backend.setSize(of: widget, to: childResult.size.size) + backend.updateHoverTarget( + widget, + environment: environment, + action: action + ) + } + return childResult + } +} From 05569988b636b3a79767450d5198e2be07fb0b98 Mon Sep 17 00:00:00 2001 From: Mia Koring Date: Sun, 7 Sep 2025 00:09:00 +0200 Subject: [PATCH 02/15] Fixed Default Hover implementation --- Sources/SwiftCrossUI/Backend/AppBackend.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/SwiftCrossUI/Backend/AppBackend.swift b/Sources/SwiftCrossUI/Backend/AppBackend.swift index 3876465fbb..3c6a8f8161 100644 --- a/Sources/SwiftCrossUI/Backend/AppBackend.swift +++ b/Sources/SwiftCrossUI/Backend/AppBackend.swift @@ -1153,13 +1153,13 @@ extension AppBackend { } - public func createHoverTarget(wrapping child: Widget) { + public func createHoverTarget(wrapping child: Widget) -> Widget { todo() } public func updateHoverTarget( - _ hoverTarget: Widget, + _ container: Widget, environment: EnvironmentValues, - action: @escaping () -> Void + action: @escaping (Bool) -> Void ) { todo() } From 1113eaac72279eccf509fea5a80db6bea906b0e0 Mon Sep 17 00:00:00 2001 From: Mia Koring Date: Sun, 7 Sep 2025 10:05:11 +0200 Subject: [PATCH 03/15] Added UIKit .onHover + minor consistency improvement | fixed minor Naming fixes in AppKitBackend - tapGestureRecognizer and longPressGestureRecognizer now get removed if their corresponding handler is set to nil. - Added Hoverable Widget - Added hovertarget creation & update functions - added macCalatalyst as compatible for UISlider since it supports it --- Examples/Package.swift | 2 +- Sources/AppKitBackend/AppKitBackend.swift | 20 ++++---- .../UIKitBackend/UIKitBackend+Control.swift | 49 ++++++++++++++++++- 3 files changed, 60 insertions(+), 11 deletions(-) diff --git a/Examples/Package.swift b/Examples/Package.swift index 31797fffd3..1735fc7675 100644 --- a/Examples/Package.swift +++ b/Examples/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 5.10 import Foundation import PackageDescription diff --git a/Sources/AppKitBackend/AppKitBackend.swift b/Sources/AppKitBackend/AppKitBackend.swift index e41f213578..8ce36b93a7 100644 --- a/Sources/AppKitBackend/AppKitBackend.swift +++ b/Sources/AppKitBackend/AppKitBackend.swift @@ -1435,17 +1435,17 @@ public final class AppKitBackend: AppBackend { .isActive = true child.translatesAutoresizingMaskIntoConstraints = false - let tapGestureTarget = NSCustomHoverTarget() - container.addSubview(tapGestureTarget) - tapGestureTarget.leadingAnchor.constraint(equalTo: container.leadingAnchor) + let hoverGestureTarget = NSCustomHoverTarget() + container.addSubview(hoverGestureTarget) + hoverGestureTarget.leadingAnchor.constraint(equalTo: container.leadingAnchor) .isActive = true - tapGestureTarget.topAnchor.constraint(equalTo: container.topAnchor) + hoverGestureTarget.topAnchor.constraint(equalTo: container.topAnchor) .isActive = true - tapGestureTarget.trailingAnchor.constraint(equalTo: container.trailingAnchor) + hoverGestureTarget.trailingAnchor.constraint(equalTo: container.trailingAnchor) .isActive = true - tapGestureTarget.bottomAnchor.constraint(equalTo: container.bottomAnchor) + hoverGestureTarget.bottomAnchor.constraint(equalTo: container.bottomAnchor) .isActive = true - tapGestureTarget.translatesAutoresizingMaskIntoConstraints = false + hoverGestureTarget.translatesAutoresizingMaskIntoConstraints = false return container } @@ -1455,8 +1455,8 @@ public final class AppKitBackend: AppBackend { environment: EnvironmentValues, action: @escaping (Bool) -> Void ) { - let tapGestureTarget = container.subviews[1] as! NSCustomHoverTarget - tapGestureTarget.hoverChangesHandler = action + let hoverGestureTarget = container.subviews[1] as! NSCustomHoverTarget + hoverGestureTarget.hoverChangesHandler = action } final class NSBezierPathView: NSView { @@ -1773,6 +1773,8 @@ final class NSCustomHoverTarget: NSView { addTrackingArea(area) trackingArea = area } else if hoverChangesHandler == nil, let trackingArea { + // should be impossible at the moment of implementation + // keeping it to be save in case of later changes removeTrackingArea(trackingArea) self.trackingArea = nil } diff --git a/Sources/UIKitBackend/UIKitBackend+Control.swift b/Sources/UIKitBackend/UIKitBackend+Control.swift index 2446545f49..4ed1d7a272 100644 --- a/Sources/UIKitBackend/UIKitBackend+Control.swift +++ b/Sources/UIKitBackend/UIKitBackend+Control.swift @@ -133,6 +133,9 @@ final class TappableWidget: ContainerWidget { target: self, action: #selector(viewTouched)) child.view.addGestureRecognizer(gestureRecognizer) self.tapGestureRecognizer = gestureRecognizer + } else if onTap == nil, let tapGestureRecognizer { + child.view.removeGestureRecognizer(tapGestureRecognizer) + self.tapGestureRecognizer = nil } } } @@ -144,6 +147,9 @@ final class TappableWidget: ContainerWidget { target: self, action: #selector(viewLongPressed(sender:))) child.view.addGestureRecognizer(gestureRecognizer) self.longPressGestureRecognizer = gestureRecognizer + } else if onLongPress == nil, let longPressGestureRecognizer { + child.view.removeGestureRecognizer(longPressGestureRecognizer) + self.onLongPress = nil } } } @@ -164,6 +170,36 @@ final class TappableWidget: ContainerWidget { } } + +@available(tvOS, unavailable) +final class HoverableWidget: ContainerWidget { + private var hoverGestureRecognizer: UIHoverGestureRecognizer? + + var hoverChangesHandler: ((Bool) -> Void)? { + didSet { + if hoverChangesHandler != nil && hoverGestureRecognizer == nil { + let gestureRecognizer = UIHoverGestureRecognizer(target: self, + action: #selector(hoveringChanged(_:))) + child.view.addGestureRecognizer(gestureRecognizer) + self.hoverGestureRecognizer = gestureRecognizer + } else if hoverChangesHandler == nil, let hoverGestureRecognizer { + // should be impossible at the moment of implementation + // keeping it to be save in case of later changes + child.view.removeGestureRecognizer(hoverGestureRecognizer) + self.hoverGestureRecognizer = nil + } + } + } + + @objc + func hoveringChanged(_ recognizer: UIHoverGestureRecognizer) { + switch recognizer.state { + case .began: hoverChangesHandler?(true) + case .ended: hoverChangesHandler?(false) + default: break + } + } +} @available(tvOS, unavailable) final class SliderWidget: WrapperWidget { var onChange: ((Double) -> Void)? @@ -413,8 +449,19 @@ extension UIKitBackend { wrapper.onLongPress = environment.isEnabled ? action : {} } } + + public func createHoverTarget(wrapping child: Widget) -> Widget { + HoverableWidget(child: child) + } + + public func updateHoverTarget(_ hoverTarget: any WidgetProtocol, + environment: EnvironmentValues, + action: @escaping (Bool) -> Void) { + let wrapper = hoverTarget as! HoverableWidget + wrapper.hoverChangesHandler = action + } - #if os(iOS) || os(visionOS) + #if os(iOS) || os(visionOS) || targetEnvironment(macCatalyst) public func createSlider() -> Widget { SliderWidget() } From 95261cf24922ee240104132a4273e94052251697 Mon Sep 17 00:00:00 2001 From: Mia Koring Date: Sun, 7 Sep 2025 10:05:11 +0200 Subject: [PATCH 04/15] Added UIKit .onHover + minor consistency improvement | fixed minor Naming fixes in AppKitBackend - tapGestureRecognizer and longPressGestureRecognizer now get removed if their corresponding handler is set to nil. - Added Hoverable Widget - Added hovertarget creation & update functions - added macCalatalyst as compatible for UISlider since it supports it --- Examples/Sources/HoverExample/HoverApp.swift | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Examples/Sources/HoverExample/HoverApp.swift b/Examples/Sources/HoverExample/HoverApp.swift index a5e141aeca..195ca9bcfe 100644 --- a/Examples/Sources/HoverExample/HoverApp.swift +++ b/Examples/Sources/HoverExample/HoverApp.swift @@ -36,11 +36,13 @@ struct CellView: View { .onHover { hovering in if !hovering { timer = Timer.scheduledTimer(withTimeInterval: 0.05, repeats: true) { timer in - if opacity >= 0.05 { - opacity -= 0.05 - } else { - opacity = 0.0 - timer.invalidate() + DispatchQueue.main.async { + if opacity >= 0.05 { + opacity -= 0.05 + } else { + opacity = 0.0 + timer.invalidate() + } } } } else { From 77794a06e03b9658ccd806507592866599c72835 Mon Sep 17 00:00:00 2001 From: Mia Koring Date: Sun, 7 Sep 2025 21:45:58 +0200 Subject: [PATCH 05/15] added gtk4 support --- Examples/Sources/HoverExample/HoverApp.swift | 3 + Sources/Gtk/Generated/Accessible.swift | 23 +- .../Generated/AccessibleAutocomplete.swift | 64 +- .../Generated/AccessibleInvalidState.swift | 50 +- .../Gtk/Generated/AccessibleProperty.swift | 288 +-- .../Gtk/Generated/AccessibleRelation.swift | 268 +-- Sources/Gtk/Generated/AccessibleRole.swift | 986 +++++----- Sources/Gtk/Generated/AccessibleSort.swift | 50 +- Sources/Gtk/Generated/AccessibleState.swift | 122 +- .../Gtk/Generated/AccessibleTristate.swift | 38 +- Sources/Gtk/Generated/Actionable.swift | 9 +- Sources/Gtk/Generated/Align.swift | 56 +- Sources/Gtk/Generated/AppChooser.swift | 15 +- Sources/Gtk/Generated/ArrowType.swift | 60 +- Sources/Gtk/Generated/AssistantPageType.swift | 96 +- Sources/Gtk/Generated/BaselinePosition.swift | 38 +- Sources/Gtk/Generated/BorderStyle.swift | 120 +- Sources/Gtk/Generated/Buildable.swift | 10 +- Sources/Gtk/Generated/BuilderError.swift | 202 +- Sources/Gtk/Generated/BuilderScope.swift | 14 +- Sources/Gtk/Generated/Button.swift | 350 ++-- Sources/Gtk/Generated/ButtonsType.swift | 76 +- Sources/Gtk/Generated/CellEditable.swift | 53 +- Sources/Gtk/Generated/CellLayout.swift | 40 +- .../Gtk/Generated/CellRendererAccelMode.swift | 24 +- Sources/Gtk/Generated/CellRendererMode.swift | 42 +- Sources/Gtk/Generated/CheckButton.swift | 354 ++-- .../Gtk/Generated/ConstraintAttribute.swift | 162 +- .../Gtk/Generated/ConstraintRelation.swift | 36 +- .../Gtk/Generated/ConstraintStrength.swift | 50 +- Sources/Gtk/Generated/ConstraintTarget.swift | 6 +- .../Generated/ConstraintVflParserError.swift | 75 +- Sources/Gtk/Generated/CornerType.swift | 58 +- Sources/Gtk/Generated/CssParserError.swift | 62 +- Sources/Gtk/Generated/CssParserWarning.swift | 42 +- Sources/Gtk/Generated/DeleteType.swift | 108 +- Sources/Gtk/Generated/DirectionType.swift | 72 +- Sources/Gtk/Generated/DrawingArea.swift | 130 +- Sources/Gtk/Generated/DropDown.swift | 343 ++-- Sources/Gtk/Generated/Editable.swift | 130 +- .../Gtk/Generated/EditableProperties.swift | 110 +- Sources/Gtk/Generated/Entry.swift | 1680 ++++++++--------- Sources/Gtk/Generated/EntryIconPosition.swift | 24 +- Sources/Gtk/Generated/EventController.swift | 121 +- .../Gtk/Generated/EventControllerMotion.swift | 101 + .../Gtk/Generated/EventSequenceState.swift | 36 +- Sources/Gtk/Generated/FileChooser.swift | 59 +- Sources/Gtk/Generated/FileChooserAction.swift | 46 +- Sources/Gtk/Generated/FileChooserError.swift | 52 +- Sources/Gtk/Generated/FileChooserNative.swift | 339 ++-- Sources/Gtk/Generated/FilterChange.swift | 50 +- Sources/Gtk/Generated/FilterMatch.swift | 44 +- Sources/Gtk/Generated/FontChooser.swift | 38 +- Sources/Gtk/Generated/GLArea.swift | 432 +++-- Sources/Gtk/Generated/Gesture.swift | 273 ++- Sources/Gtk/Generated/GestureClick.swift | 122 +- Sources/Gtk/Generated/GestureLongPress.swift | 86 +- Sources/Gtk/Generated/GestureSingle.swift | 98 +- Sources/Gtk/Generated/IconSize.swift | 40 +- Sources/Gtk/Generated/IconThemeError.swift | 24 +- .../Gtk/Generated/IconViewDropPosition.swift | 72 +- Sources/Gtk/Generated/Image.swift | 432 +++-- Sources/Gtk/Generated/ImageType.swift | 52 +- Sources/Gtk/Generated/InputPurpose.swift | 140 +- Sources/Gtk/Generated/Justification.swift | 48 +- Sources/Gtk/Generated/Label.swift | 980 +++++----- Sources/Gtk/Generated/LevelBarMode.swift | 26 +- Sources/Gtk/Generated/ListBox.swift | 348 ++-- Sources/Gtk/Generated/MessageType.swift | 60 +- Sources/Gtk/Generated/MovementStep.swift | 120 +- Sources/Gtk/Generated/Native.swift | 12 +- Sources/Gtk/Generated/NativeDialog.swift | 156 +- Sources/Gtk/Generated/NotebookTab.swift | 24 +- Sources/Gtk/Generated/NumberUpLayout.swift | 96 +- Sources/Gtk/Generated/Ordering.swift | 38 +- Sources/Gtk/Generated/Orientation.swift | 26 +- Sources/Gtk/Generated/Overflow.swift | 30 +- Sources/Gtk/Generated/PackType.swift | 26 +- Sources/Gtk/Generated/PadActionType.swift | 42 +- Sources/Gtk/Generated/PageOrientation.swift | 48 +- Sources/Gtk/Generated/PageSet.swift | 36 +- Sources/Gtk/Generated/PanDirection.swift | 48 +- Sources/Gtk/Generated/Picture.swift | 256 ++- Sources/Gtk/Generated/PolicyType.swift | 58 +- Sources/Gtk/Generated/Popover.swift | 321 ++-- Sources/Gtk/Generated/PositionType.swift | 50 +- Sources/Gtk/Generated/PrintDuplex.swift | 36 +- Sources/Gtk/Generated/PrintError.swift | 50 +- .../Gtk/Generated/PrintOperationAction.swift | 56 +- .../Gtk/Generated/PrintOperationResult.swift | 54 +- Sources/Gtk/Generated/PrintPages.swift | 48 +- Sources/Gtk/Generated/PrintQuality.swift | 48 +- Sources/Gtk/Generated/PrintStatus.swift | 120 +- Sources/Gtk/Generated/ProgressBar.swift | 249 ++- Sources/Gtk/Generated/PropagationLimit.swift | 32 +- Sources/Gtk/Generated/PropagationPhase.swift | 62 +- Sources/Gtk/Generated/Range.swift | 343 ++-- .../Gtk/Generated/RecentManagerError.swift | 94 +- Sources/Gtk/Generated/ResponseType.swift | 136 +- .../Generated/RevealerTransitionType.swift | 120 +- Sources/Gtk/Generated/Root.swift | 12 +- Sources/Gtk/Generated/Scale.swift | 202 +- Sources/Gtk/Generated/ScrollStep.swift | 72 +- Sources/Gtk/Generated/ScrollType.swift | 192 +- Sources/Gtk/Generated/Scrollable.swift | 23 +- Sources/Gtk/Generated/ScrollablePolicy.swift | 24 +- Sources/Gtk/Generated/SelectionMode.swift | 64 +- Sources/Gtk/Generated/SelectionModel.swift | 29 +- Sources/Gtk/Generated/SensitivityType.swift | 38 +- Sources/Gtk/Generated/ShortcutManager.swift | 10 +- Sources/Gtk/Generated/ShortcutScope.swift | 42 +- Sources/Gtk/Generated/ShortcutType.swift | 126 +- Sources/Gtk/Generated/SizeGroupMode.swift | 48 +- Sources/Gtk/Generated/SizeRequestMode.swift | 36 +- Sources/Gtk/Generated/SortType.swift | 24 +- Sources/Gtk/Generated/SorterChange.swift | 58 +- Sources/Gtk/Generated/SorterOrder.swift | 42 +- .../Generated/SpinButtonUpdatePolicy.swift | 32 +- Sources/Gtk/Generated/SpinType.swift | 84 +- Sources/Gtk/Generated/Spinner.swift | 51 +- .../Gtk/Generated/StackTransitionType.swift | 278 +-- .../Gtk/Generated/StringFilterMatchMode.swift | 42 +- Sources/Gtk/Generated/StyleProvider.swift | 10 +- Sources/Gtk/Generated/Switch.swift | 241 ++- Sources/Gtk/Generated/SystemSetting.swift | 80 +- Sources/Gtk/Generated/TextDirection.swift | 36 +- .../Gtk/Generated/TextExtendSelection.swift | 28 +- Sources/Gtk/Generated/TextViewLayer.swift | 24 +- Sources/Gtk/Generated/TextWindowType.swift | 72 +- Sources/Gtk/Generated/TreeDragDest.swift | 4 +- Sources/Gtk/Generated/TreeDragSource.swift | 4 +- Sources/Gtk/Generated/TreeSortable.swift | 11 +- .../Gtk/Generated/TreeViewColumnSizing.swift | 36 +- .../Gtk/Generated/TreeViewDropPosition.swift | 48 +- Sources/Gtk/Generated/TreeViewGridLines.swift | 48 +- Sources/Gtk/Generated/Unit.swift | 48 +- Sources/Gtk/Generated/WrapMode.swift | 54 +- Sources/GtkBackend/GtkBackend.swift | 19 + Sources/GtkCodeGen/GtkCodeGen.swift | 2 +- 139 files changed, 7867 insertions(+), 7920 deletions(-) create mode 100644 Sources/Gtk/Generated/EventControllerMotion.swift diff --git a/Examples/Sources/HoverExample/HoverApp.swift b/Examples/Sources/HoverExample/HoverApp.swift index 195ca9bcfe..292c87f56c 100644 --- a/Examples/Sources/HoverExample/HoverApp.swift +++ b/Examples/Sources/HoverExample/HoverApp.swift @@ -20,6 +20,9 @@ struct HoverExample: App { } } .background(Color.black) + .onAppear { + print(type(of: backend)) + } } .defaultSize(width: 900, height: 540) } diff --git a/Sources/Gtk/Generated/Accessible.swift b/Sources/Gtk/Generated/Accessible.swift index 4659bc8e0f..4a356e0d18 100644 --- a/Sources/Gtk/Generated/Accessible.swift +++ b/Sources/Gtk/Generated/Accessible.swift @@ -1,30 +1,30 @@ import CGtk /// An interface for describing UI elements for Assistive Technologies. -/// +/// /// Every accessible implementation has: -/// +/// /// - a “role”, represented by a value of the [enum@Gtk.AccessibleRole] enumeration /// - “attributes”, represented by a set of [enum@Gtk.AccessibleState], /// [enum@Gtk.AccessibleProperty] and [enum@Gtk.AccessibleRelation] values -/// +/// /// The role cannot be changed after instantiating a `GtkAccessible` /// implementation. -/// +/// /// The attributes are updated every time a UI element's state changes in /// a way that should be reflected by assistive technologies. For instance, /// if a `GtkWidget` visibility changes, the %GTK_ACCESSIBLE_STATE_HIDDEN /// state will also change to reflect the [property@Gtk.Widget:visible] property. -/// +/// /// Every accessible implementation is part of a tree of accessible objects. /// Normally, this tree corresponds to the widget tree, but can be customized /// by reimplementing the [vfunc@Gtk.Accessible.get_accessible_parent], /// [vfunc@Gtk.Accessible.get_first_accessible_child] and /// [vfunc@Gtk.Accessible.get_next_accessible_sibling] virtual functions. -/// +/// /// Note that you can not create a top-level accessible object as of now, /// which means that you must always have a parent accessible object. -/// +/// /// Also note that when an accessible object does not correspond to a widget, /// and it has children, whose implementation you don't control, /// it is necessary to ensure the correct shape of the a11y tree @@ -32,8 +32,9 @@ import CGtk /// updating the sibling by [method@Gtk.Accessible.update_next_accessible_sibling]. public protocol Accessible: GObjectRepresentable { /// The accessible role of the given `GtkAccessible` implementation. - /// - /// The accessible role cannot be changed once set. - var accessibleRole: AccessibleRole { get set } +/// +/// The accessible role cannot be changed once set. +var accessibleRole: AccessibleRole { get set } -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AccessibleAutocomplete.swift b/Sources/Gtk/Generated/AccessibleAutocomplete.swift index 1af0f8d331..f877f61ae8 100644 --- a/Sources/Gtk/Generated/AccessibleAutocomplete.swift +++ b/Sources/Gtk/Generated/AccessibleAutocomplete.swift @@ -6,36 +6,36 @@ public enum AccessibleAutocomplete: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleAutocomplete /// Automatic suggestions are not displayed. - case none - /// When a user is providing input, text - /// suggesting one way to complete the provided input may be dynamically - /// inserted after the caret. - case inline - /// When a user is providing input, an element - /// containing a collection of values that could complete the provided input - /// may be displayed. - case list - /// When a user is providing input, an element - /// containing a collection of values that could complete the provided input - /// may be displayed. If displayed, one value in the collection is automatically - /// selected, and the text needed to complete the automatically selected value - /// appears after the caret in the input. - case both +case none +/// When a user is providing input, text +/// suggesting one way to complete the provided input may be dynamically +/// inserted after the caret. +case inline +/// When a user is providing input, an element +/// containing a collection of values that could complete the provided input +/// may be displayed. +case list +/// When a user is providing input, an element +/// containing a collection of values that could complete the provided input +/// may be displayed. If displayed, one value in the collection is automatically +/// selected, and the text needed to complete the automatically selected value +/// appears after the caret in the input. +case both public static var type: GType { - gtk_accessible_autocomplete_get_type() - } + gtk_accessible_autocomplete_get_type() +} public init(from gtkEnum: GtkAccessibleAutocomplete) { switch gtkEnum { case GTK_ACCESSIBLE_AUTOCOMPLETE_NONE: - self = .none - case GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE: - self = .inline - case GTK_ACCESSIBLE_AUTOCOMPLETE_LIST: - self = .list - case GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH: - self = .both + self = .none +case GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE: + self = .inline +case GTK_ACCESSIBLE_AUTOCOMPLETE_LIST: + self = .list +case GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH: + self = .both default: fatalError("Unsupported GtkAccessibleAutocomplete enum value: \(gtkEnum.rawValue)") } @@ -44,13 +44,13 @@ public enum AccessibleAutocomplete: GValueRepresentableEnum { public func toGtk() -> GtkAccessibleAutocomplete { switch self { case .none: - return GTK_ACCESSIBLE_AUTOCOMPLETE_NONE - case .inline: - return GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE - case .list: - return GTK_ACCESSIBLE_AUTOCOMPLETE_LIST - case .both: - return GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH + return GTK_ACCESSIBLE_AUTOCOMPLETE_NONE +case .inline: + return GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE +case .list: + return GTK_ACCESSIBLE_AUTOCOMPLETE_LIST +case .both: + return GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AccessibleInvalidState.swift b/Sources/Gtk/Generated/AccessibleInvalidState.swift index be5eff22c3..76c2055efe 100644 --- a/Sources/Gtk/Generated/AccessibleInvalidState.swift +++ b/Sources/Gtk/Generated/AccessibleInvalidState.swift @@ -2,7 +2,7 @@ import CGtk /// The possible values for the %GTK_ACCESSIBLE_STATE_INVALID /// accessible state. -/// +/// /// Note that the %GTK_ACCESSIBLE_INVALID_FALSE and /// %GTK_ACCESSIBLE_INVALID_TRUE have the same values /// as %FALSE and %TRUE. @@ -10,28 +10,28 @@ public enum AccessibleInvalidState: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleInvalidState /// There are no detected errors in the value - case false_ - /// The value entered by the user has failed validation - case true_ - /// A grammatical error was detected - case grammar - /// A spelling error was detected - case spelling +case false_ +/// The value entered by the user has failed validation +case true_ +/// A grammatical error was detected +case grammar +/// A spelling error was detected +case spelling public static var type: GType { - gtk_accessible_invalid_state_get_type() - } + gtk_accessible_invalid_state_get_type() +} public init(from gtkEnum: GtkAccessibleInvalidState) { switch gtkEnum { case GTK_ACCESSIBLE_INVALID_FALSE: - self = .false_ - case GTK_ACCESSIBLE_INVALID_TRUE: - self = .true_ - case GTK_ACCESSIBLE_INVALID_GRAMMAR: - self = .grammar - case GTK_ACCESSIBLE_INVALID_SPELLING: - self = .spelling + self = .false_ +case GTK_ACCESSIBLE_INVALID_TRUE: + self = .true_ +case GTK_ACCESSIBLE_INVALID_GRAMMAR: + self = .grammar +case GTK_ACCESSIBLE_INVALID_SPELLING: + self = .spelling default: fatalError("Unsupported GtkAccessibleInvalidState enum value: \(gtkEnum.rawValue)") } @@ -40,13 +40,13 @@ public enum AccessibleInvalidState: GValueRepresentableEnum { public func toGtk() -> GtkAccessibleInvalidState { switch self { case .false_: - return GTK_ACCESSIBLE_INVALID_FALSE - case .true_: - return GTK_ACCESSIBLE_INVALID_TRUE - case .grammar: - return GTK_ACCESSIBLE_INVALID_GRAMMAR - case .spelling: - return GTK_ACCESSIBLE_INVALID_SPELLING + return GTK_ACCESSIBLE_INVALID_FALSE +case .true_: + return GTK_ACCESSIBLE_INVALID_TRUE +case .grammar: + return GTK_ACCESSIBLE_INVALID_GRAMMAR +case .spelling: + return GTK_ACCESSIBLE_INVALID_SPELLING } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AccessibleProperty.swift b/Sources/Gtk/Generated/AccessibleProperty.swift index a30c276c15..a98b3b4e67 100644 --- a/Sources/Gtk/Generated/AccessibleProperty.swift +++ b/Sources/Gtk/Generated/AccessibleProperty.swift @@ -5,118 +5,118 @@ public enum AccessibleProperty: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleProperty /// Indicates whether inputting text - /// could trigger display of one or more predictions of the user's intended - /// value for a combobox, searchbox, or textbox and specifies how predictions - /// would be presented if they were made. Value type: [enum@AccessibleAutocomplete] - case autocomplete - /// Defines a string value that describes - /// or annotates the current element. Value type: string - case description - /// Indicates the availability and type of - /// interactive popup element, such as menu or dialog, that can be triggered - /// by an element. - case hasPopup - /// Indicates keyboard shortcuts that an - /// author has implemented to activate or give focus to an element. Value type: - /// string. The format of the value is a space-separated list of shortcuts, with - /// each shortcut consisting of one or more modifiers (`Control`, `Alt` or `Shift`), - /// followed by a non-modifier key, all separated by `+`. - /// Examples: `F2`, `Alt-F`, `Control+Shift+N` - case keyShortcuts - /// Defines a string value that labels the current - /// element. Value type: string - case label - /// Defines the hierarchical level of an element - /// within a structure. Value type: integer - case level - /// Indicates whether an element is modal when - /// displayed. Value type: boolean - case modal - /// Indicates whether a text box accepts - /// multiple lines of input or only a single line. Value type: boolean - case multiLine - /// Indicates that the user may select - /// more than one item from the current selectable descendants. Value type: - /// boolean - case multiSelectable - /// Indicates whether the element's - /// orientation is horizontal, vertical, or unknown/ambiguous. Value type: - /// [enum@Orientation] - case orientation - /// Defines a short hint (a word or short - /// phrase) intended to aid the user with data entry when the control has no - /// value. A hint could be a sample value or a brief description of the expected - /// format. Value type: string - case placeholder - /// Indicates that the element is not editable, - /// but is otherwise operable. Value type: boolean - case readOnly - /// Indicates that user input is required on - /// the element before a form may be submitted. Value type: boolean - case required - /// Defines a human-readable, - /// author-localized description for the role of an element. Value type: string - case roleDescription - /// Indicates if items in a table or grid are - /// sorted in ascending or descending order. Value type: [enum@AccessibleSort] - case sort - /// Defines the maximum allowed value for a - /// range widget. Value type: double - case valueMax - /// Defines the minimum allowed value for a - /// range widget. Value type: double - case valueMin - /// Defines the current value for a range widget. - /// Value type: double - case valueNow - /// Defines the human readable text alternative - /// of aria-valuenow for a range widget. Value type: string - case valueText +/// could trigger display of one or more predictions of the user's intended +/// value for a combobox, searchbox, or textbox and specifies how predictions +/// would be presented if they were made. Value type: [enum@AccessibleAutocomplete] +case autocomplete +/// Defines a string value that describes +/// or annotates the current element. Value type: string +case description +/// Indicates the availability and type of +/// interactive popup element, such as menu or dialog, that can be triggered +/// by an element. +case hasPopup +/// Indicates keyboard shortcuts that an +/// author has implemented to activate or give focus to an element. Value type: +/// string. The format of the value is a space-separated list of shortcuts, with +/// each shortcut consisting of one or more modifiers (`Control`, `Alt` or `Shift`), +/// followed by a non-modifier key, all separated by `+`. +/// Examples: `F2`, `Alt-F`, `Control+Shift+N` +case keyShortcuts +/// Defines a string value that labels the current +/// element. Value type: string +case label +/// Defines the hierarchical level of an element +/// within a structure. Value type: integer +case level +/// Indicates whether an element is modal when +/// displayed. Value type: boolean +case modal +/// Indicates whether a text box accepts +/// multiple lines of input or only a single line. Value type: boolean +case multiLine +/// Indicates that the user may select +/// more than one item from the current selectable descendants. Value type: +/// boolean +case multiSelectable +/// Indicates whether the element's +/// orientation is horizontal, vertical, or unknown/ambiguous. Value type: +/// [enum@Orientation] +case orientation +/// Defines a short hint (a word or short +/// phrase) intended to aid the user with data entry when the control has no +/// value. A hint could be a sample value or a brief description of the expected +/// format. Value type: string +case placeholder +/// Indicates that the element is not editable, +/// but is otherwise operable. Value type: boolean +case readOnly +/// Indicates that user input is required on +/// the element before a form may be submitted. Value type: boolean +case required +/// Defines a human-readable, +/// author-localized description for the role of an element. Value type: string +case roleDescription +/// Indicates if items in a table or grid are +/// sorted in ascending or descending order. Value type: [enum@AccessibleSort] +case sort +/// Defines the maximum allowed value for a +/// range widget. Value type: double +case valueMax +/// Defines the minimum allowed value for a +/// range widget. Value type: double +case valueMin +/// Defines the current value for a range widget. +/// Value type: double +case valueNow +/// Defines the human readable text alternative +/// of aria-valuenow for a range widget. Value type: string +case valueText public static var type: GType { - gtk_accessible_property_get_type() - } + gtk_accessible_property_get_type() +} public init(from gtkEnum: GtkAccessibleProperty) { switch gtkEnum { case GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE: - self = .autocomplete - case GTK_ACCESSIBLE_PROPERTY_DESCRIPTION: - self = .description - case GTK_ACCESSIBLE_PROPERTY_HAS_POPUP: - self = .hasPopup - case GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS: - self = .keyShortcuts - case GTK_ACCESSIBLE_PROPERTY_LABEL: - self = .label - case GTK_ACCESSIBLE_PROPERTY_LEVEL: - self = .level - case GTK_ACCESSIBLE_PROPERTY_MODAL: - self = .modal - case GTK_ACCESSIBLE_PROPERTY_MULTI_LINE: - self = .multiLine - case GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE: - self = .multiSelectable - case GTK_ACCESSIBLE_PROPERTY_ORIENTATION: - self = .orientation - case GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER: - self = .placeholder - case GTK_ACCESSIBLE_PROPERTY_READ_ONLY: - self = .readOnly - case GTK_ACCESSIBLE_PROPERTY_REQUIRED: - self = .required - case GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION: - self = .roleDescription - case GTK_ACCESSIBLE_PROPERTY_SORT: - self = .sort - case GTK_ACCESSIBLE_PROPERTY_VALUE_MAX: - self = .valueMax - case GTK_ACCESSIBLE_PROPERTY_VALUE_MIN: - self = .valueMin - case GTK_ACCESSIBLE_PROPERTY_VALUE_NOW: - self = .valueNow - case GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT: - self = .valueText + self = .autocomplete +case GTK_ACCESSIBLE_PROPERTY_DESCRIPTION: + self = .description +case GTK_ACCESSIBLE_PROPERTY_HAS_POPUP: + self = .hasPopup +case GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS: + self = .keyShortcuts +case GTK_ACCESSIBLE_PROPERTY_LABEL: + self = .label +case GTK_ACCESSIBLE_PROPERTY_LEVEL: + self = .level +case GTK_ACCESSIBLE_PROPERTY_MODAL: + self = .modal +case GTK_ACCESSIBLE_PROPERTY_MULTI_LINE: + self = .multiLine +case GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE: + self = .multiSelectable +case GTK_ACCESSIBLE_PROPERTY_ORIENTATION: + self = .orientation +case GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER: + self = .placeholder +case GTK_ACCESSIBLE_PROPERTY_READ_ONLY: + self = .readOnly +case GTK_ACCESSIBLE_PROPERTY_REQUIRED: + self = .required +case GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION: + self = .roleDescription +case GTK_ACCESSIBLE_PROPERTY_SORT: + self = .sort +case GTK_ACCESSIBLE_PROPERTY_VALUE_MAX: + self = .valueMax +case GTK_ACCESSIBLE_PROPERTY_VALUE_MIN: + self = .valueMin +case GTK_ACCESSIBLE_PROPERTY_VALUE_NOW: + self = .valueNow +case GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT: + self = .valueText default: fatalError("Unsupported GtkAccessibleProperty enum value: \(gtkEnum.rawValue)") } @@ -125,43 +125,43 @@ public enum AccessibleProperty: GValueRepresentableEnum { public func toGtk() -> GtkAccessibleProperty { switch self { case .autocomplete: - return GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE - case .description: - return GTK_ACCESSIBLE_PROPERTY_DESCRIPTION - case .hasPopup: - return GTK_ACCESSIBLE_PROPERTY_HAS_POPUP - case .keyShortcuts: - return GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS - case .label: - return GTK_ACCESSIBLE_PROPERTY_LABEL - case .level: - return GTK_ACCESSIBLE_PROPERTY_LEVEL - case .modal: - return GTK_ACCESSIBLE_PROPERTY_MODAL - case .multiLine: - return GTK_ACCESSIBLE_PROPERTY_MULTI_LINE - case .multiSelectable: - return GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE - case .orientation: - return GTK_ACCESSIBLE_PROPERTY_ORIENTATION - case .placeholder: - return GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER - case .readOnly: - return GTK_ACCESSIBLE_PROPERTY_READ_ONLY - case .required: - return GTK_ACCESSIBLE_PROPERTY_REQUIRED - case .roleDescription: - return GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION - case .sort: - return GTK_ACCESSIBLE_PROPERTY_SORT - case .valueMax: - return GTK_ACCESSIBLE_PROPERTY_VALUE_MAX - case .valueMin: - return GTK_ACCESSIBLE_PROPERTY_VALUE_MIN - case .valueNow: - return GTK_ACCESSIBLE_PROPERTY_VALUE_NOW - case .valueText: - return GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT + return GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE +case .description: + return GTK_ACCESSIBLE_PROPERTY_DESCRIPTION +case .hasPopup: + return GTK_ACCESSIBLE_PROPERTY_HAS_POPUP +case .keyShortcuts: + return GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS +case .label: + return GTK_ACCESSIBLE_PROPERTY_LABEL +case .level: + return GTK_ACCESSIBLE_PROPERTY_LEVEL +case .modal: + return GTK_ACCESSIBLE_PROPERTY_MODAL +case .multiLine: + return GTK_ACCESSIBLE_PROPERTY_MULTI_LINE +case .multiSelectable: + return GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE +case .orientation: + return GTK_ACCESSIBLE_PROPERTY_ORIENTATION +case .placeholder: + return GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER +case .readOnly: + return GTK_ACCESSIBLE_PROPERTY_READ_ONLY +case .required: + return GTK_ACCESSIBLE_PROPERTY_REQUIRED +case .roleDescription: + return GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION +case .sort: + return GTK_ACCESSIBLE_PROPERTY_SORT +case .valueMax: + return GTK_ACCESSIBLE_PROPERTY_VALUE_MAX +case .valueMin: + return GTK_ACCESSIBLE_PROPERTY_VALUE_MIN +case .valueNow: + return GTK_ACCESSIBLE_PROPERTY_VALUE_NOW +case .valueText: + return GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AccessibleRelation.swift b/Sources/Gtk/Generated/AccessibleRelation.swift index 8e6cba4ed1..a88676ffc6 100644 --- a/Sources/Gtk/Generated/AccessibleRelation.swift +++ b/Sources/Gtk/Generated/AccessibleRelation.swift @@ -1,116 +1,116 @@ import CGtk /// The possible accessible relations of a [iface@Accessible]. -/// +/// /// Accessible relations can be references to other widgets, /// integers or strings. public enum AccessibleRelation: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleRelation /// Identifies the currently active - /// element when focus is on a composite widget, combobox, textbox, group, - /// or application. Value type: reference - case activeDescendant - /// Defines the total number of columns - /// in a table, grid, or treegrid. Value type: integer - case colCount - /// Defines an element's column index or - /// position with respect to the total number of columns within a table, - /// grid, or treegrid. Value type: integer - case colIndex - /// Defines a human readable text - /// alternative of %GTK_ACCESSIBLE_RELATION_COL_INDEX. Value type: string - case colIndexText - /// Defines the number of columns spanned - /// by a cell or gridcell within a table, grid, or treegrid. Value type: integer - case colSpan - /// Identifies the element (or elements) whose - /// contents or presence are controlled by the current element. Value type: reference - case controls - /// Identifies the element (or elements) - /// that describes the object. Value type: reference - case describedBy - /// Identifies the element (or elements) that - /// provide additional information related to the object. Value type: reference - case details - /// Identifies the element (or elements) that - /// provide an error message for an object. Value type: reference - case errorMessage - /// Identifies the next element (or elements) - /// in an alternate reading order of content which, at the user's discretion, - /// allows assistive technology to override the general default of reading in - /// document source order. Value type: reference - case flowTo - /// Identifies the element (or elements) - /// that labels the current element. Value type: reference - case labelledBy - /// Identifies an element (or elements) in order - /// to define a visual, functional, or contextual parent/child relationship - /// between elements where the widget hierarchy cannot be used to represent - /// the relationship. Value type: reference - case owns - /// Defines an element's number or position - /// in the current set of listitems or treeitems. Value type: integer - case posInSet - /// Defines the total number of rows in a table, - /// grid, or treegrid. Value type: integer - case rowCount - /// Defines an element's row index or position - /// with respect to the total number of rows within a table, grid, or treegrid. - /// Value type: integer - case rowIndex - /// Defines a human readable text - /// alternative of aria-rowindex. Value type: string - case rowIndexText - /// Defines the number of rows spanned by a - /// cell or gridcell within a table, grid, or treegrid. Value type: integer - case rowSpan - /// Defines the number of items in the current - /// set of listitems or treeitems. Value type: integer - case setSize +/// element when focus is on a composite widget, combobox, textbox, group, +/// or application. Value type: reference +case activeDescendant +/// Defines the total number of columns +/// in a table, grid, or treegrid. Value type: integer +case colCount +/// Defines an element's column index or +/// position with respect to the total number of columns within a table, +/// grid, or treegrid. Value type: integer +case colIndex +/// Defines a human readable text +/// alternative of %GTK_ACCESSIBLE_RELATION_COL_INDEX. Value type: string +case colIndexText +/// Defines the number of columns spanned +/// by a cell or gridcell within a table, grid, or treegrid. Value type: integer +case colSpan +/// Identifies the element (or elements) whose +/// contents or presence are controlled by the current element. Value type: reference +case controls +/// Identifies the element (or elements) +/// that describes the object. Value type: reference +case describedBy +/// Identifies the element (or elements) that +/// provide additional information related to the object. Value type: reference +case details +/// Identifies the element (or elements) that +/// provide an error message for an object. Value type: reference +case errorMessage +/// Identifies the next element (or elements) +/// in an alternate reading order of content which, at the user's discretion, +/// allows assistive technology to override the general default of reading in +/// document source order. Value type: reference +case flowTo +/// Identifies the element (or elements) +/// that labels the current element. Value type: reference +case labelledBy +/// Identifies an element (or elements) in order +/// to define a visual, functional, or contextual parent/child relationship +/// between elements where the widget hierarchy cannot be used to represent +/// the relationship. Value type: reference +case owns +/// Defines an element's number or position +/// in the current set of listitems or treeitems. Value type: integer +case posInSet +/// Defines the total number of rows in a table, +/// grid, or treegrid. Value type: integer +case rowCount +/// Defines an element's row index or position +/// with respect to the total number of rows within a table, grid, or treegrid. +/// Value type: integer +case rowIndex +/// Defines a human readable text +/// alternative of aria-rowindex. Value type: string +case rowIndexText +/// Defines the number of rows spanned by a +/// cell or gridcell within a table, grid, or treegrid. Value type: integer +case rowSpan +/// Defines the number of items in the current +/// set of listitems or treeitems. Value type: integer +case setSize public static var type: GType { - gtk_accessible_relation_get_type() - } + gtk_accessible_relation_get_type() +} public init(from gtkEnum: GtkAccessibleRelation) { switch gtkEnum { case GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT: - self = .activeDescendant - case GTK_ACCESSIBLE_RELATION_COL_COUNT: - self = .colCount - case GTK_ACCESSIBLE_RELATION_COL_INDEX: - self = .colIndex - case GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT: - self = .colIndexText - case GTK_ACCESSIBLE_RELATION_COL_SPAN: - self = .colSpan - case GTK_ACCESSIBLE_RELATION_CONTROLS: - self = .controls - case GTK_ACCESSIBLE_RELATION_DESCRIBED_BY: - self = .describedBy - case GTK_ACCESSIBLE_RELATION_DETAILS: - self = .details - case GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE: - self = .errorMessage - case GTK_ACCESSIBLE_RELATION_FLOW_TO: - self = .flowTo - case GTK_ACCESSIBLE_RELATION_LABELLED_BY: - self = .labelledBy - case GTK_ACCESSIBLE_RELATION_OWNS: - self = .owns - case GTK_ACCESSIBLE_RELATION_POS_IN_SET: - self = .posInSet - case GTK_ACCESSIBLE_RELATION_ROW_COUNT: - self = .rowCount - case GTK_ACCESSIBLE_RELATION_ROW_INDEX: - self = .rowIndex - case GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT: - self = .rowIndexText - case GTK_ACCESSIBLE_RELATION_ROW_SPAN: - self = .rowSpan - case GTK_ACCESSIBLE_RELATION_SET_SIZE: - self = .setSize + self = .activeDescendant +case GTK_ACCESSIBLE_RELATION_COL_COUNT: + self = .colCount +case GTK_ACCESSIBLE_RELATION_COL_INDEX: + self = .colIndex +case GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT: + self = .colIndexText +case GTK_ACCESSIBLE_RELATION_COL_SPAN: + self = .colSpan +case GTK_ACCESSIBLE_RELATION_CONTROLS: + self = .controls +case GTK_ACCESSIBLE_RELATION_DESCRIBED_BY: + self = .describedBy +case GTK_ACCESSIBLE_RELATION_DETAILS: + self = .details +case GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE: + self = .errorMessage +case GTK_ACCESSIBLE_RELATION_FLOW_TO: + self = .flowTo +case GTK_ACCESSIBLE_RELATION_LABELLED_BY: + self = .labelledBy +case GTK_ACCESSIBLE_RELATION_OWNS: + self = .owns +case GTK_ACCESSIBLE_RELATION_POS_IN_SET: + self = .posInSet +case GTK_ACCESSIBLE_RELATION_ROW_COUNT: + self = .rowCount +case GTK_ACCESSIBLE_RELATION_ROW_INDEX: + self = .rowIndex +case GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT: + self = .rowIndexText +case GTK_ACCESSIBLE_RELATION_ROW_SPAN: + self = .rowSpan +case GTK_ACCESSIBLE_RELATION_SET_SIZE: + self = .setSize default: fatalError("Unsupported GtkAccessibleRelation enum value: \(gtkEnum.rawValue)") } @@ -119,41 +119,41 @@ public enum AccessibleRelation: GValueRepresentableEnum { public func toGtk() -> GtkAccessibleRelation { switch self { case .activeDescendant: - return GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT - case .colCount: - return GTK_ACCESSIBLE_RELATION_COL_COUNT - case .colIndex: - return GTK_ACCESSIBLE_RELATION_COL_INDEX - case .colIndexText: - return GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT - case .colSpan: - return GTK_ACCESSIBLE_RELATION_COL_SPAN - case .controls: - return GTK_ACCESSIBLE_RELATION_CONTROLS - case .describedBy: - return GTK_ACCESSIBLE_RELATION_DESCRIBED_BY - case .details: - return GTK_ACCESSIBLE_RELATION_DETAILS - case .errorMessage: - return GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE - case .flowTo: - return GTK_ACCESSIBLE_RELATION_FLOW_TO - case .labelledBy: - return GTK_ACCESSIBLE_RELATION_LABELLED_BY - case .owns: - return GTK_ACCESSIBLE_RELATION_OWNS - case .posInSet: - return GTK_ACCESSIBLE_RELATION_POS_IN_SET - case .rowCount: - return GTK_ACCESSIBLE_RELATION_ROW_COUNT - case .rowIndex: - return GTK_ACCESSIBLE_RELATION_ROW_INDEX - case .rowIndexText: - return GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT - case .rowSpan: - return GTK_ACCESSIBLE_RELATION_ROW_SPAN - case .setSize: - return GTK_ACCESSIBLE_RELATION_SET_SIZE + return GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT +case .colCount: + return GTK_ACCESSIBLE_RELATION_COL_COUNT +case .colIndex: + return GTK_ACCESSIBLE_RELATION_COL_INDEX +case .colIndexText: + return GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT +case .colSpan: + return GTK_ACCESSIBLE_RELATION_COL_SPAN +case .controls: + return GTK_ACCESSIBLE_RELATION_CONTROLS +case .describedBy: + return GTK_ACCESSIBLE_RELATION_DESCRIBED_BY +case .details: + return GTK_ACCESSIBLE_RELATION_DETAILS +case .errorMessage: + return GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE +case .flowTo: + return GTK_ACCESSIBLE_RELATION_FLOW_TO +case .labelledBy: + return GTK_ACCESSIBLE_RELATION_LABELLED_BY +case .owns: + return GTK_ACCESSIBLE_RELATION_OWNS +case .posInSet: + return GTK_ACCESSIBLE_RELATION_POS_IN_SET +case .rowCount: + return GTK_ACCESSIBLE_RELATION_ROW_COUNT +case .rowIndex: + return GTK_ACCESSIBLE_RELATION_ROW_INDEX +case .rowIndexText: + return GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT +case .rowSpan: + return GTK_ACCESSIBLE_RELATION_ROW_SPAN +case .setSize: + return GTK_ACCESSIBLE_RELATION_SET_SIZE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AccessibleRole.swift b/Sources/Gtk/Generated/AccessibleRole.swift index b2e0c1d12d..c9e2ceb871 100644 --- a/Sources/Gtk/Generated/AccessibleRole.swift +++ b/Sources/Gtk/Generated/AccessibleRole.swift @@ -1,355 +1,355 @@ import CGtk /// The accessible role for a [iface@Accessible] implementation. -/// +/// /// Abstract roles are only used as part of the ontology; application /// developers must not use abstract roles in their code. public enum AccessibleRole: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleRole /// An element with important, and usually - /// time-sensitive, information - case alert - /// A type of dialog that contains an - /// alert message - case alertDialog - /// Unused - case banner - /// An input element that allows for - /// user-triggered actions when clicked or pressed - case button - /// Unused - case caption - /// Unused - case cell - /// A checkable input element that has - /// three possible values: `true`, `false`, or `mixed` - case checkbox - /// A header in a columned list. - case columnHeader - /// An input that controls another element, - /// such as a list or a grid, that can dynamically pop up to help the user - /// set the value of the input - case comboBox - /// Abstract role. - case command - /// Abstract role. - case composite - /// A dialog is a window that is designed to interrupt - /// the current processing of an application in order to prompt the user to enter - /// information or require a response. - case dialog - /// Content that assistive technology users may want to - /// browse in a reading mode. - case document - /// Unused - case feed - /// Unused - case form - /// A nameless container that has no semantic meaning - /// of its own. This is the role that GTK uses by default for widgets. - case generic - /// A grid of items. - case grid - /// An item in a grid or tree grid. - case gridCell - /// An element that groups multiple related widgets. GTK uses - /// this role for various containers, like [class@Gtk.HeaderBar] or [class@Gtk.Notebook]. - case group - /// Unused - case heading - /// An image. - case img - /// Abstract role. - case input - /// A visible name or caption for a user interface component. - case label - /// Abstract role. - case landmark - /// Unused - case legend - /// A clickable link. - case link - /// A list of items. - case list - /// Unused. - case listBox - /// An item in a list. - case listItem - /// Unused - case log - /// Unused - case main - /// Unused - case marquee - /// Unused - case math - /// An element that represents a value within a known range. - case meter - /// A menu. - case menu - /// A menubar. - case menuBar - /// An item in a menu. - case menuItem - /// A check item in a menu. - case menuItemCheckbox - /// A radio item in a menu. - case menuItemRadio - /// Unused - case navigation - /// An element that is not represented to accessibility technologies. - /// This role is synonymous to @GTK_ACCESSIBLE_ROLE_PRESENTATION. - case none - /// Unused - case note - /// Unused - case option - /// An element that is not represented to accessibility technologies. - /// This role is synonymous to @GTK_ACCESSIBLE_ROLE_NONE. - case presentation - /// An element that displays the progress - /// status for tasks that take a long time. - case progressBar - /// A checkable input in a group of radio roles, - /// only one of which can be checked at a time. - case radio - /// Unused - case radioGroup - /// Abstract role. - case range - /// Unused - case region - /// A row in a columned list. - case row - /// Unused - case rowGroup - /// Unused - case rowHeader - /// A graphical object that controls the scrolling - /// of content within a viewing area, regardless of whether the content is fully - /// displayed within the viewing area. - case scrollbar - /// Unused - case search - /// A type of textbox intended for specifying - /// search criteria. - case searchBox - /// Abstract role. - case section - /// Abstract role. - case sectionHead - /// Abstract role. - case select - /// A divider that separates and distinguishes - /// sections of content or groups of menuitems. - case separator - /// A user input where the user selects a value - /// from within a given range. - case slider - /// A form of range that expects the user to - /// select from among discrete choices. - case spinButton - /// Unused - case status - /// Abstract role. - case structure - /// A type of checkbox that represents on/off values, - /// as opposed to checked/unchecked values. - case switch_ - /// An item in a list of tab used for switching pages. - case tab - /// Unused - case table - /// A list of tabs for switching pages. - case tabList - /// A page in a notebook or stack. - case tabPanel - /// A type of input that allows free-form text - /// as its value. - case textBox - /// Unused - case time - /// Unused - case timer - /// Unused - case toolbar - /// Unused - case tooltip - /// Unused - case tree - /// A treeview-like, columned list. - case treeGrid - /// Unused - case treeItem - /// Abstract role for interactive components of a - /// graphical user interface - case widget - /// Abstract role for windows. - case window +/// time-sensitive, information +case alert +/// A type of dialog that contains an +/// alert message +case alertDialog +/// Unused +case banner +/// An input element that allows for +/// user-triggered actions when clicked or pressed +case button +/// Unused +case caption +/// Unused +case cell +/// A checkable input element that has +/// three possible values: `true`, `false`, or `mixed` +case checkbox +/// A header in a columned list. +case columnHeader +/// An input that controls another element, +/// such as a list or a grid, that can dynamically pop up to help the user +/// set the value of the input +case comboBox +/// Abstract role. +case command +/// Abstract role. +case composite +/// A dialog is a window that is designed to interrupt +/// the current processing of an application in order to prompt the user to enter +/// information or require a response. +case dialog +/// Content that assistive technology users may want to +/// browse in a reading mode. +case document +/// Unused +case feed +/// Unused +case form +/// A nameless container that has no semantic meaning +/// of its own. This is the role that GTK uses by default for widgets. +case generic +/// A grid of items. +case grid +/// An item in a grid or tree grid. +case gridCell +/// An element that groups multiple related widgets. GTK uses +/// this role for various containers, like [class@Gtk.HeaderBar] or [class@Gtk.Notebook]. +case group +/// Unused +case heading +/// An image. +case img +/// Abstract role. +case input +/// A visible name or caption for a user interface component. +case label +/// Abstract role. +case landmark +/// Unused +case legend +/// A clickable link. +case link +/// A list of items. +case list +/// Unused. +case listBox +/// An item in a list. +case listItem +/// Unused +case log +/// Unused +case main +/// Unused +case marquee +/// Unused +case math +/// An element that represents a value within a known range. +case meter +/// A menu. +case menu +/// A menubar. +case menuBar +/// An item in a menu. +case menuItem +/// A check item in a menu. +case menuItemCheckbox +/// A radio item in a menu. +case menuItemRadio +/// Unused +case navigation +/// An element that is not represented to accessibility technologies. +/// This role is synonymous to @GTK_ACCESSIBLE_ROLE_PRESENTATION. +case none +/// Unused +case note +/// Unused +case option +/// An element that is not represented to accessibility technologies. +/// This role is synonymous to @GTK_ACCESSIBLE_ROLE_NONE. +case presentation +/// An element that displays the progress +/// status for tasks that take a long time. +case progressBar +/// A checkable input in a group of radio roles, +/// only one of which can be checked at a time. +case radio +/// Unused +case radioGroup +/// Abstract role. +case range +/// Unused +case region +/// A row in a columned list. +case row +/// Unused +case rowGroup +/// Unused +case rowHeader +/// A graphical object that controls the scrolling +/// of content within a viewing area, regardless of whether the content is fully +/// displayed within the viewing area. +case scrollbar +/// Unused +case search +/// A type of textbox intended for specifying +/// search criteria. +case searchBox +/// Abstract role. +case section +/// Abstract role. +case sectionHead +/// Abstract role. +case select +/// A divider that separates and distinguishes +/// sections of content or groups of menuitems. +case separator +/// A user input where the user selects a value +/// from within a given range. +case slider +/// A form of range that expects the user to +/// select from among discrete choices. +case spinButton +/// Unused +case status +/// Abstract role. +case structure +/// A type of checkbox that represents on/off values, +/// as opposed to checked/unchecked values. +case switch_ +/// An item in a list of tab used for switching pages. +case tab +/// Unused +case table +/// A list of tabs for switching pages. +case tabList +/// A page in a notebook or stack. +case tabPanel +/// A type of input that allows free-form text +/// as its value. +case textBox +/// Unused +case time +/// Unused +case timer +/// Unused +case toolbar +/// Unused +case tooltip +/// Unused +case tree +/// A treeview-like, columned list. +case treeGrid +/// Unused +case treeItem +/// Abstract role for interactive components of a +/// graphical user interface +case widget +/// Abstract role for windows. +case window public static var type: GType { - gtk_accessible_role_get_type() - } + gtk_accessible_role_get_type() +} public init(from gtkEnum: GtkAccessibleRole) { switch gtkEnum { case GTK_ACCESSIBLE_ROLE_ALERT: - self = .alert - case GTK_ACCESSIBLE_ROLE_ALERT_DIALOG: - self = .alertDialog - case GTK_ACCESSIBLE_ROLE_BANNER: - self = .banner - case GTK_ACCESSIBLE_ROLE_BUTTON: - self = .button - case GTK_ACCESSIBLE_ROLE_CAPTION: - self = .caption - case GTK_ACCESSIBLE_ROLE_CELL: - self = .cell - case GTK_ACCESSIBLE_ROLE_CHECKBOX: - self = .checkbox - case GTK_ACCESSIBLE_ROLE_COLUMN_HEADER: - self = .columnHeader - case GTK_ACCESSIBLE_ROLE_COMBO_BOX: - self = .comboBox - case GTK_ACCESSIBLE_ROLE_COMMAND: - self = .command - case GTK_ACCESSIBLE_ROLE_COMPOSITE: - self = .composite - case GTK_ACCESSIBLE_ROLE_DIALOG: - self = .dialog - case GTK_ACCESSIBLE_ROLE_DOCUMENT: - self = .document - case GTK_ACCESSIBLE_ROLE_FEED: - self = .feed - case GTK_ACCESSIBLE_ROLE_FORM: - self = .form - case GTK_ACCESSIBLE_ROLE_GENERIC: - self = .generic - case GTK_ACCESSIBLE_ROLE_GRID: - self = .grid - case GTK_ACCESSIBLE_ROLE_GRID_CELL: - self = .gridCell - case GTK_ACCESSIBLE_ROLE_GROUP: - self = .group - case GTK_ACCESSIBLE_ROLE_HEADING: - self = .heading - case GTK_ACCESSIBLE_ROLE_IMG: - self = .img - case GTK_ACCESSIBLE_ROLE_INPUT: - self = .input - case GTK_ACCESSIBLE_ROLE_LABEL: - self = .label - case GTK_ACCESSIBLE_ROLE_LANDMARK: - self = .landmark - case GTK_ACCESSIBLE_ROLE_LEGEND: - self = .legend - case GTK_ACCESSIBLE_ROLE_LINK: - self = .link - case GTK_ACCESSIBLE_ROLE_LIST: - self = .list - case GTK_ACCESSIBLE_ROLE_LIST_BOX: - self = .listBox - case GTK_ACCESSIBLE_ROLE_LIST_ITEM: - self = .listItem - case GTK_ACCESSIBLE_ROLE_LOG: - self = .log - case GTK_ACCESSIBLE_ROLE_MAIN: - self = .main - case GTK_ACCESSIBLE_ROLE_MARQUEE: - self = .marquee - case GTK_ACCESSIBLE_ROLE_MATH: - self = .math - case GTK_ACCESSIBLE_ROLE_METER: - self = .meter - case GTK_ACCESSIBLE_ROLE_MENU: - self = .menu - case GTK_ACCESSIBLE_ROLE_MENU_BAR: - self = .menuBar - case GTK_ACCESSIBLE_ROLE_MENU_ITEM: - self = .menuItem - case GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX: - self = .menuItemCheckbox - case GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO: - self = .menuItemRadio - case GTK_ACCESSIBLE_ROLE_NAVIGATION: - self = .navigation - case GTK_ACCESSIBLE_ROLE_NONE: - self = .none - case GTK_ACCESSIBLE_ROLE_NOTE: - self = .note - case GTK_ACCESSIBLE_ROLE_OPTION: - self = .option - case GTK_ACCESSIBLE_ROLE_PRESENTATION: - self = .presentation - case GTK_ACCESSIBLE_ROLE_PROGRESS_BAR: - self = .progressBar - case GTK_ACCESSIBLE_ROLE_RADIO: - self = .radio - case GTK_ACCESSIBLE_ROLE_RADIO_GROUP: - self = .radioGroup - case GTK_ACCESSIBLE_ROLE_RANGE: - self = .range - case GTK_ACCESSIBLE_ROLE_REGION: - self = .region - case GTK_ACCESSIBLE_ROLE_ROW: - self = .row - case GTK_ACCESSIBLE_ROLE_ROW_GROUP: - self = .rowGroup - case GTK_ACCESSIBLE_ROLE_ROW_HEADER: - self = .rowHeader - case GTK_ACCESSIBLE_ROLE_SCROLLBAR: - self = .scrollbar - case GTK_ACCESSIBLE_ROLE_SEARCH: - self = .search - case GTK_ACCESSIBLE_ROLE_SEARCH_BOX: - self = .searchBox - case GTK_ACCESSIBLE_ROLE_SECTION: - self = .section - case GTK_ACCESSIBLE_ROLE_SECTION_HEAD: - self = .sectionHead - case GTK_ACCESSIBLE_ROLE_SELECT: - self = .select - case GTK_ACCESSIBLE_ROLE_SEPARATOR: - self = .separator - case GTK_ACCESSIBLE_ROLE_SLIDER: - self = .slider - case GTK_ACCESSIBLE_ROLE_SPIN_BUTTON: - self = .spinButton - case GTK_ACCESSIBLE_ROLE_STATUS: - self = .status - case GTK_ACCESSIBLE_ROLE_STRUCTURE: - self = .structure - case GTK_ACCESSIBLE_ROLE_SWITCH: - self = .switch_ - case GTK_ACCESSIBLE_ROLE_TAB: - self = .tab - case GTK_ACCESSIBLE_ROLE_TABLE: - self = .table - case GTK_ACCESSIBLE_ROLE_TAB_LIST: - self = .tabList - case GTK_ACCESSIBLE_ROLE_TAB_PANEL: - self = .tabPanel - case GTK_ACCESSIBLE_ROLE_TEXT_BOX: - self = .textBox - case GTK_ACCESSIBLE_ROLE_TIME: - self = .time - case GTK_ACCESSIBLE_ROLE_TIMER: - self = .timer - case GTK_ACCESSIBLE_ROLE_TOOLBAR: - self = .toolbar - case GTK_ACCESSIBLE_ROLE_TOOLTIP: - self = .tooltip - case GTK_ACCESSIBLE_ROLE_TREE: - self = .tree - case GTK_ACCESSIBLE_ROLE_TREE_GRID: - self = .treeGrid - case GTK_ACCESSIBLE_ROLE_TREE_ITEM: - self = .treeItem - case GTK_ACCESSIBLE_ROLE_WIDGET: - self = .widget - case GTK_ACCESSIBLE_ROLE_WINDOW: - self = .window + self = .alert +case GTK_ACCESSIBLE_ROLE_ALERT_DIALOG: + self = .alertDialog +case GTK_ACCESSIBLE_ROLE_BANNER: + self = .banner +case GTK_ACCESSIBLE_ROLE_BUTTON: + self = .button +case GTK_ACCESSIBLE_ROLE_CAPTION: + self = .caption +case GTK_ACCESSIBLE_ROLE_CELL: + self = .cell +case GTK_ACCESSIBLE_ROLE_CHECKBOX: + self = .checkbox +case GTK_ACCESSIBLE_ROLE_COLUMN_HEADER: + self = .columnHeader +case GTK_ACCESSIBLE_ROLE_COMBO_BOX: + self = .comboBox +case GTK_ACCESSIBLE_ROLE_COMMAND: + self = .command +case GTK_ACCESSIBLE_ROLE_COMPOSITE: + self = .composite +case GTK_ACCESSIBLE_ROLE_DIALOG: + self = .dialog +case GTK_ACCESSIBLE_ROLE_DOCUMENT: + self = .document +case GTK_ACCESSIBLE_ROLE_FEED: + self = .feed +case GTK_ACCESSIBLE_ROLE_FORM: + self = .form +case GTK_ACCESSIBLE_ROLE_GENERIC: + self = .generic +case GTK_ACCESSIBLE_ROLE_GRID: + self = .grid +case GTK_ACCESSIBLE_ROLE_GRID_CELL: + self = .gridCell +case GTK_ACCESSIBLE_ROLE_GROUP: + self = .group +case GTK_ACCESSIBLE_ROLE_HEADING: + self = .heading +case GTK_ACCESSIBLE_ROLE_IMG: + self = .img +case GTK_ACCESSIBLE_ROLE_INPUT: + self = .input +case GTK_ACCESSIBLE_ROLE_LABEL: + self = .label +case GTK_ACCESSIBLE_ROLE_LANDMARK: + self = .landmark +case GTK_ACCESSIBLE_ROLE_LEGEND: + self = .legend +case GTK_ACCESSIBLE_ROLE_LINK: + self = .link +case GTK_ACCESSIBLE_ROLE_LIST: + self = .list +case GTK_ACCESSIBLE_ROLE_LIST_BOX: + self = .listBox +case GTK_ACCESSIBLE_ROLE_LIST_ITEM: + self = .listItem +case GTK_ACCESSIBLE_ROLE_LOG: + self = .log +case GTK_ACCESSIBLE_ROLE_MAIN: + self = .main +case GTK_ACCESSIBLE_ROLE_MARQUEE: + self = .marquee +case GTK_ACCESSIBLE_ROLE_MATH: + self = .math +case GTK_ACCESSIBLE_ROLE_METER: + self = .meter +case GTK_ACCESSIBLE_ROLE_MENU: + self = .menu +case GTK_ACCESSIBLE_ROLE_MENU_BAR: + self = .menuBar +case GTK_ACCESSIBLE_ROLE_MENU_ITEM: + self = .menuItem +case GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX: + self = .menuItemCheckbox +case GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO: + self = .menuItemRadio +case GTK_ACCESSIBLE_ROLE_NAVIGATION: + self = .navigation +case GTK_ACCESSIBLE_ROLE_NONE: + self = .none +case GTK_ACCESSIBLE_ROLE_NOTE: + self = .note +case GTK_ACCESSIBLE_ROLE_OPTION: + self = .option +case GTK_ACCESSIBLE_ROLE_PRESENTATION: + self = .presentation +case GTK_ACCESSIBLE_ROLE_PROGRESS_BAR: + self = .progressBar +case GTK_ACCESSIBLE_ROLE_RADIO: + self = .radio +case GTK_ACCESSIBLE_ROLE_RADIO_GROUP: + self = .radioGroup +case GTK_ACCESSIBLE_ROLE_RANGE: + self = .range +case GTK_ACCESSIBLE_ROLE_REGION: + self = .region +case GTK_ACCESSIBLE_ROLE_ROW: + self = .row +case GTK_ACCESSIBLE_ROLE_ROW_GROUP: + self = .rowGroup +case GTK_ACCESSIBLE_ROLE_ROW_HEADER: + self = .rowHeader +case GTK_ACCESSIBLE_ROLE_SCROLLBAR: + self = .scrollbar +case GTK_ACCESSIBLE_ROLE_SEARCH: + self = .search +case GTK_ACCESSIBLE_ROLE_SEARCH_BOX: + self = .searchBox +case GTK_ACCESSIBLE_ROLE_SECTION: + self = .section +case GTK_ACCESSIBLE_ROLE_SECTION_HEAD: + self = .sectionHead +case GTK_ACCESSIBLE_ROLE_SELECT: + self = .select +case GTK_ACCESSIBLE_ROLE_SEPARATOR: + self = .separator +case GTK_ACCESSIBLE_ROLE_SLIDER: + self = .slider +case GTK_ACCESSIBLE_ROLE_SPIN_BUTTON: + self = .spinButton +case GTK_ACCESSIBLE_ROLE_STATUS: + self = .status +case GTK_ACCESSIBLE_ROLE_STRUCTURE: + self = .structure +case GTK_ACCESSIBLE_ROLE_SWITCH: + self = .switch_ +case GTK_ACCESSIBLE_ROLE_TAB: + self = .tab +case GTK_ACCESSIBLE_ROLE_TABLE: + self = .table +case GTK_ACCESSIBLE_ROLE_TAB_LIST: + self = .tabList +case GTK_ACCESSIBLE_ROLE_TAB_PANEL: + self = .tabPanel +case GTK_ACCESSIBLE_ROLE_TEXT_BOX: + self = .textBox +case GTK_ACCESSIBLE_ROLE_TIME: + self = .time +case GTK_ACCESSIBLE_ROLE_TIMER: + self = .timer +case GTK_ACCESSIBLE_ROLE_TOOLBAR: + self = .toolbar +case GTK_ACCESSIBLE_ROLE_TOOLTIP: + self = .tooltip +case GTK_ACCESSIBLE_ROLE_TREE: + self = .tree +case GTK_ACCESSIBLE_ROLE_TREE_GRID: + self = .treeGrid +case GTK_ACCESSIBLE_ROLE_TREE_ITEM: + self = .treeItem +case GTK_ACCESSIBLE_ROLE_WIDGET: + self = .widget +case GTK_ACCESSIBLE_ROLE_WINDOW: + self = .window default: fatalError("Unsupported GtkAccessibleRole enum value: \(gtkEnum.rawValue)") } @@ -358,161 +358,161 @@ public enum AccessibleRole: GValueRepresentableEnum { public func toGtk() -> GtkAccessibleRole { switch self { case .alert: - return GTK_ACCESSIBLE_ROLE_ALERT - case .alertDialog: - return GTK_ACCESSIBLE_ROLE_ALERT_DIALOG - case .banner: - return GTK_ACCESSIBLE_ROLE_BANNER - case .button: - return GTK_ACCESSIBLE_ROLE_BUTTON - case .caption: - return GTK_ACCESSIBLE_ROLE_CAPTION - case .cell: - return GTK_ACCESSIBLE_ROLE_CELL - case .checkbox: - return GTK_ACCESSIBLE_ROLE_CHECKBOX - case .columnHeader: - return GTK_ACCESSIBLE_ROLE_COLUMN_HEADER - case .comboBox: - return GTK_ACCESSIBLE_ROLE_COMBO_BOX - case .command: - return GTK_ACCESSIBLE_ROLE_COMMAND - case .composite: - return GTK_ACCESSIBLE_ROLE_COMPOSITE - case .dialog: - return GTK_ACCESSIBLE_ROLE_DIALOG - case .document: - return GTK_ACCESSIBLE_ROLE_DOCUMENT - case .feed: - return GTK_ACCESSIBLE_ROLE_FEED - case .form: - return GTK_ACCESSIBLE_ROLE_FORM - case .generic: - return GTK_ACCESSIBLE_ROLE_GENERIC - case .grid: - return GTK_ACCESSIBLE_ROLE_GRID - case .gridCell: - return GTK_ACCESSIBLE_ROLE_GRID_CELL - case .group: - return GTK_ACCESSIBLE_ROLE_GROUP - case .heading: - return GTK_ACCESSIBLE_ROLE_HEADING - case .img: - return GTK_ACCESSIBLE_ROLE_IMG - case .input: - return GTK_ACCESSIBLE_ROLE_INPUT - case .label: - return GTK_ACCESSIBLE_ROLE_LABEL - case .landmark: - return GTK_ACCESSIBLE_ROLE_LANDMARK - case .legend: - return GTK_ACCESSIBLE_ROLE_LEGEND - case .link: - return GTK_ACCESSIBLE_ROLE_LINK - case .list: - return GTK_ACCESSIBLE_ROLE_LIST - case .listBox: - return GTK_ACCESSIBLE_ROLE_LIST_BOX - case .listItem: - return GTK_ACCESSIBLE_ROLE_LIST_ITEM - case .log: - return GTK_ACCESSIBLE_ROLE_LOG - case .main: - return GTK_ACCESSIBLE_ROLE_MAIN - case .marquee: - return GTK_ACCESSIBLE_ROLE_MARQUEE - case .math: - return GTK_ACCESSIBLE_ROLE_MATH - case .meter: - return GTK_ACCESSIBLE_ROLE_METER - case .menu: - return GTK_ACCESSIBLE_ROLE_MENU - case .menuBar: - return GTK_ACCESSIBLE_ROLE_MENU_BAR - case .menuItem: - return GTK_ACCESSIBLE_ROLE_MENU_ITEM - case .menuItemCheckbox: - return GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX - case .menuItemRadio: - return GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO - case .navigation: - return GTK_ACCESSIBLE_ROLE_NAVIGATION - case .none: - return GTK_ACCESSIBLE_ROLE_NONE - case .note: - return GTK_ACCESSIBLE_ROLE_NOTE - case .option: - return GTK_ACCESSIBLE_ROLE_OPTION - case .presentation: - return GTK_ACCESSIBLE_ROLE_PRESENTATION - case .progressBar: - return GTK_ACCESSIBLE_ROLE_PROGRESS_BAR - case .radio: - return GTK_ACCESSIBLE_ROLE_RADIO - case .radioGroup: - return GTK_ACCESSIBLE_ROLE_RADIO_GROUP - case .range: - return GTK_ACCESSIBLE_ROLE_RANGE - case .region: - return GTK_ACCESSIBLE_ROLE_REGION - case .row: - return GTK_ACCESSIBLE_ROLE_ROW - case .rowGroup: - return GTK_ACCESSIBLE_ROLE_ROW_GROUP - case .rowHeader: - return GTK_ACCESSIBLE_ROLE_ROW_HEADER - case .scrollbar: - return GTK_ACCESSIBLE_ROLE_SCROLLBAR - case .search: - return GTK_ACCESSIBLE_ROLE_SEARCH - case .searchBox: - return GTK_ACCESSIBLE_ROLE_SEARCH_BOX - case .section: - return GTK_ACCESSIBLE_ROLE_SECTION - case .sectionHead: - return GTK_ACCESSIBLE_ROLE_SECTION_HEAD - case .select: - return GTK_ACCESSIBLE_ROLE_SELECT - case .separator: - return GTK_ACCESSIBLE_ROLE_SEPARATOR - case .slider: - return GTK_ACCESSIBLE_ROLE_SLIDER - case .spinButton: - return GTK_ACCESSIBLE_ROLE_SPIN_BUTTON - case .status: - return GTK_ACCESSIBLE_ROLE_STATUS - case .structure: - return GTK_ACCESSIBLE_ROLE_STRUCTURE - case .switch_: - return GTK_ACCESSIBLE_ROLE_SWITCH - case .tab: - return GTK_ACCESSIBLE_ROLE_TAB - case .table: - return GTK_ACCESSIBLE_ROLE_TABLE - case .tabList: - return GTK_ACCESSIBLE_ROLE_TAB_LIST - case .tabPanel: - return GTK_ACCESSIBLE_ROLE_TAB_PANEL - case .textBox: - return GTK_ACCESSIBLE_ROLE_TEXT_BOX - case .time: - return GTK_ACCESSIBLE_ROLE_TIME - case .timer: - return GTK_ACCESSIBLE_ROLE_TIMER - case .toolbar: - return GTK_ACCESSIBLE_ROLE_TOOLBAR - case .tooltip: - return GTK_ACCESSIBLE_ROLE_TOOLTIP - case .tree: - return GTK_ACCESSIBLE_ROLE_TREE - case .treeGrid: - return GTK_ACCESSIBLE_ROLE_TREE_GRID - case .treeItem: - return GTK_ACCESSIBLE_ROLE_TREE_ITEM - case .widget: - return GTK_ACCESSIBLE_ROLE_WIDGET - case .window: - return GTK_ACCESSIBLE_ROLE_WINDOW + return GTK_ACCESSIBLE_ROLE_ALERT +case .alertDialog: + return GTK_ACCESSIBLE_ROLE_ALERT_DIALOG +case .banner: + return GTK_ACCESSIBLE_ROLE_BANNER +case .button: + return GTK_ACCESSIBLE_ROLE_BUTTON +case .caption: + return GTK_ACCESSIBLE_ROLE_CAPTION +case .cell: + return GTK_ACCESSIBLE_ROLE_CELL +case .checkbox: + return GTK_ACCESSIBLE_ROLE_CHECKBOX +case .columnHeader: + return GTK_ACCESSIBLE_ROLE_COLUMN_HEADER +case .comboBox: + return GTK_ACCESSIBLE_ROLE_COMBO_BOX +case .command: + return GTK_ACCESSIBLE_ROLE_COMMAND +case .composite: + return GTK_ACCESSIBLE_ROLE_COMPOSITE +case .dialog: + return GTK_ACCESSIBLE_ROLE_DIALOG +case .document: + return GTK_ACCESSIBLE_ROLE_DOCUMENT +case .feed: + return GTK_ACCESSIBLE_ROLE_FEED +case .form: + return GTK_ACCESSIBLE_ROLE_FORM +case .generic: + return GTK_ACCESSIBLE_ROLE_GENERIC +case .grid: + return GTK_ACCESSIBLE_ROLE_GRID +case .gridCell: + return GTK_ACCESSIBLE_ROLE_GRID_CELL +case .group: + return GTK_ACCESSIBLE_ROLE_GROUP +case .heading: + return GTK_ACCESSIBLE_ROLE_HEADING +case .img: + return GTK_ACCESSIBLE_ROLE_IMG +case .input: + return GTK_ACCESSIBLE_ROLE_INPUT +case .label: + return GTK_ACCESSIBLE_ROLE_LABEL +case .landmark: + return GTK_ACCESSIBLE_ROLE_LANDMARK +case .legend: + return GTK_ACCESSIBLE_ROLE_LEGEND +case .link: + return GTK_ACCESSIBLE_ROLE_LINK +case .list: + return GTK_ACCESSIBLE_ROLE_LIST +case .listBox: + return GTK_ACCESSIBLE_ROLE_LIST_BOX +case .listItem: + return GTK_ACCESSIBLE_ROLE_LIST_ITEM +case .log: + return GTK_ACCESSIBLE_ROLE_LOG +case .main: + return GTK_ACCESSIBLE_ROLE_MAIN +case .marquee: + return GTK_ACCESSIBLE_ROLE_MARQUEE +case .math: + return GTK_ACCESSIBLE_ROLE_MATH +case .meter: + return GTK_ACCESSIBLE_ROLE_METER +case .menu: + return GTK_ACCESSIBLE_ROLE_MENU +case .menuBar: + return GTK_ACCESSIBLE_ROLE_MENU_BAR +case .menuItem: + return GTK_ACCESSIBLE_ROLE_MENU_ITEM +case .menuItemCheckbox: + return GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX +case .menuItemRadio: + return GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO +case .navigation: + return GTK_ACCESSIBLE_ROLE_NAVIGATION +case .none: + return GTK_ACCESSIBLE_ROLE_NONE +case .note: + return GTK_ACCESSIBLE_ROLE_NOTE +case .option: + return GTK_ACCESSIBLE_ROLE_OPTION +case .presentation: + return GTK_ACCESSIBLE_ROLE_PRESENTATION +case .progressBar: + return GTK_ACCESSIBLE_ROLE_PROGRESS_BAR +case .radio: + return GTK_ACCESSIBLE_ROLE_RADIO +case .radioGroup: + return GTK_ACCESSIBLE_ROLE_RADIO_GROUP +case .range: + return GTK_ACCESSIBLE_ROLE_RANGE +case .region: + return GTK_ACCESSIBLE_ROLE_REGION +case .row: + return GTK_ACCESSIBLE_ROLE_ROW +case .rowGroup: + return GTK_ACCESSIBLE_ROLE_ROW_GROUP +case .rowHeader: + return GTK_ACCESSIBLE_ROLE_ROW_HEADER +case .scrollbar: + return GTK_ACCESSIBLE_ROLE_SCROLLBAR +case .search: + return GTK_ACCESSIBLE_ROLE_SEARCH +case .searchBox: + return GTK_ACCESSIBLE_ROLE_SEARCH_BOX +case .section: + return GTK_ACCESSIBLE_ROLE_SECTION +case .sectionHead: + return GTK_ACCESSIBLE_ROLE_SECTION_HEAD +case .select: + return GTK_ACCESSIBLE_ROLE_SELECT +case .separator: + return GTK_ACCESSIBLE_ROLE_SEPARATOR +case .slider: + return GTK_ACCESSIBLE_ROLE_SLIDER +case .spinButton: + return GTK_ACCESSIBLE_ROLE_SPIN_BUTTON +case .status: + return GTK_ACCESSIBLE_ROLE_STATUS +case .structure: + return GTK_ACCESSIBLE_ROLE_STRUCTURE +case .switch_: + return GTK_ACCESSIBLE_ROLE_SWITCH +case .tab: + return GTK_ACCESSIBLE_ROLE_TAB +case .table: + return GTK_ACCESSIBLE_ROLE_TABLE +case .tabList: + return GTK_ACCESSIBLE_ROLE_TAB_LIST +case .tabPanel: + return GTK_ACCESSIBLE_ROLE_TAB_PANEL +case .textBox: + return GTK_ACCESSIBLE_ROLE_TEXT_BOX +case .time: + return GTK_ACCESSIBLE_ROLE_TIME +case .timer: + return GTK_ACCESSIBLE_ROLE_TIMER +case .toolbar: + return GTK_ACCESSIBLE_ROLE_TOOLBAR +case .tooltip: + return GTK_ACCESSIBLE_ROLE_TOOLTIP +case .tree: + return GTK_ACCESSIBLE_ROLE_TREE +case .treeGrid: + return GTK_ACCESSIBLE_ROLE_TREE_GRID +case .treeItem: + return GTK_ACCESSIBLE_ROLE_TREE_ITEM +case .widget: + return GTK_ACCESSIBLE_ROLE_WIDGET +case .window: + return GTK_ACCESSIBLE_ROLE_WINDOW } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AccessibleSort.swift b/Sources/Gtk/Generated/AccessibleSort.swift index 35f91845e7..393573ab31 100644 --- a/Sources/Gtk/Generated/AccessibleSort.swift +++ b/Sources/Gtk/Generated/AccessibleSort.swift @@ -6,29 +6,29 @@ public enum AccessibleSort: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleSort /// There is no defined sort applied to the column. - case none - /// Items are sorted in ascending order by this column. - case ascending - /// Items are sorted in descending order by this column. - case descending - /// A sort algorithm other than ascending or - /// descending has been applied. - case other +case none +/// Items are sorted in ascending order by this column. +case ascending +/// Items are sorted in descending order by this column. +case descending +/// A sort algorithm other than ascending or +/// descending has been applied. +case other public static var type: GType { - gtk_accessible_sort_get_type() - } + gtk_accessible_sort_get_type() +} public init(from gtkEnum: GtkAccessibleSort) { switch gtkEnum { case GTK_ACCESSIBLE_SORT_NONE: - self = .none - case GTK_ACCESSIBLE_SORT_ASCENDING: - self = .ascending - case GTK_ACCESSIBLE_SORT_DESCENDING: - self = .descending - case GTK_ACCESSIBLE_SORT_OTHER: - self = .other + self = .none +case GTK_ACCESSIBLE_SORT_ASCENDING: + self = .ascending +case GTK_ACCESSIBLE_SORT_DESCENDING: + self = .descending +case GTK_ACCESSIBLE_SORT_OTHER: + self = .other default: fatalError("Unsupported GtkAccessibleSort enum value: \(gtkEnum.rawValue)") } @@ -37,13 +37,13 @@ public enum AccessibleSort: GValueRepresentableEnum { public func toGtk() -> GtkAccessibleSort { switch self { case .none: - return GTK_ACCESSIBLE_SORT_NONE - case .ascending: - return GTK_ACCESSIBLE_SORT_ASCENDING - case .descending: - return GTK_ACCESSIBLE_SORT_DESCENDING - case .other: - return GTK_ACCESSIBLE_SORT_OTHER + return GTK_ACCESSIBLE_SORT_NONE +case .ascending: + return GTK_ACCESSIBLE_SORT_ASCENDING +case .descending: + return GTK_ACCESSIBLE_SORT_DESCENDING +case .other: + return GTK_ACCESSIBLE_SORT_OTHER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AccessibleState.swift b/Sources/Gtk/Generated/AccessibleState.swift index 7cfbf36ba3..3ddaa60b89 100644 --- a/Sources/Gtk/Generated/AccessibleState.swift +++ b/Sources/Gtk/Generated/AccessibleState.swift @@ -5,57 +5,57 @@ public enum AccessibleState: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleState /// A “busy” state. This state has boolean values - case busy - /// A “checked” state; indicates the current - /// state of a [class@CheckButton]. Value type: [enum@AccessibleTristate] - case checked - /// A “disabled” state; corresponds to the - /// [property@Widget:sensitive] property. It indicates a UI element - /// that is perceivable, but not editable or operable. Value type: boolean - case disabled - /// An “expanded” state; corresponds to the - /// [property@Expander:expanded] property. Value type: boolean - /// or undefined - case expanded - /// A “hidden” state; corresponds to the - /// [property@Widget:visible] property. You can use this state - /// explicitly on UI elements that should not be exposed to an assistive - /// technology. Value type: boolean - /// See also: %GTK_ACCESSIBLE_STATE_DISABLED - case hidden - /// An “invalid” state; set when a widget - /// is showing an error. Value type: [enum@AccessibleInvalidState] - case invalid - /// A “pressed” state; indicates the current - /// state of a [class@ToggleButton]. Value type: [enum@AccessibleTristate] - /// enumeration - case pressed - /// A “selected” state; set when a widget - /// is selected. Value type: boolean or undefined - case selected +case busy +/// A “checked” state; indicates the current +/// state of a [class@CheckButton]. Value type: [enum@AccessibleTristate] +case checked +/// A “disabled” state; corresponds to the +/// [property@Widget:sensitive] property. It indicates a UI element +/// that is perceivable, but not editable or operable. Value type: boolean +case disabled +/// An “expanded” state; corresponds to the +/// [property@Expander:expanded] property. Value type: boolean +/// or undefined +case expanded +/// A “hidden” state; corresponds to the +/// [property@Widget:visible] property. You can use this state +/// explicitly on UI elements that should not be exposed to an assistive +/// technology. Value type: boolean +/// See also: %GTK_ACCESSIBLE_STATE_DISABLED +case hidden +/// An “invalid” state; set when a widget +/// is showing an error. Value type: [enum@AccessibleInvalidState] +case invalid +/// A “pressed” state; indicates the current +/// state of a [class@ToggleButton]. Value type: [enum@AccessibleTristate] +/// enumeration +case pressed +/// A “selected” state; set when a widget +/// is selected. Value type: boolean or undefined +case selected public static var type: GType { - gtk_accessible_state_get_type() - } + gtk_accessible_state_get_type() +} public init(from gtkEnum: GtkAccessibleState) { switch gtkEnum { case GTK_ACCESSIBLE_STATE_BUSY: - self = .busy - case GTK_ACCESSIBLE_STATE_CHECKED: - self = .checked - case GTK_ACCESSIBLE_STATE_DISABLED: - self = .disabled - case GTK_ACCESSIBLE_STATE_EXPANDED: - self = .expanded - case GTK_ACCESSIBLE_STATE_HIDDEN: - self = .hidden - case GTK_ACCESSIBLE_STATE_INVALID: - self = .invalid - case GTK_ACCESSIBLE_STATE_PRESSED: - self = .pressed - case GTK_ACCESSIBLE_STATE_SELECTED: - self = .selected + self = .busy +case GTK_ACCESSIBLE_STATE_CHECKED: + self = .checked +case GTK_ACCESSIBLE_STATE_DISABLED: + self = .disabled +case GTK_ACCESSIBLE_STATE_EXPANDED: + self = .expanded +case GTK_ACCESSIBLE_STATE_HIDDEN: + self = .hidden +case GTK_ACCESSIBLE_STATE_INVALID: + self = .invalid +case GTK_ACCESSIBLE_STATE_PRESSED: + self = .pressed +case GTK_ACCESSIBLE_STATE_SELECTED: + self = .selected default: fatalError("Unsupported GtkAccessibleState enum value: \(gtkEnum.rawValue)") } @@ -64,21 +64,21 @@ public enum AccessibleState: GValueRepresentableEnum { public func toGtk() -> GtkAccessibleState { switch self { case .busy: - return GTK_ACCESSIBLE_STATE_BUSY - case .checked: - return GTK_ACCESSIBLE_STATE_CHECKED - case .disabled: - return GTK_ACCESSIBLE_STATE_DISABLED - case .expanded: - return GTK_ACCESSIBLE_STATE_EXPANDED - case .hidden: - return GTK_ACCESSIBLE_STATE_HIDDEN - case .invalid: - return GTK_ACCESSIBLE_STATE_INVALID - case .pressed: - return GTK_ACCESSIBLE_STATE_PRESSED - case .selected: - return GTK_ACCESSIBLE_STATE_SELECTED + return GTK_ACCESSIBLE_STATE_BUSY +case .checked: + return GTK_ACCESSIBLE_STATE_CHECKED +case .disabled: + return GTK_ACCESSIBLE_STATE_DISABLED +case .expanded: + return GTK_ACCESSIBLE_STATE_EXPANDED +case .hidden: + return GTK_ACCESSIBLE_STATE_HIDDEN +case .invalid: + return GTK_ACCESSIBLE_STATE_INVALID +case .pressed: + return GTK_ACCESSIBLE_STATE_PRESSED +case .selected: + return GTK_ACCESSIBLE_STATE_SELECTED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AccessibleTristate.swift b/Sources/Gtk/Generated/AccessibleTristate.swift index ea5f6b8b5b..56d1a4ac1f 100644 --- a/Sources/Gtk/Generated/AccessibleTristate.swift +++ b/Sources/Gtk/Generated/AccessibleTristate.swift @@ -2,7 +2,7 @@ import CGtk /// The possible values for the %GTK_ACCESSIBLE_STATE_PRESSED /// accessible state. -/// +/// /// Note that the %GTK_ACCESSIBLE_TRISTATE_FALSE and /// %GTK_ACCESSIBLE_TRISTATE_TRUE have the same values /// as %FALSE and %TRUE. @@ -10,24 +10,24 @@ public enum AccessibleTristate: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleTristate /// The state is `false` - case false_ - /// The state is `true` - case true_ - /// The state is `mixed` - case mixed +case false_ +/// The state is `true` +case true_ +/// The state is `mixed` +case mixed public static var type: GType { - gtk_accessible_tristate_get_type() - } + gtk_accessible_tristate_get_type() +} public init(from gtkEnum: GtkAccessibleTristate) { switch gtkEnum { case GTK_ACCESSIBLE_TRISTATE_FALSE: - self = .false_ - case GTK_ACCESSIBLE_TRISTATE_TRUE: - self = .true_ - case GTK_ACCESSIBLE_TRISTATE_MIXED: - self = .mixed + self = .false_ +case GTK_ACCESSIBLE_TRISTATE_TRUE: + self = .true_ +case GTK_ACCESSIBLE_TRISTATE_MIXED: + self = .mixed default: fatalError("Unsupported GtkAccessibleTristate enum value: \(gtkEnum.rawValue)") } @@ -36,11 +36,11 @@ public enum AccessibleTristate: GValueRepresentableEnum { public func toGtk() -> GtkAccessibleTristate { switch self { case .false_: - return GTK_ACCESSIBLE_TRISTATE_FALSE - case .true_: - return GTK_ACCESSIBLE_TRISTATE_TRUE - case .mixed: - return GTK_ACCESSIBLE_TRISTATE_MIXED + return GTK_ACCESSIBLE_TRISTATE_FALSE +case .true_: + return GTK_ACCESSIBLE_TRISTATE_TRUE +case .mixed: + return GTK_ACCESSIBLE_TRISTATE_MIXED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Actionable.swift b/Sources/Gtk/Generated/Actionable.swift index 5a4713d18d..129d7093a6 100644 --- a/Sources/Gtk/Generated/Actionable.swift +++ b/Sources/Gtk/Generated/Actionable.swift @@ -1,11 +1,11 @@ import CGtk /// Provides a way to associate widgets with actions. -/// +/// /// It primarily consists of two properties: [property@Gtk.Actionable:action-name] /// and [property@Gtk.Actionable:action-target]. There are also some convenience /// APIs for setting these properties. -/// +/// /// The action will be looked up in action groups that are found among /// the widgets ancestors. Most commonly, these will be the actions with /// the “win.” or “app.” prefix that are associated with the @@ -14,6 +14,7 @@ import CGtk /// as well. public protocol Actionable: GObjectRepresentable { /// The name of the action with which this widget should be associated. - var actionName: String? { get set } +var actionName: String? { get set } -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Align.swift b/Sources/Gtk/Generated/Align.swift index 120d4707f9..b711436f4c 100644 --- a/Sources/Gtk/Generated/Align.swift +++ b/Sources/Gtk/Generated/Align.swift @@ -1,17 +1,17 @@ import CGtk /// Controls how a widget deals with extra space in a single dimension. -/// +/// /// Alignment only matters if the widget receives a “too large” allocation, /// for example if you packed the widget with the [property@Gtk.Widget:hexpand] /// property inside a [class@Box], then the widget might get extra space. /// If you have for example a 16x16 icon inside a 32x32 space, the icon /// could be scaled and stretched, it could be centered, or it could be /// positioned to one side of the space. -/// +/// /// Note that in horizontal context `GTK_ALIGN_START` and `GTK_ALIGN_END` /// are interpreted relative to text direction. -/// +/// /// Baseline support is optional for containers and widgets, and is only available /// for vertical alignment. `GTK_ALIGN_BASELINE_CENTER` and `GTK_ALIGN_BASELINE_FILL` /// are treated similar to `GTK_ALIGN_CENTER` and `GTK_ALIGN_FILL`, except that it @@ -20,29 +20,29 @@ public enum Align: GValueRepresentableEnum { public typealias GtkEnum = GtkAlign /// Stretch to fill all space if possible, center if - /// no meaningful way to stretch - case fill - /// Snap to left or top side, leaving space on right or bottom - case start - /// Snap to right or bottom side, leaving space on left or top - case end - /// Center natural width of widget inside the allocation - case center +/// no meaningful way to stretch +case fill +/// Snap to left or top side, leaving space on right or bottom +case start +/// Snap to right or bottom side, leaving space on left or top +case end +/// Center natural width of widget inside the allocation +case center public static var type: GType { - gtk_align_get_type() - } + gtk_align_get_type() +} public init(from gtkEnum: GtkAlign) { switch gtkEnum { case GTK_ALIGN_FILL: - self = .fill - case GTK_ALIGN_START: - self = .start - case GTK_ALIGN_END: - self = .end - case GTK_ALIGN_CENTER: - self = .center + self = .fill +case GTK_ALIGN_START: + self = .start +case GTK_ALIGN_END: + self = .end +case GTK_ALIGN_CENTER: + self = .center default: fatalError("Unsupported GtkAlign enum value: \(gtkEnum.rawValue)") } @@ -51,13 +51,13 @@ public enum Align: GValueRepresentableEnum { public func toGtk() -> GtkAlign { switch self { case .fill: - return GTK_ALIGN_FILL - case .start: - return GTK_ALIGN_START - case .end: - return GTK_ALIGN_END - case .center: - return GTK_ALIGN_CENTER + return GTK_ALIGN_FILL +case .start: + return GTK_ALIGN_START +case .end: + return GTK_ALIGN_END +case .center: + return GTK_ALIGN_CENTER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AppChooser.swift b/Sources/Gtk/Generated/AppChooser.swift index 5d4489089c..142bef0320 100644 --- a/Sources/Gtk/Generated/AppChooser.swift +++ b/Sources/Gtk/Generated/AppChooser.swift @@ -2,11 +2,11 @@ import CGtk /// `GtkAppChooser` is an interface for widgets which allow the user to /// choose an application. -/// +/// /// The main objects that implement this interface are /// [class@Gtk.AppChooserWidget], /// [class@Gtk.AppChooserDialog] and [class@Gtk.AppChooserButton]. -/// +/// /// Applications are represented by GIO `GAppInfo` objects here. /// GIO has a concept of recommended and fallback applications for a /// given content type. Recommended applications are those that claim @@ -16,13 +16,14 @@ import CGtk /// type. The `GtkAppChooserWidget` provides detailed control over /// whether the shown list of applications should include default, /// recommended or fallback applications. -/// +/// /// To obtain the application that has been selected in a `GtkAppChooser`, /// use [method@Gtk.AppChooser.get_app_info]. public protocol AppChooser: GObjectRepresentable { /// The content type of the `GtkAppChooser` object. - /// - /// See `GContentType` for more information about content types. - var contentType: String { get set } +/// +/// See `GContentType` for more information about content types. +var contentType: String { get set } -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ArrowType.swift b/Sources/Gtk/Generated/ArrowType.swift index 8c591c0df6..2e6a4a3dd6 100644 --- a/Sources/Gtk/Generated/ArrowType.swift +++ b/Sources/Gtk/Generated/ArrowType.swift @@ -5,32 +5,32 @@ public enum ArrowType: GValueRepresentableEnum { public typealias GtkEnum = GtkArrowType /// Represents an upward pointing arrow. - case up - /// Represents a downward pointing arrow. - case down - /// Represents a left pointing arrow. - case left - /// Represents a right pointing arrow. - case right - /// No arrow. - case none +case up +/// Represents a downward pointing arrow. +case down +/// Represents a left pointing arrow. +case left +/// Represents a right pointing arrow. +case right +/// No arrow. +case none public static var type: GType { - gtk_arrow_type_get_type() - } + gtk_arrow_type_get_type() +} public init(from gtkEnum: GtkArrowType) { switch gtkEnum { case GTK_ARROW_UP: - self = .up - case GTK_ARROW_DOWN: - self = .down - case GTK_ARROW_LEFT: - self = .left - case GTK_ARROW_RIGHT: - self = .right - case GTK_ARROW_NONE: - self = .none + self = .up +case GTK_ARROW_DOWN: + self = .down +case GTK_ARROW_LEFT: + self = .left +case GTK_ARROW_RIGHT: + self = .right +case GTK_ARROW_NONE: + self = .none default: fatalError("Unsupported GtkArrowType enum value: \(gtkEnum.rawValue)") } @@ -39,15 +39,15 @@ public enum ArrowType: GValueRepresentableEnum { public func toGtk() -> GtkArrowType { switch self { case .up: - return GTK_ARROW_UP - case .down: - return GTK_ARROW_DOWN - case .left: - return GTK_ARROW_LEFT - case .right: - return GTK_ARROW_RIGHT - case .none: - return GTK_ARROW_NONE + return GTK_ARROW_UP +case .down: + return GTK_ARROW_DOWN +case .left: + return GTK_ARROW_LEFT +case .right: + return GTK_ARROW_RIGHT +case .none: + return GTK_ARROW_NONE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AssistantPageType.swift b/Sources/Gtk/Generated/AssistantPageType.swift index 35e0bfdc55..a160f080c1 100644 --- a/Sources/Gtk/Generated/AssistantPageType.swift +++ b/Sources/Gtk/Generated/AssistantPageType.swift @@ -1,58 +1,58 @@ import CGtk /// Determines the role of a page inside a `GtkAssistant`. -/// +/// /// The role is used to handle buttons sensitivity and visibility. -/// +/// /// Note that an assistant needs to end its page flow with a page of type /// %GTK_ASSISTANT_PAGE_CONFIRM, %GTK_ASSISTANT_PAGE_SUMMARY or /// %GTK_ASSISTANT_PAGE_PROGRESS to be correct. -/// +/// /// The Cancel button will only be shown if the page isn’t “committed”. /// See gtk_assistant_commit() for details. public enum AssistantPageType: GValueRepresentableEnum { public typealias GtkEnum = GtkAssistantPageType /// The page has regular contents. Both the - /// Back and forward buttons will be shown. - case content - /// The page contains an introduction to the - /// assistant task. Only the Forward button will be shown if there is a - /// next page. - case intro - /// The page lets the user confirm or deny the - /// changes. The Back and Apply buttons will be shown. - case confirm - /// The page informs the user of the changes - /// done. Only the Close button will be shown. - case summary - /// Used for tasks that take a long time to - /// complete, blocks the assistant until the page is marked as complete. - /// Only the back button will be shown. - case progress - /// Used for when other page types are not - /// appropriate. No buttons will be shown, and the application must - /// add its own buttons through gtk_assistant_add_action_widget(). - case custom +/// Back and forward buttons will be shown. +case content +/// The page contains an introduction to the +/// assistant task. Only the Forward button will be shown if there is a +/// next page. +case intro +/// The page lets the user confirm or deny the +/// changes. The Back and Apply buttons will be shown. +case confirm +/// The page informs the user of the changes +/// done. Only the Close button will be shown. +case summary +/// Used for tasks that take a long time to +/// complete, blocks the assistant until the page is marked as complete. +/// Only the back button will be shown. +case progress +/// Used for when other page types are not +/// appropriate. No buttons will be shown, and the application must +/// add its own buttons through gtk_assistant_add_action_widget(). +case custom public static var type: GType { - gtk_assistant_page_type_get_type() - } + gtk_assistant_page_type_get_type() +} public init(from gtkEnum: GtkAssistantPageType) { switch gtkEnum { case GTK_ASSISTANT_PAGE_CONTENT: - self = .content - case GTK_ASSISTANT_PAGE_INTRO: - self = .intro - case GTK_ASSISTANT_PAGE_CONFIRM: - self = .confirm - case GTK_ASSISTANT_PAGE_SUMMARY: - self = .summary - case GTK_ASSISTANT_PAGE_PROGRESS: - self = .progress - case GTK_ASSISTANT_PAGE_CUSTOM: - self = .custom + self = .content +case GTK_ASSISTANT_PAGE_INTRO: + self = .intro +case GTK_ASSISTANT_PAGE_CONFIRM: + self = .confirm +case GTK_ASSISTANT_PAGE_SUMMARY: + self = .summary +case GTK_ASSISTANT_PAGE_PROGRESS: + self = .progress +case GTK_ASSISTANT_PAGE_CUSTOM: + self = .custom default: fatalError("Unsupported GtkAssistantPageType enum value: \(gtkEnum.rawValue)") } @@ -61,17 +61,17 @@ public enum AssistantPageType: GValueRepresentableEnum { public func toGtk() -> GtkAssistantPageType { switch self { case .content: - return GTK_ASSISTANT_PAGE_CONTENT - case .intro: - return GTK_ASSISTANT_PAGE_INTRO - case .confirm: - return GTK_ASSISTANT_PAGE_CONFIRM - case .summary: - return GTK_ASSISTANT_PAGE_SUMMARY - case .progress: - return GTK_ASSISTANT_PAGE_PROGRESS - case .custom: - return GTK_ASSISTANT_PAGE_CUSTOM + return GTK_ASSISTANT_PAGE_CONTENT +case .intro: + return GTK_ASSISTANT_PAGE_INTRO +case .confirm: + return GTK_ASSISTANT_PAGE_CONFIRM +case .summary: + return GTK_ASSISTANT_PAGE_SUMMARY +case .progress: + return GTK_ASSISTANT_PAGE_PROGRESS +case .custom: + return GTK_ASSISTANT_PAGE_CUSTOM } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/BaselinePosition.swift b/Sources/Gtk/Generated/BaselinePosition.swift index 9a1efe3a51..dc9baaee71 100644 --- a/Sources/Gtk/Generated/BaselinePosition.swift +++ b/Sources/Gtk/Generated/BaselinePosition.swift @@ -1,7 +1,7 @@ import CGtk /// Baseline position in a row of widgets. -/// +/// /// Whenever a container has some form of natural row it may align /// children in that row along a common typographical baseline. If /// the amount of vertical space in the row is taller than the total @@ -12,24 +12,24 @@ public enum BaselinePosition: GValueRepresentableEnum { public typealias GtkEnum = GtkBaselinePosition /// Align the baseline at the top - case top - /// Center the baseline - case center - /// Align the baseline at the bottom - case bottom +case top +/// Center the baseline +case center +/// Align the baseline at the bottom +case bottom public static var type: GType { - gtk_baseline_position_get_type() - } + gtk_baseline_position_get_type() +} public init(from gtkEnum: GtkBaselinePosition) { switch gtkEnum { case GTK_BASELINE_POSITION_TOP: - self = .top - case GTK_BASELINE_POSITION_CENTER: - self = .center - case GTK_BASELINE_POSITION_BOTTOM: - self = .bottom + self = .top +case GTK_BASELINE_POSITION_CENTER: + self = .center +case GTK_BASELINE_POSITION_BOTTOM: + self = .bottom default: fatalError("Unsupported GtkBaselinePosition enum value: \(gtkEnum.rawValue)") } @@ -38,11 +38,11 @@ public enum BaselinePosition: GValueRepresentableEnum { public func toGtk() -> GtkBaselinePosition { switch self { case .top: - return GTK_BASELINE_POSITION_TOP - case .center: - return GTK_BASELINE_POSITION_CENTER - case .bottom: - return GTK_BASELINE_POSITION_BOTTOM + return GTK_BASELINE_POSITION_TOP +case .center: + return GTK_BASELINE_POSITION_CENTER +case .bottom: + return GTK_BASELINE_POSITION_BOTTOM } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/BorderStyle.swift b/Sources/Gtk/Generated/BorderStyle.swift index e29013f349..65b71ef962 100644 --- a/Sources/Gtk/Generated/BorderStyle.swift +++ b/Sources/Gtk/Generated/BorderStyle.swift @@ -5,52 +5,52 @@ public enum BorderStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkBorderStyle /// No visible border - case none - /// Same as %GTK_BORDER_STYLE_NONE - case hidden - /// A single line segment - case solid - /// Looks as if the content is sunken into the canvas - case inset - /// Looks as if the content is coming out of the canvas - case outset - /// A series of round dots - case dotted - /// A series of square-ended dashes - case dashed - /// Two parallel lines with some space between them - case double - /// Looks as if it were carved in the canvas - case groove - /// Looks as if it were coming out of the canvas - case ridge +case none +/// Same as %GTK_BORDER_STYLE_NONE +case hidden +/// A single line segment +case solid +/// Looks as if the content is sunken into the canvas +case inset +/// Looks as if the content is coming out of the canvas +case outset +/// A series of round dots +case dotted +/// A series of square-ended dashes +case dashed +/// Two parallel lines with some space between them +case double +/// Looks as if it were carved in the canvas +case groove +/// Looks as if it were coming out of the canvas +case ridge public static var type: GType { - gtk_border_style_get_type() - } + gtk_border_style_get_type() +} public init(from gtkEnum: GtkBorderStyle) { switch gtkEnum { case GTK_BORDER_STYLE_NONE: - self = .none - case GTK_BORDER_STYLE_HIDDEN: - self = .hidden - case GTK_BORDER_STYLE_SOLID: - self = .solid - case GTK_BORDER_STYLE_INSET: - self = .inset - case GTK_BORDER_STYLE_OUTSET: - self = .outset - case GTK_BORDER_STYLE_DOTTED: - self = .dotted - case GTK_BORDER_STYLE_DASHED: - self = .dashed - case GTK_BORDER_STYLE_DOUBLE: - self = .double - case GTK_BORDER_STYLE_GROOVE: - self = .groove - case GTK_BORDER_STYLE_RIDGE: - self = .ridge + self = .none +case GTK_BORDER_STYLE_HIDDEN: + self = .hidden +case GTK_BORDER_STYLE_SOLID: + self = .solid +case GTK_BORDER_STYLE_INSET: + self = .inset +case GTK_BORDER_STYLE_OUTSET: + self = .outset +case GTK_BORDER_STYLE_DOTTED: + self = .dotted +case GTK_BORDER_STYLE_DASHED: + self = .dashed +case GTK_BORDER_STYLE_DOUBLE: + self = .double +case GTK_BORDER_STYLE_GROOVE: + self = .groove +case GTK_BORDER_STYLE_RIDGE: + self = .ridge default: fatalError("Unsupported GtkBorderStyle enum value: \(gtkEnum.rawValue)") } @@ -59,25 +59,25 @@ public enum BorderStyle: GValueRepresentableEnum { public func toGtk() -> GtkBorderStyle { switch self { case .none: - return GTK_BORDER_STYLE_NONE - case .hidden: - return GTK_BORDER_STYLE_HIDDEN - case .solid: - return GTK_BORDER_STYLE_SOLID - case .inset: - return GTK_BORDER_STYLE_INSET - case .outset: - return GTK_BORDER_STYLE_OUTSET - case .dotted: - return GTK_BORDER_STYLE_DOTTED - case .dashed: - return GTK_BORDER_STYLE_DASHED - case .double: - return GTK_BORDER_STYLE_DOUBLE - case .groove: - return GTK_BORDER_STYLE_GROOVE - case .ridge: - return GTK_BORDER_STYLE_RIDGE + return GTK_BORDER_STYLE_NONE +case .hidden: + return GTK_BORDER_STYLE_HIDDEN +case .solid: + return GTK_BORDER_STYLE_SOLID +case .inset: + return GTK_BORDER_STYLE_INSET +case .outset: + return GTK_BORDER_STYLE_OUTSET +case .dotted: + return GTK_BORDER_STYLE_DOTTED +case .dashed: + return GTK_BORDER_STYLE_DASHED +case .double: + return GTK_BORDER_STYLE_DOUBLE +case .groove: + return GTK_BORDER_STYLE_GROOVE +case .ridge: + return GTK_BORDER_STYLE_RIDGE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Buildable.swift b/Sources/Gtk/Generated/Buildable.swift index a72135d704..954cb37f73 100644 --- a/Sources/Gtk/Generated/Buildable.swift +++ b/Sources/Gtk/Generated/Buildable.swift @@ -1,17 +1,19 @@ import CGtk /// Allows objects to extend and customize deserialization from ui files. -/// +/// /// The `GtkBuildable` interface includes methods for setting names and /// properties of objects, parsing custom tags and constructing child objects. -/// +/// /// It is implemented by all widgets and many of the non-widget objects that are /// provided by GTK. The main user of this interface is [class@Gtk.Builder]. /// There should be very little need for applications to call any of these /// functions directly. -/// +/// /// An object only needs to implement this interface if it needs to extend the /// `GtkBuilder` XML format or run any extra routines at deserialization time. public protocol Buildable: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/BuilderError.swift b/Sources/Gtk/Generated/BuilderError.swift index aff20af88a..c41097eab7 100644 --- a/Sources/Gtk/Generated/BuilderError.swift +++ b/Sources/Gtk/Generated/BuilderError.swift @@ -6,83 +6,83 @@ public enum BuilderError: GValueRepresentableEnum { public typealias GtkEnum = GtkBuilderError /// A type-func attribute didn’t name - /// a function that returns a `GType`. - case invalidTypeFunction - /// The input contained a tag that `GtkBuilder` - /// can’t handle. - case unhandledTag - /// An attribute that is required by - /// `GtkBuilder` was missing. - case missingAttribute - /// `GtkBuilder` found an attribute that - /// it doesn’t understand. - case invalidAttribute - /// `GtkBuilder` found a tag that - /// it doesn’t understand. - case invalidTag - /// A required property value was - /// missing. - case missingPropertyValue - /// `GtkBuilder` couldn’t parse - /// some attribute value. - case invalidValue - /// The input file requires a newer version - /// of GTK. - case versionMismatch - /// An object id occurred twice. - case duplicateId - /// A specified object type is of the same type or - /// derived from the type of the composite class being extended with builder XML. - case objectTypeRefused - /// The wrong type was specified in a composite class’s template XML - case templateMismatch - /// The specified property is unknown for the object class. - case invalidProperty - /// The specified signal is unknown for the object class. - case invalidSignal - /// An object id is unknown. - case invalidId - /// A function could not be found. This often happens - /// when symbols are set to be kept private. Compiling code with -rdynamic or using the - /// `gmodule-export-2.0` pkgconfig module can fix this problem. - case invalidFunction +/// a function that returns a `GType`. +case invalidTypeFunction +/// The input contained a tag that `GtkBuilder` +/// can’t handle. +case unhandledTag +/// An attribute that is required by +/// `GtkBuilder` was missing. +case missingAttribute +/// `GtkBuilder` found an attribute that +/// it doesn’t understand. +case invalidAttribute +/// `GtkBuilder` found a tag that +/// it doesn’t understand. +case invalidTag +/// A required property value was +/// missing. +case missingPropertyValue +/// `GtkBuilder` couldn’t parse +/// some attribute value. +case invalidValue +/// The input file requires a newer version +/// of GTK. +case versionMismatch +/// An object id occurred twice. +case duplicateId +/// A specified object type is of the same type or +/// derived from the type of the composite class being extended with builder XML. +case objectTypeRefused +/// The wrong type was specified in a composite class’s template XML +case templateMismatch +/// The specified property is unknown for the object class. +case invalidProperty +/// The specified signal is unknown for the object class. +case invalidSignal +/// An object id is unknown. +case invalidId +/// A function could not be found. This often happens +/// when symbols are set to be kept private. Compiling code with -rdynamic or using the +/// `gmodule-export-2.0` pkgconfig module can fix this problem. +case invalidFunction public static var type: GType { - gtk_builder_error_get_type() - } + gtk_builder_error_get_type() +} public init(from gtkEnum: GtkBuilderError) { switch gtkEnum { case GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION: - self = .invalidTypeFunction - case GTK_BUILDER_ERROR_UNHANDLED_TAG: - self = .unhandledTag - case GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: - self = .missingAttribute - case GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: - self = .invalidAttribute - case GTK_BUILDER_ERROR_INVALID_TAG: - self = .invalidTag - case GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: - self = .missingPropertyValue - case GTK_BUILDER_ERROR_INVALID_VALUE: - self = .invalidValue - case GTK_BUILDER_ERROR_VERSION_MISMATCH: - self = .versionMismatch - case GTK_BUILDER_ERROR_DUPLICATE_ID: - self = .duplicateId - case GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED: - self = .objectTypeRefused - case GTK_BUILDER_ERROR_TEMPLATE_MISMATCH: - self = .templateMismatch - case GTK_BUILDER_ERROR_INVALID_PROPERTY: - self = .invalidProperty - case GTK_BUILDER_ERROR_INVALID_SIGNAL: - self = .invalidSignal - case GTK_BUILDER_ERROR_INVALID_ID: - self = .invalidId - case GTK_BUILDER_ERROR_INVALID_FUNCTION: - self = .invalidFunction + self = .invalidTypeFunction +case GTK_BUILDER_ERROR_UNHANDLED_TAG: + self = .unhandledTag +case GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: + self = .missingAttribute +case GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: + self = .invalidAttribute +case GTK_BUILDER_ERROR_INVALID_TAG: + self = .invalidTag +case GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: + self = .missingPropertyValue +case GTK_BUILDER_ERROR_INVALID_VALUE: + self = .invalidValue +case GTK_BUILDER_ERROR_VERSION_MISMATCH: + self = .versionMismatch +case GTK_BUILDER_ERROR_DUPLICATE_ID: + self = .duplicateId +case GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED: + self = .objectTypeRefused +case GTK_BUILDER_ERROR_TEMPLATE_MISMATCH: + self = .templateMismatch +case GTK_BUILDER_ERROR_INVALID_PROPERTY: + self = .invalidProperty +case GTK_BUILDER_ERROR_INVALID_SIGNAL: + self = .invalidSignal +case GTK_BUILDER_ERROR_INVALID_ID: + self = .invalidId +case GTK_BUILDER_ERROR_INVALID_FUNCTION: + self = .invalidFunction default: fatalError("Unsupported GtkBuilderError enum value: \(gtkEnum.rawValue)") } @@ -91,35 +91,35 @@ public enum BuilderError: GValueRepresentableEnum { public func toGtk() -> GtkBuilderError { switch self { case .invalidTypeFunction: - return GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION - case .unhandledTag: - return GTK_BUILDER_ERROR_UNHANDLED_TAG - case .missingAttribute: - return GTK_BUILDER_ERROR_MISSING_ATTRIBUTE - case .invalidAttribute: - return GTK_BUILDER_ERROR_INVALID_ATTRIBUTE - case .invalidTag: - return GTK_BUILDER_ERROR_INVALID_TAG - case .missingPropertyValue: - return GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE - case .invalidValue: - return GTK_BUILDER_ERROR_INVALID_VALUE - case .versionMismatch: - return GTK_BUILDER_ERROR_VERSION_MISMATCH - case .duplicateId: - return GTK_BUILDER_ERROR_DUPLICATE_ID - case .objectTypeRefused: - return GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED - case .templateMismatch: - return GTK_BUILDER_ERROR_TEMPLATE_MISMATCH - case .invalidProperty: - return GTK_BUILDER_ERROR_INVALID_PROPERTY - case .invalidSignal: - return GTK_BUILDER_ERROR_INVALID_SIGNAL - case .invalidId: - return GTK_BUILDER_ERROR_INVALID_ID - case .invalidFunction: - return GTK_BUILDER_ERROR_INVALID_FUNCTION + return GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION +case .unhandledTag: + return GTK_BUILDER_ERROR_UNHANDLED_TAG +case .missingAttribute: + return GTK_BUILDER_ERROR_MISSING_ATTRIBUTE +case .invalidAttribute: + return GTK_BUILDER_ERROR_INVALID_ATTRIBUTE +case .invalidTag: + return GTK_BUILDER_ERROR_INVALID_TAG +case .missingPropertyValue: + return GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE +case .invalidValue: + return GTK_BUILDER_ERROR_INVALID_VALUE +case .versionMismatch: + return GTK_BUILDER_ERROR_VERSION_MISMATCH +case .duplicateId: + return GTK_BUILDER_ERROR_DUPLICATE_ID +case .objectTypeRefused: + return GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED +case .templateMismatch: + return GTK_BUILDER_ERROR_TEMPLATE_MISMATCH +case .invalidProperty: + return GTK_BUILDER_ERROR_INVALID_PROPERTY +case .invalidSignal: + return GTK_BUILDER_ERROR_INVALID_SIGNAL +case .invalidId: + return GTK_BUILDER_ERROR_INVALID_ID +case .invalidFunction: + return GTK_BUILDER_ERROR_INVALID_FUNCTION } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/BuilderScope.swift b/Sources/Gtk/Generated/BuilderScope.swift index 2390cbc4bf..3aae527b45 100644 --- a/Sources/Gtk/Generated/BuilderScope.swift +++ b/Sources/Gtk/Generated/BuilderScope.swift @@ -1,22 +1,24 @@ import CGtk /// Provides language binding support to `GtkBuilder`. -/// +/// /// The goal of `GtkBuilderScope` is to look up programming-language-specific /// values for strings that are given in a `GtkBuilder` UI file. -/// +/// /// The primary intended audience is bindings that want to provide deeper /// integration of `GtkBuilder` into the language. -/// +/// /// A `GtkBuilderScope` instance may be used with multiple `GtkBuilder` objects, /// even at once. -/// +/// /// By default, GTK will use its own implementation of `GtkBuilderScope` /// for the C language which can be created via [ctor@Gtk.BuilderCScope.new]. -/// +/// /// If you implement `GtkBuilderScope` for a language binding, you /// may want to (partially) derive from or fall back to a [class@Gtk.BuilderCScope], /// as that class implements support for automatic lookups from C symbols. public protocol BuilderScope: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Button.swift b/Sources/Gtk/Generated/Button.swift index b932a6ac92..32a2c7b9a1 100644 --- a/Sources/Gtk/Generated/Button.swift +++ b/Sources/Gtk/Generated/Button.swift @@ -1,232 +1,224 @@ import CGtk /// Calls a callback function when the button is clicked. -/// +/// /// An example GtkButton -/// +/// /// The `GtkButton` widget can hold any valid child widget. That is, it can hold /// almost any other standard `GtkWidget`. The most commonly used child is the /// `GtkLabel`. -/// +/// /// # Shortcuts and Gestures -/// +/// /// The following signals have default keybindings: -/// +/// /// - [signal@Gtk.Button::activate] -/// +/// /// # CSS nodes -/// +/// /// `GtkButton` has a single CSS node with name button. The node will get the /// style classes .image-button or .text-button, if the content is just an /// image or label, respectively. It may also receive the .flat style class. /// When activating a button via the keyboard, the button will temporarily /// gain the .keyboard-activating style class. -/// +/// /// Other style classes that are commonly used with `GtkButton` include /// .suggested-action and .destructive-action. In special cases, buttons /// can be made round by adding the .circular style class. -/// +/// /// Button-like widgets like [class@Gtk.ToggleButton], [class@Gtk.MenuButton], /// [class@Gtk.VolumeButton], [class@Gtk.LockButton], [class@Gtk.ColorButton] /// or [class@Gtk.FontButton] use style classes such as .toggle, .popup, .scale, /// .lock, .color on the button node to differentiate themselves from a plain /// `GtkButton`. -/// +/// /// # Accessibility -/// +/// /// `GtkButton` uses the [enum@Gtk.AccessibleRole.button] role. open class Button: Widget, Actionable { /// Creates a new `GtkButton` widget. - /// - /// To add a child widget to the button, use [method@Gtk.Button.set_child]. - public convenience init() { - self.init( - gtk_button_new() - ) +/// +/// To add a child widget to the button, use [method@Gtk.Button.set_child]. +public convenience init() { + self.init( + gtk_button_new() + ) +} + +/// Creates a new button containing an icon from the current icon theme. +/// +/// If the icon name isn’t known, a “broken image” icon will be +/// displayed instead. If the current icon theme is changed, the icon +/// will be updated appropriately. +public convenience init(iconName: String) { + self.init( + gtk_button_new_from_icon_name(iconName) + ) +} + +/// Creates a `GtkButton` widget with a `GtkLabel` child. +public convenience init(label: String) { + self.init( + gtk_button_new_with_label(label) + ) +} + +/// Creates a new `GtkButton` containing a label. +/// +/// If characters in @label are preceded by an underscore, they are underlined. +/// If you need a literal underscore character in a label, use “__” (two +/// underscores). The first underlined character represents a keyboard +/// accelerator called a mnemonic. Pressing Alt and that key +/// activates the button. +public convenience init(mnemonic label: String) { + self.init( + gtk_button_new_with_mnemonic(label) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) +} + +addSignal(name: "clicked") { [weak self] () in + guard let self = self else { return } + self.clicked?(self) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new button containing an icon from the current icon theme. - /// - /// If the icon name isn’t known, a “broken image” icon will be - /// displayed instead. If the current icon theme is changed, the icon - /// will be updated appropriately. - public convenience init(iconName: String) { - self.init( - gtk_button_new_from_icon_name(iconName) - ) +addSignal(name: "notify::can-shrink", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCanShrink?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a `GtkButton` widget with a `GtkLabel` child. - public convenience init(label: String) { - self.init( - gtk_button_new_with_label(label) - ) +addSignal(name: "notify::child", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyChild?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new `GtkButton` containing a label. - /// - /// If characters in @label are preceded by an underscore, they are underlined. - /// If you need a literal underscore character in a label, use “__” (two - /// underscores). The first underlined character represents a keyboard - /// accelerator called a mnemonic. Pressing Alt and that key - /// activates the button. - public convenience init(mnemonic label: String) { - self.init( - gtk_button_new_with_mnemonic(label) - ) +addSignal(name: "notify::has-frame", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasFrame?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) - } - - addSignal(name: "clicked") { [weak self] () in - guard let self = self else { return } - self.clicked?(self) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::can-shrink", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCanShrink?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::child", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyChild?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::has-frame", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasFrame?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::icon-name", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIconName?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::label", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLabel?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-underline", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseUnderline?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::action-name", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionName?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::action-target", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionTarget?(self, param0) - } +addSignal(name: "notify::icon-name", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIconName?(self, param0) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::label", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLabel?(self, param0) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::use-underline", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseUnderline?(self, param0) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::action-name", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionName?(self, param0) +} + +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::action-target", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionTarget?(self, param0) +} +} + /// Whether the button has a frame. - @GObjectProperty(named: "has-frame") public var hasFrame: Bool +@GObjectProperty(named: "has-frame") public var hasFrame: Bool - /// The name of the icon used to automatically populate the button. - @GObjectProperty(named: "icon-name") public var iconName: String? +/// The name of the icon used to automatically populate the button. +@GObjectProperty(named: "icon-name") public var iconName: String? - /// Text of the label inside the button, if the button contains a label widget. - @GObjectProperty(named: "label") public var label: String? +/// Text of the label inside the button, if the button contains a label widget. +@GObjectProperty(named: "label") public var label: String? - /// If set, an underline in the text indicates that the following character is - /// to be used as mnemonic. - @GObjectProperty(named: "use-underline") public var useUnderline: Bool +/// If set, an underline in the text indicates that the following character is +/// to be used as mnemonic. +@GObjectProperty(named: "use-underline") public var useUnderline: Bool - /// The name of the action with which this widget should be associated. - @GObjectProperty(named: "action-name") public var actionName: String? +/// The name of the action with which this widget should be associated. +@GObjectProperty(named: "action-name") public var actionName: String? - /// Emitted to animate press then release. - /// - /// This is an action signal. Applications should never connect - /// to this signal, but use the [signal@Gtk.Button::clicked] signal. - /// - /// The default bindings for this signal are all forms of the - /// and Enter keys. - public var activate: ((Button) -> Void)? +/// Emitted to animate press then release. +/// +/// This is an action signal. Applications should never connect +/// to this signal, but use the [signal@Gtk.Button::clicked] signal. +/// +/// The default bindings for this signal are all forms of the +/// and Enter keys. +public var activate: ((Button) -> Void)? - /// Emitted when the button has been activated (pressed and released). - public var clicked: ((Button) -> Void)? +/// Emitted when the button has been activated (pressed and released). +public var clicked: ((Button) -> Void)? - public var notifyCanShrink: ((Button, OpaquePointer) -> Void)? - public var notifyChild: ((Button, OpaquePointer) -> Void)? +public var notifyCanShrink: ((Button, OpaquePointer) -> Void)? - public var notifyHasFrame: ((Button, OpaquePointer) -> Void)? - public var notifyIconName: ((Button, OpaquePointer) -> Void)? +public var notifyChild: ((Button, OpaquePointer) -> Void)? - public var notifyLabel: ((Button, OpaquePointer) -> Void)? - public var notifyUseUnderline: ((Button, OpaquePointer) -> Void)? +public var notifyHasFrame: ((Button, OpaquePointer) -> Void)? - public var notifyActionName: ((Button, OpaquePointer) -> Void)? - public var notifyActionTarget: ((Button, OpaquePointer) -> Void)? -} +public var notifyIconName: ((Button, OpaquePointer) -> Void)? + + +public var notifyLabel: ((Button, OpaquePointer) -> Void)? + + +public var notifyUseUnderline: ((Button, OpaquePointer) -> Void)? + + +public var notifyActionName: ((Button, OpaquePointer) -> Void)? + + +public var notifyActionTarget: ((Button, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ButtonsType.swift b/Sources/Gtk/Generated/ButtonsType.swift index ae70565d91..daa430f79a 100644 --- a/Sources/Gtk/Generated/ButtonsType.swift +++ b/Sources/Gtk/Generated/ButtonsType.swift @@ -1,10 +1,10 @@ import CGtk /// Prebuilt sets of buttons for `GtkDialog`. -/// +/// /// If none of these choices are appropriate, simply use /// %GTK_BUTTONS_NONE and call [method@Gtk.Dialog.add_buttons]. -/// +/// /// > Please note that %GTK_BUTTONS_OK, %GTK_BUTTONS_YES_NO /// > and %GTK_BUTTONS_OK_CANCEL are discouraged by the /// > [GNOME Human Interface Guidelines](https://developer.gnome.org/hig/). @@ -12,36 +12,36 @@ public enum ButtonsType: GValueRepresentableEnum { public typealias GtkEnum = GtkButtonsType /// No buttons at all - case none - /// An OK button - case ok - /// A Close button - case close - /// A Cancel button - case cancel - /// Yes and No buttons - case yesNo - /// OK and Cancel buttons - case okCancel +case none +/// An OK button +case ok +/// A Close button +case close +/// A Cancel button +case cancel +/// Yes and No buttons +case yesNo +/// OK and Cancel buttons +case okCancel public static var type: GType { - gtk_buttons_type_get_type() - } + gtk_buttons_type_get_type() +} public init(from gtkEnum: GtkButtonsType) { switch gtkEnum { case GTK_BUTTONS_NONE: - self = .none - case GTK_BUTTONS_OK: - self = .ok - case GTK_BUTTONS_CLOSE: - self = .close - case GTK_BUTTONS_CANCEL: - self = .cancel - case GTK_BUTTONS_YES_NO: - self = .yesNo - case GTK_BUTTONS_OK_CANCEL: - self = .okCancel + self = .none +case GTK_BUTTONS_OK: + self = .ok +case GTK_BUTTONS_CLOSE: + self = .close +case GTK_BUTTONS_CANCEL: + self = .cancel +case GTK_BUTTONS_YES_NO: + self = .yesNo +case GTK_BUTTONS_OK_CANCEL: + self = .okCancel default: fatalError("Unsupported GtkButtonsType enum value: \(gtkEnum.rawValue)") } @@ -50,17 +50,17 @@ public enum ButtonsType: GValueRepresentableEnum { public func toGtk() -> GtkButtonsType { switch self { case .none: - return GTK_BUTTONS_NONE - case .ok: - return GTK_BUTTONS_OK - case .close: - return GTK_BUTTONS_CLOSE - case .cancel: - return GTK_BUTTONS_CANCEL - case .yesNo: - return GTK_BUTTONS_YES_NO - case .okCancel: - return GTK_BUTTONS_OK_CANCEL + return GTK_BUTTONS_NONE +case .ok: + return GTK_BUTTONS_OK +case .close: + return GTK_BUTTONS_CLOSE +case .cancel: + return GTK_BUTTONS_CANCEL +case .yesNo: + return GTK_BUTTONS_YES_NO +case .okCancel: + return GTK_BUTTONS_OK_CANCEL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/CellEditable.swift b/Sources/Gtk/Generated/CellEditable.swift index fa4c171a02..918485f6a2 100644 --- a/Sources/Gtk/Generated/CellEditable.swift +++ b/Sources/Gtk/Generated/CellEditable.swift @@ -1,36 +1,37 @@ import CGtk /// Interface for widgets that can be used for editing cells -/// +/// /// The `GtkCellEditable` interface must be implemented for widgets to be usable /// to edit the contents of a `GtkTreeView` cell. It provides a way to specify how /// temporary widgets should be configured for editing, get the new value, etc. public protocol CellEditable: GObjectRepresentable { + /// This signal is a sign for the cell renderer to update its - /// value from the @cell_editable. - /// - /// Implementations of `GtkCellEditable` are responsible for - /// emitting this signal when they are done editing, e.g. - /// `GtkEntry` emits this signal when the user presses Enter. Typical things to - /// do in a handler for ::editing-done are to capture the edited value, - /// disconnect the @cell_editable from signals on the `GtkCellRenderer`, etc. - /// - /// gtk_cell_editable_editing_done() is a convenience method - /// for emitting `GtkCellEditable::editing-done`. - var editingDone: ((Self) -> Void)? { get set } +/// value from the @cell_editable. +/// +/// Implementations of `GtkCellEditable` are responsible for +/// emitting this signal when they are done editing, e.g. +/// `GtkEntry` emits this signal when the user presses Enter. Typical things to +/// do in a handler for ::editing-done are to capture the edited value, +/// disconnect the @cell_editable from signals on the `GtkCellRenderer`, etc. +/// +/// gtk_cell_editable_editing_done() is a convenience method +/// for emitting `GtkCellEditable::editing-done`. +var editingDone: ((Self) -> Void)? { get set } - /// This signal is meant to indicate that the cell is finished - /// editing, and the @cell_editable widget is being removed and may - /// subsequently be destroyed. - /// - /// Implementations of `GtkCellEditable` are responsible for - /// emitting this signal when they are done editing. It must - /// be emitted after the `GtkCellEditable::editing-done` signal, - /// to give the cell renderer a chance to update the cell's value - /// before the widget is removed. - /// - /// gtk_cell_editable_remove_widget() is a convenience method - /// for emitting `GtkCellEditable::remove-widget`. - var removeWidget: ((Self) -> Void)? { get set } -} +/// This signal is meant to indicate that the cell is finished +/// editing, and the @cell_editable widget is being removed and may +/// subsequently be destroyed. +/// +/// Implementations of `GtkCellEditable` are responsible for +/// emitting this signal when they are done editing. It must +/// be emitted after the `GtkCellEditable::editing-done` signal, +/// to give the cell renderer a chance to update the cell's value +/// before the widget is removed. +/// +/// gtk_cell_editable_remove_widget() is a convenience method +/// for emitting `GtkCellEditable::remove-widget`. +var removeWidget: ((Self) -> Void)? { get set } +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/CellLayout.swift b/Sources/Gtk/Generated/CellLayout.swift index 2aa7aa88b5..51c91867db 100644 --- a/Sources/Gtk/Generated/CellLayout.swift +++ b/Sources/Gtk/Generated/CellLayout.swift @@ -1,11 +1,11 @@ import CGtk /// An interface for packing cells -/// +/// /// `GtkCellLayout` is an interface to be implemented by all objects which /// want to provide a `GtkTreeViewColumn` like API for packing cells, /// setting attributes and data funcs. -/// +/// /// One of the notable features provided by implementations of /// `GtkCellLayout` are attributes. Attributes let you set the properties /// in flexible ways. They can just be set to constant values like regular @@ -15,9 +15,9 @@ import CGtk /// the cell renderer. Finally, it is possible to specify a function with /// gtk_cell_layout_set_cell_data_func() that is called to determine the /// value of the attribute for each cell that is rendered. -/// +/// /// ## GtkCellLayouts as GtkBuildable -/// +/// /// Implementations of GtkCellLayout which also implement the GtkBuildable /// interface (`GtkCellView`, `GtkIconView`, `GtkComboBox`, /// `GtkEntryCompletion`, `GtkTreeViewColumn`) accept `GtkCellRenderer` objects @@ -26,38 +26,38 @@ import CGtk /// elements. Each `` element has a name attribute which specifies /// a property of the cell renderer; the content of the element is the /// attribute value. -/// +/// /// This is an example of a UI definition fragment specifying attributes: -/// +/// /// ```xml /// 0 /// ``` -/// +/// /// Furthermore for implementations of `GtkCellLayout` that use a `GtkCellArea` /// to lay out cells (all `GtkCellLayout`s in GTK use a `GtkCellArea`) /// [cell properties](class.CellArea.html#cell-properties) can also be defined /// in the format by specifying the custom `` attribute which can /// contain multiple `` elements. -/// +/// /// Here is a UI definition fragment specifying cell properties: -/// +/// /// ```xml /// TrueFalse /// ``` -/// +/// /// ## Subclassing GtkCellLayout implementations -/// +/// /// When subclassing a widget that implements `GtkCellLayout` like /// `GtkIconView` or `GtkComboBox`, there are some considerations related /// to the fact that these widgets internally use a `GtkCellArea`. /// The cell area is exposed as a construct-only property by these /// widgets. This means that it is possible to e.g. do -/// +/// /// ```c /// GtkWIdget *combo = /// g_object_new (GTK_TYPE_COMBO_BOX, "cell-area", my_cell_area, NULL); /// ``` -/// +/// /// to use a custom cell area with a combo box. But construct properties /// are only initialized after instance `init()` /// functions have run, which means that using functions which rely on @@ -65,21 +65,21 @@ import CGtk /// cause the default cell area to be instantiated. In this case, a provided /// construct property value will be ignored (with a warning, to alert /// you to the problem). -/// +/// /// ```c /// static void /// my_combo_box_init (MyComboBox *b) /// { /// GtkCellRenderer *cell; -/// +/// /// cell = gtk_cell_renderer_pixbuf_new (); -/// +/// /// // The following call causes the default cell area for combo boxes, /// // a GtkCellAreaBox, to be instantiated /// gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (b), cell, FALSE); /// ... /// } -/// +/// /// GtkWidget * /// my_combo_box_new (GtkCellArea *area) /// { @@ -87,12 +87,14 @@ import CGtk /// return g_object_new (MY_TYPE_COMBO_BOX, "cell-area", area, NULL); /// } /// ``` -/// +/// /// If supporting alternative cell areas with your derived widget is /// not important, then this does not have to concern you. If you want /// to support alternative cell areas, you can do so by moving the /// problematic calls out of `init()` and into a `constructor()` /// for your class. public protocol CellLayout: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/CellRendererAccelMode.swift b/Sources/Gtk/Generated/CellRendererAccelMode.swift index 80a29bf5bd..4952def369 100644 --- a/Sources/Gtk/Generated/CellRendererAccelMode.swift +++ b/Sources/Gtk/Generated/CellRendererAccelMode.swift @@ -5,20 +5,20 @@ public enum CellRendererAccelMode: GValueRepresentableEnum { public typealias GtkEnum = GtkCellRendererAccelMode /// GTK accelerators mode - case gtk - /// Other accelerator mode - case other +case gtk +/// Other accelerator mode +case other public static var type: GType { - gtk_cell_renderer_accel_mode_get_type() - } + gtk_cell_renderer_accel_mode_get_type() +} public init(from gtkEnum: GtkCellRendererAccelMode) { switch gtkEnum { case GTK_CELL_RENDERER_ACCEL_MODE_GTK: - self = .gtk - case GTK_CELL_RENDERER_ACCEL_MODE_OTHER: - self = .other + self = .gtk +case GTK_CELL_RENDERER_ACCEL_MODE_OTHER: + self = .other default: fatalError("Unsupported GtkCellRendererAccelMode enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ public enum CellRendererAccelMode: GValueRepresentableEnum { public func toGtk() -> GtkCellRendererAccelMode { switch self { case .gtk: - return GTK_CELL_RENDERER_ACCEL_MODE_GTK - case .other: - return GTK_CELL_RENDERER_ACCEL_MODE_OTHER + return GTK_CELL_RENDERER_ACCEL_MODE_GTK +case .other: + return GTK_CELL_RENDERER_ACCEL_MODE_OTHER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/CellRendererMode.swift b/Sources/Gtk/Generated/CellRendererMode.swift index b073354ea2..74d702f294 100644 --- a/Sources/Gtk/Generated/CellRendererMode.swift +++ b/Sources/Gtk/Generated/CellRendererMode.swift @@ -5,27 +5,27 @@ public enum CellRendererMode: GValueRepresentableEnum { public typealias GtkEnum = GtkCellRendererMode /// The cell is just for display - /// and cannot be interacted with. Note that this doesn’t mean that eg. the - /// row being drawn can’t be selected -- just that a particular element of - /// it cannot be individually modified. - case inert - /// The cell can be clicked. - case activatable - /// The cell can be edited or otherwise modified. - case editable +/// and cannot be interacted with. Note that this doesn’t mean that eg. the +/// row being drawn can’t be selected -- just that a particular element of +/// it cannot be individually modified. +case inert +/// The cell can be clicked. +case activatable +/// The cell can be edited or otherwise modified. +case editable public static var type: GType { - gtk_cell_renderer_mode_get_type() - } + gtk_cell_renderer_mode_get_type() +} public init(from gtkEnum: GtkCellRendererMode) { switch gtkEnum { case GTK_CELL_RENDERER_MODE_INERT: - self = .inert - case GTK_CELL_RENDERER_MODE_ACTIVATABLE: - self = .activatable - case GTK_CELL_RENDERER_MODE_EDITABLE: - self = .editable + self = .inert +case GTK_CELL_RENDERER_MODE_ACTIVATABLE: + self = .activatable +case GTK_CELL_RENDERER_MODE_EDITABLE: + self = .editable default: fatalError("Unsupported GtkCellRendererMode enum value: \(gtkEnum.rawValue)") } @@ -34,11 +34,11 @@ public enum CellRendererMode: GValueRepresentableEnum { public func toGtk() -> GtkCellRendererMode { switch self { case .inert: - return GTK_CELL_RENDERER_MODE_INERT - case .activatable: - return GTK_CELL_RENDERER_MODE_ACTIVATABLE - case .editable: - return GTK_CELL_RENDERER_MODE_EDITABLE + return GTK_CELL_RENDERER_MODE_INERT +case .activatable: + return GTK_CELL_RENDERER_MODE_ACTIVATABLE +case .editable: + return GTK_CELL_RENDERER_MODE_EDITABLE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/CheckButton.swift b/Sources/Gtk/Generated/CheckButton.swift index 287ea926a3..9c15409bac 100644 --- a/Sources/Gtk/Generated/CheckButton.swift +++ b/Sources/Gtk/Generated/CheckButton.swift @@ -1,251 +1,243 @@ import CGtk /// Places a label next to an indicator. -/// +/// /// Example GtkCheckButtons -/// +/// /// A `GtkCheckButton` is created by calling either [ctor@Gtk.CheckButton.new] /// or [ctor@Gtk.CheckButton.new_with_label]. -/// +/// /// The state of a `GtkCheckButton` can be set specifically using /// [method@Gtk.CheckButton.set_active], and retrieved using /// [method@Gtk.CheckButton.get_active]. -/// +/// /// # Inconsistent state -/// +/// /// In addition to "on" and "off", check buttons can be an /// "in between" state that is neither on nor off. This can be used /// e.g. when the user has selected a range of elements (such as some /// text or spreadsheet cells) that are affected by a check button, /// and the current values in that range are inconsistent. -/// +/// /// To set a `GtkCheckButton` to inconsistent state, use /// [method@Gtk.CheckButton.set_inconsistent]. -/// +/// /// # Grouping -/// +/// /// Check buttons can be grouped together, to form mutually exclusive /// groups - only one of the buttons can be toggled at a time, and toggling /// another one will switch the currently toggled one off. -/// +/// /// Grouped check buttons use a different indicator, and are commonly referred /// to as *radio buttons*. -/// +/// /// Example GtkRadioButtons -/// +/// /// To add a `GtkCheckButton` to a group, use [method@Gtk.CheckButton.set_group]. -/// +/// /// When the code must keep track of the state of a group of radio buttons, it /// is recommended to keep track of such state through a stateful /// `GAction` with a target for each button. Using the `toggled` signals to keep /// track of the group changes and state is discouraged. -/// +/// /// # Shortcuts and Gestures -/// +/// /// `GtkCheckButton` supports the following keyboard shortcuts: -/// +/// /// - or Enter activates the button. -/// +/// /// # CSS nodes -/// +/// /// ``` /// checkbutton[.text-button][.grouped] /// ├── check /// ╰── [label] /// ``` -/// +/// /// A `GtkCheckButton` has a main node with name checkbutton. If the /// [property@Gtk.CheckButton:label] or [property@Gtk.CheckButton:child] /// properties are set, it contains a child widget. The indicator node /// is named check when no group is set, and radio if the checkbutton /// is grouped together with other checkbuttons. -/// +/// /// # Accessibility -/// +/// /// `GtkCheckButton` uses the [enum@Gtk.AccessibleRole.checkbox] role. open class CheckButton: Widget, Actionable { /// Creates a new `GtkCheckButton`. - public convenience init() { - self.init( - gtk_check_button_new() - ) +public convenience init() { + self.init( + gtk_check_button_new() + ) +} + +/// Creates a new `GtkCheckButton` with the given text. +public convenience init(label: String) { + self.init( + gtk_check_button_new_with_label(label) + ) +} + +/// Creates a new `GtkCheckButton` with the given text and a mnemonic. +public convenience init(mnemonic label: String) { + self.init( + gtk_check_button_new_with_mnemonic(label) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) +} + +addSignal(name: "toggled") { [weak self] () in + guard let self = self else { return } + self.toggled?(self) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new `GtkCheckButton` with the given text. - public convenience init(label: String) { - self.init( - gtk_check_button_new_with_label(label) - ) +addSignal(name: "notify::active", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActive?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new `GtkCheckButton` with the given text and a mnemonic. - public convenience init(mnemonic label: String) { - self.init( - gtk_check_button_new_with_mnemonic(label) - ) +addSignal(name: "notify::child", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyChild?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) - } - - addSignal(name: "toggled") { [weak self] () in - guard let self = self else { return } - self.toggled?(self) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::active", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActive?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::child", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyChild?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::group", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyGroup?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::inconsistent", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInconsistent?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::label", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLabel?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-underline", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseUnderline?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::action-name", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionName?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::action-target", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionTarget?(self, param0) - } +addSignal(name: "notify::group", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyGroup?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::inconsistent", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInconsistent?(self, param0) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::label", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLabel?(self, param0) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::use-underline", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseUnderline?(self, param0) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::action-name", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionName?(self, param0) +} + +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::action-target", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionTarget?(self, param0) +} +} + /// If the check button is active. - /// - /// Setting `active` to %TRUE will add the `:checked:` state to both - /// the check button and the indicator CSS node. - @GObjectProperty(named: "active") public var active: Bool +/// +/// Setting `active` to %TRUE will add the `:checked:` state to both +/// the check button and the indicator CSS node. +@GObjectProperty(named: "active") public var active: Bool - /// If the check button is in an “in between” state. - /// - /// The inconsistent state only affects visual appearance, - /// not the semantics of the button. - @GObjectProperty(named: "inconsistent") public var inconsistent: Bool +/// If the check button is in an “in between” state. +/// +/// The inconsistent state only affects visual appearance, +/// not the semantics of the button. +@GObjectProperty(named: "inconsistent") public var inconsistent: Bool - /// Text of the label inside the check button, if it contains a label widget. - @GObjectProperty(named: "label") public var label: String? +/// Text of the label inside the check button, if it contains a label widget. +@GObjectProperty(named: "label") public var label: String? - /// If set, an underline in the text indicates that the following - /// character is to be used as mnemonic. - @GObjectProperty(named: "use-underline") public var useUnderline: Bool +/// If set, an underline in the text indicates that the following +/// character is to be used as mnemonic. +@GObjectProperty(named: "use-underline") public var useUnderline: Bool - /// The name of the action with which this widget should be associated. - @GObjectProperty(named: "action-name") public var actionName: String? +/// The name of the action with which this widget should be associated. +@GObjectProperty(named: "action-name") public var actionName: String? - /// Emitted to when the check button is activated. - /// - /// The `::activate` signal on `GtkCheckButton` is an action signal and - /// emitting it causes the button to animate press then release. - /// - /// Applications should never connect to this signal, but use the - /// [signal@Gtk.CheckButton::toggled] signal. - /// - /// The default bindings for this signal are all forms of the - /// and Enter keys. - public var activate: ((CheckButton) -> Void)? +/// Emitted to when the check button is activated. +/// +/// The `::activate` signal on `GtkCheckButton` is an action signal and +/// emitting it causes the button to animate press then release. +/// +/// Applications should never connect to this signal, but use the +/// [signal@Gtk.CheckButton::toggled] signal. +/// +/// The default bindings for this signal are all forms of the +/// and Enter keys. +public var activate: ((CheckButton) -> Void)? - /// Emitted when the buttons's [property@Gtk.CheckButton:active] - /// property changes. - public var toggled: ((CheckButton) -> Void)? +/// Emitted when the buttons's [property@Gtk.CheckButton:active] +/// property changes. +public var toggled: ((CheckButton) -> Void)? - public var notifyActive: ((CheckButton, OpaquePointer) -> Void)? - public var notifyChild: ((CheckButton, OpaquePointer) -> Void)? +public var notifyActive: ((CheckButton, OpaquePointer) -> Void)? - public var notifyGroup: ((CheckButton, OpaquePointer) -> Void)? - public var notifyInconsistent: ((CheckButton, OpaquePointer) -> Void)? +public var notifyChild: ((CheckButton, OpaquePointer) -> Void)? - public var notifyLabel: ((CheckButton, OpaquePointer) -> Void)? - public var notifyUseUnderline: ((CheckButton, OpaquePointer) -> Void)? +public var notifyGroup: ((CheckButton, OpaquePointer) -> Void)? - public var notifyActionName: ((CheckButton, OpaquePointer) -> Void)? - public var notifyActionTarget: ((CheckButton, OpaquePointer) -> Void)? -} +public var notifyInconsistent: ((CheckButton, OpaquePointer) -> Void)? + + +public var notifyLabel: ((CheckButton, OpaquePointer) -> Void)? + + +public var notifyUseUnderline: ((CheckButton, OpaquePointer) -> Void)? + + +public var notifyActionName: ((CheckButton, OpaquePointer) -> Void)? + + +public var notifyActionTarget: ((CheckButton, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ConstraintAttribute.swift b/Sources/Gtk/Generated/ConstraintAttribute.swift index 1bc24638df..1e5c0ce066 100644 --- a/Sources/Gtk/Generated/ConstraintAttribute.swift +++ b/Sources/Gtk/Generated/ConstraintAttribute.swift @@ -5,69 +5,69 @@ public enum ConstraintAttribute: GValueRepresentableEnum { public typealias GtkEnum = GtkConstraintAttribute /// No attribute, used for constant - /// relations - case none - /// The left edge of a widget, regardless of - /// text direction - case left - /// The right edge of a widget, regardless - /// of text direction - case right - /// The top edge of a widget - case top - /// The bottom edge of a widget - case bottom - /// The leading edge of a widget, depending - /// on text direction; equivalent to %GTK_CONSTRAINT_ATTRIBUTE_LEFT for LTR - /// languages, and %GTK_CONSTRAINT_ATTRIBUTE_RIGHT for RTL ones - case start - /// The trailing edge of a widget, depending - /// on text direction; equivalent to %GTK_CONSTRAINT_ATTRIBUTE_RIGHT for LTR - /// languages, and %GTK_CONSTRAINT_ATTRIBUTE_LEFT for RTL ones - case end - /// The width of a widget - case width - /// The height of a widget - case height - /// The center of a widget, on the - /// horizontal axis - case centerX - /// The center of a widget, on the - /// vertical axis - case centerY - /// The baseline of a widget - case baseline +/// relations +case none +/// The left edge of a widget, regardless of +/// text direction +case left +/// The right edge of a widget, regardless +/// of text direction +case right +/// The top edge of a widget +case top +/// The bottom edge of a widget +case bottom +/// The leading edge of a widget, depending +/// on text direction; equivalent to %GTK_CONSTRAINT_ATTRIBUTE_LEFT for LTR +/// languages, and %GTK_CONSTRAINT_ATTRIBUTE_RIGHT for RTL ones +case start +/// The trailing edge of a widget, depending +/// on text direction; equivalent to %GTK_CONSTRAINT_ATTRIBUTE_RIGHT for LTR +/// languages, and %GTK_CONSTRAINT_ATTRIBUTE_LEFT for RTL ones +case end +/// The width of a widget +case width +/// The height of a widget +case height +/// The center of a widget, on the +/// horizontal axis +case centerX +/// The center of a widget, on the +/// vertical axis +case centerY +/// The baseline of a widget +case baseline public static var type: GType { - gtk_constraint_attribute_get_type() - } + gtk_constraint_attribute_get_type() +} public init(from gtkEnum: GtkConstraintAttribute) { switch gtkEnum { case GTK_CONSTRAINT_ATTRIBUTE_NONE: - self = .none - case GTK_CONSTRAINT_ATTRIBUTE_LEFT: - self = .left - case GTK_CONSTRAINT_ATTRIBUTE_RIGHT: - self = .right - case GTK_CONSTRAINT_ATTRIBUTE_TOP: - self = .top - case GTK_CONSTRAINT_ATTRIBUTE_BOTTOM: - self = .bottom - case GTK_CONSTRAINT_ATTRIBUTE_START: - self = .start - case GTK_CONSTRAINT_ATTRIBUTE_END: - self = .end - case GTK_CONSTRAINT_ATTRIBUTE_WIDTH: - self = .width - case GTK_CONSTRAINT_ATTRIBUTE_HEIGHT: - self = .height - case GTK_CONSTRAINT_ATTRIBUTE_CENTER_X: - self = .centerX - case GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y: - self = .centerY - case GTK_CONSTRAINT_ATTRIBUTE_BASELINE: - self = .baseline + self = .none +case GTK_CONSTRAINT_ATTRIBUTE_LEFT: + self = .left +case GTK_CONSTRAINT_ATTRIBUTE_RIGHT: + self = .right +case GTK_CONSTRAINT_ATTRIBUTE_TOP: + self = .top +case GTK_CONSTRAINT_ATTRIBUTE_BOTTOM: + self = .bottom +case GTK_CONSTRAINT_ATTRIBUTE_START: + self = .start +case GTK_CONSTRAINT_ATTRIBUTE_END: + self = .end +case GTK_CONSTRAINT_ATTRIBUTE_WIDTH: + self = .width +case GTK_CONSTRAINT_ATTRIBUTE_HEIGHT: + self = .height +case GTK_CONSTRAINT_ATTRIBUTE_CENTER_X: + self = .centerX +case GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y: + self = .centerY +case GTK_CONSTRAINT_ATTRIBUTE_BASELINE: + self = .baseline default: fatalError("Unsupported GtkConstraintAttribute enum value: \(gtkEnum.rawValue)") } @@ -76,29 +76,29 @@ public enum ConstraintAttribute: GValueRepresentableEnum { public func toGtk() -> GtkConstraintAttribute { switch self { case .none: - return GTK_CONSTRAINT_ATTRIBUTE_NONE - case .left: - return GTK_CONSTRAINT_ATTRIBUTE_LEFT - case .right: - return GTK_CONSTRAINT_ATTRIBUTE_RIGHT - case .top: - return GTK_CONSTRAINT_ATTRIBUTE_TOP - case .bottom: - return GTK_CONSTRAINT_ATTRIBUTE_BOTTOM - case .start: - return GTK_CONSTRAINT_ATTRIBUTE_START - case .end: - return GTK_CONSTRAINT_ATTRIBUTE_END - case .width: - return GTK_CONSTRAINT_ATTRIBUTE_WIDTH - case .height: - return GTK_CONSTRAINT_ATTRIBUTE_HEIGHT - case .centerX: - return GTK_CONSTRAINT_ATTRIBUTE_CENTER_X - case .centerY: - return GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y - case .baseline: - return GTK_CONSTRAINT_ATTRIBUTE_BASELINE + return GTK_CONSTRAINT_ATTRIBUTE_NONE +case .left: + return GTK_CONSTRAINT_ATTRIBUTE_LEFT +case .right: + return GTK_CONSTRAINT_ATTRIBUTE_RIGHT +case .top: + return GTK_CONSTRAINT_ATTRIBUTE_TOP +case .bottom: + return GTK_CONSTRAINT_ATTRIBUTE_BOTTOM +case .start: + return GTK_CONSTRAINT_ATTRIBUTE_START +case .end: + return GTK_CONSTRAINT_ATTRIBUTE_END +case .width: + return GTK_CONSTRAINT_ATTRIBUTE_WIDTH +case .height: + return GTK_CONSTRAINT_ATTRIBUTE_HEIGHT +case .centerX: + return GTK_CONSTRAINT_ATTRIBUTE_CENTER_X +case .centerY: + return GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y +case .baseline: + return GTK_CONSTRAINT_ATTRIBUTE_BASELINE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ConstraintRelation.swift b/Sources/Gtk/Generated/ConstraintRelation.swift index 58e75a256e..78cd718df6 100644 --- a/Sources/Gtk/Generated/ConstraintRelation.swift +++ b/Sources/Gtk/Generated/ConstraintRelation.swift @@ -5,24 +5,24 @@ public enum ConstraintRelation: GValueRepresentableEnum { public typealias GtkEnum = GtkConstraintRelation /// Less than, or equal - case le - /// Equal - case eq - /// Greater than, or equal - case ge +case le +/// Equal +case eq +/// Greater than, or equal +case ge public static var type: GType { - gtk_constraint_relation_get_type() - } + gtk_constraint_relation_get_type() +} public init(from gtkEnum: GtkConstraintRelation) { switch gtkEnum { case GTK_CONSTRAINT_RELATION_LE: - self = .le - case GTK_CONSTRAINT_RELATION_EQ: - self = .eq - case GTK_CONSTRAINT_RELATION_GE: - self = .ge + self = .le +case GTK_CONSTRAINT_RELATION_EQ: + self = .eq +case GTK_CONSTRAINT_RELATION_GE: + self = .ge default: fatalError("Unsupported GtkConstraintRelation enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ public enum ConstraintRelation: GValueRepresentableEnum { public func toGtk() -> GtkConstraintRelation { switch self { case .le: - return GTK_CONSTRAINT_RELATION_LE - case .eq: - return GTK_CONSTRAINT_RELATION_EQ - case .ge: - return GTK_CONSTRAINT_RELATION_GE + return GTK_CONSTRAINT_RELATION_LE +case .eq: + return GTK_CONSTRAINT_RELATION_EQ +case .ge: + return GTK_CONSTRAINT_RELATION_GE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ConstraintStrength.swift b/Sources/Gtk/Generated/ConstraintStrength.swift index 0e0fa5367b..56e0c59e20 100644 --- a/Sources/Gtk/Generated/ConstraintStrength.swift +++ b/Sources/Gtk/Generated/ConstraintStrength.swift @@ -1,35 +1,35 @@ import CGtk /// The strength of a constraint, expressed as a symbolic constant. -/// +/// /// The strength of a [class@Constraint] can be expressed with any positive /// integer; the values of this enumeration can be used for readability. public enum ConstraintStrength: GValueRepresentableEnum { public typealias GtkEnum = GtkConstraintStrength /// The constraint is required towards solving the layout - case required - /// A strong constraint - case strong - /// A medium constraint - case medium - /// A weak constraint - case weak +case required +/// A strong constraint +case strong +/// A medium constraint +case medium +/// A weak constraint +case weak public static var type: GType { - gtk_constraint_strength_get_type() - } + gtk_constraint_strength_get_type() +} public init(from gtkEnum: GtkConstraintStrength) { switch gtkEnum { case GTK_CONSTRAINT_STRENGTH_REQUIRED: - self = .required - case GTK_CONSTRAINT_STRENGTH_STRONG: - self = .strong - case GTK_CONSTRAINT_STRENGTH_MEDIUM: - self = .medium - case GTK_CONSTRAINT_STRENGTH_WEAK: - self = .weak + self = .required +case GTK_CONSTRAINT_STRENGTH_STRONG: + self = .strong +case GTK_CONSTRAINT_STRENGTH_MEDIUM: + self = .medium +case GTK_CONSTRAINT_STRENGTH_WEAK: + self = .weak default: fatalError("Unsupported GtkConstraintStrength enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ public enum ConstraintStrength: GValueRepresentableEnum { public func toGtk() -> GtkConstraintStrength { switch self { case .required: - return GTK_CONSTRAINT_STRENGTH_REQUIRED - case .strong: - return GTK_CONSTRAINT_STRENGTH_STRONG - case .medium: - return GTK_CONSTRAINT_STRENGTH_MEDIUM - case .weak: - return GTK_CONSTRAINT_STRENGTH_WEAK + return GTK_CONSTRAINT_STRENGTH_REQUIRED +case .strong: + return GTK_CONSTRAINT_STRENGTH_STRONG +case .medium: + return GTK_CONSTRAINT_STRENGTH_MEDIUM +case .weak: + return GTK_CONSTRAINT_STRENGTH_WEAK } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ConstraintTarget.swift b/Sources/Gtk/Generated/ConstraintTarget.swift index 07bfaf33b9..222de0a185 100644 --- a/Sources/Gtk/Generated/ConstraintTarget.swift +++ b/Sources/Gtk/Generated/ConstraintTarget.swift @@ -2,8 +2,10 @@ import CGtk /// Makes it possible to use an object as source or target in a /// [class@Gtk.Constraint]. -/// +/// /// Besides `GtkWidget`, it is also implemented by `GtkConstraintGuide`. public protocol ConstraintTarget: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ConstraintVflParserError.swift b/Sources/Gtk/Generated/ConstraintVflParserError.swift index 1b485c06f8..8bda010e9e 100644 --- a/Sources/Gtk/Generated/ConstraintVflParserError.swift +++ b/Sources/Gtk/Generated/ConstraintVflParserError.swift @@ -5,56 +5,55 @@ public enum ConstraintVflParserError: GValueRepresentableEnum { public typealias GtkEnum = GtkConstraintVflParserError /// Invalid or unknown symbol - case symbol - /// Invalid or unknown attribute - case attribute - /// Invalid or unknown view - case view - /// Invalid or unknown metric - case metric - /// Invalid or unknown priority - case priority - /// Invalid or unknown relation - case relation +case symbol +/// Invalid or unknown attribute +case attribute +/// Invalid or unknown view +case view +/// Invalid or unknown metric +case metric +/// Invalid or unknown priority +case priority +/// Invalid or unknown relation +case relation public static var type: GType { - gtk_constraint_vfl_parser_error_get_type() - } + gtk_constraint_vfl_parser_error_get_type() +} public init(from gtkEnum: GtkConstraintVflParserError) { switch gtkEnum { case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL: - self = .symbol - case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE: - self = .attribute - case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW: - self = .view - case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC: - self = .metric - case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY: - self = .priority - case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION: - self = .relation + self = .symbol +case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE: + self = .attribute +case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW: + self = .view +case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC: + self = .metric +case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY: + self = .priority +case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION: + self = .relation default: - fatalError( - "Unsupported GtkConstraintVflParserError enum value: \(gtkEnum.rawValue)") + fatalError("Unsupported GtkConstraintVflParserError enum value: \(gtkEnum.rawValue)") } } public func toGtk() -> GtkConstraintVflParserError { switch self { case .symbol: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL - case .attribute: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE - case .view: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW - case .metric: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC - case .priority: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY - case .relation: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL +case .attribute: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE +case .view: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW +case .metric: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC +case .priority: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY +case .relation: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/CornerType.swift b/Sources/Gtk/Generated/CornerType.swift index 8d6999bae6..4224f19381 100644 --- a/Sources/Gtk/Generated/CornerType.swift +++ b/Sources/Gtk/Generated/CornerType.swift @@ -2,38 +2,38 @@ import CGtk /// Specifies which corner a child widget should be placed in when packed into /// a `GtkScrolledWindow.` -/// +/// /// This is effectively the opposite of where the scroll bars are placed. public enum CornerType: GValueRepresentableEnum { public typealias GtkEnum = GtkCornerType /// Place the scrollbars on the right and bottom of the - /// widget (default behaviour). - case topLeft - /// Place the scrollbars on the top and right of the - /// widget. - case bottomLeft - /// Place the scrollbars on the left and bottom of the - /// widget. - case topRight - /// Place the scrollbars on the top and left of the - /// widget. - case bottomRight +/// widget (default behaviour). +case topLeft +/// Place the scrollbars on the top and right of the +/// widget. +case bottomLeft +/// Place the scrollbars on the left and bottom of the +/// widget. +case topRight +/// Place the scrollbars on the top and left of the +/// widget. +case bottomRight public static var type: GType { - gtk_corner_type_get_type() - } + gtk_corner_type_get_type() +} public init(from gtkEnum: GtkCornerType) { switch gtkEnum { case GTK_CORNER_TOP_LEFT: - self = .topLeft - case GTK_CORNER_BOTTOM_LEFT: - self = .bottomLeft - case GTK_CORNER_TOP_RIGHT: - self = .topRight - case GTK_CORNER_BOTTOM_RIGHT: - self = .bottomRight + self = .topLeft +case GTK_CORNER_BOTTOM_LEFT: + self = .bottomLeft +case GTK_CORNER_TOP_RIGHT: + self = .topRight +case GTK_CORNER_BOTTOM_RIGHT: + self = .bottomRight default: fatalError("Unsupported GtkCornerType enum value: \(gtkEnum.rawValue)") } @@ -42,13 +42,13 @@ public enum CornerType: GValueRepresentableEnum { public func toGtk() -> GtkCornerType { switch self { case .topLeft: - return GTK_CORNER_TOP_LEFT - case .bottomLeft: - return GTK_CORNER_BOTTOM_LEFT - case .topRight: - return GTK_CORNER_TOP_RIGHT - case .bottomRight: - return GTK_CORNER_BOTTOM_RIGHT + return GTK_CORNER_TOP_LEFT +case .bottomLeft: + return GTK_CORNER_BOTTOM_LEFT +case .topRight: + return GTK_CORNER_TOP_RIGHT +case .bottomRight: + return GTK_CORNER_BOTTOM_RIGHT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/CssParserError.swift b/Sources/Gtk/Generated/CssParserError.swift index 8036a95f88..9566e2db89 100644 --- a/Sources/Gtk/Generated/CssParserError.swift +++ b/Sources/Gtk/Generated/CssParserError.swift @@ -1,39 +1,39 @@ import CGtk /// Errors that can occur while parsing CSS. -/// +/// /// These errors are unexpected and will cause parts of the given CSS /// to be ignored. public enum CssParserError: GValueRepresentableEnum { public typealias GtkEnum = GtkCssParserError /// Unknown failure. - case failed - /// The given text does not form valid syntax - case syntax - /// Failed to import a resource - case import_ - /// The given name has not been defined - case name - /// The given value is not correct - case unknownValue +case failed +/// The given text does not form valid syntax +case syntax +/// Failed to import a resource +case import_ +/// The given name has not been defined +case name +/// The given value is not correct +case unknownValue public static var type: GType { - gtk_css_parser_error_get_type() - } + gtk_css_parser_error_get_type() +} public init(from gtkEnum: GtkCssParserError) { switch gtkEnum { case GTK_CSS_PARSER_ERROR_FAILED: - self = .failed - case GTK_CSS_PARSER_ERROR_SYNTAX: - self = .syntax - case GTK_CSS_PARSER_ERROR_IMPORT: - self = .import_ - case GTK_CSS_PARSER_ERROR_NAME: - self = .name - case GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE: - self = .unknownValue + self = .failed +case GTK_CSS_PARSER_ERROR_SYNTAX: + self = .syntax +case GTK_CSS_PARSER_ERROR_IMPORT: + self = .import_ +case GTK_CSS_PARSER_ERROR_NAME: + self = .name +case GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE: + self = .unknownValue default: fatalError("Unsupported GtkCssParserError enum value: \(gtkEnum.rawValue)") } @@ -42,15 +42,15 @@ public enum CssParserError: GValueRepresentableEnum { public func toGtk() -> GtkCssParserError { switch self { case .failed: - return GTK_CSS_PARSER_ERROR_FAILED - case .syntax: - return GTK_CSS_PARSER_ERROR_SYNTAX - case .import_: - return GTK_CSS_PARSER_ERROR_IMPORT - case .name: - return GTK_CSS_PARSER_ERROR_NAME - case .unknownValue: - return GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE + return GTK_CSS_PARSER_ERROR_FAILED +case .syntax: + return GTK_CSS_PARSER_ERROR_SYNTAX +case .import_: + return GTK_CSS_PARSER_ERROR_IMPORT +case .name: + return GTK_CSS_PARSER_ERROR_NAME +case .unknownValue: + return GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/CssParserWarning.swift b/Sources/Gtk/Generated/CssParserWarning.swift index 3050bfa3f3..459ecb80b9 100644 --- a/Sources/Gtk/Generated/CssParserWarning.swift +++ b/Sources/Gtk/Generated/CssParserWarning.swift @@ -1,33 +1,33 @@ import CGtk /// Warnings that can occur while parsing CSS. -/// +/// /// Unlike `GtkCssParserError`s, warnings do not cause the parser to /// skip any input, but they indicate issues that should be fixed. public enum CssParserWarning: GValueRepresentableEnum { public typealias GtkEnum = GtkCssParserWarning /// The given construct is - /// deprecated and will be removed in a future version - case deprecated - /// A syntax construct was used - /// that should be avoided - case syntax - /// A feature is not implemented - case unimplemented +/// deprecated and will be removed in a future version +case deprecated +/// A syntax construct was used +/// that should be avoided +case syntax +/// A feature is not implemented +case unimplemented public static var type: GType { - gtk_css_parser_warning_get_type() - } + gtk_css_parser_warning_get_type() +} public init(from gtkEnum: GtkCssParserWarning) { switch gtkEnum { case GTK_CSS_PARSER_WARNING_DEPRECATED: - self = .deprecated - case GTK_CSS_PARSER_WARNING_SYNTAX: - self = .syntax - case GTK_CSS_PARSER_WARNING_UNIMPLEMENTED: - self = .unimplemented + self = .deprecated +case GTK_CSS_PARSER_WARNING_SYNTAX: + self = .syntax +case GTK_CSS_PARSER_WARNING_UNIMPLEMENTED: + self = .unimplemented default: fatalError("Unsupported GtkCssParserWarning enum value: \(gtkEnum.rawValue)") } @@ -36,11 +36,11 @@ public enum CssParserWarning: GValueRepresentableEnum { public func toGtk() -> GtkCssParserWarning { switch self { case .deprecated: - return GTK_CSS_PARSER_WARNING_DEPRECATED - case .syntax: - return GTK_CSS_PARSER_WARNING_SYNTAX - case .unimplemented: - return GTK_CSS_PARSER_WARNING_UNIMPLEMENTED + return GTK_CSS_PARSER_WARNING_DEPRECATED +case .syntax: + return GTK_CSS_PARSER_WARNING_SYNTAX +case .unimplemented: + return GTK_CSS_PARSER_WARNING_UNIMPLEMENTED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/DeleteType.swift b/Sources/Gtk/Generated/DeleteType.swift index 9d5197ef0c..7b22266c3e 100644 --- a/Sources/Gtk/Generated/DeleteType.swift +++ b/Sources/Gtk/Generated/DeleteType.swift @@ -5,50 +5,50 @@ public enum DeleteType: GValueRepresentableEnum { public typealias GtkEnum = GtkDeleteType /// Delete characters. - case chars - /// Delete only the portion of the word to the - /// left/right of cursor if we’re in the middle of a word. - case wordEnds - /// Delete words. - case words - /// Delete display-lines. Display-lines - /// refers to the visible lines, with respect to the current line - /// breaks. As opposed to paragraphs, which are defined by line - /// breaks in the input. - case displayLines - /// Delete only the portion of the - /// display-line to the left/right of cursor. - case displayLineEnds - /// Delete to the end of the - /// paragraph. Like C-k in Emacs (or its reverse). - case paragraphEnds - /// Delete entire line. Like C-k in pico. - case paragraphs - /// Delete only whitespace. Like M-\ in Emacs. - case whitespace +case chars +/// Delete only the portion of the word to the +/// left/right of cursor if we’re in the middle of a word. +case wordEnds +/// Delete words. +case words +/// Delete display-lines. Display-lines +/// refers to the visible lines, with respect to the current line +/// breaks. As opposed to paragraphs, which are defined by line +/// breaks in the input. +case displayLines +/// Delete only the portion of the +/// display-line to the left/right of cursor. +case displayLineEnds +/// Delete to the end of the +/// paragraph. Like C-k in Emacs (or its reverse). +case paragraphEnds +/// Delete entire line. Like C-k in pico. +case paragraphs +/// Delete only whitespace. Like M-\ in Emacs. +case whitespace public static var type: GType { - gtk_delete_type_get_type() - } + gtk_delete_type_get_type() +} public init(from gtkEnum: GtkDeleteType) { switch gtkEnum { case GTK_DELETE_CHARS: - self = .chars - case GTK_DELETE_WORD_ENDS: - self = .wordEnds - case GTK_DELETE_WORDS: - self = .words - case GTK_DELETE_DISPLAY_LINES: - self = .displayLines - case GTK_DELETE_DISPLAY_LINE_ENDS: - self = .displayLineEnds - case GTK_DELETE_PARAGRAPH_ENDS: - self = .paragraphEnds - case GTK_DELETE_PARAGRAPHS: - self = .paragraphs - case GTK_DELETE_WHITESPACE: - self = .whitespace + self = .chars +case GTK_DELETE_WORD_ENDS: + self = .wordEnds +case GTK_DELETE_WORDS: + self = .words +case GTK_DELETE_DISPLAY_LINES: + self = .displayLines +case GTK_DELETE_DISPLAY_LINE_ENDS: + self = .displayLineEnds +case GTK_DELETE_PARAGRAPH_ENDS: + self = .paragraphEnds +case GTK_DELETE_PARAGRAPHS: + self = .paragraphs +case GTK_DELETE_WHITESPACE: + self = .whitespace default: fatalError("Unsupported GtkDeleteType enum value: \(gtkEnum.rawValue)") } @@ -57,21 +57,21 @@ public enum DeleteType: GValueRepresentableEnum { public func toGtk() -> GtkDeleteType { switch self { case .chars: - return GTK_DELETE_CHARS - case .wordEnds: - return GTK_DELETE_WORD_ENDS - case .words: - return GTK_DELETE_WORDS - case .displayLines: - return GTK_DELETE_DISPLAY_LINES - case .displayLineEnds: - return GTK_DELETE_DISPLAY_LINE_ENDS - case .paragraphEnds: - return GTK_DELETE_PARAGRAPH_ENDS - case .paragraphs: - return GTK_DELETE_PARAGRAPHS - case .whitespace: - return GTK_DELETE_WHITESPACE + return GTK_DELETE_CHARS +case .wordEnds: + return GTK_DELETE_WORD_ENDS +case .words: + return GTK_DELETE_WORDS +case .displayLines: + return GTK_DELETE_DISPLAY_LINES +case .displayLineEnds: + return GTK_DELETE_DISPLAY_LINE_ENDS +case .paragraphEnds: + return GTK_DELETE_PARAGRAPH_ENDS +case .paragraphs: + return GTK_DELETE_PARAGRAPHS +case .whitespace: + return GTK_DELETE_WHITESPACE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/DirectionType.swift b/Sources/Gtk/Generated/DirectionType.swift index af0b146996..bd80042ac2 100644 --- a/Sources/Gtk/Generated/DirectionType.swift +++ b/Sources/Gtk/Generated/DirectionType.swift @@ -5,36 +5,36 @@ public enum DirectionType: GValueRepresentableEnum { public typealias GtkEnum = GtkDirectionType /// Move forward. - case tabForward - /// Move backward. - case tabBackward - /// Move up. - case up - /// Move down. - case down - /// Move left. - case left - /// Move right. - case right +case tabForward +/// Move backward. +case tabBackward +/// Move up. +case up +/// Move down. +case down +/// Move left. +case left +/// Move right. +case right public static var type: GType { - gtk_direction_type_get_type() - } + gtk_direction_type_get_type() +} public init(from gtkEnum: GtkDirectionType) { switch gtkEnum { case GTK_DIR_TAB_FORWARD: - self = .tabForward - case GTK_DIR_TAB_BACKWARD: - self = .tabBackward - case GTK_DIR_UP: - self = .up - case GTK_DIR_DOWN: - self = .down - case GTK_DIR_LEFT: - self = .left - case GTK_DIR_RIGHT: - self = .right + self = .tabForward +case GTK_DIR_TAB_BACKWARD: + self = .tabBackward +case GTK_DIR_UP: + self = .up +case GTK_DIR_DOWN: + self = .down +case GTK_DIR_LEFT: + self = .left +case GTK_DIR_RIGHT: + self = .right default: fatalError("Unsupported GtkDirectionType enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ public enum DirectionType: GValueRepresentableEnum { public func toGtk() -> GtkDirectionType { switch self { case .tabForward: - return GTK_DIR_TAB_FORWARD - case .tabBackward: - return GTK_DIR_TAB_BACKWARD - case .up: - return GTK_DIR_UP - case .down: - return GTK_DIR_DOWN - case .left: - return GTK_DIR_LEFT - case .right: - return GTK_DIR_RIGHT + return GTK_DIR_TAB_FORWARD +case .tabBackward: + return GTK_DIR_TAB_BACKWARD +case .up: + return GTK_DIR_UP +case .down: + return GTK_DIR_DOWN +case .left: + return GTK_DIR_LEFT +case .right: + return GTK_DIR_RIGHT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/DrawingArea.swift b/Sources/Gtk/Generated/DrawingArea.swift index 4fa422c1dc..c24736f50a 100644 --- a/Sources/Gtk/Generated/DrawingArea.swift +++ b/Sources/Gtk/Generated/DrawingArea.swift @@ -1,28 +1,28 @@ import CGtk /// Allows drawing with cairo. -/// +/// /// An example GtkDrawingArea -/// +/// /// It’s essentially a blank widget; you can draw on it. After /// creating a drawing area, the application may want to connect to: -/// +/// /// - The [signal@Gtk.Widget::realize] signal to take any necessary actions /// when the widget is instantiated on a particular display. /// (Create GDK resources in response to this signal.) -/// +/// /// - The [signal@Gtk.DrawingArea::resize] signal to take any necessary /// actions when the widget changes size. -/// +/// /// - Call [method@Gtk.DrawingArea.set_draw_func] to handle redrawing the /// contents of the widget. -/// +/// /// The following code portion demonstrates using a drawing /// area to display a circle in the normal widget foreground /// color. -/// +/// /// ## Simple GtkDrawingArea usage -/// +/// /// ```c /// static void /// draw_function (GtkDrawingArea *area, @@ -32,24 +32,24 @@ import CGtk /// gpointer data) /// { /// GdkRGBA color; -/// +/// /// cairo_arc (cr, /// width / 2.0, height / 2.0, /// MIN (width, height) / 2.0, /// 0, 2 * G_PI); -/// +/// /// gtk_widget_get_color (GTK_WIDGET (area), /// &color); /// gdk_cairo_set_source_rgba (cr, &color); -/// +/// /// cairo_fill (cr); /// } -/// +/// /// int /// main (int argc, char **argv) /// { /// gtk_init (); -/// +/// /// GtkWidget *area = gtk_drawing_area_new (); /// gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (area), 100); /// gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (area), 100); @@ -59,87 +59,83 @@ import CGtk /// return 0; /// } /// ``` -/// +/// /// The draw function is normally called when a drawing area first comes /// onscreen, or when it’s covered by another window and then uncovered. /// You can also force a redraw by adding to the “damage region” of the /// drawing area’s window using [method@Gtk.Widget.queue_draw]. /// This will cause the drawing area to call the draw function again. -/// +/// /// The available routines for drawing are documented in the /// [Cairo documentation](https://www.cairographics.org/manual/); GDK /// offers additional API to integrate with Cairo, like [func@Gdk.cairo_set_source_rgba] /// or [func@Gdk.cairo_set_source_pixbuf]. -/// +/// /// To receive mouse events on a drawing area, you will need to use /// event controllers. To receive keyboard events, you will need to set /// the “can-focus” property on the drawing area, and you should probably /// draw some user-visible indication that the drawing area is focused. -/// +/// /// If you need more complex control over your widget, you should consider /// creating your own `GtkWidget` subclass. open class DrawingArea: Widget { /// Creates a new drawing area. - public convenience init() { - self.init( - gtk_drawing_area_new() - ) - } - - override func didMoveToParent() { - super.didMoveToParent() +public convenience init() { + self.init( + gtk_drawing_area_new() + ) +} - let handler0: - @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } + override func didMoveToParent() { + super.didMoveToParent() - addSignal(name: "resize", handler: gCallback(handler0)) { - [weak self] (param0: Int, param1: Int) in - guard let self = self else { return } - self.resize?(self, param0, param1) - } + let handler0: @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } +addSignal(name: "resize", handler: gCallback(handler0)) { [weak self] (param0: Int, param1: Int) in + guard let self = self else { return } + self.resize?(self, param0, param1) +} - addSignal(name: "notify::content-height", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContentHeight?(self, param0) - } +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } +addSignal(name: "notify::content-height", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContentHeight?(self, param0) +} - addSignal(name: "notify::content-width", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContentWidth?(self, param0) - } +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::content-width", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContentWidth?(self, param0) +} +} + /// The content height. - @GObjectProperty(named: "content-height") public var contentHeight: Int +@GObjectProperty(named: "content-height") public var contentHeight: Int - /// The content width. - @GObjectProperty(named: "content-width") public var contentWidth: Int +/// The content width. +@GObjectProperty(named: "content-width") public var contentWidth: Int - /// Emitted once when the widget is realized, and then each time the widget - /// is changed while realized. - /// - /// This is useful in order to keep state up to date with the widget size, - /// like for instance a backing surface. - public var resize: ((DrawingArea, Int, Int) -> Void)? +/// Emitted once when the widget is realized, and then each time the widget +/// is changed while realized. +/// +/// This is useful in order to keep state up to date with the widget size, +/// like for instance a backing surface. +public var resize: ((DrawingArea, Int, Int) -> Void)? - public var notifyContentHeight: ((DrawingArea, OpaquePointer) -> Void)? - public var notifyContentWidth: ((DrawingArea, OpaquePointer) -> Void)? -} +public var notifyContentHeight: ((DrawingArea, OpaquePointer) -> Void)? + + +public var notifyContentWidth: ((DrawingArea, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/DropDown.swift b/Sources/Gtk/Generated/DropDown.swift index 5ff024cbf5..16265c0ffb 100644 --- a/Sources/Gtk/Generated/DropDown.swift +++ b/Sources/Gtk/Generated/DropDown.swift @@ -1,230 +1,219 @@ import CGtk /// Allows the user to choose an item from a list of options. -/// +/// /// An example GtkDropDown -/// +/// /// The `GtkDropDown` displays the [selected][property@Gtk.DropDown:selected] /// choice. -/// +/// /// The options are given to `GtkDropDown` in the form of `GListModel` /// and how the individual options are represented is determined by /// a [class@Gtk.ListItemFactory]. The default factory displays simple strings, /// and adds a checkmark to the selected item in the popup. -/// +/// /// To set your own factory, use [method@Gtk.DropDown.set_factory]. It is /// possible to use a separate factory for the items in the popup, with /// [method@Gtk.DropDown.set_list_factory]. -/// +/// /// `GtkDropDown` knows how to obtain strings from the items in a /// [class@Gtk.StringList]; for other models, you have to provide an expression /// to find the strings via [method@Gtk.DropDown.set_expression]. -/// +/// /// `GtkDropDown` can optionally allow search in the popup, which is /// useful if the list of options is long. To enable the search entry, /// use [method@Gtk.DropDown.set_enable_search]. -/// +/// /// Here is a UI definition example for `GtkDropDown` with a simple model: -/// +/// /// ```xml /// FactoryHomeSubway /// ``` -/// +/// /// If a `GtkDropDown` is created in this manner, or with /// [ctor@Gtk.DropDown.new_from_strings], for instance, the object returned from /// [method@Gtk.DropDown.get_selected_item] will be a [class@Gtk.StringObject]. -/// +/// /// To learn more about the list widget framework, see the /// [overview](section-list-widget.html). -/// +/// /// ## CSS nodes -/// +/// /// `GtkDropDown` has a single CSS node with name dropdown, /// with the button and popover nodes as children. -/// +/// /// ## Accessibility -/// +/// /// `GtkDropDown` uses the [enum@Gtk.AccessibleRole.combo_box] role. open class DropDown: Widget { /// Creates a new `GtkDropDown` that is populated with - /// the strings. - public convenience init(strings: [String]) { - self.init( - gtk_drop_down_new_from_strings( - strings - .map({ UnsafePointer($0.unsafeUTF8Copy().baseAddress) }) - .unsafeCopy() - .baseAddress!) - ) +/// the strings. +public convenience init(strings: [String]) { + self.init( + gtk_drop_down_new_from_strings(strings + .map({ UnsafePointer($0.unsafeUTF8Copy().baseAddress) }) + .unsafeCopy() + .baseAddress!) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::enable-search", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEnableSearch?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::expression", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExpression?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::factory", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFactory?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::header-factory", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHeaderFactory?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::list-factory", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyListFactory?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::model", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyModel?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::search-match-mode", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySearchMatchMode?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::selected", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelected?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::selected-item", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectedItem?(self, param0) - } - - let handler10: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::show-arrow", handler: gCallback(handler10)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowArrow?(self, param0) - } +addSignal(name: "notify::enable-search", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEnableSearch?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Whether to show a search entry in the popup. - /// - /// Note that search requires [property@Gtk.DropDown:expression] - /// to be set. - @GObjectProperty(named: "enable-search") public var enableSearch: Bool +addSignal(name: "notify::expression", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExpression?(self, param0) +} - /// Model for the displayed items. - @GObjectProperty(named: "model") public var model: OpaquePointer? +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// The position of the selected item. - /// - /// If no item is selected, the property has the value - /// %GTK_INVALID_LIST_POSITION. - @GObjectProperty(named: "selected") public var selected: Int +addSignal(name: "notify::factory", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFactory?(self, param0) +} - /// Emitted to when the drop down is activated. - /// - /// The `::activate` signal on `GtkDropDown` is an action signal and - /// emitting it causes the drop down to pop up its dropdown. - public var activate: ((DropDown) -> Void)? +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyEnableSearch: ((DropDown, OpaquePointer) -> Void)? +addSignal(name: "notify::header-factory", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHeaderFactory?(self, param0) +} - public var notifyExpression: ((DropDown, OpaquePointer) -> Void)? +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyFactory: ((DropDown, OpaquePointer) -> Void)? +addSignal(name: "notify::list-factory", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyListFactory?(self, param0) +} - public var notifyHeaderFactory: ((DropDown, OpaquePointer) -> Void)? +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyListFactory: ((DropDown, OpaquePointer) -> Void)? +addSignal(name: "notify::model", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyModel?(self, param0) +} - public var notifyModel: ((DropDown, OpaquePointer) -> Void)? +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySearchMatchMode: ((DropDown, OpaquePointer) -> Void)? +addSignal(name: "notify::search-match-mode", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySearchMatchMode?(self, param0) +} - public var notifySelected: ((DropDown, OpaquePointer) -> Void)? +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySelectedItem: ((DropDown, OpaquePointer) -> Void)? +addSignal(name: "notify::selected", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelected?(self, param0) +} + +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::selected-item", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectedItem?(self, param0) +} + +let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyShowArrow: ((DropDown, OpaquePointer) -> Void)? +addSignal(name: "notify::show-arrow", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowArrow?(self, param0) } +} + + /// Whether to show a search entry in the popup. +/// +/// Note that search requires [property@Gtk.DropDown:expression] +/// to be set. +@GObjectProperty(named: "enable-search") public var enableSearch: Bool + +/// Model for the displayed items. +@GObjectProperty(named: "model") public var model: OpaquePointer? + +/// The position of the selected item. +/// +/// If no item is selected, the property has the value +/// %GTK_INVALID_LIST_POSITION. +@GObjectProperty(named: "selected") public var selected: Int + +/// Emitted to when the drop down is activated. +/// +/// The `::activate` signal on `GtkDropDown` is an action signal and +/// emitting it causes the drop down to pop up its dropdown. +public var activate: ((DropDown) -> Void)? + + +public var notifyEnableSearch: ((DropDown, OpaquePointer) -> Void)? + + +public var notifyExpression: ((DropDown, OpaquePointer) -> Void)? + + +public var notifyFactory: ((DropDown, OpaquePointer) -> Void)? + + +public var notifyHeaderFactory: ((DropDown, OpaquePointer) -> Void)? + + +public var notifyListFactory: ((DropDown, OpaquePointer) -> Void)? + + +public var notifyModel: ((DropDown, OpaquePointer) -> Void)? + + +public var notifySearchMatchMode: ((DropDown, OpaquePointer) -> Void)? + + +public var notifySelected: ((DropDown, OpaquePointer) -> Void)? + + +public var notifySelectedItem: ((DropDown, OpaquePointer) -> Void)? + + +public var notifyShowArrow: ((DropDown, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Editable.swift b/Sources/Gtk/Generated/Editable.swift index 7f75a1573c..b36043e6ab 100644 --- a/Sources/Gtk/Generated/Editable.swift +++ b/Sources/Gtk/Generated/Editable.swift @@ -1,22 +1,22 @@ import CGtk /// Interface for single-line text editing widgets. -/// +/// /// Typical examples of editable widgets are [class@Gtk.Entry] and /// [class@Gtk.SpinButton]. It contains functions for generically manipulating /// an editable widget, a large number of action signals used for key bindings, /// and several signals that an application can connect to modify the behavior /// of a widget. -/// +/// /// As an example of the latter usage, by connecting the following handler to /// [signal@Gtk.Editable::insert-text], an application can convert all entry /// into a widget into uppercase. -/// +/// /// ## Forcing entry to uppercase. -/// +/// /// ```c /// #include -/// +/// /// void /// insert_text_handler (GtkEditable *editable, /// const char *text, @@ -25,29 +25,29 @@ import CGtk /// gpointer data) /// { /// char *result = g_utf8_strup (text, length); -/// +/// /// g_signal_handlers_block_by_func (editable, /// (gpointer) insert_text_handler, data); /// gtk_editable_insert_text (editable, result, length, position); /// g_signal_handlers_unblock_by_func (editable, /// (gpointer) insert_text_handler, data); -/// +/// /// g_signal_stop_emission_by_name (editable, "insert_text"); -/// +/// /// g_free (result); /// } /// ``` -/// +/// /// ## Implementing GtkEditable -/// +/// /// The most likely scenario for implementing `GtkEditable` on your own widget /// is that you will embed a `GtkText` inside a complex widget, and want to /// delegate the editable functionality to that text widget. `GtkEditable` /// provides some utility functions to make this easy. -/// +/// /// In your class_init function, call [func@Gtk.Editable.install_properties], /// passing the first available property ID: -/// +/// /// ```c /// static void /// my_class_init (MyClass *class) @@ -58,31 +58,31 @@ import CGtk /// ... /// } /// ``` -/// +/// /// In your interface_init function for the `GtkEditable` interface, provide /// an implementation for the get_delegate vfunc that returns your text widget: -/// +/// /// ```c /// GtkEditable * /// get_editable_delegate (GtkEditable *editable) /// { /// return GTK_EDITABLE (MY_WIDGET (editable)->text_widget); /// } -/// +/// /// static void /// my_editable_init (GtkEditableInterface *iface) /// { /// iface->get_delegate = get_editable_delegate; /// } /// ``` -/// +/// /// You don't need to provide any other vfuncs. The default implementations /// work by forwarding to the delegate that the GtkEditableInterface.get_delegate() /// vfunc returns. -/// +/// /// In your instance_init function, create your text widget, and then call /// [method@Gtk.Editable.init_delegate]: -/// +/// /// ```c /// static void /// my_widget_init (MyWidget *self) @@ -93,10 +93,10 @@ import CGtk /// ... /// } /// ``` -/// +/// /// In your dispose function, call [method@Gtk.Editable.finish_delegate] before /// destroying your text widget: -/// +/// /// ```c /// static void /// my_widget_dispose (GObject *object) @@ -107,19 +107,19 @@ import CGtk /// ... /// } /// ``` -/// +/// /// Finally, use [func@Gtk.Editable.delegate_set_property] in your `set_property` /// function (and similar for `get_property`), to set the editable properties: -/// +/// /// ```c /// ... /// if (gtk_editable_delegate_set_property (object, prop_id, value, pspec)) /// return; -/// +/// /// switch (prop_id) /// ... /// ``` -/// +/// /// It is important to note that if you create a `GtkEditable` that uses /// a delegate, the low level [signal@Gtk.Editable::insert-text] and /// [signal@Gtk.Editable::delete-text] signals will be propagated from the @@ -130,54 +130,54 @@ import CGtk /// to them on the delegate obtained via [method@Gtk.Editable.get_delegate]. public protocol Editable: GObjectRepresentable { /// The current position of the insertion cursor in chars. - var cursorPosition: Int { get set } +var cursorPosition: Int { get set } - /// Whether the entry contents can be edited. - var editable: Bool { get set } +/// Whether the entry contents can be edited. +var editable: Bool { get set } - /// If undo/redo should be enabled for the editable. - var enableUndo: Bool { get set } +/// If undo/redo should be enabled for the editable. +var enableUndo: Bool { get set } - /// The desired maximum width of the entry, in characters. - var maxWidthChars: Int { get set } +/// The desired maximum width of the entry, in characters. +var maxWidthChars: Int { get set } - /// The contents of the entry. - var text: String { get set } +/// The contents of the entry. +var text: String { get set } - /// Number of characters to leave space for in the entry. - var widthChars: Int { get set } +/// Number of characters to leave space for in the entry. +var widthChars: Int { get set } - /// The horizontal alignment, from 0 (left) to 1 (right). - /// - /// Reversed for RTL layouts. - var xalign: Float { get set } +/// The horizontal alignment, from 0 (left) to 1 (right). +/// +/// Reversed for RTL layouts. +var xalign: Float { get set } /// Emitted at the end of a single user-visible operation on the - /// contents. - /// - /// E.g., a paste operation that replaces the contents of the - /// selection will cause only one signal emission (even though it - /// is implemented by first deleting the selection, then inserting - /// the new content, and may cause multiple ::notify::text signals - /// to be emitted). - var changed: ((Self) -> Void)? { get set } +/// contents. +/// +/// E.g., a paste operation that replaces the contents of the +/// selection will cause only one signal emission (even though it +/// is implemented by first deleting the selection, then inserting +/// the new content, and may cause multiple ::notify::text signals +/// to be emitted). +var changed: ((Self) -> Void)? { get set } - /// Emitted when text is deleted from the widget by the user. - /// - /// The default handler for this signal will normally be responsible for - /// deleting the text, so by connecting to this signal and then stopping - /// the signal with g_signal_stop_emission(), it is possible to modify the - /// range of deleted text, or prevent it from being deleted entirely. - /// - /// The @start_pos and @end_pos parameters are interpreted as for - /// [method@Gtk.Editable.delete_text]. - var deleteText: ((Self, Int, Int) -> Void)? { get set } +/// Emitted when text is deleted from the widget by the user. +/// +/// The default handler for this signal will normally be responsible for +/// deleting the text, so by connecting to this signal and then stopping +/// the signal with g_signal_stop_emission(), it is possible to modify the +/// range of deleted text, or prevent it from being deleted entirely. +/// +/// The @start_pos and @end_pos parameters are interpreted as for +/// [method@Gtk.Editable.delete_text]. +var deleteText: ((Self, Int, Int) -> Void)? { get set } - /// Emitted when text is inserted into the widget by the user. - /// - /// The default handler for this signal will normally be responsible - /// for inserting the text, so by connecting to this signal and then - /// stopping the signal with g_signal_stop_emission(), it is possible - /// to modify the inserted text, or prevent it from being inserted entirely. - var insertText: ((Self, UnsafePointer, Int, gpointer) -> Void)? { get set } -} +/// Emitted when text is inserted into the widget by the user. +/// +/// The default handler for this signal will normally be responsible +/// for inserting the text, so by connecting to this signal and then +/// stopping the signal with g_signal_stop_emission(), it is possible +/// to modify the inserted text, or prevent it from being inserted entirely. +var insertText: ((Self, UnsafePointer, Int, gpointer) -> Void)? { get set } +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/EditableProperties.swift b/Sources/Gtk/Generated/EditableProperties.swift index 99c51d3239..ac550444ea 100644 --- a/Sources/Gtk/Generated/EditableProperties.swift +++ b/Sources/Gtk/Generated/EditableProperties.swift @@ -1,55 +1,55 @@ import CGtk /// The identifiers for [iface@Gtk.Editable] properties. -/// +/// /// See [func@Gtk.Editable.install_properties] for details on how to /// implement the `GtkEditable` interface. public enum EditableProperties: GValueRepresentableEnum { public typealias GtkEnum = GtkEditableProperties /// The property id for [property@Gtk.Editable:text] - case propText - /// The property id for [property@Gtk.Editable:cursor-position] - case propCursorPosition - /// The property id for [property@Gtk.Editable:selection-bound] - case propSelectionBound - /// The property id for [property@Gtk.Editable:editable] - case propEditable - /// The property id for [property@Gtk.Editable:width-chars] - case propWidthChars - /// The property id for [property@Gtk.Editable:max-width-chars] - case propMaxWidthChars - /// The property id for [property@Gtk.Editable:xalign] - case propXalign - /// The property id for [property@Gtk.Editable:enable-undo] - case propEnableUndo - /// The number of properties - case numProperties +case propText +/// The property id for [property@Gtk.Editable:cursor-position] +case propCursorPosition +/// The property id for [property@Gtk.Editable:selection-bound] +case propSelectionBound +/// The property id for [property@Gtk.Editable:editable] +case propEditable +/// The property id for [property@Gtk.Editable:width-chars] +case propWidthChars +/// The property id for [property@Gtk.Editable:max-width-chars] +case propMaxWidthChars +/// The property id for [property@Gtk.Editable:xalign] +case propXalign +/// The property id for [property@Gtk.Editable:enable-undo] +case propEnableUndo +/// The number of properties +case numProperties public static var type: GType { - gtk_editable_properties_get_type() - } + gtk_editable_properties_get_type() +} public init(from gtkEnum: GtkEditableProperties) { switch gtkEnum { case GTK_EDITABLE_PROP_TEXT: - self = .propText - case GTK_EDITABLE_PROP_CURSOR_POSITION: - self = .propCursorPosition - case GTK_EDITABLE_PROP_SELECTION_BOUND: - self = .propSelectionBound - case GTK_EDITABLE_PROP_EDITABLE: - self = .propEditable - case GTK_EDITABLE_PROP_WIDTH_CHARS: - self = .propWidthChars - case GTK_EDITABLE_PROP_MAX_WIDTH_CHARS: - self = .propMaxWidthChars - case GTK_EDITABLE_PROP_XALIGN: - self = .propXalign - case GTK_EDITABLE_PROP_ENABLE_UNDO: - self = .propEnableUndo - case GTK_EDITABLE_NUM_PROPERTIES: - self = .numProperties + self = .propText +case GTK_EDITABLE_PROP_CURSOR_POSITION: + self = .propCursorPosition +case GTK_EDITABLE_PROP_SELECTION_BOUND: + self = .propSelectionBound +case GTK_EDITABLE_PROP_EDITABLE: + self = .propEditable +case GTK_EDITABLE_PROP_WIDTH_CHARS: + self = .propWidthChars +case GTK_EDITABLE_PROP_MAX_WIDTH_CHARS: + self = .propMaxWidthChars +case GTK_EDITABLE_PROP_XALIGN: + self = .propXalign +case GTK_EDITABLE_PROP_ENABLE_UNDO: + self = .propEnableUndo +case GTK_EDITABLE_NUM_PROPERTIES: + self = .numProperties default: fatalError("Unsupported GtkEditableProperties enum value: \(gtkEnum.rawValue)") } @@ -58,23 +58,23 @@ public enum EditableProperties: GValueRepresentableEnum { public func toGtk() -> GtkEditableProperties { switch self { case .propText: - return GTK_EDITABLE_PROP_TEXT - case .propCursorPosition: - return GTK_EDITABLE_PROP_CURSOR_POSITION - case .propSelectionBound: - return GTK_EDITABLE_PROP_SELECTION_BOUND - case .propEditable: - return GTK_EDITABLE_PROP_EDITABLE - case .propWidthChars: - return GTK_EDITABLE_PROP_WIDTH_CHARS - case .propMaxWidthChars: - return GTK_EDITABLE_PROP_MAX_WIDTH_CHARS - case .propXalign: - return GTK_EDITABLE_PROP_XALIGN - case .propEnableUndo: - return GTK_EDITABLE_PROP_ENABLE_UNDO - case .numProperties: - return GTK_EDITABLE_NUM_PROPERTIES + return GTK_EDITABLE_PROP_TEXT +case .propCursorPosition: + return GTK_EDITABLE_PROP_CURSOR_POSITION +case .propSelectionBound: + return GTK_EDITABLE_PROP_SELECTION_BOUND +case .propEditable: + return GTK_EDITABLE_PROP_EDITABLE +case .propWidthChars: + return GTK_EDITABLE_PROP_WIDTH_CHARS +case .propMaxWidthChars: + return GTK_EDITABLE_PROP_MAX_WIDTH_CHARS +case .propXalign: + return GTK_EDITABLE_PROP_XALIGN +case .propEnableUndo: + return GTK_EDITABLE_PROP_ENABLE_UNDO +case .numProperties: + return GTK_EDITABLE_NUM_PROPERTIES } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Entry.swift b/Sources/Gtk/Generated/Entry.swift index 97cc334be7..8a3d9764b7 100644 --- a/Sources/Gtk/Generated/Entry.swift +++ b/Sources/Gtk/Generated/Entry.swift @@ -1,25 +1,25 @@ import CGtk /// A single-line text entry widget. -/// +/// /// An example GtkEntry -/// +/// /// A fairly large set of key bindings are supported by default. If the /// entered text is longer than the allocation of the widget, the widget /// will scroll so that the cursor position is visible. -/// +/// /// When using an entry for passwords and other sensitive information, it /// can be put into “password mode” using [method@Gtk.Entry.set_visibility]. /// In this mode, entered text is displayed using a “invisible” character. /// By default, GTK picks the best invisible character that is available /// in the current font, but it can be changed with /// [method@Gtk.Entry.set_invisible_char]. -/// +/// /// `GtkEntry` has the ability to display progress or activity /// information behind the text. To make an entry display such information, /// use [method@Gtk.Entry.set_progress_fraction] or /// [method@Gtk.Entry.set_progress_pulse_step]. -/// +/// /// Additionally, `GtkEntry` can show icons at either side of the entry. /// These icons can be activatable by clicking, can be set up as drag source /// and can have tooltips. To add an icon, use @@ -30,15 +30,15 @@ import CGtk /// [method@Gtk.Entry.set_icon_drag_source]. To set a tooltip on an icon, use /// [method@Gtk.Entry.set_icon_tooltip_text] or the corresponding function /// for markup. -/// +/// /// Note that functionality or information that is only available by clicking /// on an icon in an entry may not be accessible at all to users which are not /// able to use a mouse or other pointing device. It is therefore recommended /// that any such functionality should also be available by other means, e.g. /// via the context menu of the entry. -/// +/// /// # CSS nodes -/// +/// /// ``` /// entry[.flat][.warning][.error] /// ├── text[.readonly] @@ -46,940 +46,904 @@ import CGtk /// ├── image.right /// ╰── [progress[.pulse]] /// ``` -/// +/// /// `GtkEntry` has a main node with the name entry. Depending on the properties /// of the entry, the style classes .read-only and .flat may appear. The style /// classes .warning and .error may also be used with entries. -/// +/// /// When the entry shows icons, it adds subnodes with the name image and the /// style class .left or .right, depending on where the icon appears. -/// +/// /// When the entry shows progress, it adds a subnode with the name progress. /// The node has the style class .pulse when the shown progress is pulsing. -/// +/// /// For all the subnodes added to the text node in various situations, /// see [class@Gtk.Text]. -/// +/// /// # GtkEntry as GtkBuildable -/// +/// /// The `GtkEntry` implementation of the `GtkBuildable` interface supports a /// custom `` element, which supports any number of `` /// elements. The `` element has attributes named “name“, “value“, /// “start“ and “end“ and allows you to specify `PangoAttribute` values for /// this label. -/// +/// /// An example of a UI definition fragment specifying Pango attributes: /// ```xml /// /// ``` -/// +/// /// The start and end attributes specify the range of characters to which the /// Pango attribute applies. If start and end are not specified, the attribute /// is applied to the whole text. Note that specifying ranges does not make much /// sense with translatable attributes. Use markup embedded in the translatable /// content instead. -/// +/// /// # Accessibility -/// +/// /// `GtkEntry` uses the [enum@Gtk.AccessibleRole.text_box] role. open class Entry: Widget, CellEditable, Editable { /// Creates a new entry. - public convenience init() { - self.init( - gtk_entry_new() - ) - } - - /// Creates a new entry with the specified text buffer. - public convenience init(buffer: UnsafeMutablePointer!) { - self.init( - gtk_entry_new_with_buffer(buffer) - ) - } - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, UnsafeMutableRawPointer) - -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "icon-press", handler: gCallback(handler1)) { - [weak self] (param0: GtkEntryIconPosition) in - guard let self = self else { return } - self.iconPress?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, UnsafeMutableRawPointer) - -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "icon-release", handler: gCallback(handler2)) { - [weak self] (param0: GtkEntryIconPosition) in - guard let self = self else { return } - self.iconRelease?(self, param0) - } - - addSignal(name: "editing-done") { [weak self] () in - guard let self = self else { return } - self.editingDone?(self) - } - - addSignal(name: "remove-widget") { [weak self] () in - guard let self = self else { return } - self.removeWidget?(self) - } - - addSignal(name: "changed") { [weak self] () in - guard let self = self else { return } - self.changed?(self) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "delete-text", handler: gCallback(handler6)) { - [weak self] (param0: Int, param1: Int) in - guard let self = self else { return } - self.deleteText?(self, param0, param1) - } - - let handler7: - @convention(c) ( - UnsafeMutableRawPointer, UnsafePointer, Int, gpointer, - UnsafeMutableRawPointer - ) -> Void = - { _, value1, value2, value3, data in - SignalBox3, Int, gpointer>.run( - data, value1, value2, value3) - } - - addSignal(name: "insert-text", handler: gCallback(handler7)) { - [weak self] (param0: UnsafePointer, param1: Int, param2: gpointer) in - guard let self = self else { return } - self.insertText?(self, param0, param1, param2) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::activates-default", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActivatesDefault?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::attributes", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAttributes?(self, param0) - } - - let handler10: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::buffer", handler: gCallback(handler10)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyBuffer?(self, param0) - } - - let handler11: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::completion", handler: gCallback(handler11)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCompletion?(self, param0) - } - - let handler12: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::enable-emoji-completion", handler: gCallback(handler12)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEnableEmojiCompletion?(self, param0) - } - - let handler13: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::extra-menu", handler: gCallback(handler13)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExtraMenu?(self, param0) - } - - let handler14: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::has-frame", handler: gCallback(handler14)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasFrame?(self, param0) - } - - let handler15: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::im-module", handler: gCallback(handler15)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyImModule?(self, param0) - } - - let handler16: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::input-hints", handler: gCallback(handler16)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInputHints?(self, param0) - } - - let handler17: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::input-purpose", handler: gCallback(handler17)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInputPurpose?(self, param0) - } - - let handler18: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::invisible-char", handler: gCallback(handler18)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInvisibleCharacter?(self, param0) - } - - let handler19: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::invisible-char-set", handler: gCallback(handler19)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInvisibleCharacterSet?(self, param0) - } - - let handler20: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::max-length", handler: gCallback(handler20)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMaxLength?(self, param0) - } - - let handler21: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::overwrite-mode", handler: gCallback(handler21)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyOverwriteMode?(self, param0) - } - - let handler22: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::placeholder-text", handler: gCallback(handler22)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPlaceholderText?(self, param0) - } - - let handler23: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-activatable", handler: gCallback(handler23)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconActivatable?(self, param0) - } - - let handler24: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-gicon", handler: gCallback(handler24)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconGicon?(self, param0) - } - - let handler25: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-name", handler: gCallback(handler25)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconName?(self, param0) - } - - let handler26: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-paintable", handler: gCallback(handler26)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconPaintable?(self, param0) - } - - let handler27: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-sensitive", handler: gCallback(handler27)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconSensitive?(self, param0) - } - - let handler28: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-storage-type", handler: gCallback(handler28)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconStorageType?(self, param0) - } - - let handler29: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-tooltip-markup", handler: gCallback(handler29)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconTooltipMarkup?(self, param0) - } - - let handler30: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-tooltip-text", handler: gCallback(handler30)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconTooltipText?(self, param0) - } - - let handler31: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::progress-fraction", handler: gCallback(handler31)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyProgressFraction?(self, param0) - } - - let handler32: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::progress-pulse-step", handler: gCallback(handler32)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyProgressPulseStep?(self, param0) - } - - let handler33: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::scroll-offset", handler: gCallback(handler33)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyScrollOffset?(self, param0) - } - - let handler34: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-activatable", handler: gCallback(handler34)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconActivatable?(self, param0) - } - - let handler35: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-gicon", handler: gCallback(handler35)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconGicon?(self, param0) - } - - let handler36: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-name", handler: gCallback(handler36)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconName?(self, param0) - } - - let handler37: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-paintable", handler: gCallback(handler37)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconPaintable?(self, param0) - } - - let handler38: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-sensitive", handler: gCallback(handler38)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconSensitive?(self, param0) - } - - let handler39: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-storage-type", handler: gCallback(handler39)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconStorageType?(self, param0) - } - - let handler40: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-tooltip-markup", handler: gCallback(handler40)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconTooltipMarkup?(self, param0) - } - - let handler41: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-tooltip-text", handler: gCallback(handler41)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconTooltipText?(self, param0) - } - - let handler42: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::show-emoji-icon", handler: gCallback(handler42)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowEmojiIcon?(self, param0) - } - - let handler43: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::tabs", handler: gCallback(handler43)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTabs?(self, param0) - } - - let handler44: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::text-length", handler: gCallback(handler44)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTextLength?(self, param0) - } - - let handler45: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::truncate-multiline", handler: gCallback(handler45)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTruncateMultiline?(self, param0) - } - - let handler46: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::visibility", handler: gCallback(handler46)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyVisibility?(self, param0) - } - - let handler47: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::editing-canceled", handler: gCallback(handler47)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEditingCanceled?(self, param0) - } - - let handler48: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::cursor-position", handler: gCallback(handler48)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCursorPosition?(self, param0) - } - - let handler49: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::editable", handler: gCallback(handler49)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEditable?(self, param0) - } - - let handler50: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::enable-undo", handler: gCallback(handler50)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEnableUndo?(self, param0) - } - - let handler51: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::max-width-chars", handler: gCallback(handler51)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMaxWidthChars?(self, param0) - } - - let handler52: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::selection-bound", handler: gCallback(handler52)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectionBound?(self, param0) - } - - let handler53: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::text", handler: gCallback(handler53)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyText?(self, param0) - } - - let handler54: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::width-chars", handler: gCallback(handler54)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWidthChars?(self, param0) - } - - let handler55: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::xalign", handler: gCallback(handler55)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyXalign?(self, param0) - } +public convenience init() { + self.init( + gtk_entry_new() + ) +} + +/// Creates a new entry with the specified text buffer. +public convenience init(buffer: UnsafeMutablePointer!) { + self.init( + gtk_entry_new_with_buffer(buffer) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Whether to activate the default widget when Enter is pressed. - @GObjectProperty(named: "activates-default") public var activatesDefault: Bool - - /// Whether the entry should draw a frame. - @GObjectProperty(named: "has-frame") public var hasFrame: Bool - - /// The purpose of this text field. - /// - /// This property can be used by on-screen keyboards and other input - /// methods to adjust their behaviour. - /// - /// Note that setting the purpose to %GTK_INPUT_PURPOSE_PASSWORD or - /// %GTK_INPUT_PURPOSE_PIN is independent from setting - /// [property@Gtk.Entry:visibility]. - @GObjectProperty(named: "input-purpose") public var inputPurpose: InputPurpose - - /// The character to use when masking entry contents (“password mode”). - @GObjectProperty(named: "invisible-char") public var invisibleCharacter: UInt - - /// Maximum number of characters for this entry. - @GObjectProperty(named: "max-length") public var maxLength: Int - - /// If text is overwritten when typing in the `GtkEntry`. - @GObjectProperty(named: "overwrite-mode") public var overwriteMode: Bool - - /// The text that will be displayed in the `GtkEntry` when it is empty - /// and unfocused. - @GObjectProperty(named: "placeholder-text") public var placeholderText: String? - - /// The current fraction of the task that's been completed. - @GObjectProperty(named: "progress-fraction") public var progressFraction: Double - - /// The fraction of total entry width to move the progress - /// bouncing block for each pulse. - /// - /// See [method@Gtk.Entry.progress_pulse]. - @GObjectProperty(named: "progress-pulse-step") public var progressPulseStep: Double - - /// The length of the text in the `GtkEntry`. - @GObjectProperty(named: "text-length") public var textLength: UInt - - /// Whether the entry should show the “invisible char” instead of the - /// actual text (“password mode”). - @GObjectProperty(named: "visibility") public var visibility: Bool - - /// The current position of the insertion cursor in chars. - @GObjectProperty(named: "cursor-position") public var cursorPosition: Int - - /// Whether the entry contents can be edited. - @GObjectProperty(named: "editable") public var editable: Bool - - /// If undo/redo should be enabled for the editable. - @GObjectProperty(named: "enable-undo") public var enableUndo: Bool - - /// The desired maximum width of the entry, in characters. - @GObjectProperty(named: "max-width-chars") public var maxWidthChars: Int - - /// The contents of the entry. - @GObjectProperty(named: "text") public var text: String - - /// Number of characters to leave space for in the entry. - @GObjectProperty(named: "width-chars") public var widthChars: Int - - /// The horizontal alignment, from 0 (left) to 1 (right). - /// - /// Reversed for RTL layouts. - @GObjectProperty(named: "xalign") public var xalign: Float +addSignal(name: "icon-press", handler: gCallback(handler1)) { [weak self] (param0: GtkEntryIconPosition) in + guard let self = self else { return } + self.iconPress?(self, param0) +} - /// Emitted when the entry is activated. - /// - /// The keybindings for this signal are all forms of the Enter key. - public var activate: ((Entry) -> Void)? +let handler2: @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Emitted when an activatable icon is clicked. - public var iconPress: ((Entry, GtkEntryIconPosition) -> Void)? +addSignal(name: "icon-release", handler: gCallback(handler2)) { [weak self] (param0: GtkEntryIconPosition) in + guard let self = self else { return } + self.iconRelease?(self, param0) +} - /// Emitted on the button release from a mouse click - /// over an activatable icon. - public var iconRelease: ((Entry, GtkEntryIconPosition) -> Void)? +addSignal(name: "editing-done") { [weak self] () in + guard let self = self else { return } + self.editingDone?(self) +} + +addSignal(name: "remove-widget") { [weak self] () in + guard let self = self else { return } + self.removeWidget?(self) +} + +addSignal(name: "changed") { [weak self] () in + guard let self = self else { return } + self.changed?(self) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } - /// This signal is a sign for the cell renderer to update its - /// value from the @cell_editable. - /// - /// Implementations of `GtkCellEditable` are responsible for - /// emitting this signal when they are done editing, e.g. - /// `GtkEntry` emits this signal when the user presses Enter. Typical things to - /// do in a handler for ::editing-done are to capture the edited value, - /// disconnect the @cell_editable from signals on the `GtkCellRenderer`, etc. - /// - /// gtk_cell_editable_editing_done() is a convenience method - /// for emitting `GtkCellEditable::editing-done`. - public var editingDone: ((Entry) -> Void)? +addSignal(name: "delete-text", handler: gCallback(handler6)) { [weak self] (param0: Int, param1: Int) in + guard let self = self else { return } + self.deleteText?(self, param0, param1) +} - /// This signal is meant to indicate that the cell is finished - /// editing, and the @cell_editable widget is being removed and may - /// subsequently be destroyed. - /// - /// Implementations of `GtkCellEditable` are responsible for - /// emitting this signal when they are done editing. It must - /// be emitted after the `GtkCellEditable::editing-done` signal, - /// to give the cell renderer a chance to update the cell's value - /// before the widget is removed. - /// - /// gtk_cell_editable_remove_widget() is a convenience method - /// for emitting `GtkCellEditable::remove-widget`. - public var removeWidget: ((Entry) -> Void)? +let handler7: @convention(c) (UnsafeMutableRawPointer, UnsafePointer, Int, gpointer, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, value3, data in + SignalBox3, Int, gpointer>.run(data, value1, value2, value3) + } - /// Emitted at the end of a single user-visible operation on the - /// contents. - /// - /// E.g., a paste operation that replaces the contents of the - /// selection will cause only one signal emission (even though it - /// is implemented by first deleting the selection, then inserting - /// the new content, and may cause multiple ::notify::text signals - /// to be emitted). - public var changed: ((Entry) -> Void)? +addSignal(name: "insert-text", handler: gCallback(handler7)) { [weak self] (param0: UnsafePointer, param1: Int, param2: gpointer) in + guard let self = self else { return } + self.insertText?(self, param0, param1, param2) +} - /// Emitted when text is deleted from the widget by the user. - /// - /// The default handler for this signal will normally be responsible for - /// deleting the text, so by connecting to this signal and then stopping - /// the signal with g_signal_stop_emission(), it is possible to modify the - /// range of deleted text, or prevent it from being deleted entirely. - /// - /// The @start_pos and @end_pos parameters are interpreted as for - /// [method@Gtk.Editable.delete_text]. - public var deleteText: ((Entry, Int, Int) -> Void)? +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Emitted when text is inserted into the widget by the user. - /// - /// The default handler for this signal will normally be responsible - /// for inserting the text, so by connecting to this signal and then - /// stopping the signal with g_signal_stop_emission(), it is possible - /// to modify the inserted text, or prevent it from being inserted entirely. - public var insertText: ((Entry, UnsafePointer, Int, gpointer) -> Void)? +addSignal(name: "notify::activates-default", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActivatesDefault?(self, param0) +} - public var notifyActivatesDefault: ((Entry, OpaquePointer) -> Void)? +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyAttributes: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::attributes", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAttributes?(self, param0) +} - public var notifyBuffer: ((Entry, OpaquePointer) -> Void)? +let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyCompletion: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::buffer", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyBuffer?(self, param0) +} - public var notifyEnableEmojiCompletion: ((Entry, OpaquePointer) -> Void)? +let handler11: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyExtraMenu: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::completion", handler: gCallback(handler11)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCompletion?(self, param0) +} - public var notifyHasFrame: ((Entry, OpaquePointer) -> Void)? +let handler12: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyImModule: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::enable-emoji-completion", handler: gCallback(handler12)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEnableEmojiCompletion?(self, param0) +} - public var notifyInputHints: ((Entry, OpaquePointer) -> Void)? +let handler13: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyInputPurpose: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::extra-menu", handler: gCallback(handler13)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExtraMenu?(self, param0) +} - public var notifyInvisibleCharacter: ((Entry, OpaquePointer) -> Void)? +let handler14: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyInvisibleCharacterSet: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::has-frame", handler: gCallback(handler14)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasFrame?(self, param0) +} - public var notifyMaxLength: ((Entry, OpaquePointer) -> Void)? +let handler15: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyOverwriteMode: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::im-module", handler: gCallback(handler15)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyImModule?(self, param0) +} - public var notifyPlaceholderText: ((Entry, OpaquePointer) -> Void)? +let handler16: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyPrimaryIconActivatable: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::input-hints", handler: gCallback(handler16)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInputHints?(self, param0) +} - public var notifyPrimaryIconGicon: ((Entry, OpaquePointer) -> Void)? +let handler17: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyPrimaryIconName: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::input-purpose", handler: gCallback(handler17)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInputPurpose?(self, param0) +} - public var notifyPrimaryIconPaintable: ((Entry, OpaquePointer) -> Void)? +let handler18: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyPrimaryIconSensitive: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::invisible-char", handler: gCallback(handler18)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInvisibleCharacter?(self, param0) +} - public var notifyPrimaryIconStorageType: ((Entry, OpaquePointer) -> Void)? +let handler19: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyPrimaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::invisible-char-set", handler: gCallback(handler19)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInvisibleCharacterSet?(self, param0) +} - public var notifyPrimaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? +let handler20: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyProgressFraction: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::max-length", handler: gCallback(handler20)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMaxLength?(self, param0) +} - public var notifyProgressPulseStep: ((Entry, OpaquePointer) -> Void)? +let handler21: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyScrollOffset: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::menu-entry-icon-primary-text", handler: gCallback(handler21)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMenuEntryIconPrimaryText?(self, param0) +} - public var notifySecondaryIconActivatable: ((Entry, OpaquePointer) -> Void)? +let handler22: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySecondaryIconGicon: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::menu-entry-icon-secondary-text", handler: gCallback(handler22)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMenuEntryIconSecondaryText?(self, param0) +} - public var notifySecondaryIconName: ((Entry, OpaquePointer) -> Void)? +let handler23: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySecondaryIconPaintable: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::overwrite-mode", handler: gCallback(handler23)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyOverwriteMode?(self, param0) +} - public var notifySecondaryIconSensitive: ((Entry, OpaquePointer) -> Void)? +let handler24: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySecondaryIconStorageType: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::placeholder-text", handler: gCallback(handler24)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPlaceholderText?(self, param0) +} - public var notifySecondaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? +let handler25: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySecondaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-activatable", handler: gCallback(handler25)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconActivatable?(self, param0) +} - public var notifyShowEmojiIcon: ((Entry, OpaquePointer) -> Void)? +let handler26: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyTabs: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-gicon", handler: gCallback(handler26)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconGicon?(self, param0) +} - public var notifyTextLength: ((Entry, OpaquePointer) -> Void)? +let handler27: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyTruncateMultiline: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-name", handler: gCallback(handler27)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconName?(self, param0) +} - public var notifyVisibility: ((Entry, OpaquePointer) -> Void)? +let handler28: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyEditingCanceled: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-paintable", handler: gCallback(handler28)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconPaintable?(self, param0) +} - public var notifyCursorPosition: ((Entry, OpaquePointer) -> Void)? +let handler29: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyEditable: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-sensitive", handler: gCallback(handler29)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconSensitive?(self, param0) +} - public var notifyEnableUndo: ((Entry, OpaquePointer) -> Void)? +let handler30: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyMaxWidthChars: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-storage-type", handler: gCallback(handler30)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconStorageType?(self, param0) +} - public var notifySelectionBound: ((Entry, OpaquePointer) -> Void)? +let handler31: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyText: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-tooltip-markup", handler: gCallback(handler31)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconTooltipMarkup?(self, param0) +} - public var notifyWidthChars: ((Entry, OpaquePointer) -> Void)? +let handler32: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyXalign: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-tooltip-text", handler: gCallback(handler32)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconTooltipText?(self, param0) } + +let handler33: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::progress-fraction", handler: gCallback(handler33)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyProgressFraction?(self, param0) +} + +let handler34: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::progress-pulse-step", handler: gCallback(handler34)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyProgressPulseStep?(self, param0) +} + +let handler35: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::scroll-offset", handler: gCallback(handler35)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyScrollOffset?(self, param0) +} + +let handler36: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::secondary-icon-activatable", handler: gCallback(handler36)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconActivatable?(self, param0) +} + +let handler37: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::secondary-icon-gicon", handler: gCallback(handler37)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconGicon?(self, param0) +} + +let handler38: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::secondary-icon-name", handler: gCallback(handler38)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconName?(self, param0) +} + +let handler39: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::secondary-icon-paintable", handler: gCallback(handler39)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconPaintable?(self, param0) +} + +let handler40: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::secondary-icon-sensitive", handler: gCallback(handler40)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconSensitive?(self, param0) +} + +let handler41: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::secondary-icon-storage-type", handler: gCallback(handler41)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconStorageType?(self, param0) +} + +let handler42: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::secondary-icon-tooltip-markup", handler: gCallback(handler42)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconTooltipMarkup?(self, param0) +} + +let handler43: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::secondary-icon-tooltip-text", handler: gCallback(handler43)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconTooltipText?(self, param0) +} + +let handler44: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::show-emoji-icon", handler: gCallback(handler44)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowEmojiIcon?(self, param0) +} + +let handler45: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::tabs", handler: gCallback(handler45)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTabs?(self, param0) +} + +let handler46: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::text-length", handler: gCallback(handler46)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTextLength?(self, param0) +} + +let handler47: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::truncate-multiline", handler: gCallback(handler47)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTruncateMultiline?(self, param0) +} + +let handler48: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::visibility", handler: gCallback(handler48)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyVisibility?(self, param0) +} + +let handler49: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::editing-canceled", handler: gCallback(handler49)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEditingCanceled?(self, param0) +} + +let handler50: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::cursor-position", handler: gCallback(handler50)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCursorPosition?(self, param0) +} + +let handler51: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::editable", handler: gCallback(handler51)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEditable?(self, param0) +} + +let handler52: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::enable-undo", handler: gCallback(handler52)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEnableUndo?(self, param0) +} + +let handler53: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::max-width-chars", handler: gCallback(handler53)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMaxWidthChars?(self, param0) +} + +let handler54: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::selection-bound", handler: gCallback(handler54)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectionBound?(self, param0) +} + +let handler55: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::text", handler: gCallback(handler55)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyText?(self, param0) +} + +let handler56: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::width-chars", handler: gCallback(handler56)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWidthChars?(self, param0) +} + +let handler57: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::xalign", handler: gCallback(handler57)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyXalign?(self, param0) +} +} + + /// Whether to activate the default widget when Enter is pressed. +@GObjectProperty(named: "activates-default") public var activatesDefault: Bool + +/// Whether the entry should draw a frame. +@GObjectProperty(named: "has-frame") public var hasFrame: Bool + +/// The purpose of this text field. +/// +/// This property can be used by on-screen keyboards and other input +/// methods to adjust their behaviour. +/// +/// Note that setting the purpose to %GTK_INPUT_PURPOSE_PASSWORD or +/// %GTK_INPUT_PURPOSE_PIN is independent from setting +/// [property@Gtk.Entry:visibility]. +@GObjectProperty(named: "input-purpose") public var inputPurpose: InputPurpose + +/// The character to use when masking entry contents (“password mode”). +@GObjectProperty(named: "invisible-char") public var invisibleCharacter: UInt + +/// Maximum number of characters for this entry. +@GObjectProperty(named: "max-length") public var maxLength: Int + +/// If text is overwritten when typing in the `GtkEntry`. +@GObjectProperty(named: "overwrite-mode") public var overwriteMode: Bool + +/// The text that will be displayed in the `GtkEntry` when it is empty +/// and unfocused. +@GObjectProperty(named: "placeholder-text") public var placeholderText: String? + +/// The current fraction of the task that's been completed. +@GObjectProperty(named: "progress-fraction") public var progressFraction: Double + +/// The fraction of total entry width to move the progress +/// bouncing block for each pulse. +/// +/// See [method@Gtk.Entry.progress_pulse]. +@GObjectProperty(named: "progress-pulse-step") public var progressPulseStep: Double + +/// The length of the text in the `GtkEntry`. +@GObjectProperty(named: "text-length") public var textLength: UInt + +/// Whether the entry should show the “invisible char” instead of the +/// actual text (“password mode”). +@GObjectProperty(named: "visibility") public var visibility: Bool + +/// The current position of the insertion cursor in chars. +@GObjectProperty(named: "cursor-position") public var cursorPosition: Int + +/// Whether the entry contents can be edited. +@GObjectProperty(named: "editable") public var editable: Bool + +/// If undo/redo should be enabled for the editable. +@GObjectProperty(named: "enable-undo") public var enableUndo: Bool + +/// The desired maximum width of the entry, in characters. +@GObjectProperty(named: "max-width-chars") public var maxWidthChars: Int + +/// The contents of the entry. +@GObjectProperty(named: "text") public var text: String + +/// Number of characters to leave space for in the entry. +@GObjectProperty(named: "width-chars") public var widthChars: Int + +/// The horizontal alignment, from 0 (left) to 1 (right). +/// +/// Reversed for RTL layouts. +@GObjectProperty(named: "xalign") public var xalign: Float + +/// Emitted when the entry is activated. +/// +/// The keybindings for this signal are all forms of the Enter key. +public var activate: ((Entry) -> Void)? + +/// Emitted when an activatable icon is clicked. +public var iconPress: ((Entry, GtkEntryIconPosition) -> Void)? + +/// Emitted on the button release from a mouse click +/// over an activatable icon. +public var iconRelease: ((Entry, GtkEntryIconPosition) -> Void)? + +/// This signal is a sign for the cell renderer to update its +/// value from the @cell_editable. +/// +/// Implementations of `GtkCellEditable` are responsible for +/// emitting this signal when they are done editing, e.g. +/// `GtkEntry` emits this signal when the user presses Enter. Typical things to +/// do in a handler for ::editing-done are to capture the edited value, +/// disconnect the @cell_editable from signals on the `GtkCellRenderer`, etc. +/// +/// gtk_cell_editable_editing_done() is a convenience method +/// for emitting `GtkCellEditable::editing-done`. +public var editingDone: ((Entry) -> Void)? + +/// This signal is meant to indicate that the cell is finished +/// editing, and the @cell_editable widget is being removed and may +/// subsequently be destroyed. +/// +/// Implementations of `GtkCellEditable` are responsible for +/// emitting this signal when they are done editing. It must +/// be emitted after the `GtkCellEditable::editing-done` signal, +/// to give the cell renderer a chance to update the cell's value +/// before the widget is removed. +/// +/// gtk_cell_editable_remove_widget() is a convenience method +/// for emitting `GtkCellEditable::remove-widget`. +public var removeWidget: ((Entry) -> Void)? + +/// Emitted at the end of a single user-visible operation on the +/// contents. +/// +/// E.g., a paste operation that replaces the contents of the +/// selection will cause only one signal emission (even though it +/// is implemented by first deleting the selection, then inserting +/// the new content, and may cause multiple ::notify::text signals +/// to be emitted). +public var changed: ((Entry) -> Void)? + +/// Emitted when text is deleted from the widget by the user. +/// +/// The default handler for this signal will normally be responsible for +/// deleting the text, so by connecting to this signal and then stopping +/// the signal with g_signal_stop_emission(), it is possible to modify the +/// range of deleted text, or prevent it from being deleted entirely. +/// +/// The @start_pos and @end_pos parameters are interpreted as for +/// [method@Gtk.Editable.delete_text]. +public var deleteText: ((Entry, Int, Int) -> Void)? + +/// Emitted when text is inserted into the widget by the user. +/// +/// The default handler for this signal will normally be responsible +/// for inserting the text, so by connecting to this signal and then +/// stopping the signal with g_signal_stop_emission(), it is possible +/// to modify the inserted text, or prevent it from being inserted entirely. +public var insertText: ((Entry, UnsafePointer, Int, gpointer) -> Void)? + + +public var notifyActivatesDefault: ((Entry, OpaquePointer) -> Void)? + + +public var notifyAttributes: ((Entry, OpaquePointer) -> Void)? + + +public var notifyBuffer: ((Entry, OpaquePointer) -> Void)? + + +public var notifyCompletion: ((Entry, OpaquePointer) -> Void)? + + +public var notifyEnableEmojiCompletion: ((Entry, OpaquePointer) -> Void)? + + +public var notifyExtraMenu: ((Entry, OpaquePointer) -> Void)? + + +public var notifyHasFrame: ((Entry, OpaquePointer) -> Void)? + + +public var notifyImModule: ((Entry, OpaquePointer) -> Void)? + + +public var notifyInputHints: ((Entry, OpaquePointer) -> Void)? + + +public var notifyInputPurpose: ((Entry, OpaquePointer) -> Void)? + + +public var notifyInvisibleCharacter: ((Entry, OpaquePointer) -> Void)? + + +public var notifyInvisibleCharacterSet: ((Entry, OpaquePointer) -> Void)? + + +public var notifyMaxLength: ((Entry, OpaquePointer) -> Void)? + + +public var notifyMenuEntryIconPrimaryText: ((Entry, OpaquePointer) -> Void)? + + +public var notifyMenuEntryIconSecondaryText: ((Entry, OpaquePointer) -> Void)? + + +public var notifyOverwriteMode: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPlaceholderText: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconActivatable: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconGicon: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconName: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconPaintable: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconSensitive: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconStorageType: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? + + +public var notifyProgressFraction: ((Entry, OpaquePointer) -> Void)? + + +public var notifyProgressPulseStep: ((Entry, OpaquePointer) -> Void)? + + +public var notifyScrollOffset: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconActivatable: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconGicon: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconName: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconPaintable: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconSensitive: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconStorageType: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? + + +public var notifyShowEmojiIcon: ((Entry, OpaquePointer) -> Void)? + + +public var notifyTabs: ((Entry, OpaquePointer) -> Void)? + + +public var notifyTextLength: ((Entry, OpaquePointer) -> Void)? + + +public var notifyTruncateMultiline: ((Entry, OpaquePointer) -> Void)? + + +public var notifyVisibility: ((Entry, OpaquePointer) -> Void)? + + +public var notifyEditingCanceled: ((Entry, OpaquePointer) -> Void)? + + +public var notifyCursorPosition: ((Entry, OpaquePointer) -> Void)? + + +public var notifyEditable: ((Entry, OpaquePointer) -> Void)? + + +public var notifyEnableUndo: ((Entry, OpaquePointer) -> Void)? + + +public var notifyMaxWidthChars: ((Entry, OpaquePointer) -> Void)? + + +public var notifySelectionBound: ((Entry, OpaquePointer) -> Void)? + + +public var notifyText: ((Entry, OpaquePointer) -> Void)? + + +public var notifyWidthChars: ((Entry, OpaquePointer) -> Void)? + + +public var notifyXalign: ((Entry, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/EntryIconPosition.swift b/Sources/Gtk/Generated/EntryIconPosition.swift index 6ef056f05c..9528a4e836 100644 --- a/Sources/Gtk/Generated/EntryIconPosition.swift +++ b/Sources/Gtk/Generated/EntryIconPosition.swift @@ -5,20 +5,20 @@ public enum EntryIconPosition: GValueRepresentableEnum { public typealias GtkEnum = GtkEntryIconPosition /// At the beginning of the entry (depending on the text direction). - case primary - /// At the end of the entry (depending on the text direction). - case secondary +case primary +/// At the end of the entry (depending on the text direction). +case secondary public static var type: GType { - gtk_entry_icon_position_get_type() - } + gtk_entry_icon_position_get_type() +} public init(from gtkEnum: GtkEntryIconPosition) { switch gtkEnum { case GTK_ENTRY_ICON_PRIMARY: - self = .primary - case GTK_ENTRY_ICON_SECONDARY: - self = .secondary + self = .primary +case GTK_ENTRY_ICON_SECONDARY: + self = .secondary default: fatalError("Unsupported GtkEntryIconPosition enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ public enum EntryIconPosition: GValueRepresentableEnum { public func toGtk() -> GtkEntryIconPosition { switch self { case .primary: - return GTK_ENTRY_ICON_PRIMARY - case .secondary: - return GTK_ENTRY_ICON_SECONDARY + return GTK_ENTRY_ICON_PRIMARY +case .secondary: + return GTK_ENTRY_ICON_SECONDARY } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/EventController.swift b/Sources/Gtk/Generated/EventController.swift index c29ce1254a..6842e79b31 100644 --- a/Sources/Gtk/Generated/EventController.swift +++ b/Sources/Gtk/Generated/EventController.swift @@ -1,85 +1,82 @@ import CGtk /// The base class for event controllers. -/// +/// /// These are ancillary objects associated to widgets, which react /// to `GdkEvents`, and possibly trigger actions as a consequence. -/// +/// /// Event controllers are added to a widget with /// [method@Gtk.Widget.add_controller]. It is rarely necessary to /// explicitly remove a controller with [method@Gtk.Widget.remove_controller]. -/// +/// /// See the chapter on [input handling](input-handling.html) for /// an overview of the basic concepts, such as the capture and bubble /// phases of event propagation. open class EventController: GObject { + public override func registerSignals() { - super.registerSignals() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::name", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyName?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::propagation-limit", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPropagationLimit?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::propagation-phase", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPropagationPhase?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::widget", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWidget?(self, param0) - } + super.registerSignals() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// The name for this controller, typically used for debugging purposes. - @GObjectProperty(named: "name") public var name: String? +addSignal(name: "notify::name", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyName?(self, param0) +} - /// The limit for which events this controller will handle. - @GObjectProperty(named: "propagation-limit") public var propagationLimit: PropagationLimit +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// The propagation phase at which this controller will handle events. - @GObjectProperty(named: "propagation-phase") public var propagationPhase: PropagationPhase +addSignal(name: "notify::propagation-limit", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPropagationLimit?(self, param0) +} - public var notifyName: ((EventController, OpaquePointer) -> Void)? +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyPropagationLimit: ((EventController, OpaquePointer) -> Void)? +addSignal(name: "notify::propagation-phase", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPropagationPhase?(self, param0) +} - public var notifyPropagationPhase: ((EventController, OpaquePointer) -> Void)? +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyWidget: ((EventController, OpaquePointer) -> Void)? +addSignal(name: "notify::widget", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWidget?(self, param0) +} } + + /// The name for this controller, typically used for debugging purposes. +@GObjectProperty(named: "name") public var name: String? + +/// The limit for which events this controller will handle. +@GObjectProperty(named: "propagation-limit") public var propagationLimit: PropagationLimit + +/// The propagation phase at which this controller will handle events. +@GObjectProperty(named: "propagation-phase") public var propagationPhase: PropagationPhase + + +public var notifyName: ((EventController, OpaquePointer) -> Void)? + + +public var notifyPropagationLimit: ((EventController, OpaquePointer) -> Void)? + + +public var notifyPropagationPhase: ((EventController, OpaquePointer) -> Void)? + + +public var notifyWidget: ((EventController, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/EventControllerMotion.swift b/Sources/Gtk/Generated/EventControllerMotion.swift new file mode 100644 index 0000000000..9310628743 --- /dev/null +++ b/Sources/Gtk/Generated/EventControllerMotion.swift @@ -0,0 +1,101 @@ +import CGtk + +/// Tracks the pointer position. +/// +/// The event controller offers [signal@Gtk.EventControllerMotion::enter] +/// and [signal@Gtk.EventControllerMotion::leave] signals, as well as +/// [property@Gtk.EventControllerMotion:is-pointer] and +/// [property@Gtk.EventControllerMotion:contains-pointer] properties +/// which are updated to reflect changes in the pointer position as it +/// moves over the widget. +open class EventControllerMotion: EventController { + /// Creates a new event controller that will handle motion events. +public convenience init() { + self.init( + gtk_event_controller_motion_new() + ) +} + + public override func registerSignals() { + super.registerSignals() + + let handler0: @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + +addSignal(name: "enter", handler: gCallback(handler0)) { [weak self] (param0: Double, param1: Double) in + guard let self = self else { return } + self.enter?(self, param0, param1) +} + +addSignal(name: "leave") { [weak self] () in + guard let self = self else { return } + self.leave?(self) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + +addSignal(name: "motion", handler: gCallback(handler2)) { [weak self] (param0: Double, param1: Double) in + guard let self = self else { return } + self.motion?(self, param0, param1) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::contains-pointer", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContainsPointer?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::is-pointer", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIsPointer?(self, param0) +} +} + + /// Whether the pointer is in the controllers widget or a descendant. +/// +/// See also [property@Gtk.EventControllerMotion:is-pointer]. +/// +/// When handling crossing events, this property is updated +/// before [signal@Gtk.EventControllerMotion::enter], but after +/// [signal@Gtk.EventControllerMotion::leave] is emitted. +@GObjectProperty(named: "contains-pointer") public var containsPointer: Bool + +/// Whether the pointer is in the controllers widget itself, +/// as opposed to in a descendent widget. +/// +/// See also [property@Gtk.EventControllerMotion:contains-pointer]. +/// +/// When handling crossing events, this property is updated +/// before [signal@Gtk.EventControllerMotion::enter], but after +/// [signal@Gtk.EventControllerMotion::leave] is emitted. +@GObjectProperty(named: "is-pointer") public var isPointer: Bool + +/// Signals that the pointer has entered the widget. +public var enter: ((EventControllerMotion, Double, Double) -> Void)? + +/// Signals that the pointer has left the widget. +public var leave: ((EventControllerMotion) -> Void)? + +/// Emitted when the pointer moves inside the widget. +public var motion: ((EventControllerMotion, Double, Double) -> Void)? + + +public var notifyContainsPointer: ((EventControllerMotion, OpaquePointer) -> Void)? + + +public var notifyIsPointer: ((EventControllerMotion, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/EventSequenceState.swift b/Sources/Gtk/Generated/EventSequenceState.swift index d64e046cab..ca6ae3e2d7 100644 --- a/Sources/Gtk/Generated/EventSequenceState.swift +++ b/Sources/Gtk/Generated/EventSequenceState.swift @@ -5,24 +5,24 @@ public enum EventSequenceState: GValueRepresentableEnum { public typealias GtkEnum = GtkEventSequenceState /// The sequence is handled, but not grabbed. - case none - /// The sequence is handled and grabbed. - case claimed - /// The sequence is denied. - case denied +case none +/// The sequence is handled and grabbed. +case claimed +/// The sequence is denied. +case denied public static var type: GType { - gtk_event_sequence_state_get_type() - } + gtk_event_sequence_state_get_type() +} public init(from gtkEnum: GtkEventSequenceState) { switch gtkEnum { case GTK_EVENT_SEQUENCE_NONE: - self = .none - case GTK_EVENT_SEQUENCE_CLAIMED: - self = .claimed - case GTK_EVENT_SEQUENCE_DENIED: - self = .denied + self = .none +case GTK_EVENT_SEQUENCE_CLAIMED: + self = .claimed +case GTK_EVENT_SEQUENCE_DENIED: + self = .denied default: fatalError("Unsupported GtkEventSequenceState enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ public enum EventSequenceState: GValueRepresentableEnum { public func toGtk() -> GtkEventSequenceState { switch self { case .none: - return GTK_EVENT_SEQUENCE_NONE - case .claimed: - return GTK_EVENT_SEQUENCE_CLAIMED - case .denied: - return GTK_EVENT_SEQUENCE_DENIED + return GTK_EVENT_SEQUENCE_NONE +case .claimed: + return GTK_EVENT_SEQUENCE_CLAIMED +case .denied: + return GTK_EVENT_SEQUENCE_DENIED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/FileChooser.swift b/Sources/Gtk/Generated/FileChooser.swift index 057280132d..ca019aca97 100644 --- a/Sources/Gtk/Generated/FileChooser.swift +++ b/Sources/Gtk/Generated/FileChooser.swift @@ -2,37 +2,37 @@ import CGtk /// `GtkFileChooser` is an interface that can be implemented by file /// selection widgets. -/// +/// /// In GTK, the main objects that implement this interface are /// [class@Gtk.FileChooserWidget] and [class@Gtk.FileChooserDialog]. -/// +/// /// You do not need to write an object that implements the `GtkFileChooser` /// interface unless you are trying to adapt an existing file selector to /// expose a standard programming interface. -/// +/// /// `GtkFileChooser` allows for shortcuts to various places in the filesystem. /// In the default implementation these are displayed in the left pane. It /// may be a bit confusing at first that these shortcuts come from various /// sources and in various flavours, so lets explain the terminology here: -/// +/// /// - Bookmarks: are created by the user, by dragging folders from the /// right pane to the left pane, or by using the “Add”. Bookmarks /// can be renamed and deleted by the user. -/// +/// /// - Shortcuts: can be provided by the application. For example, a Paint /// program may want to add a shortcut for a Clipart folder. Shortcuts /// cannot be modified by the user. -/// +/// /// - Volumes: are provided by the underlying filesystem abstraction. They are /// the “roots” of the filesystem. -/// +/// /// # File Names and Encodings -/// +/// /// When the user is finished selecting files in a `GtkFileChooser`, your /// program can get the selected filenames as `GFile`s. -/// +/// /// # Adding options -/// +/// /// You can add extra widgets to a file chooser to provide options /// that are not present in the default design, by using /// [method@Gtk.FileChooser.add_choice]. Each choice has an identifier and @@ -42,27 +42,28 @@ import CGtk /// be rendered as a combo box. public protocol FileChooser: GObjectRepresentable { /// The type of operation that the file chooser is performing. - var action: FileChooserAction { get set } +var action: FileChooserAction { get set } - /// Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode - /// will offer the user to create new folders. - var createFolders: Bool { get set } +/// Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode +/// will offer the user to create new folders. +var createFolders: Bool { get set } - /// A `GListModel` containing the filters that have been - /// added with gtk_file_chooser_add_filter(). - /// - /// The returned object should not be modified. It may - /// or may not be updated for later changes. - var filters: OpaquePointer { get set } +/// A `GListModel` containing the filters that have been +/// added with gtk_file_chooser_add_filter(). +/// +/// The returned object should not be modified. It may +/// or may not be updated for later changes. +var filters: OpaquePointer { get set } - /// Whether to allow multiple files to be selected. - var selectMultiple: Bool { get set } +/// Whether to allow multiple files to be selected. +var selectMultiple: Bool { get set } - /// A `GListModel` containing the shortcut folders that have been - /// added with gtk_file_chooser_add_shortcut_folder(). - /// - /// The returned object should not be modified. It may - /// or may not be updated for later changes. - var shortcutFolders: OpaquePointer { get set } +/// A `GListModel` containing the shortcut folders that have been +/// added with gtk_file_chooser_add_shortcut_folder(). +/// +/// The returned object should not be modified. It may +/// or may not be updated for later changes. +var shortcutFolders: OpaquePointer { get set } -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/FileChooserAction.swift b/Sources/Gtk/Generated/FileChooserAction.swift index fb1e889e94..dab1abc72c 100644 --- a/Sources/Gtk/Generated/FileChooserAction.swift +++ b/Sources/Gtk/Generated/FileChooserAction.swift @@ -6,29 +6,29 @@ public enum FileChooserAction: GValueRepresentableEnum { public typealias GtkEnum = GtkFileChooserAction /// Indicates open mode. The file chooser - /// will only let the user pick an existing file. - case open - /// Indicates save mode. The file chooser - /// will let the user pick an existing file, or type in a new - /// filename. - case save - /// Indicates an Open mode for - /// selecting folders. The file chooser will let the user pick an - /// existing folder. - case selectFolder +/// will only let the user pick an existing file. +case open +/// Indicates save mode. The file chooser +/// will let the user pick an existing file, or type in a new +/// filename. +case save +/// Indicates an Open mode for +/// selecting folders. The file chooser will let the user pick an +/// existing folder. +case selectFolder public static var type: GType { - gtk_file_chooser_action_get_type() - } + gtk_file_chooser_action_get_type() +} public init(from gtkEnum: GtkFileChooserAction) { switch gtkEnum { case GTK_FILE_CHOOSER_ACTION_OPEN: - self = .open - case GTK_FILE_CHOOSER_ACTION_SAVE: - self = .save - case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER: - self = .selectFolder + self = .open +case GTK_FILE_CHOOSER_ACTION_SAVE: + self = .save +case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER: + self = .selectFolder default: fatalError("Unsupported GtkFileChooserAction enum value: \(gtkEnum.rawValue)") } @@ -37,11 +37,11 @@ public enum FileChooserAction: GValueRepresentableEnum { public func toGtk() -> GtkFileChooserAction { switch self { case .open: - return GTK_FILE_CHOOSER_ACTION_OPEN - case .save: - return GTK_FILE_CHOOSER_ACTION_SAVE - case .selectFolder: - return GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER + return GTK_FILE_CHOOSER_ACTION_OPEN +case .save: + return GTK_FILE_CHOOSER_ACTION_SAVE +case .selectFolder: + return GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/FileChooserError.swift b/Sources/Gtk/Generated/FileChooserError.swift index 78085a9ffa..4b5ae8e16a 100644 --- a/Sources/Gtk/Generated/FileChooserError.swift +++ b/Sources/Gtk/Generated/FileChooserError.swift @@ -6,30 +6,30 @@ public enum FileChooserError: GValueRepresentableEnum { public typealias GtkEnum = GtkFileChooserError /// Indicates that a file does not exist. - case nonexistent - /// Indicates a malformed filename. - case badFilename - /// Indicates a duplicate path (e.g. when - /// adding a bookmark). - case alreadyExists - /// Indicates an incomplete hostname - /// (e.g. "http://foo" without a slash after that). - case incompleteHostname +case nonexistent +/// Indicates a malformed filename. +case badFilename +/// Indicates a duplicate path (e.g. when +/// adding a bookmark). +case alreadyExists +/// Indicates an incomplete hostname +/// (e.g. "http://foo" without a slash after that). +case incompleteHostname public static var type: GType { - gtk_file_chooser_error_get_type() - } + gtk_file_chooser_error_get_type() +} public init(from gtkEnum: GtkFileChooserError) { switch gtkEnum { case GTK_FILE_CHOOSER_ERROR_NONEXISTENT: - self = .nonexistent - case GTK_FILE_CHOOSER_ERROR_BAD_FILENAME: - self = .badFilename - case GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS: - self = .alreadyExists - case GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME: - self = .incompleteHostname + self = .nonexistent +case GTK_FILE_CHOOSER_ERROR_BAD_FILENAME: + self = .badFilename +case GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS: + self = .alreadyExists +case GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME: + self = .incompleteHostname default: fatalError("Unsupported GtkFileChooserError enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ public enum FileChooserError: GValueRepresentableEnum { public func toGtk() -> GtkFileChooserError { switch self { case .nonexistent: - return GTK_FILE_CHOOSER_ERROR_NONEXISTENT - case .badFilename: - return GTK_FILE_CHOOSER_ERROR_BAD_FILENAME - case .alreadyExists: - return GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS - case .incompleteHostname: - return GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME + return GTK_FILE_CHOOSER_ERROR_NONEXISTENT +case .badFilename: + return GTK_FILE_CHOOSER_ERROR_BAD_FILENAME +case .alreadyExists: + return GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS +case .incompleteHostname: + return GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/FileChooserNative.swift b/Sources/Gtk/Generated/FileChooserNative.swift index ad788b8891..970c5c4ead 100644 --- a/Sources/Gtk/Generated/FileChooserNative.swift +++ b/Sources/Gtk/Generated/FileChooserNative.swift @@ -2,7 +2,7 @@ import CGtk /// `GtkFileChooserNative` is an abstraction of a dialog suitable /// for use with “File Open” or “File Save as” commands. -/// +/// /// By default, this just uses a `GtkFileChooserDialog` to implement /// the actual dialog. However, on some platforms, such as Windows and /// macOS, the native platform file chooser is used instead. When the @@ -10,25 +10,25 @@ import CGtk /// filesystem access (such as Flatpak), `GtkFileChooserNative` may call /// the proper APIs (portals) to let the user choose a file and make it /// available to the application. -/// +/// /// While the API of `GtkFileChooserNative` closely mirrors `GtkFileChooserDialog`, /// the main difference is that there is no access to any `GtkWindow` or `GtkWidget` /// for the dialog. This is required, as there may not be one in the case of a /// platform native dialog. -/// +/// /// Showing, hiding and running the dialog is handled by the /// [class@Gtk.NativeDialog] functions. -/// +/// /// Note that unlike `GtkFileChooserDialog`, `GtkFileChooserNative` objects /// are not toplevel widgets, and GTK does not keep them alive. It is your /// responsibility to keep a reference until you are done with the /// object. -/// +/// /// ## Typical usage -/// +/// /// In the simplest of cases, you can the following code to use /// `GtkFileChooserNative` to select a file for opening: -/// +/// /// ```c /// static void /// on_response (GtkNativeDialog *native, @@ -38,31 +38,31 @@ import CGtk /// { /// GtkFileChooser *chooser = GTK_FILE_CHOOSER (native); /// GFile *file = gtk_file_chooser_get_file (chooser); -/// +/// /// open_file (file); -/// +/// /// g_object_unref (file); /// } -/// +/// /// g_object_unref (native); /// } -/// +/// /// // ... /// GtkFileChooserNative *native; /// GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN; -/// +/// /// native = gtk_file_chooser_native_new ("Open File", /// parent_window, /// action, /// "_Open", /// "_Cancel"); -/// +/// /// g_signal_connect (native, "response", G_CALLBACK (on_response), NULL); /// gtk_native_dialog_show (GTK_NATIVE_DIALOG (native)); /// ``` -/// +/// /// To use a `GtkFileChooserNative` for saving, you can use this: -/// +/// /// ```c /// static void /// on_response (GtkNativeDialog *native, @@ -72,236 +72,225 @@ import CGtk /// { /// GtkFileChooser *chooser = GTK_FILE_CHOOSER (native); /// GFile *file = gtk_file_chooser_get_file (chooser); -/// +/// /// save_to_file (file); -/// +/// /// g_object_unref (file); /// } -/// +/// /// g_object_unref (native); /// } -/// +/// /// // ... /// GtkFileChooserNative *native; /// GtkFileChooser *chooser; /// GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SAVE; -/// +/// /// native = gtk_file_chooser_native_new ("Save File", /// parent_window, /// action, /// "_Save", /// "_Cancel"); /// chooser = GTK_FILE_CHOOSER (native); -/// +/// /// if (user_edited_a_new_document) /// gtk_file_chooser_set_current_name (chooser, _("Untitled document")); /// else /// gtk_file_chooser_set_file (chooser, existing_file, NULL); -/// +/// /// g_signal_connect (native, "response", G_CALLBACK (on_response), NULL); /// gtk_native_dialog_show (GTK_NATIVE_DIALOG (native)); /// ``` -/// +/// /// For more information on how to best set up a file dialog, /// see the [class@Gtk.FileChooserDialog] documentation. -/// +/// /// ## Response Codes -/// +/// /// `GtkFileChooserNative` inherits from [class@Gtk.NativeDialog], /// which means it will return %GTK_RESPONSE_ACCEPT if the user accepted, /// and %GTK_RESPONSE_CANCEL if he pressed cancel. It can also return /// %GTK_RESPONSE_DELETE_EVENT if the window was unexpectedly closed. -/// +/// /// ## Differences from `GtkFileChooserDialog` -/// +/// /// There are a few things in the [iface@Gtk.FileChooser] interface that /// are not possible to use with `GtkFileChooserNative`, as such use would /// prohibit the use of a native dialog. -/// +/// /// No operations that change the dialog work while the dialog is visible. /// Set all the properties that are required before showing the dialog. -/// +/// /// ## Win32 details -/// +/// /// On windows the `IFileDialog` implementation (added in Windows Vista) is /// used. It supports many of the features that `GtkFileChooser` has, but /// there are some things it does not handle: -/// +/// /// * Any [class@Gtk.FileFilter] added using a mimetype -/// +/// /// If any of these features are used the regular `GtkFileChooserDialog` /// will be used in place of the native one. -/// +/// /// ## Portal details -/// +/// /// When the `org.freedesktop.portal.FileChooser` portal is available on /// the session bus, it is used to bring up an out-of-process file chooser. /// Depending on the kind of session the application is running in, this may /// or may not be a GTK file chooser. -/// +/// /// ## macOS details -/// +/// /// On macOS the `NSSavePanel` and `NSOpenPanel` classes are used to provide /// native file chooser dialogs. Some features provided by `GtkFileChooser` /// are not supported: -/// +/// /// * Shortcut folders. open class FileChooserNative: NativeDialog, FileChooser { /// Creates a new `GtkFileChooserNative`. - public convenience init( - title: String, parent: UnsafeMutablePointer!, action: GtkFileChooserAction, - acceptLabel: String, cancelLabel: String - ) { - self.init( - gtk_file_chooser_native_new(title, parent, action, acceptLabel, cancelLabel) - ) - } +public convenience init(title: String, parent: UnsafeMutablePointer!, action: GtkFileChooserAction, acceptLabel: String, cancelLabel: String) { + self.init( + gtk_file_chooser_native_new(title, parent, action, acceptLabel, cancelLabel) + ) +} public override func registerSignals() { - super.registerSignals() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::accept-label", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAcceptLabel?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::cancel-label", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCancelLabel?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::action", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAction?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::create-folders", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCreateFolders?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::filter", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFilter?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::filters", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFilters?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::select-multiple", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectMultiple?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::shortcut-folders", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShortcutFolders?(self, param0) - } + super.registerSignals() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// The text used for the label on the accept button in the dialog, or - /// %NULL to use the default text. - @GObjectProperty(named: "accept-label") public var acceptLabel: String? +addSignal(name: "notify::accept-label", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAcceptLabel?(self, param0) +} - /// The text used for the label on the cancel button in the dialog, or - /// %NULL to use the default text. - @GObjectProperty(named: "cancel-label") public var cancelLabel: String? +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// The type of operation that the file chooser is performing. - @GObjectProperty(named: "action") public var action: FileChooserAction +addSignal(name: "notify::cancel-label", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCancelLabel?(self, param0) +} - /// Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode - /// will offer the user to create new folders. - @GObjectProperty(named: "create-folders") public var createFolders: Bool +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// A `GListModel` containing the filters that have been - /// added with gtk_file_chooser_add_filter(). - /// - /// The returned object should not be modified. It may - /// or may not be updated for later changes. - @GObjectProperty(named: "filters") public var filters: OpaquePointer +addSignal(name: "notify::action", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAction?(self, param0) +} - /// Whether to allow multiple files to be selected. - @GObjectProperty(named: "select-multiple") public var selectMultiple: Bool +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// A `GListModel` containing the shortcut folders that have been - /// added with gtk_file_chooser_add_shortcut_folder(). - /// - /// The returned object should not be modified. It may - /// or may not be updated for later changes. - @GObjectProperty(named: "shortcut-folders") public var shortcutFolders: OpaquePointer +addSignal(name: "notify::create-folders", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCreateFolders?(self, param0) +} - public var notifyAcceptLabel: ((FileChooserNative, OpaquePointer) -> Void)? +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyCancelLabel: ((FileChooserNative, OpaquePointer) -> Void)? +addSignal(name: "notify::filter", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFilter?(self, param0) +} - public var notifyAction: ((FileChooserNative, OpaquePointer) -> Void)? +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyCreateFolders: ((FileChooserNative, OpaquePointer) -> Void)? +addSignal(name: "notify::filters", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFilters?(self, param0) +} - public var notifyFilter: ((FileChooserNative, OpaquePointer) -> Void)? +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyFilters: ((FileChooserNative, OpaquePointer) -> Void)? +addSignal(name: "notify::select-multiple", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectMultiple?(self, param0) +} - public var notifySelectMultiple: ((FileChooserNative, OpaquePointer) -> Void)? +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyShortcutFolders: ((FileChooserNative, OpaquePointer) -> Void)? +addSignal(name: "notify::shortcut-folders", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShortcutFolders?(self, param0) +} } + + /// The text used for the label on the accept button in the dialog, or +/// %NULL to use the default text. +@GObjectProperty(named: "accept-label") public var acceptLabel: String? + +/// The text used for the label on the cancel button in the dialog, or +/// %NULL to use the default text. +@GObjectProperty(named: "cancel-label") public var cancelLabel: String? + +/// The type of operation that the file chooser is performing. +@GObjectProperty(named: "action") public var action: FileChooserAction + +/// Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode +/// will offer the user to create new folders. +@GObjectProperty(named: "create-folders") public var createFolders: Bool + +/// A `GListModel` containing the filters that have been +/// added with gtk_file_chooser_add_filter(). +/// +/// The returned object should not be modified. It may +/// or may not be updated for later changes. +@GObjectProperty(named: "filters") public var filters: OpaquePointer + +/// Whether to allow multiple files to be selected. +@GObjectProperty(named: "select-multiple") public var selectMultiple: Bool + +/// A `GListModel` containing the shortcut folders that have been +/// added with gtk_file_chooser_add_shortcut_folder(). +/// +/// The returned object should not be modified. It may +/// or may not be updated for later changes. +@GObjectProperty(named: "shortcut-folders") public var shortcutFolders: OpaquePointer + + +public var notifyAcceptLabel: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyCancelLabel: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyAction: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyCreateFolders: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyFilter: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyFilters: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifySelectMultiple: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyShortcutFolders: ((FileChooserNative, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/FilterChange.swift b/Sources/Gtk/Generated/FilterChange.swift index 39c9f528a0..ff29ec0419 100644 --- a/Sources/Gtk/Generated/FilterChange.swift +++ b/Sources/Gtk/Generated/FilterChange.swift @@ -2,37 +2,39 @@ import CGtk /// Describes changes in a filter in more detail and allows objects /// using the filter to optimize refiltering items. -/// +/// /// If you are writing an implementation and are not sure which /// value to pass, `GTK_FILTER_CHANGE_DIFFERENT` is always a correct /// choice. +/// +/// New values may be added in the future. public enum FilterChange: GValueRepresentableEnum { public typealias GtkEnum = GtkFilterChange /// The filter change cannot be - /// described with any of the other enumeration values - case different - /// The filter is less strict than - /// it was before: All items that it used to return true - /// still return true, others now may, too. - case lessStrict - /// The filter is more strict than - /// it was before: All items that it used to return false - /// still return false, others now may, too. - case moreStrict +/// described with any of the other enumeration values +case different +/// The filter is less strict than +/// it was before: All items that it used to return true +/// still return true, others now may, too. +case lessStrict +/// The filter is more strict than +/// it was before: All items that it used to return false +/// still return false, others now may, too. +case moreStrict public static var type: GType { - gtk_filter_change_get_type() - } + gtk_filter_change_get_type() +} public init(from gtkEnum: GtkFilterChange) { switch gtkEnum { case GTK_FILTER_CHANGE_DIFFERENT: - self = .different - case GTK_FILTER_CHANGE_LESS_STRICT: - self = .lessStrict - case GTK_FILTER_CHANGE_MORE_STRICT: - self = .moreStrict + self = .different +case GTK_FILTER_CHANGE_LESS_STRICT: + self = .lessStrict +case GTK_FILTER_CHANGE_MORE_STRICT: + self = .moreStrict default: fatalError("Unsupported GtkFilterChange enum value: \(gtkEnum.rawValue)") } @@ -41,11 +43,11 @@ public enum FilterChange: GValueRepresentableEnum { public func toGtk() -> GtkFilterChange { switch self { case .different: - return GTK_FILTER_CHANGE_DIFFERENT - case .lessStrict: - return GTK_FILTER_CHANGE_LESS_STRICT - case .moreStrict: - return GTK_FILTER_CHANGE_MORE_STRICT + return GTK_FILTER_CHANGE_DIFFERENT +case .lessStrict: + return GTK_FILTER_CHANGE_LESS_STRICT +case .moreStrict: + return GTK_FILTER_CHANGE_MORE_STRICT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/FilterMatch.swift b/Sources/Gtk/Generated/FilterMatch.swift index 27def01204..6057e32d95 100644 --- a/Sources/Gtk/Generated/FilterMatch.swift +++ b/Sources/Gtk/Generated/FilterMatch.swift @@ -1,7 +1,7 @@ import CGtk /// Describes the known strictness of a filter. -/// +/// /// Note that for filters where the strictness is not known, /// `GTK_FILTER_MATCH_SOME` is always an acceptable value, /// even if a filter does match all or no items. @@ -9,27 +9,27 @@ public enum FilterMatch: GValueRepresentableEnum { public typealias GtkEnum = GtkFilterMatch /// The filter matches some items, - /// [method@Gtk.Filter.match] may return true or false - case some - /// The filter does not match any item, - /// [method@Gtk.Filter.match] will always return false - case none - /// The filter matches all items, - /// [method@Gtk.Filter.match] will alays return true - case all +/// [method@Gtk.Filter.match] may return true or false +case some +/// The filter does not match any item, +/// [method@Gtk.Filter.match] will always return false +case none +/// The filter matches all items, +/// [method@Gtk.Filter.match] will alays return true +case all public static var type: GType { - gtk_filter_match_get_type() - } + gtk_filter_match_get_type() +} public init(from gtkEnum: GtkFilterMatch) { switch gtkEnum { case GTK_FILTER_MATCH_SOME: - self = .some - case GTK_FILTER_MATCH_NONE: - self = .none - case GTK_FILTER_MATCH_ALL: - self = .all + self = .some +case GTK_FILTER_MATCH_NONE: + self = .none +case GTK_FILTER_MATCH_ALL: + self = .all default: fatalError("Unsupported GtkFilterMatch enum value: \(gtkEnum.rawValue)") } @@ -38,11 +38,11 @@ public enum FilterMatch: GValueRepresentableEnum { public func toGtk() -> GtkFilterMatch { switch self { case .some: - return GTK_FILTER_MATCH_SOME - case .none: - return GTK_FILTER_MATCH_NONE - case .all: - return GTK_FILTER_MATCH_ALL + return GTK_FILTER_MATCH_SOME +case .none: + return GTK_FILTER_MATCH_NONE +case .all: + return GTK_FILTER_MATCH_ALL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/FontChooser.swift b/Sources/Gtk/Generated/FontChooser.swift index 1739368b72..451dff6cdc 100644 --- a/Sources/Gtk/Generated/FontChooser.swift +++ b/Sources/Gtk/Generated/FontChooser.swift @@ -2,33 +2,33 @@ import CGtk /// `GtkFontChooser` is an interface that can be implemented by widgets /// for choosing fonts. -/// +/// /// In GTK, the main objects that implement this interface are /// [class@Gtk.FontChooserWidget], [class@Gtk.FontChooserDialog] and /// [class@Gtk.FontButton]. public protocol FontChooser: GObjectRepresentable { /// The font description as a string, e.g. "Sans Italic 12". - var font: String? { get set } +var font: String? { get set } - /// The selected font features. - /// - /// The format of the string is compatible with - /// CSS and with Pango attributes. - var fontFeatures: String { get set } +/// The selected font features. +/// +/// The format of the string is compatible with +/// CSS and with Pango attributes. +var fontFeatures: String { get set } - /// The language for which the font features were selected. - var language: String { get set } +/// The language for which the font features were selected. +var language: String { get set } - /// The string with which to preview the font. - var previewText: String { get set } +/// The string with which to preview the font. +var previewText: String { get set } - /// Whether to show an entry to change the preview text. - var showPreviewEntry: Bool { get set } +/// Whether to show an entry to change the preview text. +var showPreviewEntry: Bool { get set } /// Emitted when a font is activated. - /// - /// This usually happens when the user double clicks an item, - /// or an item is selected and the user presses one of the keys - /// Space, Shift+Space, Return or Enter. - var fontActivated: ((Self, UnsafePointer) -> Void)? { get set } -} +/// +/// This usually happens when the user double clicks an item, +/// or an item is selected and the user presses one of the keys +/// Space, Shift+Space, Return or Enter. +var fontActivated: ((Self, UnsafePointer) -> Void)? { get set } +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/GLArea.swift b/Sources/Gtk/Generated/GLArea.swift index 3d286c2204..11bec91792 100644 --- a/Sources/Gtk/Generated/GLArea.swift +++ b/Sources/Gtk/Generated/GLArea.swift @@ -1,33 +1,33 @@ import CGtk /// Allows drawing with OpenGL. -/// +/// /// An example GtkGLArea -/// +/// /// `GtkGLArea` sets up its own [class@Gdk.GLContext], and creates a custom /// GL framebuffer that the widget will do GL rendering onto. It also ensures /// that this framebuffer is the default GL rendering target when rendering. /// The completed rendering is integrated into the larger GTK scene graph as /// a texture. -/// +/// /// In order to draw, you have to connect to the [signal@Gtk.GLArea::render] /// signal, or subclass `GtkGLArea` and override the GtkGLAreaClass.render /// virtual function. -/// +/// /// The `GtkGLArea` widget ensures that the `GdkGLContext` is associated with /// the widget's drawing area, and it is kept updated when the size and /// position of the drawing area changes. -/// +/// /// ## Drawing with GtkGLArea -/// +/// /// The simplest way to draw using OpenGL commands in a `GtkGLArea` is to /// create a widget instance and connect to the [signal@Gtk.GLArea::render] signal: -/// +/// /// The `render()` function will be called when the `GtkGLArea` is ready /// for you to draw its content: -/// +/// /// The initial contents of the framebuffer are transparent. -/// +/// /// ```c /// static gboolean /// render (GtkGLArea *area, GdkGLContext *context) @@ -36,38 +36,45 @@ import CGtk /// // GdkGLContext has been made current to the drawable /// // surface used by the `GtkGLArea` and the viewport has /// // already been set to be the size of the allocation -/// +/// /// // we can start by clearing the buffer /// glClearColor (0, 0, 0, 0); /// glClear (GL_COLOR_BUFFER_BIT); -/// +/// +/// // record the active framebuffer ID, so we can return to it +/// // with `glBindFramebuffer (GL_FRAMEBUFFER, screen_fb)` should +/// // we, for instance, intend on utilizing the results of an +/// // intermediate render texture pass +/// GLuint screen_fb = 0; +/// glGetIntegerv (GL_FRAMEBUFFER_BINDING, &screen_fb); +/// /// // draw your object /// // draw_an_object (); -/// +/// /// // we completed our drawing; the draw commands will be /// // flushed at the end of the signal emission chain, and /// // the buffers will be drawn on the window /// return TRUE; /// } -/// +/// /// void setup_glarea (void) /// { /// // create a GtkGLArea instance /// GtkWidget *gl_area = gtk_gl_area_new (); -/// +/// /// // connect to the "render" signal /// g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL); /// } /// ``` -/// +/// /// If you need to initialize OpenGL state, e.g. buffer objects or /// shaders, you should use the [signal@Gtk.Widget::realize] signal; /// you can use the [signal@Gtk.Widget::unrealize] signal to clean up. /// Since the `GdkGLContext` creation and initialization may fail, you /// will need to check for errors, using [method@Gtk.GLArea.get_error]. -/// +/// /// An example of how to safely initialize the GL state is: -/// +/// /// ```c /// static void /// on_realize (GtkGLArea *area) @@ -75,13 +82,13 @@ import CGtk /// // We need to make the context current if we want to /// // call GL API /// gtk_gl_area_make_current (area); -/// +/// /// // If there were errors during the initialization or /// // when trying to make the context current, this /// // function will return a GError for you to catch /// if (gtk_gl_area_get_error (area) != NULL) /// return; -/// +/// /// // You can also use gtk_gl_area_set_error() in order /// // to show eventual initialization errors on the /// // GtkGLArea widget itself @@ -93,7 +100,7 @@ import CGtk /// g_error_free (error); /// return; /// } -/// +/// /// init_shaders (&error); /// if (error != NULL) /// { @@ -103,210 +110,199 @@ import CGtk /// } /// } /// ``` -/// +/// /// If you need to change the options for creating the `GdkGLContext` /// you should use the [signal@Gtk.GLArea::create-context] signal. open class GLArea: Widget { /// Creates a new `GtkGLArea` widget. - public convenience init() { - self.init( - gtk_gl_area_new() - ) +public convenience init() { + self.init( + gtk_gl_area_new() + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "create-context") { [weak self] () in + guard let self = self else { return } + self.createContext?(self) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "create-context") { [weak self] () in - guard let self = self else { return } - self.createContext?(self) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "render", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.render?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "resize", handler: gCallback(handler2)) { - [weak self] (param0: Int, param1: Int) in - guard let self = self else { return } - self.resize?(self, param0, param1) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::allowed-apis", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAllowedApis?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::api", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyApi?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::auto-render", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAutoRender?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::context", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContext?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::has-depth-buffer", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasDepthBuffer?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::has-stencil-buffer", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasStencilBuffer?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-es", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseEs?(self, param0) - } +addSignal(name: "render", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.render?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) } - /// If set to %TRUE the ::render signal will be emitted every time - /// the widget draws. - /// - /// This is the default and is useful if drawing the widget is faster. - /// - /// If set to %FALSE the data from previous rendering is kept around and will - /// be used for drawing the widget the next time, unless the window is resized. - /// In order to force a rendering [method@Gtk.GLArea.queue_render] must be called. - /// This mode is useful when the scene changes seldom, but takes a long time - /// to redraw. - @GObjectProperty(named: "auto-render") public var autoRender: Bool - - /// The `GdkGLContext` used by the `GtkGLArea` widget. - /// - /// The `GtkGLArea` widget is responsible for creating the `GdkGLContext` - /// instance. If you need to render with other kinds of buffers (stencil, - /// depth, etc), use render buffers. - @GObjectProperty(named: "context") public var context: OpaquePointer? - - /// If set to %TRUE the widget will allocate and enable a depth buffer for the - /// target framebuffer. - /// - /// Setting this property will enable GL's depth testing as a side effect. If - /// you don't need depth testing, you should call `glDisable(GL_DEPTH_TEST)` - /// in your `GtkGLArea::render` handler. - @GObjectProperty(named: "has-depth-buffer") public var hasDepthBuffer: Bool - - /// If set to %TRUE the widget will allocate and enable a stencil buffer for the - /// target framebuffer. - @GObjectProperty(named: "has-stencil-buffer") public var hasStencilBuffer: Bool - - /// If set to %TRUE the widget will try to create a `GdkGLContext` using - /// OpenGL ES instead of OpenGL. - @GObjectProperty(named: "use-es") public var useEs: Bool - - /// Emitted when the widget is being realized. - /// - /// This allows you to override how the GL context is created. - /// This is useful when you want to reuse an existing GL context, - /// or if you want to try creating different kinds of GL options. - /// - /// If context creation fails then the signal handler can use - /// [method@Gtk.GLArea.set_error] to register a more detailed error - /// of how the construction failed. - public var createContext: ((GLArea) -> Void)? - - /// Emitted every time the contents of the `GtkGLArea` should be redrawn. - /// - /// The @context is bound to the @area prior to emitting this function, - /// and the buffers are painted to the window once the emission terminates. - public var render: ((GLArea, OpaquePointer) -> Void)? - - /// Emitted once when the widget is realized, and then each time the widget - /// is changed while realized. - /// - /// This is useful in order to keep GL state up to date with the widget size, - /// like for instance camera properties which may depend on the width/height - /// ratio. - /// - /// The GL context for the area is guaranteed to be current when this signal - /// is emitted. - /// - /// The default handler sets up the GL viewport. - public var resize: ((GLArea, Int, Int) -> Void)? - - public var notifyAllowedApis: ((GLArea, OpaquePointer) -> Void)? - - public var notifyApi: ((GLArea, OpaquePointer) -> Void)? - - public var notifyAutoRender: ((GLArea, OpaquePointer) -> Void)? - - public var notifyContext: ((GLArea, OpaquePointer) -> Void)? - - public var notifyHasDepthBuffer: ((GLArea, OpaquePointer) -> Void)? - - public var notifyHasStencilBuffer: ((GLArea, OpaquePointer) -> Void)? - - public var notifyUseEs: ((GLArea, OpaquePointer) -> Void)? +addSignal(name: "resize", handler: gCallback(handler2)) { [weak self] (param0: Int, param1: Int) in + guard let self = self else { return } + self.resize?(self, param0, param1) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::allowed-apis", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAllowedApis?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::api", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyApi?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::auto-render", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAutoRender?(self, param0) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::context", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContext?(self, param0) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::has-depth-buffer", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasDepthBuffer?(self, param0) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::has-stencil-buffer", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasStencilBuffer?(self, param0) +} + +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::use-es", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseEs?(self, param0) } +} + + /// If set to %TRUE the ::render signal will be emitted every time +/// the widget draws. +/// +/// This is the default and is useful if drawing the widget is faster. +/// +/// If set to %FALSE the data from previous rendering is kept around and will +/// be used for drawing the widget the next time, unless the window is resized. +/// In order to force a rendering [method@Gtk.GLArea.queue_render] must be called. +/// This mode is useful when the scene changes seldom, but takes a long time +/// to redraw. +@GObjectProperty(named: "auto-render") public var autoRender: Bool + +/// The `GdkGLContext` used by the `GtkGLArea` widget. +/// +/// The `GtkGLArea` widget is responsible for creating the `GdkGLContext` +/// instance. If you need to render with other kinds of buffers (stencil, +/// depth, etc), use render buffers. +@GObjectProperty(named: "context") public var context: OpaquePointer? + +/// If set to %TRUE the widget will allocate and enable a depth buffer for the +/// target framebuffer. +/// +/// Setting this property will enable GL's depth testing as a side effect. If +/// you don't need depth testing, you should call `glDisable(GL_DEPTH_TEST)` +/// in your `GtkGLArea::render` handler. +@GObjectProperty(named: "has-depth-buffer") public var hasDepthBuffer: Bool + +/// If set to %TRUE the widget will allocate and enable a stencil buffer for the +/// target framebuffer. +@GObjectProperty(named: "has-stencil-buffer") public var hasStencilBuffer: Bool + +/// If set to %TRUE the widget will try to create a `GdkGLContext` using +/// OpenGL ES instead of OpenGL. +@GObjectProperty(named: "use-es") public var useEs: Bool + +/// Emitted when the widget is being realized. +/// +/// This allows you to override how the GL context is created. +/// This is useful when you want to reuse an existing GL context, +/// or if you want to try creating different kinds of GL options. +/// +/// If context creation fails then the signal handler can use +/// [method@Gtk.GLArea.set_error] to register a more detailed error +/// of how the construction failed. +public var createContext: ((GLArea) -> Void)? + +/// Emitted every time the contents of the `GtkGLArea` should be redrawn. +/// +/// The @context is bound to the @area prior to emitting this function, +/// and the buffers are painted to the window once the emission terminates. +public var render: ((GLArea, OpaquePointer) -> Void)? + +/// Emitted once when the widget is realized, and then each time the widget +/// is changed while realized. +/// +/// This is useful in order to keep GL state up to date with the widget size, +/// like for instance camera properties which may depend on the width/height +/// ratio. +/// +/// The GL context for the area is guaranteed to be current when this signal +/// is emitted. +/// +/// The default handler sets up the GL viewport. +public var resize: ((GLArea, Int, Int) -> Void)? + + +public var notifyAllowedApis: ((GLArea, OpaquePointer) -> Void)? + + +public var notifyApi: ((GLArea, OpaquePointer) -> Void)? + + +public var notifyAutoRender: ((GLArea, OpaquePointer) -> Void)? + + +public var notifyContext: ((GLArea, OpaquePointer) -> Void)? + + +public var notifyHasDepthBuffer: ((GLArea, OpaquePointer) -> Void)? + + +public var notifyHasStencilBuffer: ((GLArea, OpaquePointer) -> Void)? + + +public var notifyUseEs: ((GLArea, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Gesture.swift b/Sources/Gtk/Generated/Gesture.swift index 9b9b702cbf..d98561da4d 100644 --- a/Sources/Gtk/Generated/Gesture.swift +++ b/Sources/Gtk/Generated/Gesture.swift @@ -1,219 +1,206 @@ import CGtk /// The base class for gesture recognition. -/// +/// /// Although `GtkGesture` is quite generalized to serve as a base for /// multi-touch gestures, it is suitable to implement single-touch and /// pointer-based gestures (using the special %NULL `GdkEventSequence` /// value for these). -/// +/// /// The number of touches that a `GtkGesture` need to be recognized is /// controlled by the [property@Gtk.Gesture:n-points] property, if a /// gesture is keeping track of less or more than that number of sequences, /// it won't check whether the gesture is recognized. -/// +/// /// As soon as the gesture has the expected number of touches, it will check /// regularly if it is recognized, the criteria to consider a gesture as /// "recognized" is left to `GtkGesture` subclasses. -/// +/// /// A recognized gesture will then emit the following signals: -/// +/// /// - [signal@Gtk.Gesture::begin] when the gesture is recognized. /// - [signal@Gtk.Gesture::update], whenever an input event is processed. /// - [signal@Gtk.Gesture::end] when the gesture is no longer recognized. -/// +/// /// ## Event propagation -/// +/// /// In order to receive events, a gesture needs to set a propagation phase /// through [method@Gtk.EventController.set_propagation_phase]. -/// +/// /// In the capture phase, events are propagated from the toplevel down /// to the target widget, and gestures that are attached to containers /// above the widget get a chance to interact with the event before it /// reaches the target. -/// +/// /// In the bubble phase, events are propagated up from the target widget /// to the toplevel, and gestures that are attached to containers above /// the widget get a chance to interact with events that have not been /// handled yet. -/// +/// /// ## States of a sequence -/// +/// /// Whenever input interaction happens, a single event may trigger a cascade /// of `GtkGesture`s, both across the parents of the widget receiving the /// event and in parallel within an individual widget. It is a responsibility /// of the widgets using those gestures to set the state of touch sequences /// accordingly in order to enable cooperation of gestures around the /// `GdkEventSequence`s triggering those. -/// +/// /// Within a widget, gestures can be grouped through [method@Gtk.Gesture.group]. /// Grouped gestures synchronize the state of sequences, so calling /// [method@Gtk.Gesture.set_state] on one will effectively propagate /// the state throughout the group. -/// +/// /// By default, all sequences start out in the %GTK_EVENT_SEQUENCE_NONE state, /// sequences in this state trigger the gesture event handler, but event /// propagation will continue unstopped by gestures. -/// +/// /// If a sequence enters into the %GTK_EVENT_SEQUENCE_DENIED state, the gesture /// group will effectively ignore the sequence, letting events go unstopped /// through the gesture, but the "slot" will still remain occupied while /// the touch is active. -/// +/// /// If a sequence enters in the %GTK_EVENT_SEQUENCE_CLAIMED state, the gesture /// group will grab all interaction on the sequence, by: -/// +/// /// - Setting the same sequence to %GTK_EVENT_SEQUENCE_DENIED on every other /// gesture group within the widget, and every gesture on parent widgets /// in the propagation chain. /// - Emitting [signal@Gtk.Gesture::cancel] on every gesture in widgets /// underneath in the propagation chain. /// - Stopping event propagation after the gesture group handles the event. -/// +/// /// Note: if a sequence is set early to %GTK_EVENT_SEQUENCE_CLAIMED on /// %GDK_TOUCH_BEGIN/%GDK_BUTTON_PRESS (so those events are captured before /// reaching the event widget, this implies %GTK_PHASE_CAPTURE), one similar /// event will be emulated if the sequence changes to %GTK_EVENT_SEQUENCE_DENIED. /// This way event coherence is preserved before event propagation is unstopped /// again. -/// +/// /// Sequence states can't be changed freely. /// See [method@Gtk.Gesture.set_state] to know about the possible /// lifetimes of a `GdkEventSequence`. -/// +/// /// ## Touchpad gestures -/// +/// /// On the platforms that support it, `GtkGesture` will handle transparently /// touchpad gesture events. The only precautions users of `GtkGesture` should /// do to enable this support are: -/// +/// /// - If the gesture has %GTK_PHASE_NONE, ensuring events of type /// %GDK_TOUCHPAD_SWIPE and %GDK_TOUCHPAD_PINCH are handled by the `GtkGesture` open class Gesture: EventController { + public override func registerSignals() { - super.registerSignals() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "begin", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.begin?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "cancel", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.cancel?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "end", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.end?(self, param0) - } - - let handler3: - @convention(c) ( - UnsafeMutableRawPointer, OpaquePointer, GtkEventSequenceState, - UnsafeMutableRawPointer - ) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "sequence-state-changed", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer, param1: GtkEventSequenceState) in - guard let self = self else { return } - self.sequenceStateChanged?(self, param0, param1) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "update", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.update?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::n-points", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyNPoints?(self, param0) - } + super.registerSignals() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Emitted when the gesture is recognized. - /// - /// This means the number of touch sequences matches - /// [property@Gtk.Gesture:n-points]. - /// - /// Note: These conditions may also happen when an extra touch - /// (eg. a third touch on a 2-touches gesture) is lifted, in that - /// situation @sequence won't pertain to the current set of active - /// touches, so don't rely on this being true. - public var begin: ((Gesture, OpaquePointer) -> Void)? - - /// Emitted whenever a sequence is cancelled. - /// - /// This usually happens on active touches when - /// [method@Gtk.EventController.reset] is called on @gesture - /// (manually, due to grabs...), or the individual @sequence - /// was claimed by parent widgets' controllers (see - /// [method@Gtk.Gesture.set_sequence_state]). - /// - /// @gesture must forget everything about @sequence as in - /// response to this signal. - public var cancel: ((Gesture, OpaquePointer) -> Void)? - - /// Emitted when @gesture either stopped recognizing the event - /// sequences as something to be handled, or the number of touch - /// sequences became higher or lower than [property@Gtk.Gesture:n-points]. - /// - /// Note: @sequence might not pertain to the group of sequences that - /// were previously triggering recognition on @gesture (ie. a just - /// pressed touch sequence that exceeds [property@Gtk.Gesture:n-points]). - /// This situation may be detected by checking through - /// [method@Gtk.Gesture.handles_sequence]. - public var end: ((Gesture, OpaquePointer) -> Void)? - - /// Emitted whenever a sequence state changes. - /// - /// See [method@Gtk.Gesture.set_sequence_state] to know - /// more about the expectable sequence lifetimes. - public var sequenceStateChanged: ((Gesture, OpaquePointer, GtkEventSequenceState) -> Void)? - - /// Emitted whenever an event is handled while the gesture is recognized. - /// - /// @sequence is guaranteed to pertain to the set of active touches. - public var update: ((Gesture, OpaquePointer) -> Void)? - - public var notifyNPoints: ((Gesture, OpaquePointer) -> Void)? +addSignal(name: "begin", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.begin?(self, param0) } + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "cancel", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.cancel?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "end", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.end?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, GtkEventSequenceState, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + +addSignal(name: "sequence-state-changed", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer, param1: GtkEventSequenceState) in + guard let self = self else { return } + self.sequenceStateChanged?(self, param0, param1) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "update", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.update?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::n-points", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyNPoints?(self, param0) +} +} + + /// Emitted when the gesture is recognized. +/// +/// This means the number of touch sequences matches +/// [property@Gtk.Gesture:n-points]. +/// +/// Note: These conditions may also happen when an extra touch +/// (eg. a third touch on a 2-touches gesture) is lifted, in that +/// situation @sequence won't pertain to the current set of active +/// touches, so don't rely on this being true. +public var begin: ((Gesture, OpaquePointer) -> Void)? + +/// Emitted whenever a sequence is cancelled. +/// +/// This usually happens on active touches when +/// [method@Gtk.EventController.reset] is called on @gesture +/// (manually, due to grabs...), or the individual @sequence +/// was claimed by parent widgets' controllers (see +/// [method@Gtk.Gesture.set_sequence_state]). +/// +/// @gesture must forget everything about @sequence as in +/// response to this signal. +public var cancel: ((Gesture, OpaquePointer) -> Void)? + +/// Emitted when @gesture either stopped recognizing the event +/// sequences as something to be handled, or the number of touch +/// sequences became higher or lower than [property@Gtk.Gesture:n-points]. +/// +/// Note: @sequence might not pertain to the group of sequences that +/// were previously triggering recognition on @gesture (ie. a just +/// pressed touch sequence that exceeds [property@Gtk.Gesture:n-points]). +/// This situation may be detected by checking through +/// [method@Gtk.Gesture.handles_sequence]. +public var end: ((Gesture, OpaquePointer) -> Void)? + +/// Emitted whenever a sequence state changes. +/// +/// See [method@Gtk.Gesture.set_sequence_state] to know +/// more about the expectable sequence lifetimes. +public var sequenceStateChanged: ((Gesture, OpaquePointer, GtkEventSequenceState) -> Void)? + +/// Emitted whenever an event is handled while the gesture is recognized. +/// +/// @sequence is guaranteed to pertain to the set of active touches. +public var update: ((Gesture, OpaquePointer) -> Void)? + + +public var notifyNPoints: ((Gesture, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/GestureClick.swift b/Sources/Gtk/Generated/GestureClick.swift index f71c8f6c84..54cdd661b2 100644 --- a/Sources/Gtk/Generated/GestureClick.swift +++ b/Sources/Gtk/Generated/GestureClick.swift @@ -1,7 +1,7 @@ import CGtk /// Recognizes click gestures. -/// +/// /// It is able to recognize multiple clicks on a nearby zone, which /// can be listened for through the [signal@Gtk.GestureClick::pressed] /// signal. Whenever time or distance between clicks exceed the GTK @@ -9,83 +9,71 @@ import CGtk /// click counter is reset. open class GestureClick: GestureSingle { /// Returns a newly created `GtkGesture` that recognizes - /// single and multiple presses. - public convenience init() { - self.init( - gtk_gesture_click_new() - ) - } +/// single and multiple presses. +public convenience init() { + self.init( + gtk_gesture_click_new() + ) +} public override func registerSignals() { - super.registerSignals() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, Int, Double, Double, UnsafeMutableRawPointer) - -> Void = - { _, value1, value2, value3, data in - SignalBox3.run(data, value1, value2, value3) - } + super.registerSignals() - addSignal(name: "pressed", handler: gCallback(handler0)) { - [weak self] (param0: Int, param1: Double, param2: Double) in - guard let self = self else { return } - self.pressed?(self, param0, param1, param2) - } + let handler0: @convention(c) (UnsafeMutableRawPointer, Int, Double, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, value3, data in + SignalBox3.run(data, value1, value2, value3) + } - let handler1: - @convention(c) (UnsafeMutableRawPointer, Int, Double, Double, UnsafeMutableRawPointer) - -> Void = - { _, value1, value2, value3, data in - SignalBox3.run(data, value1, value2, value3) - } +addSignal(name: "pressed", handler: gCallback(handler0)) { [weak self] (param0: Int, param1: Double, param2: Double) in + guard let self = self else { return } + self.pressed?(self, param0, param1, param2) +} - addSignal(name: "released", handler: gCallback(handler1)) { - [weak self] (param0: Int, param1: Double, param2: Double) in - guard let self = self else { return } - self.released?(self, param0, param1, param2) - } +let handler1: @convention(c) (UnsafeMutableRawPointer, Int, Double, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, value3, data in + SignalBox3.run(data, value1, value2, value3) + } - addSignal(name: "stopped") { [weak self] () in - guard let self = self else { return } - self.stopped?(self) - } +addSignal(name: "released", handler: gCallback(handler1)) { [weak self] (param0: Int, param1: Double, param2: Double) in + guard let self = self else { return } + self.released?(self, param0, param1, param2) +} - let handler3: - @convention(c) ( - UnsafeMutableRawPointer, Double, Double, UInt, OpaquePointer, - UnsafeMutableRawPointer - ) -> Void = - { _, value1, value2, value3, value4, data in - SignalBox4.run( - data, value1, value2, value3, value4) - } +addSignal(name: "stopped") { [weak self] () in + guard let self = self else { return } + self.stopped?(self) +} - addSignal(name: "unpaired-release", handler: gCallback(handler3)) { - [weak self] (param0: Double, param1: Double, param2: UInt, param3: OpaquePointer) in - guard let self = self else { return } - self.unpairedRelease?(self, param0, param1, param2, param3) - } +let handler3: @convention(c) (UnsafeMutableRawPointer, Double, Double, UInt, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, value3, value4, data in + SignalBox4.run(data, value1, value2, value3, value4) } +addSignal(name: "unpaired-release", handler: gCallback(handler3)) { [weak self] (param0: Double, param1: Double, param2: UInt, param3: OpaquePointer) in + guard let self = self else { return } + self.unpairedRelease?(self, param0, param1, param2, param3) +} +} + /// Emitted whenever a button or touch press happens. - public var pressed: ((GestureClick, Int, Double, Double) -> Void)? +public var pressed: ((GestureClick, Int, Double, Double) -> Void)? - /// Emitted when a button or touch is released. - /// - /// @n_press will report the number of press that is paired to - /// this event, note that [signal@Gtk.GestureClick::stopped] may - /// have been emitted between the press and its release, @n_press - /// will only start over at the next press. - public var released: ((GestureClick, Int, Double, Double) -> Void)? +/// Emitted when a button or touch is released. +/// +/// @n_press will report the number of press that is paired to +/// this event, note that [signal@Gtk.GestureClick::stopped] may +/// have been emitted between the press and its release, @n_press +/// will only start over at the next press. +public var released: ((GestureClick, Int, Double, Double) -> Void)? - /// Emitted whenever any time/distance threshold has been exceeded. - public var stopped: ((GestureClick) -> Void)? +/// Emitted whenever any time/distance threshold has been exceeded. +public var stopped: ((GestureClick) -> Void)? - /// Emitted whenever the gesture receives a release - /// event that had no previous corresponding press. - /// - /// Due to implicit grabs, this can only happen on situations - /// where input is grabbed elsewhere mid-press or the pressed - /// widget voluntarily relinquishes its implicit grab. - public var unpairedRelease: ((GestureClick, Double, Double, UInt, OpaquePointer) -> Void)? -} +/// Emitted whenever the gesture receives a release +/// event that had no previous corresponding press. +/// +/// Due to implicit grabs, this can only happen on situations +/// where input is grabbed elsewhere mid-press or the pressed +/// widget voluntarily relinquishes its implicit grab. +public var unpairedRelease: ((GestureClick, Double, Double, UInt, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/GestureLongPress.swift b/Sources/Gtk/Generated/GestureLongPress.swift index ee0eaaa4df..5adcd3ef4d 100644 --- a/Sources/Gtk/Generated/GestureLongPress.swift +++ b/Sources/Gtk/Generated/GestureLongPress.swift @@ -1,72 +1,68 @@ import CGtk /// Recognizes long press gestures. -/// +/// /// This gesture is also known as “Press and Hold”. -/// +/// /// When the timeout is exceeded, the gesture is triggering the /// [signal@Gtk.GestureLongPress::pressed] signal. -/// +/// /// If the touchpoint is lifted before the timeout passes, or if /// it drifts too far of the initial press point, the /// [signal@Gtk.GestureLongPress::cancelled] signal will be emitted. -/// +/// /// How long the timeout is before the ::pressed signal gets emitted is /// determined by the [property@Gtk.Settings:gtk-long-press-time] setting. /// It can be modified by the [property@Gtk.GestureLongPress:delay-factor] /// property. open class GestureLongPress: GestureSingle { /// Returns a newly created `GtkGesture` that recognizes long presses. - public convenience init() { - self.init( - gtk_gesture_long_press_new() - ) - } +public convenience init() { + self.init( + gtk_gesture_long_press_new() + ) +} public override func registerSignals() { - super.registerSignals() - - addSignal(name: "cancelled") { [weak self] () in - guard let self = self else { return } - self.cancelled?(self) - } + super.registerSignals() - let handler1: - @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> - Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } + addSignal(name: "cancelled") { [weak self] () in + guard let self = self else { return } + self.cancelled?(self) +} - addSignal(name: "pressed", handler: gCallback(handler1)) { - [weak self] (param0: Double, param1: Double) in - guard let self = self else { return } - self.pressed?(self, param0, param1) - } +let handler1: @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } +addSignal(name: "pressed", handler: gCallback(handler1)) { [weak self] (param0: Double, param1: Double) in + guard let self = self else { return } + self.pressed?(self, param0, param1) +} - addSignal(name: "notify::delay-factor", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDelayFactor?(self, param0) - } +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::delay-factor", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDelayFactor?(self, param0) +} +} + /// Factor by which to modify the default timeout. - @GObjectProperty(named: "delay-factor") public var delayFactor: Double +@GObjectProperty(named: "delay-factor") public var delayFactor: Double - /// Emitted whenever a press moved too far, or was released - /// before [signal@Gtk.GestureLongPress::pressed] happened. - public var cancelled: ((GestureLongPress) -> Void)? +/// Emitted whenever a press moved too far, or was released +/// before [signal@Gtk.GestureLongPress::pressed] happened. +public var cancelled: ((GestureLongPress) -> Void)? - /// Emitted whenever a press goes unmoved/unreleased longer than - /// what the GTK defaults tell. - public var pressed: ((GestureLongPress, Double, Double) -> Void)? +/// Emitted whenever a press goes unmoved/unreleased longer than +/// what the GTK defaults tell. +public var pressed: ((GestureLongPress, Double, Double) -> Void)? - public var notifyDelayFactor: ((GestureLongPress, OpaquePointer) -> Void)? -} + +public var notifyDelayFactor: ((GestureLongPress, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/GestureSingle.swift b/Sources/Gtk/Generated/GestureSingle.swift index c131329c8a..8bb88f0de6 100644 --- a/Sources/Gtk/Generated/GestureSingle.swift +++ b/Sources/Gtk/Generated/GestureSingle.swift @@ -1,11 +1,11 @@ import CGtk /// A `GtkGesture` subclass optimized for singe-touch and mouse gestures. -/// +/// /// Under interaction, these gestures stick to the first interacting sequence, /// which is accessible through [method@Gtk.GestureSingle.get_current_sequence] /// while the gesture is being interacted with. -/// +/// /// By default gestures react to both %GDK_BUTTON_PRIMARY and touch events. /// [method@Gtk.GestureSingle.set_touch_only] can be used to change the /// touch behavior. Callers may also specify a different mouse button number @@ -14,61 +14,59 @@ import CGtk /// button being currently pressed can be known through /// [method@Gtk.GestureSingle.get_current_button]. open class GestureSingle: Gesture { + public override func registerSignals() { - super.registerSignals() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::button", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyButton?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::exclusive", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExclusive?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::touch-only", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTouchOnly?(self, param0) - } + super.registerSignals() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::button", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyButton?(self, param0) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::exclusive", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExclusive?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::touch-only", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTouchOnly?(self, param0) +} +} + /// Mouse button number to listen to, or 0 to listen for any button. - @GObjectProperty(named: "button") public var button: UInt +@GObjectProperty(named: "button") public var button: UInt - /// Whether the gesture is exclusive. - /// - /// Exclusive gestures only listen to pointer and pointer emulated events. - @GObjectProperty(named: "exclusive") public var exclusive: Bool +/// Whether the gesture is exclusive. +/// +/// Exclusive gestures only listen to pointer and pointer emulated events. +@GObjectProperty(named: "exclusive") public var exclusive: Bool - /// Whether the gesture handles only touch events. - @GObjectProperty(named: "touch-only") public var touchOnly: Bool +/// Whether the gesture handles only touch events. +@GObjectProperty(named: "touch-only") public var touchOnly: Bool - public var notifyButton: ((GestureSingle, OpaquePointer) -> Void)? - public var notifyExclusive: ((GestureSingle, OpaquePointer) -> Void)? +public var notifyButton: ((GestureSingle, OpaquePointer) -> Void)? - public var notifyTouchOnly: ((GestureSingle, OpaquePointer) -> Void)? -} + +public var notifyExclusive: ((GestureSingle, OpaquePointer) -> Void)? + + +public var notifyTouchOnly: ((GestureSingle, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/IconSize.swift b/Sources/Gtk/Generated/IconSize.swift index d16dd7398f..d1fb16ba73 100644 --- a/Sources/Gtk/Generated/IconSize.swift +++ b/Sources/Gtk/Generated/IconSize.swift @@ -1,10 +1,10 @@ import CGtk /// Built-in icon sizes. -/// +/// /// Icon sizes default to being inherited. Where they cannot be /// inherited, text size is the default. -/// +/// /// All widgets which use `GtkIconSize` set the normal-icons or /// large-icons style classes correspondingly, and let themes /// determine the actual size to be used with the @@ -13,24 +13,24 @@ public enum IconSize: GValueRepresentableEnum { public typealias GtkEnum = GtkIconSize /// Keep the size of the parent element - case inherit - /// Size similar to text size - case normal - /// Large size, for example in an icon view - case large +case inherit +/// Size similar to text size +case normal +/// Large size, for example in an icon view +case large public static var type: GType { - gtk_icon_size_get_type() - } + gtk_icon_size_get_type() +} public init(from gtkEnum: GtkIconSize) { switch gtkEnum { case GTK_ICON_SIZE_INHERIT: - self = .inherit - case GTK_ICON_SIZE_NORMAL: - self = .normal - case GTK_ICON_SIZE_LARGE: - self = .large + self = .inherit +case GTK_ICON_SIZE_NORMAL: + self = .normal +case GTK_ICON_SIZE_LARGE: + self = .large default: fatalError("Unsupported GtkIconSize enum value: \(gtkEnum.rawValue)") } @@ -39,11 +39,11 @@ public enum IconSize: GValueRepresentableEnum { public func toGtk() -> GtkIconSize { switch self { case .inherit: - return GTK_ICON_SIZE_INHERIT - case .normal: - return GTK_ICON_SIZE_NORMAL - case .large: - return GTK_ICON_SIZE_LARGE + return GTK_ICON_SIZE_INHERIT +case .normal: + return GTK_ICON_SIZE_NORMAL +case .large: + return GTK_ICON_SIZE_LARGE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/IconThemeError.swift b/Sources/Gtk/Generated/IconThemeError.swift index 537df0dc54..5a152db246 100644 --- a/Sources/Gtk/Generated/IconThemeError.swift +++ b/Sources/Gtk/Generated/IconThemeError.swift @@ -5,20 +5,20 @@ public enum IconThemeError: GValueRepresentableEnum { public typealias GtkEnum = GtkIconThemeError /// The icon specified does not exist in the theme - case notFound - /// An unspecified error occurred. - case failed +case notFound +/// An unspecified error occurred. +case failed public static var type: GType { - gtk_icon_theme_error_get_type() - } + gtk_icon_theme_error_get_type() +} public init(from gtkEnum: GtkIconThemeError) { switch gtkEnum { case GTK_ICON_THEME_NOT_FOUND: - self = .notFound - case GTK_ICON_THEME_FAILED: - self = .failed + self = .notFound +case GTK_ICON_THEME_FAILED: + self = .failed default: fatalError("Unsupported GtkIconThemeError enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ public enum IconThemeError: GValueRepresentableEnum { public func toGtk() -> GtkIconThemeError { switch self { case .notFound: - return GTK_ICON_THEME_NOT_FOUND - case .failed: - return GTK_ICON_THEME_FAILED + return GTK_ICON_THEME_NOT_FOUND +case .failed: + return GTK_ICON_THEME_FAILED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/IconViewDropPosition.swift b/Sources/Gtk/Generated/IconViewDropPosition.swift index b6c709f411..3f3b74fba7 100644 --- a/Sources/Gtk/Generated/IconViewDropPosition.swift +++ b/Sources/Gtk/Generated/IconViewDropPosition.swift @@ -5,36 +5,36 @@ public enum IconViewDropPosition: GValueRepresentableEnum { public typealias GtkEnum = GtkIconViewDropPosition /// No drop possible - case noDrop - /// Dropped item replaces the item - case dropInto - /// Dropped item is inserted to the left - case dropLeft - /// Dropped item is inserted to the right - case dropRight - /// Dropped item is inserted above - case dropAbove - /// Dropped item is inserted below - case dropBelow +case noDrop +/// Dropped item replaces the item +case dropInto +/// Dropped item is inserted to the left +case dropLeft +/// Dropped item is inserted to the right +case dropRight +/// Dropped item is inserted above +case dropAbove +/// Dropped item is inserted below +case dropBelow public static var type: GType { - gtk_icon_view_drop_position_get_type() - } + gtk_icon_view_drop_position_get_type() +} public init(from gtkEnum: GtkIconViewDropPosition) { switch gtkEnum { case GTK_ICON_VIEW_NO_DROP: - self = .noDrop - case GTK_ICON_VIEW_DROP_INTO: - self = .dropInto - case GTK_ICON_VIEW_DROP_LEFT: - self = .dropLeft - case GTK_ICON_VIEW_DROP_RIGHT: - self = .dropRight - case GTK_ICON_VIEW_DROP_ABOVE: - self = .dropAbove - case GTK_ICON_VIEW_DROP_BELOW: - self = .dropBelow + self = .noDrop +case GTK_ICON_VIEW_DROP_INTO: + self = .dropInto +case GTK_ICON_VIEW_DROP_LEFT: + self = .dropLeft +case GTK_ICON_VIEW_DROP_RIGHT: + self = .dropRight +case GTK_ICON_VIEW_DROP_ABOVE: + self = .dropAbove +case GTK_ICON_VIEW_DROP_BELOW: + self = .dropBelow default: fatalError("Unsupported GtkIconViewDropPosition enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ public enum IconViewDropPosition: GValueRepresentableEnum { public func toGtk() -> GtkIconViewDropPosition { switch self { case .noDrop: - return GTK_ICON_VIEW_NO_DROP - case .dropInto: - return GTK_ICON_VIEW_DROP_INTO - case .dropLeft: - return GTK_ICON_VIEW_DROP_LEFT - case .dropRight: - return GTK_ICON_VIEW_DROP_RIGHT - case .dropAbove: - return GTK_ICON_VIEW_DROP_ABOVE - case .dropBelow: - return GTK_ICON_VIEW_DROP_BELOW + return GTK_ICON_VIEW_NO_DROP +case .dropInto: + return GTK_ICON_VIEW_DROP_INTO +case .dropLeft: + return GTK_ICON_VIEW_DROP_LEFT +case .dropRight: + return GTK_ICON_VIEW_DROP_RIGHT +case .dropAbove: + return GTK_ICON_VIEW_DROP_ABOVE +case .dropBelow: + return GTK_ICON_VIEW_DROP_BELOW } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Image.swift b/Sources/Gtk/Generated/Image.swift index 455f4f9772..c33bfbdeba 100644 --- a/Sources/Gtk/Generated/Image.swift +++ b/Sources/Gtk/Generated/Image.swift @@ -1,274 +1,272 @@ import CGtk /// Displays an image. -/// +/// /// picture>An example GtkImage -/// +/// /// Various kinds of object can be displayed as an image; most typically, /// you would load a `GdkTexture` from a file, using the convenience function /// [ctor@Gtk.Image.new_from_file], for instance: -/// +/// /// ```c /// GtkWidget *image = gtk_image_new_from_file ("myfile.png"); /// ``` -/// +/// /// If the file isn’t loaded successfully, the image will contain a /// “broken image” icon similar to that used in many web browsers. -/// -/// If you want to handle errors in loading the file yourself, -/// for example by displaying an error message, then load the image with -/// [ctor@Gdk.Texture.new_from_file], then create the `GtkImage` with +/// +/// If you want to handle errors in loading the file yourself, for example +/// by displaying an error message, then load the image with an image +/// loading framework such as libglycin, then create the `GtkImage` with /// [ctor@Gtk.Image.new_from_paintable]. -/// +/// /// Sometimes an application will want to avoid depending on external data /// files, such as image files. See the documentation of `GResource` inside /// GIO, for details. In this case, [property@Gtk.Image:resource], /// [ctor@Gtk.Image.new_from_resource], and [method@Gtk.Image.set_from_resource] /// should be used. -/// +/// /// `GtkImage` displays its image as an icon, with a size that is determined /// by the application. See [class@Gtk.Picture] if you want to show an image /// at is actual size. -/// +/// /// ## CSS nodes -/// +/// /// `GtkImage` has a single CSS node with the name `image`. The style classes /// `.normal-icons` or `.large-icons` may appear, depending on the /// [property@Gtk.Image:icon-size] property. -/// +/// /// ## Accessibility -/// +/// /// `GtkImage` uses the [enum@Gtk.AccessibleRole.img] role. open class Image: Widget { /// Creates a new empty `GtkImage` widget. - public convenience init() { - self.init( - gtk_image_new() - ) +public convenience init() { + self.init( + gtk_image_new() + ) +} + +/// Creates a new `GtkImage` displaying the file @filename. +/// +/// If the file isn’t found or can’t be loaded, the resulting `GtkImage` +/// will display a “broken image” icon. This function never returns %NULL, +/// it always returns a valid `GtkImage` widget. +/// +/// If you need to detect failures to load the file, use an +/// image loading framework such as libglycin to load the file +/// yourself, then create the `GtkImage` from the texture. +/// +/// The storage type (see [method@Gtk.Image.get_storage_type]) +/// of the returned image is not defined, it will be whatever +/// is appropriate for displaying the file. +public convenience init(filename: String) { + self.init( + gtk_image_new_from_file(filename) + ) +} + +/// Creates a `GtkImage` displaying an icon from the current icon theme. +/// +/// If the icon name isn’t known, a “broken image” icon will be +/// displayed instead. If the current icon theme is changed, the icon +/// will be updated appropriately. +public convenience init(icon: OpaquePointer) { + self.init( + gtk_image_new_from_gicon(icon) + ) +} + +/// Creates a `GtkImage` displaying an icon from the current icon theme. +/// +/// If the icon name isn’t known, a “broken image” icon will be +/// displayed instead. If the current icon theme is changed, the icon +/// will be updated appropriately. +public convenience init(iconName: String) { + self.init( + gtk_image_new_from_icon_name(iconName) + ) +} + +/// Creates a new `GtkImage` displaying @paintable. +/// +/// The `GtkImage` does not assume a reference to the paintable; you still +/// need to unref it if you own references. `GtkImage` will add its own +/// reference rather than adopting yours. +/// +/// The `GtkImage` will track changes to the @paintable and update +/// its size and contents in response to it. +/// +/// Note that paintables are still subject to the icon size that is +/// set on the image. If you want to display a paintable at its intrinsic +/// size, use [class@Gtk.Picture] instead. +/// +/// If @paintable is a [iface@Gtk.SymbolicPaintable], then it will be +/// recolored with the symbolic palette from the theme. +public convenience init(paintable: OpaquePointer) { + self.init( + gtk_image_new_from_paintable(paintable) + ) +} + +/// Creates a new `GtkImage` displaying the resource file @resource_path. +/// +/// If the file isn’t found or can’t be loaded, the resulting `GtkImage` will +/// display a “broken image” icon. This function never returns %NULL, +/// it always returns a valid `GtkImage` widget. +/// +/// If you need to detect failures to load the file, use an +/// image loading framework such as libglycin to load the file +/// yourself, then create the `GtkImage` from the texture. +/// +/// The storage type (see [method@Gtk.Image.get_storage_type]) of +/// the returned image is not defined, it will be whatever is +/// appropriate for displaying the file. +public convenience init(resourcePath: String) { + self.init( + gtk_image_new_from_resource(resourcePath) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::file", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFile?(self, param0) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new `GtkImage` displaying the file @filename. - /// - /// If the file isn’t found or can’t be loaded, the resulting `GtkImage` - /// will display a “broken image” icon. This function never returns %NULL, - /// it always returns a valid `GtkImage` widget. - /// - /// If you need to detect failures to load the file, use - /// [ctor@Gdk.Texture.new_from_file] to load the file yourself, - /// then create the `GtkImage` from the texture. - /// - /// The storage type (see [method@Gtk.Image.get_storage_type]) - /// of the returned image is not defined, it will be whatever - /// is appropriate for displaying the file. - public convenience init(filename: String) { - self.init( - gtk_image_new_from_file(filename) - ) +addSignal(name: "notify::gicon", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyGicon?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::icon-name", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIconName?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a `GtkImage` displaying an icon from the current icon theme. - /// - /// If the icon name isn’t known, a “broken image” icon will be - /// displayed instead. If the current icon theme is changed, the icon - /// will be updated appropriately. - public convenience init(icon: OpaquePointer) { - self.init( - gtk_image_new_from_gicon(icon) - ) +addSignal(name: "notify::icon-size", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIconSize?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a `GtkImage` displaying an icon from the current icon theme. - /// - /// If the icon name isn’t known, a “broken image” icon will be - /// displayed instead. If the current icon theme is changed, the icon - /// will be updated appropriately. - public convenience init(iconName: String) { - self.init( - gtk_image_new_from_icon_name(iconName) - ) +addSignal(name: "notify::paintable", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPaintable?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new `GtkImage` displaying @paintable. - /// - /// The `GtkImage` does not assume a reference to the paintable; you still - /// need to unref it if you own references. `GtkImage` will add its own - /// reference rather than adopting yours. - /// - /// The `GtkImage` will track changes to the @paintable and update - /// its size and contents in response to it. - public convenience init(paintable: OpaquePointer) { - self.init( - gtk_image_new_from_paintable(paintable) - ) +addSignal(name: "notify::pixel-size", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPixelSize?(self, param0) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new `GtkImage` displaying the resource file @resource_path. - /// - /// If the file isn’t found or can’t be loaded, the resulting `GtkImage` will - /// display a “broken image” icon. This function never returns %NULL, - /// it always returns a valid `GtkImage` widget. - /// - /// If you need to detect failures to load the file, use - /// [ctor@GdkPixbuf.Pixbuf.new_from_file] to load the file yourself, - /// then create the `GtkImage` from the pixbuf. - /// - /// The storage type (see [method@Gtk.Image.get_storage_type]) of - /// the returned image is not defined, it will be whatever is - /// appropriate for displaying the file. - public convenience init(resourcePath: String) { - self.init( - gtk_image_new_from_resource(resourcePath) - ) +addSignal(name: "notify::resource", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyResource?(self, param0) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::file", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFile?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::gicon", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyGicon?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::icon-name", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIconName?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::icon-size", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIconSize?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::paintable", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPaintable?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::pixel-size", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPixelSize?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::resource", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyResource?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::storage-type", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyStorageType?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-fallback", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseFallback?(self, param0) - } +addSignal(name: "notify::storage-type", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyStorageType?(self, param0) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::use-fallback", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseFallback?(self, param0) +} +} + /// The name of the icon in the icon theme. - /// - /// If the icon theme is changed, the image will be updated automatically. - @GObjectProperty(named: "icon-name") public var iconName: String? +/// +/// If the icon theme is changed, the image will be updated automatically. +@GObjectProperty(named: "icon-name") public var iconName: String? - /// The symbolic size to display icons at. - @GObjectProperty(named: "icon-size") public var iconSize: IconSize +/// The symbolic size to display icons at. +@GObjectProperty(named: "icon-size") public var iconSize: IconSize - /// The `GdkPaintable` to display. - @GObjectProperty(named: "paintable") public var paintable: OpaquePointer? +/// The `GdkPaintable` to display. +@GObjectProperty(named: "paintable") public var paintable: OpaquePointer? - /// The size in pixels to display icons at. - /// - /// If set to a value != -1, this property overrides the - /// [property@Gtk.Image:icon-size] property for images of type - /// `GTK_IMAGE_ICON_NAME`. - @GObjectProperty(named: "pixel-size") public var pixelSize: Int +/// The size in pixels to display icons at. +/// +/// If set to a value != -1, this property overrides the +/// [property@Gtk.Image:icon-size] property for images of type +/// `GTK_IMAGE_ICON_NAME`. +@GObjectProperty(named: "pixel-size") public var pixelSize: Int - /// The representation being used for image data. - @GObjectProperty(named: "storage-type") public var storageType: ImageType +/// The representation being used for image data. +@GObjectProperty(named: "storage-type") public var storageType: ImageType - public var notifyFile: ((Image, OpaquePointer) -> Void)? - public var notifyGicon: ((Image, OpaquePointer) -> Void)? +public var notifyFile: ((Image, OpaquePointer) -> Void)? - public var notifyIconName: ((Image, OpaquePointer) -> Void)? - public var notifyIconSize: ((Image, OpaquePointer) -> Void)? +public var notifyGicon: ((Image, OpaquePointer) -> Void)? - public var notifyPaintable: ((Image, OpaquePointer) -> Void)? - public var notifyPixelSize: ((Image, OpaquePointer) -> Void)? +public var notifyIconName: ((Image, OpaquePointer) -> Void)? - public var notifyResource: ((Image, OpaquePointer) -> Void)? - public var notifyStorageType: ((Image, OpaquePointer) -> Void)? +public var notifyIconSize: ((Image, OpaquePointer) -> Void)? - public var notifyUseFallback: ((Image, OpaquePointer) -> Void)? -} + +public var notifyPaintable: ((Image, OpaquePointer) -> Void)? + + +public var notifyPixelSize: ((Image, OpaquePointer) -> Void)? + + +public var notifyResource: ((Image, OpaquePointer) -> Void)? + + +public var notifyStorageType: ((Image, OpaquePointer) -> Void)? + + +public var notifyUseFallback: ((Image, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ImageType.swift b/Sources/Gtk/Generated/ImageType.swift index 1adff5b1de..f34b0ae104 100644 --- a/Sources/Gtk/Generated/ImageType.swift +++ b/Sources/Gtk/Generated/ImageType.swift @@ -1,39 +1,39 @@ import CGtk /// Describes the image data representation used by a [class@Gtk.Image]. -/// +/// /// If you want to get the image from the widget, you can only get the /// currently-stored representation; for instance, if the gtk_image_get_storage_type() /// returns %GTK_IMAGE_PAINTABLE, then you can call gtk_image_get_paintable(). -/// +/// /// For empty images, you can request any storage type (call any of the "get" /// functions), but they will all return %NULL values. public enum ImageType: GValueRepresentableEnum { public typealias GtkEnum = GtkImageType /// There is no image displayed by the widget - case empty - /// The widget contains a named icon - case iconName - /// The widget contains a `GIcon` - case gicon - /// The widget contains a `GdkPaintable` - case paintable +case empty +/// The widget contains a named icon +case iconName +/// The widget contains a `GIcon` +case gicon +/// The widget contains a `GdkPaintable` +case paintable public static var type: GType { - gtk_image_type_get_type() - } + gtk_image_type_get_type() +} public init(from gtkEnum: GtkImageType) { switch gtkEnum { case GTK_IMAGE_EMPTY: - self = .empty - case GTK_IMAGE_ICON_NAME: - self = .iconName - case GTK_IMAGE_GICON: - self = .gicon - case GTK_IMAGE_PAINTABLE: - self = .paintable + self = .empty +case GTK_IMAGE_ICON_NAME: + self = .iconName +case GTK_IMAGE_GICON: + self = .gicon +case GTK_IMAGE_PAINTABLE: + self = .paintable default: fatalError("Unsupported GtkImageType enum value: \(gtkEnum.rawValue)") } @@ -42,13 +42,13 @@ public enum ImageType: GValueRepresentableEnum { public func toGtk() -> GtkImageType { switch self { case .empty: - return GTK_IMAGE_EMPTY - case .iconName: - return GTK_IMAGE_ICON_NAME - case .gicon: - return GTK_IMAGE_GICON - case .paintable: - return GTK_IMAGE_PAINTABLE + return GTK_IMAGE_EMPTY +case .iconName: + return GTK_IMAGE_ICON_NAME +case .gicon: + return GTK_IMAGE_GICON +case .paintable: + return GTK_IMAGE_PAINTABLE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/InputPurpose.swift b/Sources/Gtk/Generated/InputPurpose.swift index c18b9b1cad..e4ac62b696 100644 --- a/Sources/Gtk/Generated/InputPurpose.swift +++ b/Sources/Gtk/Generated/InputPurpose.swift @@ -1,78 +1,78 @@ import CGtk /// Describes primary purpose of the input widget. -/// +/// /// This information is useful for on-screen keyboards and similar input /// methods to decide which keys should be presented to the user. -/// +/// /// Note that the purpose is not meant to impose a totally strict rule /// about allowed characters, and does not replace input validation. /// It is fine for an on-screen keyboard to let the user override the /// character set restriction that is expressed by the purpose. The /// application is expected to validate the entry contents, even if /// it specified a purpose. -/// +/// /// The difference between %GTK_INPUT_PURPOSE_DIGITS and /// %GTK_INPUT_PURPOSE_NUMBER is that the former accepts only digits /// while the latter also some punctuation (like commas or points, plus, /// minus) and “e” or “E” as in 3.14E+000. -/// +/// /// This enumeration may be extended in the future; input methods should /// interpret unknown values as “free form”. public enum InputPurpose: GValueRepresentableEnum { public typealias GtkEnum = GtkInputPurpose /// Allow any character - case freeForm - /// Allow only alphabetic characters - case alpha - /// Allow only digits - case digits - /// Edited field expects numbers - case number - /// Edited field expects phone number - case phone - /// Edited field expects URL - case url - /// Edited field expects email address - case email - /// Edited field expects the name of a person - case name - /// Like %GTK_INPUT_PURPOSE_FREE_FORM, but characters are hidden - case password - /// Like %GTK_INPUT_PURPOSE_DIGITS, but characters are hidden - case pin - /// Allow any character, in addition to control codes - case terminal +case freeForm +/// Allow only alphabetic characters +case alpha +/// Allow only digits +case digits +/// Edited field expects numbers +case number +/// Edited field expects phone number +case phone +/// Edited field expects URL +case url +/// Edited field expects email address +case email +/// Edited field expects the name of a person +case name +/// Like %GTK_INPUT_PURPOSE_FREE_FORM, but characters are hidden +case password +/// Like %GTK_INPUT_PURPOSE_DIGITS, but characters are hidden +case pin +/// Allow any character, in addition to control codes +case terminal public static var type: GType { - gtk_input_purpose_get_type() - } + gtk_input_purpose_get_type() +} public init(from gtkEnum: GtkInputPurpose) { switch gtkEnum { case GTK_INPUT_PURPOSE_FREE_FORM: - self = .freeForm - case GTK_INPUT_PURPOSE_ALPHA: - self = .alpha - case GTK_INPUT_PURPOSE_DIGITS: - self = .digits - case GTK_INPUT_PURPOSE_NUMBER: - self = .number - case GTK_INPUT_PURPOSE_PHONE: - self = .phone - case GTK_INPUT_PURPOSE_URL: - self = .url - case GTK_INPUT_PURPOSE_EMAIL: - self = .email - case GTK_INPUT_PURPOSE_NAME: - self = .name - case GTK_INPUT_PURPOSE_PASSWORD: - self = .password - case GTK_INPUT_PURPOSE_PIN: - self = .pin - case GTK_INPUT_PURPOSE_TERMINAL: - self = .terminal + self = .freeForm +case GTK_INPUT_PURPOSE_ALPHA: + self = .alpha +case GTK_INPUT_PURPOSE_DIGITS: + self = .digits +case GTK_INPUT_PURPOSE_NUMBER: + self = .number +case GTK_INPUT_PURPOSE_PHONE: + self = .phone +case GTK_INPUT_PURPOSE_URL: + self = .url +case GTK_INPUT_PURPOSE_EMAIL: + self = .email +case GTK_INPUT_PURPOSE_NAME: + self = .name +case GTK_INPUT_PURPOSE_PASSWORD: + self = .password +case GTK_INPUT_PURPOSE_PIN: + self = .pin +case GTK_INPUT_PURPOSE_TERMINAL: + self = .terminal default: fatalError("Unsupported GtkInputPurpose enum value: \(gtkEnum.rawValue)") } @@ -81,27 +81,27 @@ public enum InputPurpose: GValueRepresentableEnum { public func toGtk() -> GtkInputPurpose { switch self { case .freeForm: - return GTK_INPUT_PURPOSE_FREE_FORM - case .alpha: - return GTK_INPUT_PURPOSE_ALPHA - case .digits: - return GTK_INPUT_PURPOSE_DIGITS - case .number: - return GTK_INPUT_PURPOSE_NUMBER - case .phone: - return GTK_INPUT_PURPOSE_PHONE - case .url: - return GTK_INPUT_PURPOSE_URL - case .email: - return GTK_INPUT_PURPOSE_EMAIL - case .name: - return GTK_INPUT_PURPOSE_NAME - case .password: - return GTK_INPUT_PURPOSE_PASSWORD - case .pin: - return GTK_INPUT_PURPOSE_PIN - case .terminal: - return GTK_INPUT_PURPOSE_TERMINAL + return GTK_INPUT_PURPOSE_FREE_FORM +case .alpha: + return GTK_INPUT_PURPOSE_ALPHA +case .digits: + return GTK_INPUT_PURPOSE_DIGITS +case .number: + return GTK_INPUT_PURPOSE_NUMBER +case .phone: + return GTK_INPUT_PURPOSE_PHONE +case .url: + return GTK_INPUT_PURPOSE_URL +case .email: + return GTK_INPUT_PURPOSE_EMAIL +case .name: + return GTK_INPUT_PURPOSE_NAME +case .password: + return GTK_INPUT_PURPOSE_PASSWORD +case .pin: + return GTK_INPUT_PURPOSE_PIN +case .terminal: + return GTK_INPUT_PURPOSE_TERMINAL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Justification.swift b/Sources/Gtk/Generated/Justification.swift index a8d21f5f87..334fad46ff 100644 --- a/Sources/Gtk/Generated/Justification.swift +++ b/Sources/Gtk/Generated/Justification.swift @@ -5,28 +5,28 @@ public enum Justification: GValueRepresentableEnum { public typealias GtkEnum = GtkJustification /// The text is placed at the left edge of the label. - case left - /// The text is placed at the right edge of the label. - case right - /// The text is placed in the center of the label. - case center - /// The text is placed is distributed across the label. - case fill +case left +/// The text is placed at the right edge of the label. +case right +/// The text is placed in the center of the label. +case center +/// The text is placed is distributed across the label. +case fill public static var type: GType { - gtk_justification_get_type() - } + gtk_justification_get_type() +} public init(from gtkEnum: GtkJustification) { switch gtkEnum { case GTK_JUSTIFY_LEFT: - self = .left - case GTK_JUSTIFY_RIGHT: - self = .right - case GTK_JUSTIFY_CENTER: - self = .center - case GTK_JUSTIFY_FILL: - self = .fill + self = .left +case GTK_JUSTIFY_RIGHT: + self = .right +case GTK_JUSTIFY_CENTER: + self = .center +case GTK_JUSTIFY_FILL: + self = .fill default: fatalError("Unsupported GtkJustification enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum Justification: GValueRepresentableEnum { public func toGtk() -> GtkJustification { switch self { case .left: - return GTK_JUSTIFY_LEFT - case .right: - return GTK_JUSTIFY_RIGHT - case .center: - return GTK_JUSTIFY_CENTER - case .fill: - return GTK_JUSTIFY_FILL + return GTK_JUSTIFY_LEFT +case .right: + return GTK_JUSTIFY_RIGHT +case .center: + return GTK_JUSTIFY_CENTER +case .fill: + return GTK_JUSTIFY_FILL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Label.swift b/Sources/Gtk/Generated/Label.swift index f1e759cca0..0cba1191aa 100644 --- a/Sources/Gtk/Generated/Label.swift +++ b/Sources/Gtk/Generated/Label.swift @@ -1,32 +1,32 @@ import CGtk /// Displays a small amount of text. -/// +/// /// Most labels are used to label another widget (such as an [class@Entry]). -/// +/// /// An example GtkLabel -/// +/// /// ## Shortcuts and Gestures -/// +/// /// `GtkLabel` supports the following keyboard shortcuts, when the cursor is /// visible: -/// +/// /// - Shift+F10 or Menu opens the context menu. /// - Ctrl+A or Ctrl+/ /// selects all. /// - Ctrl+Shift+A or /// Ctrl+\ unselects all. -/// +/// /// Additionally, the following signals have default keybindings: -/// +/// /// - [signal@Gtk.Label::activate-current-link] /// - [signal@Gtk.Label::copy-clipboard] /// - [signal@Gtk.Label::move-cursor] -/// +/// /// ## Actions -/// +/// /// `GtkLabel` defines a set of built-in actions: -/// +/// /// - `clipboard.copy` copies the text to the clipboard. /// - `clipboard.cut` doesn't do anything, since text in labels can't be deleted. /// - `clipboard.paste` doesn't do anything, since text in labels can't be @@ -39,9 +39,9 @@ import CGtk /// deleted. /// - `selection.select-all` selects all of the text, if the label allows /// selection. -/// +/// /// ## CSS nodes -/// +/// /// ``` /// label /// ├── [selection] @@ -49,103 +49,103 @@ import CGtk /// ┊ /// ╰── [link] /// ``` -/// +/// /// `GtkLabel` has a single CSS node with the name label. A wide variety /// of style classes may be applied to labels, such as .title, .subtitle, /// .dim-label, etc. In the `GtkShortcutsWindow`, labels are used with the /// .keycap style class. -/// +/// /// If the label has a selection, it gets a subnode with name selection. -/// +/// /// If the label has links, there is one subnode per link. These subnodes /// carry the link or visited state depending on whether they have been /// visited. In this case, label node also gets a .link style class. -/// +/// /// ## GtkLabel as GtkBuildable -/// +/// /// The GtkLabel implementation of the GtkBuildable interface supports a /// custom `` element, which supports any number of `` /// elements. The `` element has attributes named “name“, “value“, /// “start“ and “end“ and allows you to specify [struct@Pango.Attribute] /// values for this label. -/// +/// /// An example of a UI definition fragment specifying Pango attributes: -/// +/// /// ```xml /// /// ``` -/// +/// /// The start and end attributes specify the range of characters to which the /// Pango attribute applies. If start and end are not specified, the attribute is /// applied to the whole text. Note that specifying ranges does not make much /// sense with translatable attributes. Use markup embedded in the translatable /// content instead. -/// +/// /// ## Accessibility -/// +/// /// `GtkLabel` uses the [enum@Gtk.AccessibleRole.label] role. -/// +/// /// ## Mnemonics -/// +/// /// Labels may contain “mnemonics”. Mnemonics are underlined characters in the /// label, used for keyboard navigation. Mnemonics are created by providing a /// string with an underscore before the mnemonic character, such as `"_File"`, /// to the functions [ctor@Gtk.Label.new_with_mnemonic] or /// [method@Gtk.Label.set_text_with_mnemonic]. -/// +/// /// Mnemonics automatically activate any activatable widget the label is /// inside, such as a [class@Gtk.Button]; if the label is not inside the /// mnemonic’s target widget, you have to tell the label about the target /// using [method@Gtk.Label.set_mnemonic_widget]. -/// +/// /// Here’s a simple example where the label is inside a button: -/// +/// /// ```c /// // Pressing Alt+H will activate this button /// GtkWidget *button = gtk_button_new (); /// GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello"); /// gtk_button_set_child (GTK_BUTTON (button), label); /// ``` -/// +/// /// There’s a convenience function to create buttons with a mnemonic label /// already inside: -/// +/// /// ```c /// // Pressing Alt+H will activate this button /// GtkWidget *button = gtk_button_new_with_mnemonic ("_Hello"); /// ``` -/// +/// /// To create a mnemonic for a widget alongside the label, such as a /// [class@Gtk.Entry], you have to point the label at the entry with /// [method@Gtk.Label.set_mnemonic_widget]: -/// +/// /// ```c /// // Pressing Alt+H will focus the entry /// GtkWidget *entry = gtk_entry_new (); /// GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello"); /// gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry); /// ``` -/// +/// /// ## Markup (styled text) -/// +/// /// To make it easy to format text in a label (changing colors, fonts, etc.), /// label text can be provided in a simple markup format: -/// +/// /// Here’s how to create a label with a small font: /// ```c /// GtkWidget *label = gtk_label_new (NULL); /// gtk_label_set_markup (GTK_LABEL (label), "Small text"); /// ``` -/// +/// /// (See the Pango manual for complete documentation] of available /// tags, [func@Pango.parse_markup]) -/// +/// /// The markup passed to [method@Gtk.Label.set_markup] must be valid XML; for example, /// literal `<`, `>` and `&` characters must be escaped as `<`, `>`, and `&`. /// If you pass text obtained from the user, file, or a network to /// [method@Gtk.Label.set_markup], you’ll want to escape it with /// [func@GLib.markup_escape_text] or [func@GLib.markup_printf_escaped]. -/// +/// /// Markup strings are just a convenient way to set the [struct@Pango.AttrList] /// on a label; [method@Gtk.Label.set_attributes] may be a simpler way to set /// attributes in some cases. Be careful though; [struct@Pango.AttrList] tends @@ -154,28 +154,28 @@ import CGtk /// to [0, `G_MAXINT`)). The reason is that specifying the `start_index` and /// `end_index` for a [struct@Pango.Attribute] requires knowledge of the exact /// string being displayed, so translations will cause problems. -/// +/// /// ## Selectable labels -/// +/// /// Labels can be made selectable with [method@Gtk.Label.set_selectable]. /// Selectable labels allow the user to copy the label contents to the /// clipboard. Only labels that contain useful-to-copy information — such /// as error messages — should be made selectable. -/// +/// /// ## Text layout -/// +/// /// A label can contain any number of paragraphs, but will have /// performance problems if it contains more than a small number. /// Paragraphs are separated by newlines or other paragraph separators /// understood by Pango. -/// +/// /// Labels can automatically wrap text if you call [method@Gtk.Label.set_wrap]. -/// +/// /// [method@Gtk.Label.set_justify] sets how the lines in a label align /// with one another. If you want to set how the label as a whole aligns /// in its available space, see the [property@Gtk.Widget:halign] and /// [property@Gtk.Widget:valign] properties. -/// +/// /// The [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] /// properties can be used to control the size allocation of ellipsized or /// wrapped labels. For ellipsizing labels, if either is specified (and less @@ -184,18 +184,18 @@ import CGtk /// width-chars is used as the minimum width, if specified, and max-width-chars /// is used as the natural width. Even if max-width-chars specified, wrapping /// labels will be rewrapped to use all of the available width. -/// +/// /// ## Links -/// +/// /// GTK supports markup for clickable hyperlinks in addition to regular Pango /// markup. The markup for links is borrowed from HTML, using the `` tag /// with “href“, “title“ and “class“ attributes. GTK renders links similar to /// the way they appear in web browsers, with colored, underlined text. The /// “title“ attribute is displayed as a tooltip on the link. The “class“ /// attribute is used as style class on the CSS node for the link. -/// +/// /// An example of inline links looks like this: -/// +/// /// ```c /// const char *text = /// "Go to the " @@ -204,481 +204,455 @@ import CGtk /// GtkWidget *label = gtk_label_new (NULL); /// gtk_label_set_markup (GTK_LABEL (label), text); /// ``` -/// +/// /// It is possible to implement custom handling for links and their tooltips /// with the [signal@Gtk.Label::activate-link] signal and the /// [method@Gtk.Label.get_current_uri] function. open class Label: Widget { /// Creates a new label with the given text inside it. - /// - /// You can pass `NULL` to get an empty label widget. - public convenience init(string: String) { - self.init( - gtk_label_new(string) - ) +/// +/// You can pass `NULL` to get an empty label widget. +public convenience init(string: String) { + self.init( + gtk_label_new(string) + ) +} + +/// Creates a new label with the given text inside it, and a mnemonic. +/// +/// If characters in @str are preceded by an underscore, they are +/// underlined. If you need a literal underscore character in a label, use +/// '__' (two underscores). The first underlined character represents a +/// keyboard accelerator called a mnemonic. The mnemonic key can be used +/// to activate another widget, chosen automatically, or explicitly using +/// [method@Gtk.Label.set_mnemonic_widget]. +/// +/// If [method@Gtk.Label.set_mnemonic_widget] is not called, then the first +/// activatable ancestor of the label will be chosen as the mnemonic +/// widget. For instance, if the label is inside a button or menu item, +/// the button or menu item will automatically become the mnemonic widget +/// and be activated by the mnemonic. +public convenience init(mnemonic string: String) { + self.init( + gtk_label_new_with_mnemonic(string) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate-current-link") { [weak self] () in + guard let self = self else { return } + self.activateCurrentLink?(self) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1>.run(data, value1) } - /// Creates a new label with the given text inside it, and a mnemonic. - /// - /// If characters in @str are preceded by an underscore, they are - /// underlined. If you need a literal underscore character in a label, use - /// '__' (two underscores). The first underlined character represents a - /// keyboard accelerator called a mnemonic. The mnemonic key can be used - /// to activate another widget, chosen automatically, or explicitly using - /// [method@Gtk.Label.set_mnemonic_widget]. - /// - /// If [method@Gtk.Label.set_mnemonic_widget] is not called, then the first - /// activatable ancestor of the label will be chosen as the mnemonic - /// widget. For instance, if the label is inside a button or menu item, - /// the button or menu item will automatically become the mnemonic widget - /// and be activated by the mnemonic. - public convenience init(mnemonic string: String) { - self.init( - gtk_label_new_with_mnemonic(string) - ) +addSignal(name: "activate-link", handler: gCallback(handler1)) { [weak self] (param0: UnsafePointer) in + guard let self = self else { return } + self.activateLink?(self, param0) +} + +addSignal(name: "copy-clipboard") { [weak self] () in + guard let self = self else { return } + self.copyClipboard?(self) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, value3, data in + SignalBox3.run(data, value1, value2, value3) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate-current-link") { [weak self] () in - guard let self = self else { return } - self.activateCurrentLink?(self) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) - -> Void = - { _, value1, data in - SignalBox1>.run(data, value1) - } - - addSignal(name: "activate-link", handler: gCallback(handler1)) { - [weak self] (param0: UnsafePointer) in - guard let self = self else { return } - self.activateLink?(self, param0) - } - - addSignal(name: "copy-clipboard") { [weak self] () in - guard let self = self else { return } - self.copyClipboard?(self) - } - - let handler3: - @convention(c) ( - UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, UnsafeMutableRawPointer - ) -> Void = - { _, value1, value2, value3, data in - SignalBox3.run(data, value1, value2, value3) - } - - addSignal(name: "move-cursor", handler: gCallback(handler3)) { - [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool) in - guard let self = self else { return } - self.moveCursor?(self, param0, param1, param2) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::attributes", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAttributes?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::ellipsize", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEllipsize?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::extra-menu", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExtraMenu?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::justify", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyJustify?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::label", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLabel?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::lines", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLines?(self, param0) - } - - let handler10: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::max-width-chars", handler: gCallback(handler10)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMaxWidthChars?(self, param0) - } - - let handler11: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::mnemonic-keyval", handler: gCallback(handler11)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMnemonicKeyval?(self, param0) - } - - let handler12: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::natural-wrap-mode", handler: gCallback(handler12)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyNaturalWrapMode?(self, param0) - } - - let handler13: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::selectable", handler: gCallback(handler13)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectable?(self, param0) - } - - let handler14: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::single-line-mode", handler: gCallback(handler14)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySingleLineMode?(self, param0) - } - - let handler15: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::tabs", handler: gCallback(handler15)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTabs?(self, param0) - } - - let handler16: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-markup", handler: gCallback(handler16)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseMarkup?(self, param0) - } - - let handler17: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-underline", handler: gCallback(handler17)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseUnderline?(self, param0) - } - - let handler18: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::width-chars", handler: gCallback(handler18)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWidthChars?(self, param0) - } - - let handler19: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::wrap", handler: gCallback(handler19)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWrap?(self, param0) - } - - let handler20: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::wrap-mode", handler: gCallback(handler20)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWrapMode?(self, param0) - } - - let handler21: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::xalign", handler: gCallback(handler21)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyXalign?(self, param0) - } - - let handler22: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::yalign", handler: gCallback(handler22)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyYalign?(self, param0) - } +addSignal(name: "move-cursor", handler: gCallback(handler3)) { [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool) in + guard let self = self else { return } + self.moveCursor?(self, param0, param1, param2) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// The alignment of the lines in the text of the label, relative to each other. - /// - /// This does *not* affect the alignment of the label within its allocation. - /// See [property@Gtk.Label:xalign] for that. - @GObjectProperty(named: "justify") public var justify: Justification - - /// The contents of the label. - /// - /// If the string contains Pango markup (see [func@Pango.parse_markup]), - /// you will have to set the [property@Gtk.Label:use-markup] property to - /// true in order for the label to display the markup attributes. See also - /// [method@Gtk.Label.set_markup] for a convenience function that sets both - /// this property and the [property@Gtk.Label:use-markup] property at the - /// same time. - /// - /// If the string contains underlines acting as mnemonics, you will have to - /// set the [property@Gtk.Label:use-underline] property to true in order - /// for the label to display them. - @GObjectProperty(named: "label") public var label: String - - /// The number of lines to which an ellipsized, wrapping label - /// should display before it gets ellipsized. This both prevents the label - /// from ellipsizing before this many lines are displayed, and limits the - /// height request of the label to this many lines. - /// - /// ::: warning - /// Setting this property has unintuitive and unfortunate consequences - /// for the minimum _width_ of the label. Specifically, if the height - /// of the label is such that it fits a smaller number of lines than - /// the value of this property, the label can not be ellipsized at all, - /// which means it must be wide enough to fit all the text fully. - /// - /// This property has no effect if the label is not wrapping or ellipsized. - /// - /// Set this property to -1 if you don't want to limit the number of lines. - @GObjectProperty(named: "lines") public var lines: Int - - /// The desired maximum width of the label, in characters. - /// - /// If this property is set to -1, the width will be calculated automatically. - /// - /// See the section on [text layout](class.Label.html#text-layout) for details - /// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] - /// determine the width of ellipsized and wrapped labels. - @GObjectProperty(named: "max-width-chars") public var maxWidthChars: Int - - /// The mnemonic accelerator key for the label. - @GObjectProperty(named: "mnemonic-keyval") public var mnemonicKeyval: UInt - - /// Whether the label text can be selected with the mouse. - @GObjectProperty(named: "selectable") public var selectable: Bool - - /// Whether the label is in single line mode. - /// - /// In single line mode, the height of the label does not depend on the - /// actual text, it is always set to ascent + descent of the font. This - /// can be an advantage in situations where resizing the label because - /// of text changes would be distracting, e.g. in a statusbar. - @GObjectProperty(named: "single-line-mode") public var singleLineMode: Bool - - /// True if the text of the label includes Pango markup. - /// - /// See [func@Pango.parse_markup]. - @GObjectProperty(named: "use-markup") public var useMarkup: Bool - - /// True if the text of the label indicates a mnemonic with an `_` - /// before the mnemonic character. - @GObjectProperty(named: "use-underline") public var useUnderline: Bool - - /// The desired width of the label, in characters. - /// - /// If this property is set to -1, the width will be calculated automatically. - /// - /// See the section on [text layout](class.Label.html#text-layout) for details - /// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] - /// determine the width of ellipsized and wrapped labels. - @GObjectProperty(named: "width-chars") public var widthChars: Int - - /// True if the label text will wrap if it gets too wide. - @GObjectProperty(named: "wrap") public var wrap: Bool - - /// The horizontal alignment of the label text inside its size allocation. - /// - /// Compare this to [property@Gtk.Widget:halign], which determines how the - /// labels size allocation is positioned in the space available for the label. - @GObjectProperty(named: "xalign") public var xalign: Float - - /// The vertical alignment of the label text inside its size allocation. - /// - /// Compare this to [property@Gtk.Widget:valign], which determines how the - /// labels size allocation is positioned in the space available for the label. - @GObjectProperty(named: "yalign") public var yalign: Float - - /// Gets emitted when the user activates a link in the label. - /// - /// The `::activate-current-link` is a [keybinding signal](class.SignalAction.html). - /// - /// Applications may also emit the signal with g_signal_emit_by_name() - /// if they need to control activation of URIs programmatically. - /// - /// The default bindings for this signal are all forms of the Enter key. - public var activateCurrentLink: ((Label) -> Void)? - - /// Gets emitted to activate a URI. - /// - /// Applications may connect to it to override the default behaviour, - /// which is to call [method@Gtk.FileLauncher.launch]. - public var activateLink: ((Label, UnsafePointer) -> Void)? - - /// Gets emitted to copy the selection to the clipboard. - /// - /// The `::copy-clipboard` signal is a [keybinding signal](class.SignalAction.html). - /// - /// The default binding for this signal is Ctrl+c. - public var copyClipboard: ((Label) -> Void)? - - /// Gets emitted when the user initiates a cursor movement. - /// - /// The `::move-cursor` signal is a [keybinding signal](class.SignalAction.html). - /// If the cursor is not visible in @entry, this signal causes the viewport to - /// be moved instead. - /// - /// Applications should not connect to it, but may emit it with - /// [func@GObject.signal_emit_by_name] if they need to control - /// the cursor programmatically. - /// - /// The default bindings for this signal come in two variants, the - /// variant with the Shift modifier extends the selection, - /// the variant without the Shift modifier does not. - /// There are too many key combinations to list them all here. - /// - /// - , , , - /// move by individual characters/lines - /// - Ctrl+, etc. move by words/paragraphs - /// - Home and End move to the ends of the buffer - public var moveCursor: ((Label, GtkMovementStep, Int, Bool) -> Void)? - - public var notifyAttributes: ((Label, OpaquePointer) -> Void)? - - public var notifyEllipsize: ((Label, OpaquePointer) -> Void)? - - public var notifyExtraMenu: ((Label, OpaquePointer) -> Void)? - - public var notifyJustify: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::attributes", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAttributes?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::ellipsize", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEllipsize?(self, param0) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::extra-menu", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExtraMenu?(self, param0) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::justify", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyJustify?(self, param0) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::label", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLabel?(self, param0) +} - public var notifyLabel: ((Label, OpaquePointer) -> Void)? - - public var notifyLines: ((Label, OpaquePointer) -> Void)? +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::lines", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLines?(self, param0) +} + +let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::max-width-chars", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMaxWidthChars?(self, param0) +} - public var notifyMaxWidthChars: ((Label, OpaquePointer) -> Void)? - - public var notifyMnemonicKeyval: ((Label, OpaquePointer) -> Void)? - - public var notifyNaturalWrapMode: ((Label, OpaquePointer) -> Void)? - - public var notifySelectable: ((Label, OpaquePointer) -> Void)? +let handler11: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySingleLineMode: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::mnemonic-keyval", handler: gCallback(handler11)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMnemonicKeyval?(self, param0) +} - public var notifyTabs: ((Label, OpaquePointer) -> Void)? +let handler12: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyUseMarkup: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::natural-wrap-mode", handler: gCallback(handler12)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyNaturalWrapMode?(self, param0) +} - public var notifyUseUnderline: ((Label, OpaquePointer) -> Void)? +let handler13: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyWidthChars: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::selectable", handler: gCallback(handler13)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectable?(self, param0) +} - public var notifyWrap: ((Label, OpaquePointer) -> Void)? +let handler14: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyWrapMode: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::single-line-mode", handler: gCallback(handler14)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySingleLineMode?(self, param0) +} - public var notifyXalign: ((Label, OpaquePointer) -> Void)? +let handler15: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyYalign: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::tabs", handler: gCallback(handler15)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTabs?(self, param0) } + +let handler16: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::use-markup", handler: gCallback(handler16)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseMarkup?(self, param0) +} + +let handler17: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::use-underline", handler: gCallback(handler17)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseUnderline?(self, param0) +} + +let handler18: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::width-chars", handler: gCallback(handler18)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWidthChars?(self, param0) +} + +let handler19: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::wrap", handler: gCallback(handler19)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWrap?(self, param0) +} + +let handler20: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::wrap-mode", handler: gCallback(handler20)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWrapMode?(self, param0) +} + +let handler21: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::xalign", handler: gCallback(handler21)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyXalign?(self, param0) +} + +let handler22: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::yalign", handler: gCallback(handler22)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyYalign?(self, param0) +} +} + + /// The alignment of the lines in the text of the label, relative to each other. +/// +/// This does *not* affect the alignment of the label within its allocation. +/// See [property@Gtk.Label:xalign] for that. +@GObjectProperty(named: "justify") public var justify: Justification + +/// The contents of the label. +/// +/// If the string contains Pango markup (see [func@Pango.parse_markup]), +/// you will have to set the [property@Gtk.Label:use-markup] property to +/// true in order for the label to display the markup attributes. See also +/// [method@Gtk.Label.set_markup] for a convenience function that sets both +/// this property and the [property@Gtk.Label:use-markup] property at the +/// same time. +/// +/// If the string contains underlines acting as mnemonics, you will have to +/// set the [property@Gtk.Label:use-underline] property to true in order +/// for the label to display them. +@GObjectProperty(named: "label") public var label: String + +/// The number of lines to which an ellipsized, wrapping label +/// should display before it gets ellipsized. This both prevents the label +/// from ellipsizing before this many lines are displayed, and limits the +/// height request of the label to this many lines. +/// +/// ::: warning +/// Setting this property has unintuitive and unfortunate consequences +/// for the minimum _width_ of the label. Specifically, if the height +/// of the label is such that it fits a smaller number of lines than +/// the value of this property, the label can not be ellipsized at all, +/// which means it must be wide enough to fit all the text fully. +/// +/// This property has no effect if the label is not wrapping or ellipsized. +/// +/// Set this property to -1 if you don't want to limit the number of lines. +@GObjectProperty(named: "lines") public var lines: Int + +/// The desired maximum width of the label, in characters. +/// +/// If this property is set to -1, the width will be calculated automatically. +/// +/// See the section on [text layout](class.Label.html#text-layout) for details +/// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] +/// determine the width of ellipsized and wrapped labels. +@GObjectProperty(named: "max-width-chars") public var maxWidthChars: Int + +/// The mnemonic accelerator key for the label. +@GObjectProperty(named: "mnemonic-keyval") public var mnemonicKeyval: UInt + +/// Whether the label text can be selected with the mouse. +@GObjectProperty(named: "selectable") public var selectable: Bool + +/// Whether the label is in single line mode. +/// +/// In single line mode, the height of the label does not depend on the +/// actual text, it is always set to ascent + descent of the font. This +/// can be an advantage in situations where resizing the label because +/// of text changes would be distracting, e.g. in a statusbar. +@GObjectProperty(named: "single-line-mode") public var singleLineMode: Bool + +/// True if the text of the label includes Pango markup. +/// +/// See [func@Pango.parse_markup]. +@GObjectProperty(named: "use-markup") public var useMarkup: Bool + +/// True if the text of the label indicates a mnemonic with an `_` +/// before the mnemonic character. +@GObjectProperty(named: "use-underline") public var useUnderline: Bool + +/// The desired width of the label, in characters. +/// +/// If this property is set to -1, the width will be calculated automatically. +/// +/// See the section on [text layout](class.Label.html#text-layout) for details +/// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] +/// determine the width of ellipsized and wrapped labels. +@GObjectProperty(named: "width-chars") public var widthChars: Int + +/// True if the label text will wrap if it gets too wide. +@GObjectProperty(named: "wrap") public var wrap: Bool + +/// The horizontal alignment of the label text inside its size allocation. +/// +/// Compare this to [property@Gtk.Widget:halign], which determines how the +/// labels size allocation is positioned in the space available for the label. +@GObjectProperty(named: "xalign") public var xalign: Float + +/// The vertical alignment of the label text inside its size allocation. +/// +/// Compare this to [property@Gtk.Widget:valign], which determines how the +/// labels size allocation is positioned in the space available for the label. +@GObjectProperty(named: "yalign") public var yalign: Float + +/// Gets emitted when the user activates a link in the label. +/// +/// The `::activate-current-link` is a [keybinding signal](class.SignalAction.html). +/// +/// Applications may also emit the signal with g_signal_emit_by_name() +/// if they need to control activation of URIs programmatically. +/// +/// The default bindings for this signal are all forms of the Enter key. +public var activateCurrentLink: ((Label) -> Void)? + +/// Gets emitted to activate a URI. +/// +/// Applications may connect to it to override the default behaviour, +/// which is to call [method@Gtk.FileLauncher.launch]. +public var activateLink: ((Label, UnsafePointer) -> Void)? + +/// Gets emitted to copy the selection to the clipboard. +/// +/// The `::copy-clipboard` signal is a [keybinding signal](class.SignalAction.html). +/// +/// The default binding for this signal is Ctrl+c. +public var copyClipboard: ((Label) -> Void)? + +/// Gets emitted when the user initiates a cursor movement. +/// +/// The `::move-cursor` signal is a [keybinding signal](class.SignalAction.html). +/// If the cursor is not visible in @entry, this signal causes the viewport to +/// be moved instead. +/// +/// Applications should not connect to it, but may emit it with +/// [func@GObject.signal_emit_by_name] if they need to control +/// the cursor programmatically. +/// +/// The default bindings for this signal come in two variants, the +/// variant with the Shift modifier extends the selection, +/// the variant without the Shift modifier does not. +/// There are too many key combinations to list them all here. +/// +/// - , , , +/// move by individual characters/lines +/// - Ctrl+, etc. move by words/paragraphs +/// - Home and End move to the ends of the buffer +public var moveCursor: ((Label, GtkMovementStep, Int, Bool) -> Void)? + + +public var notifyAttributes: ((Label, OpaquePointer) -> Void)? + + +public var notifyEllipsize: ((Label, OpaquePointer) -> Void)? + + +public var notifyExtraMenu: ((Label, OpaquePointer) -> Void)? + + +public var notifyJustify: ((Label, OpaquePointer) -> Void)? + + +public var notifyLabel: ((Label, OpaquePointer) -> Void)? + + +public var notifyLines: ((Label, OpaquePointer) -> Void)? + + +public var notifyMaxWidthChars: ((Label, OpaquePointer) -> Void)? + + +public var notifyMnemonicKeyval: ((Label, OpaquePointer) -> Void)? + + +public var notifyNaturalWrapMode: ((Label, OpaquePointer) -> Void)? + + +public var notifySelectable: ((Label, OpaquePointer) -> Void)? + + +public var notifySingleLineMode: ((Label, OpaquePointer) -> Void)? + + +public var notifyTabs: ((Label, OpaquePointer) -> Void)? + + +public var notifyUseMarkup: ((Label, OpaquePointer) -> Void)? + + +public var notifyUseUnderline: ((Label, OpaquePointer) -> Void)? + + +public var notifyWidthChars: ((Label, OpaquePointer) -> Void)? + + +public var notifyWrap: ((Label, OpaquePointer) -> Void)? + + +public var notifyWrapMode: ((Label, OpaquePointer) -> Void)? + + +public var notifyXalign: ((Label, OpaquePointer) -> Void)? + + +public var notifyYalign: ((Label, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/LevelBarMode.swift b/Sources/Gtk/Generated/LevelBarMode.swift index 999e280dea..508c23645a 100644 --- a/Sources/Gtk/Generated/LevelBarMode.swift +++ b/Sources/Gtk/Generated/LevelBarMode.swift @@ -1,27 +1,27 @@ import CGtk /// Describes how [class@LevelBar] contents should be rendered. -/// +/// /// Note that this enumeration could be extended with additional modes /// in the future. public enum LevelBarMode: GValueRepresentableEnum { public typealias GtkEnum = GtkLevelBarMode /// The bar has a continuous mode - case continuous - /// The bar has a discrete mode - case discrete +case continuous +/// The bar has a discrete mode +case discrete public static var type: GType { - gtk_level_bar_mode_get_type() - } + gtk_level_bar_mode_get_type() +} public init(from gtkEnum: GtkLevelBarMode) { switch gtkEnum { case GTK_LEVEL_BAR_MODE_CONTINUOUS: - self = .continuous - case GTK_LEVEL_BAR_MODE_DISCRETE: - self = .discrete + self = .continuous +case GTK_LEVEL_BAR_MODE_DISCRETE: + self = .discrete default: fatalError("Unsupported GtkLevelBarMode enum value: \(gtkEnum.rawValue)") } @@ -30,9 +30,9 @@ public enum LevelBarMode: GValueRepresentableEnum { public func toGtk() -> GtkLevelBarMode { switch self { case .continuous: - return GTK_LEVEL_BAR_MODE_CONTINUOUS - case .discrete: - return GTK_LEVEL_BAR_MODE_DISCRETE + return GTK_LEVEL_BAR_MODE_CONTINUOUS +case .discrete: + return GTK_LEVEL_BAR_MODE_DISCRETE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ListBox.swift b/Sources/Gtk/Generated/ListBox.swift index bc5762d6c7..f10b14d5fe 100644 --- a/Sources/Gtk/Generated/ListBox.swift +++ b/Sources/Gtk/Generated/ListBox.swift @@ -1,253 +1,233 @@ import CGtk /// Shows a vertical list. -/// +/// /// An example GtkListBox -/// +/// /// A `GtkListBox` only contains `GtkListBoxRow` children. These rows can /// by dynamically sorted and filtered, and headers can be added dynamically /// depending on the row content. It also allows keyboard and mouse navigation /// and selection like a typical list. -/// +/// /// Using `GtkListBox` is often an alternative to `GtkTreeView`, especially /// when the list contents has a more complicated layout than what is allowed /// by a `GtkCellRenderer`, or when the contents is interactive (i.e. has a /// button in it). -/// +/// /// Although a `GtkListBox` must have only `GtkListBoxRow` children, you can /// add any kind of widget to it via [method@Gtk.ListBox.prepend], /// [method@Gtk.ListBox.append] and [method@Gtk.ListBox.insert] and a /// `GtkListBoxRow` widget will automatically be inserted between the list /// and the widget. -/// +/// /// `GtkListBoxRows` can be marked as activatable or selectable. If a row is /// activatable, [signal@Gtk.ListBox::row-activated] will be emitted for it when /// the user tries to activate it. If it is selectable, the row will be marked /// as selected when the user tries to select it. -/// +/// /// # GtkListBox as GtkBuildable -/// +/// /// The `GtkListBox` implementation of the `GtkBuildable` interface supports /// setting a child as the placeholder by specifying “placeholder” as the “type” /// attribute of a `` element. See [method@Gtk.ListBox.set_placeholder] /// for info. -/// +/// /// # Shortcuts and Gestures -/// +/// /// The following signals have default keybindings: -/// +/// /// - [signal@Gtk.ListBox::move-cursor] /// - [signal@Gtk.ListBox::select-all] /// - [signal@Gtk.ListBox::toggle-cursor-row] /// - [signal@Gtk.ListBox::unselect-all] -/// +/// /// # CSS nodes -/// +/// /// ``` /// list[.separators][.rich-list][.navigation-sidebar][.boxed-list] /// ╰── row[.activatable] /// ``` -/// +/// /// `GtkListBox` uses a single CSS node named list. It may carry the .separators /// style class, when the [property@Gtk.ListBox:show-separators] property is set. /// Each `GtkListBoxRow` uses a single CSS node named row. The row nodes get the /// .activatable style class added when appropriate. -/// +/// /// It may also carry the .boxed-list style class. In this case, the list will be /// automatically surrounded by a frame and have separators. -/// +/// /// The main list node may also carry style classes to select /// the style of [list presentation](section-list-widget.html#list-styles): /// .rich-list, .navigation-sidebar or .data-table. -/// +/// /// # Accessibility -/// +/// /// `GtkListBox` uses the [enum@Gtk.AccessibleRole.list] role and `GtkListBoxRow` uses /// the [enum@Gtk.AccessibleRole.list_item] role. open class ListBox: Widget { /// Creates a new `GtkListBox` container. - public convenience init() { - self.init( - gtk_list_box_new() - ) +public convenience init() { + self.init( + gtk_list_box_new() + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate-cursor-row") { [weak self] () in + guard let self = self else { return } + self.activateCursorRow?(self) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, Bool, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, value3, value4, data in + SignalBox4.run(data, value1, value2, value3, value4) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate-cursor-row") { [weak self] () in - guard let self = self else { return } - self.activateCursorRow?(self) - } - - let handler1: - @convention(c) ( - UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, Bool, UnsafeMutableRawPointer - ) -> Void = - { _, value1, value2, value3, value4, data in - SignalBox4.run( - data, value1, value2, value3, value4) - } - - addSignal(name: "move-cursor", handler: gCallback(handler1)) { - [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool, param3: Bool) in - guard let self = self else { return } - self.moveCursor?(self, param0, param1, param2, param3) - } - - let handler2: - @convention(c) ( - UnsafeMutableRawPointer, UnsafeMutablePointer, - UnsafeMutableRawPointer - ) -> Void = - { _, value1, data in - SignalBox1>.run(data, value1) - } - - addSignal(name: "row-activated", handler: gCallback(handler2)) { - [weak self] (param0: UnsafeMutablePointer) in - guard let self = self else { return } - self.rowActivated?(self, param0) - } - - let handler3: - @convention(c) ( - UnsafeMutableRawPointer, UnsafeMutablePointer?, - UnsafeMutableRawPointer - ) -> Void = - { _, value1, data in - SignalBox1?>.run(data, value1) - } - - addSignal(name: "row-selected", handler: gCallback(handler3)) { - [weak self] (param0: UnsafeMutablePointer?) in - guard let self = self else { return } - self.rowSelected?(self, param0) - } - - addSignal(name: "selected-rows-changed") { [weak self] () in - guard let self = self else { return } - self.selectedRowsChanged?(self) - } - - addSignal(name: "toggle-cursor-row") { [weak self] () in - guard let self = self else { return } - self.toggleCursorRow?(self) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::accept-unpaired-release", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAcceptUnpairedRelease?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::activate-on-single-click", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActivateOnSingleClick?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::selection-mode", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectionMode?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::show-separators", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowSeparators?(self, param0) - } - - let handler10: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::tab-behavior", handler: gCallback(handler10)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTabBehavior?(self, param0) - } +addSignal(name: "move-cursor", handler: gCallback(handler1)) { [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool, param3: Bool) in + guard let self = self else { return } + self.moveCursor?(self, param0, param1, param2, param3) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, UnsafeMutablePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1>.run(data, value1) } - /// Determines whether children can be activated with a single - /// click, or require a double-click. - @GObjectProperty(named: "activate-on-single-click") public var activateOnSingleClick: Bool +addSignal(name: "row-activated", handler: gCallback(handler2)) { [weak self] (param0: UnsafeMutablePointer) in + guard let self = self else { return } + self.rowActivated?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, UnsafeMutablePointer?, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1?>.run(data, value1) + } - /// The selection mode used by the list box. - @GObjectProperty(named: "selection-mode") public var selectionMode: SelectionMode +addSignal(name: "row-selected", handler: gCallback(handler3)) { [weak self] (param0: UnsafeMutablePointer?) in + guard let self = self else { return } + self.rowSelected?(self, param0) +} - /// Whether to show separators between rows. - @GObjectProperty(named: "show-separators") public var showSeparators: Bool +addSignal(name: "selected-rows-changed") { [weak self] () in + guard let self = self else { return } + self.selectedRowsChanged?(self) +} - /// Emitted when the cursor row is activated. - public var activateCursorRow: ((ListBox) -> Void)? +addSignal(name: "toggle-cursor-row") { [weak self] () in + guard let self = self else { return } + self.toggleCursorRow?(self) +} - /// Emitted when the user initiates a cursor movement. - /// - /// The default bindings for this signal come in two variants, the variant with - /// the Shift modifier extends the selection, the variant without the Shift - /// modifier does not. There are too many key combinations to list them all - /// here. - /// - /// - , , , - /// move by individual children - /// - Home, End move to the ends of the box - /// - PgUp, PgDn move vertically by pages - public var moveCursor: ((ListBox, GtkMovementStep, Int, Bool, Bool) -> Void)? +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Emitted when a row has been activated by the user. - public var rowActivated: ((ListBox, UnsafeMutablePointer) -> Void)? +addSignal(name: "notify::accept-unpaired-release", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAcceptUnpairedRelease?(self, param0) +} - /// Emitted when a new row is selected, or (with a %NULL @row) - /// when the selection is cleared. - /// - /// When the @box is using %GTK_SELECTION_MULTIPLE, this signal will not - /// give you the full picture of selection changes, and you should use - /// the [signal@Gtk.ListBox::selected-rows-changed] signal instead. - public var rowSelected: ((ListBox, UnsafeMutablePointer?) -> Void)? +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Emitted when the set of selected rows changes. - public var selectedRowsChanged: ((ListBox) -> Void)? +addSignal(name: "notify::activate-on-single-click", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActivateOnSingleClick?(self, param0) +} - /// Emitted when the cursor row is toggled. - /// - /// The default bindings for this signal is Ctrl+. - public var toggleCursorRow: ((ListBox) -> Void)? +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyAcceptUnpairedRelease: ((ListBox, OpaquePointer) -> Void)? +addSignal(name: "notify::selection-mode", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectionMode?(self, param0) +} - public var notifyActivateOnSingleClick: ((ListBox, OpaquePointer) -> Void)? +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySelectionMode: ((ListBox, OpaquePointer) -> Void)? +addSignal(name: "notify::show-separators", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowSeparators?(self, param0) +} - public var notifyShowSeparators: ((ListBox, OpaquePointer) -> Void)? +let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyTabBehavior: ((ListBox, OpaquePointer) -> Void)? +addSignal(name: "notify::tab-behavior", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTabBehavior?(self, param0) +} } + + /// Determines whether children can be activated with a single +/// click, or require a double-click. +@GObjectProperty(named: "activate-on-single-click") public var activateOnSingleClick: Bool + +/// The selection mode used by the list box. +@GObjectProperty(named: "selection-mode") public var selectionMode: SelectionMode + +/// Whether to show separators between rows. +@GObjectProperty(named: "show-separators") public var showSeparators: Bool + +/// Emitted when the cursor row is activated. +public var activateCursorRow: ((ListBox) -> Void)? + +/// Emitted when the user initiates a cursor movement. +/// +/// The default bindings for this signal come in two variants, the variant with +/// the Shift modifier extends the selection, the variant without the Shift +/// modifier does not. There are too many key combinations to list them all +/// here. +/// +/// - , , , +/// move by individual children +/// - Home, End move to the ends of the box +/// - PgUp, PgDn move vertically by pages +public var moveCursor: ((ListBox, GtkMovementStep, Int, Bool, Bool) -> Void)? + +/// Emitted when a row has been activated by the user. +public var rowActivated: ((ListBox, UnsafeMutablePointer) -> Void)? + +/// Emitted when a new row is selected, or (with a %NULL @row) +/// when the selection is cleared. +/// +/// When the @box is using %GTK_SELECTION_MULTIPLE, this signal will not +/// give you the full picture of selection changes, and you should use +/// the [signal@Gtk.ListBox::selected-rows-changed] signal instead. +public var rowSelected: ((ListBox, UnsafeMutablePointer?) -> Void)? + +/// Emitted when the set of selected rows changes. +public var selectedRowsChanged: ((ListBox) -> Void)? + +/// Emitted when the cursor row is toggled. +/// +/// The default bindings for this signal is Ctrl+. +public var toggleCursorRow: ((ListBox) -> Void)? + + +public var notifyAcceptUnpairedRelease: ((ListBox, OpaquePointer) -> Void)? + + +public var notifyActivateOnSingleClick: ((ListBox, OpaquePointer) -> Void)? + + +public var notifySelectionMode: ((ListBox, OpaquePointer) -> Void)? + + +public var notifyShowSeparators: ((ListBox, OpaquePointer) -> Void)? + + +public var notifyTabBehavior: ((ListBox, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/MessageType.swift b/Sources/Gtk/Generated/MessageType.swift index f842063b16..ec25435d64 100644 --- a/Sources/Gtk/Generated/MessageType.swift +++ b/Sources/Gtk/Generated/MessageType.swift @@ -5,32 +5,32 @@ public enum MessageType: GValueRepresentableEnum { public typealias GtkEnum = GtkMessageType /// Informational message - case info - /// Non-fatal warning message - case warning - /// Question requiring a choice - case question - /// Fatal error message - case error - /// None of the above - case other +case info +/// Non-fatal warning message +case warning +/// Question requiring a choice +case question +/// Fatal error message +case error +/// None of the above +case other public static var type: GType { - gtk_message_type_get_type() - } + gtk_message_type_get_type() +} public init(from gtkEnum: GtkMessageType) { switch gtkEnum { case GTK_MESSAGE_INFO: - self = .info - case GTK_MESSAGE_WARNING: - self = .warning - case GTK_MESSAGE_QUESTION: - self = .question - case GTK_MESSAGE_ERROR: - self = .error - case GTK_MESSAGE_OTHER: - self = .other + self = .info +case GTK_MESSAGE_WARNING: + self = .warning +case GTK_MESSAGE_QUESTION: + self = .question +case GTK_MESSAGE_ERROR: + self = .error +case GTK_MESSAGE_OTHER: + self = .other default: fatalError("Unsupported GtkMessageType enum value: \(gtkEnum.rawValue)") } @@ -39,15 +39,15 @@ public enum MessageType: GValueRepresentableEnum { public func toGtk() -> GtkMessageType { switch self { case .info: - return GTK_MESSAGE_INFO - case .warning: - return GTK_MESSAGE_WARNING - case .question: - return GTK_MESSAGE_QUESTION - case .error: - return GTK_MESSAGE_ERROR - case .other: - return GTK_MESSAGE_OTHER + return GTK_MESSAGE_INFO +case .warning: + return GTK_MESSAGE_WARNING +case .question: + return GTK_MESSAGE_QUESTION +case .error: + return GTK_MESSAGE_ERROR +case .other: + return GTK_MESSAGE_OTHER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/MovementStep.swift b/Sources/Gtk/Generated/MovementStep.swift index 60162d7795..f6652e1c43 100644 --- a/Sources/Gtk/Generated/MovementStep.swift +++ b/Sources/Gtk/Generated/MovementStep.swift @@ -6,52 +6,52 @@ public enum MovementStep: GValueRepresentableEnum { public typealias GtkEnum = GtkMovementStep /// Move forward or back by graphemes - case logicalPositions - /// Move left or right by graphemes - case visualPositions - /// Move forward or back by words - case words - /// Move up or down lines (wrapped lines) - case displayLines - /// Move to either end of a line - case displayLineEnds - /// Move up or down paragraphs (newline-ended lines) - case paragraphs - /// Move to either end of a paragraph - case paragraphEnds - /// Move by pages - case pages - /// Move to ends of the buffer - case bufferEnds - /// Move horizontally by pages - case horizontalPages +case logicalPositions +/// Move left or right by graphemes +case visualPositions +/// Move forward or back by words +case words +/// Move up or down lines (wrapped lines) +case displayLines +/// Move to either end of a line +case displayLineEnds +/// Move up or down paragraphs (newline-ended lines) +case paragraphs +/// Move to either end of a paragraph +case paragraphEnds +/// Move by pages +case pages +/// Move to ends of the buffer +case bufferEnds +/// Move horizontally by pages +case horizontalPages public static var type: GType { - gtk_movement_step_get_type() - } + gtk_movement_step_get_type() +} public init(from gtkEnum: GtkMovementStep) { switch gtkEnum { case GTK_MOVEMENT_LOGICAL_POSITIONS: - self = .logicalPositions - case GTK_MOVEMENT_VISUAL_POSITIONS: - self = .visualPositions - case GTK_MOVEMENT_WORDS: - self = .words - case GTK_MOVEMENT_DISPLAY_LINES: - self = .displayLines - case GTK_MOVEMENT_DISPLAY_LINE_ENDS: - self = .displayLineEnds - case GTK_MOVEMENT_PARAGRAPHS: - self = .paragraphs - case GTK_MOVEMENT_PARAGRAPH_ENDS: - self = .paragraphEnds - case GTK_MOVEMENT_PAGES: - self = .pages - case GTK_MOVEMENT_BUFFER_ENDS: - self = .bufferEnds - case GTK_MOVEMENT_HORIZONTAL_PAGES: - self = .horizontalPages + self = .logicalPositions +case GTK_MOVEMENT_VISUAL_POSITIONS: + self = .visualPositions +case GTK_MOVEMENT_WORDS: + self = .words +case GTK_MOVEMENT_DISPLAY_LINES: + self = .displayLines +case GTK_MOVEMENT_DISPLAY_LINE_ENDS: + self = .displayLineEnds +case GTK_MOVEMENT_PARAGRAPHS: + self = .paragraphs +case GTK_MOVEMENT_PARAGRAPH_ENDS: + self = .paragraphEnds +case GTK_MOVEMENT_PAGES: + self = .pages +case GTK_MOVEMENT_BUFFER_ENDS: + self = .bufferEnds +case GTK_MOVEMENT_HORIZONTAL_PAGES: + self = .horizontalPages default: fatalError("Unsupported GtkMovementStep enum value: \(gtkEnum.rawValue)") } @@ -60,25 +60,25 @@ public enum MovementStep: GValueRepresentableEnum { public func toGtk() -> GtkMovementStep { switch self { case .logicalPositions: - return GTK_MOVEMENT_LOGICAL_POSITIONS - case .visualPositions: - return GTK_MOVEMENT_VISUAL_POSITIONS - case .words: - return GTK_MOVEMENT_WORDS - case .displayLines: - return GTK_MOVEMENT_DISPLAY_LINES - case .displayLineEnds: - return GTK_MOVEMENT_DISPLAY_LINE_ENDS - case .paragraphs: - return GTK_MOVEMENT_PARAGRAPHS - case .paragraphEnds: - return GTK_MOVEMENT_PARAGRAPH_ENDS - case .pages: - return GTK_MOVEMENT_PAGES - case .bufferEnds: - return GTK_MOVEMENT_BUFFER_ENDS - case .horizontalPages: - return GTK_MOVEMENT_HORIZONTAL_PAGES + return GTK_MOVEMENT_LOGICAL_POSITIONS +case .visualPositions: + return GTK_MOVEMENT_VISUAL_POSITIONS +case .words: + return GTK_MOVEMENT_WORDS +case .displayLines: + return GTK_MOVEMENT_DISPLAY_LINES +case .displayLineEnds: + return GTK_MOVEMENT_DISPLAY_LINE_ENDS +case .paragraphs: + return GTK_MOVEMENT_PARAGRAPHS +case .paragraphEnds: + return GTK_MOVEMENT_PARAGRAPH_ENDS +case .pages: + return GTK_MOVEMENT_PAGES +case .bufferEnds: + return GTK_MOVEMENT_BUFFER_ENDS +case .horizontalPages: + return GTK_MOVEMENT_HORIZONTAL_PAGES } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Native.swift b/Sources/Gtk/Generated/Native.swift index df37f3f405..3decd0c521 100644 --- a/Sources/Gtk/Generated/Native.swift +++ b/Sources/Gtk/Generated/Native.swift @@ -1,19 +1,21 @@ import CGtk /// An interface for widgets that have their own [class@Gdk.Surface]. -/// +/// /// The obvious example of a `GtkNative` is `GtkWindow`. -/// +/// /// Every widget that is not itself a `GtkNative` is contained in one, /// and you can get it with [method@Gtk.Widget.get_native]. -/// +/// /// To get the surface of a `GtkNative`, use [method@Gtk.Native.get_surface]. /// It is also possible to find the `GtkNative` to which a surface /// belongs, with [func@Gtk.Native.get_for_surface]. -/// +/// /// In addition to a [class@Gdk.Surface], a `GtkNative` also provides /// a [class@Gsk.Renderer] for rendering on that surface. To get the /// renderer, use [method@Gtk.Native.get_renderer]. public protocol Native: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/NativeDialog.swift b/Sources/Gtk/Generated/NativeDialog.swift index 1f7e967650..052aa5d409 100644 --- a/Sources/Gtk/Generated/NativeDialog.swift +++ b/Sources/Gtk/Generated/NativeDialog.swift @@ -1,109 +1,105 @@ import CGtk /// Base class for platform dialogs that don't use `GtkDialog`. -/// +/// /// Native dialogs are used in order to integrate better with a platform, /// by looking the same as other native applications and supporting /// platform specific features. -/// +/// /// The [class@Gtk.Dialog] functions cannot be used on such objects, /// but we need a similar API in order to drive them. The `GtkNativeDialog` /// object is an API that allows you to do this. It allows you to set /// various common properties on the dialog, as well as show and hide /// it and get a [signal@Gtk.NativeDialog::response] signal when the user /// finished with the dialog. -/// +/// /// Note that unlike `GtkDialog`, `GtkNativeDialog` objects are not /// toplevel widgets, and GTK does not keep them alive. It is your /// responsibility to keep a reference until you are done with the /// object. open class NativeDialog: GObject { + public override func registerSignals() { - super.registerSignals() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "response", handler: gCallback(handler0)) { [weak self] (param0: Int) in - guard let self = self else { return } - self.response?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::modal", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyModal?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::title", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTitle?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::transient-for", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTransientFor?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::visible", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyVisible?(self, param0) - } + super.registerSignals() + + let handler0: @convention(c) (UnsafeMutableRawPointer, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Whether the window should be modal with respect to its transient parent. - @GObjectProperty(named: "modal") public var modal: Bool +addSignal(name: "response", handler: gCallback(handler0)) { [weak self] (param0: Int) in + guard let self = self else { return } + self.response?(self, param0) +} - /// The title of the dialog window - @GObjectProperty(named: "title") public var title: String? +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Whether the window is currently visible. - @GObjectProperty(named: "visible") public var visible: Bool +addSignal(name: "notify::modal", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyModal?(self, param0) +} - /// Emitted when the user responds to the dialog. - /// - /// When this is called the dialog has been hidden. - /// - /// If you call [method@Gtk.NativeDialog.hide] before the user - /// responds to the dialog this signal will not be emitted. - public var response: ((NativeDialog, Int) -> Void)? +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyModal: ((NativeDialog, OpaquePointer) -> Void)? +addSignal(name: "notify::title", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTitle?(self, param0) +} - public var notifyTitle: ((NativeDialog, OpaquePointer) -> Void)? +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::transient-for", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTransientFor?(self, param0) +} - public var notifyTransientFor: ((NativeDialog, OpaquePointer) -> Void)? +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyVisible: ((NativeDialog, OpaquePointer) -> Void)? +addSignal(name: "notify::visible", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyVisible?(self, param0) +} } + + /// Whether the window should be modal with respect to its transient parent. +@GObjectProperty(named: "modal") public var modal: Bool + +/// The title of the dialog window +@GObjectProperty(named: "title") public var title: String? + +/// Whether the window is currently visible. +@GObjectProperty(named: "visible") public var visible: Bool + +/// Emitted when the user responds to the dialog. +/// +/// When this is called the dialog has been hidden. +/// +/// If you call [method@Gtk.NativeDialog.hide] before the user +/// responds to the dialog this signal will not be emitted. +public var response: ((NativeDialog, Int) -> Void)? + + +public var notifyModal: ((NativeDialog, OpaquePointer) -> Void)? + + +public var notifyTitle: ((NativeDialog, OpaquePointer) -> Void)? + + +public var notifyTransientFor: ((NativeDialog, OpaquePointer) -> Void)? + + +public var notifyVisible: ((NativeDialog, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/NotebookTab.swift b/Sources/Gtk/Generated/NotebookTab.swift index 3c521e29d5..ad7ee8720b 100644 --- a/Sources/Gtk/Generated/NotebookTab.swift +++ b/Sources/Gtk/Generated/NotebookTab.swift @@ -5,20 +5,20 @@ public enum NotebookTab: GValueRepresentableEnum { public typealias GtkEnum = GtkNotebookTab /// The first tab in the notebook - case first - /// The last tab in the notebook - case last +case first +/// The last tab in the notebook +case last public static var type: GType { - gtk_notebook_tab_get_type() - } + gtk_notebook_tab_get_type() +} public init(from gtkEnum: GtkNotebookTab) { switch gtkEnum { case GTK_NOTEBOOK_TAB_FIRST: - self = .first - case GTK_NOTEBOOK_TAB_LAST: - self = .last + self = .first +case GTK_NOTEBOOK_TAB_LAST: + self = .last default: fatalError("Unsupported GtkNotebookTab enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ public enum NotebookTab: GValueRepresentableEnum { public func toGtk() -> GtkNotebookTab { switch self { case .first: - return GTK_NOTEBOOK_TAB_FIRST - case .last: - return GTK_NOTEBOOK_TAB_LAST + return GTK_NOTEBOOK_TAB_FIRST +case .last: + return GTK_NOTEBOOK_TAB_LAST } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/NumberUpLayout.swift b/Sources/Gtk/Generated/NumberUpLayout.swift index 5d81e7641e..4d8fdd0b28 100644 --- a/Sources/Gtk/Generated/NumberUpLayout.swift +++ b/Sources/Gtk/Generated/NumberUpLayout.swift @@ -6,44 +6,44 @@ public enum NumberUpLayout: GValueRepresentableEnum { public typealias GtkEnum = GtkNumberUpLayout /// ![](layout-lrtb.png) - case lrtb - /// ![](layout-lrbt.png) - case lrbt - /// ![](layout-rltb.png) - case rltb - /// ![](layout-rlbt.png) - case rlbt - /// ![](layout-tblr.png) - case tblr - /// ![](layout-tbrl.png) - case tbrl - /// ![](layout-btlr.png) - case btlr - /// ![](layout-btrl.png) - case btrl +case lrtb +/// ![](layout-lrbt.png) +case lrbt +/// ![](layout-rltb.png) +case rltb +/// ![](layout-rlbt.png) +case rlbt +/// ![](layout-tblr.png) +case tblr +/// ![](layout-tbrl.png) +case tbrl +/// ![](layout-btlr.png) +case btlr +/// ![](layout-btrl.png) +case btrl public static var type: GType { - gtk_number_up_layout_get_type() - } + gtk_number_up_layout_get_type() +} public init(from gtkEnum: GtkNumberUpLayout) { switch gtkEnum { case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM: - self = .lrtb - case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP: - self = .lrbt - case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM: - self = .rltb - case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP: - self = .rlbt - case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT: - self = .tblr - case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT: - self = .tbrl - case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT: - self = .btlr - case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT: - self = .btrl + self = .lrtb +case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP: + self = .lrbt +case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM: + self = .rltb +case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP: + self = .rlbt +case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT: + self = .tblr +case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT: + self = .tbrl +case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT: + self = .btlr +case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT: + self = .btrl default: fatalError("Unsupported GtkNumberUpLayout enum value: \(gtkEnum.rawValue)") } @@ -52,21 +52,21 @@ public enum NumberUpLayout: GValueRepresentableEnum { public func toGtk() -> GtkNumberUpLayout { switch self { case .lrtb: - return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM - case .lrbt: - return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP - case .rltb: - return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM - case .rlbt: - return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP - case .tblr: - return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT - case .tbrl: - return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT - case .btlr: - return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT - case .btrl: - return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT + return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM +case .lrbt: + return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP +case .rltb: + return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM +case .rlbt: + return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP +case .tblr: + return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT +case .tbrl: + return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT +case .btlr: + return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT +case .btrl: + return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Ordering.swift b/Sources/Gtk/Generated/Ordering.swift index ac58f25c48..65bc101c37 100644 --- a/Sources/Gtk/Generated/Ordering.swift +++ b/Sources/Gtk/Generated/Ordering.swift @@ -1,7 +1,7 @@ import CGtk /// Describes the way two values can be compared. -/// +/// /// These values can be used with a [callback@GLib.CompareFunc]. However, /// a `GCompareFunc` is allowed to return any integer values. /// For converting such a value to a `GtkOrdering` value, use @@ -10,24 +10,24 @@ public enum Ordering: GValueRepresentableEnum { public typealias GtkEnum = GtkOrdering /// The first value is smaller than the second - case smaller - /// The two values are equal - case equal - /// The first value is larger than the second - case larger +case smaller +/// The two values are equal +case equal +/// The first value is larger than the second +case larger public static var type: GType { - gtk_ordering_get_type() - } + gtk_ordering_get_type() +} public init(from gtkEnum: GtkOrdering) { switch gtkEnum { case GTK_ORDERING_SMALLER: - self = .smaller - case GTK_ORDERING_EQUAL: - self = .equal - case GTK_ORDERING_LARGER: - self = .larger + self = .smaller +case GTK_ORDERING_EQUAL: + self = .equal +case GTK_ORDERING_LARGER: + self = .larger default: fatalError("Unsupported GtkOrdering enum value: \(gtkEnum.rawValue)") } @@ -36,11 +36,11 @@ public enum Ordering: GValueRepresentableEnum { public func toGtk() -> GtkOrdering { switch self { case .smaller: - return GTK_ORDERING_SMALLER - case .equal: - return GTK_ORDERING_EQUAL - case .larger: - return GTK_ORDERING_LARGER + return GTK_ORDERING_SMALLER +case .equal: + return GTK_ORDERING_EQUAL +case .larger: + return GTK_ORDERING_LARGER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Orientation.swift b/Sources/Gtk/Generated/Orientation.swift index 15d9fbac6f..e323c5d837 100644 --- a/Sources/Gtk/Generated/Orientation.swift +++ b/Sources/Gtk/Generated/Orientation.swift @@ -1,26 +1,26 @@ import CGtk /// Represents the orientation of widgets and other objects. -/// +/// /// Typical examples are [class@Box] or [class@GesturePan]. public enum Orientation: GValueRepresentableEnum { public typealias GtkEnum = GtkOrientation /// The element is in horizontal orientation. - case horizontal - /// The element is in vertical orientation. - case vertical +case horizontal +/// The element is in vertical orientation. +case vertical public static var type: GType { - gtk_orientation_get_type() - } + gtk_orientation_get_type() +} public init(from gtkEnum: GtkOrientation) { switch gtkEnum { case GTK_ORIENTATION_HORIZONTAL: - self = .horizontal - case GTK_ORIENTATION_VERTICAL: - self = .vertical + self = .horizontal +case GTK_ORIENTATION_VERTICAL: + self = .vertical default: fatalError("Unsupported GtkOrientation enum value: \(gtkEnum.rawValue)") } @@ -29,9 +29,9 @@ public enum Orientation: GValueRepresentableEnum { public func toGtk() -> GtkOrientation { switch self { case .horizontal: - return GTK_ORIENTATION_HORIZONTAL - case .vertical: - return GTK_ORIENTATION_VERTICAL + return GTK_ORIENTATION_HORIZONTAL +case .vertical: + return GTK_ORIENTATION_VERTICAL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Overflow.swift b/Sources/Gtk/Generated/Overflow.swift index d28097d9c1..ef8e4379ec 100644 --- a/Sources/Gtk/Generated/Overflow.swift +++ b/Sources/Gtk/Generated/Overflow.swift @@ -1,7 +1,7 @@ import CGtk /// Defines how content overflowing a given area should be handled. -/// +/// /// This is used in [method@Gtk.Widget.set_overflow]. The /// [property@Gtk.Widget:overflow] property is modeled after the /// CSS overflow property, but implements it only partially. @@ -9,22 +9,22 @@ public enum Overflow: GValueRepresentableEnum { public typealias GtkEnum = GtkOverflow /// No change is applied. Content is drawn at the specified - /// position. - case visible - /// Content is clipped to the bounds of the area. Content - /// outside the area is not drawn and cannot be interacted with. - case hidden +/// position. +case visible +/// Content is clipped to the bounds of the area. Content +/// outside the area is not drawn and cannot be interacted with. +case hidden public static var type: GType { - gtk_overflow_get_type() - } + gtk_overflow_get_type() +} public init(from gtkEnum: GtkOverflow) { switch gtkEnum { case GTK_OVERFLOW_VISIBLE: - self = .visible - case GTK_OVERFLOW_HIDDEN: - self = .hidden + self = .visible +case GTK_OVERFLOW_HIDDEN: + self = .hidden default: fatalError("Unsupported GtkOverflow enum value: \(gtkEnum.rawValue)") } @@ -33,9 +33,9 @@ public enum Overflow: GValueRepresentableEnum { public func toGtk() -> GtkOverflow { switch self { case .visible: - return GTK_OVERFLOW_VISIBLE - case .hidden: - return GTK_OVERFLOW_HIDDEN + return GTK_OVERFLOW_VISIBLE +case .hidden: + return GTK_OVERFLOW_HIDDEN } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PackType.swift b/Sources/Gtk/Generated/PackType.swift index 283619f764..fd74570593 100644 --- a/Sources/Gtk/Generated/PackType.swift +++ b/Sources/Gtk/Generated/PackType.swift @@ -1,26 +1,26 @@ import CGtk /// Represents the packing location of a children in its parent. -/// +/// /// See [class@WindowControls] for example. public enum PackType: GValueRepresentableEnum { public typealias GtkEnum = GtkPackType /// The child is packed into the start of the widget - case start - /// The child is packed into the end of the widget - case end +case start +/// The child is packed into the end of the widget +case end public static var type: GType { - gtk_pack_type_get_type() - } + gtk_pack_type_get_type() +} public init(from gtkEnum: GtkPackType) { switch gtkEnum { case GTK_PACK_START: - self = .start - case GTK_PACK_END: - self = .end + self = .start +case GTK_PACK_END: + self = .end default: fatalError("Unsupported GtkPackType enum value: \(gtkEnum.rawValue)") } @@ -29,9 +29,9 @@ public enum PackType: GValueRepresentableEnum { public func toGtk() -> GtkPackType { switch self { case .start: - return GTK_PACK_START - case .end: - return GTK_PACK_END + return GTK_PACK_START +case .end: + return GTK_PACK_END } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PadActionType.swift b/Sources/Gtk/Generated/PadActionType.swift index 27a2db8783..8f1f53c1de 100644 --- a/Sources/Gtk/Generated/PadActionType.swift +++ b/Sources/Gtk/Generated/PadActionType.swift @@ -5,24 +5,28 @@ public enum PadActionType: GValueRepresentableEnum { public typealias GtkEnum = GtkPadActionType /// Action is triggered by a pad button - case button - /// Action is triggered by a pad ring - case ring - /// Action is triggered by a pad strip - case strip +case button +/// Action is triggered by a pad ring +case ring +/// Action is triggered by a pad strip +case strip +/// Action is triggered by a pad dial +case dial public static var type: GType { - gtk_pad_action_type_get_type() - } + gtk_pad_action_type_get_type() +} public init(from gtkEnum: GtkPadActionType) { switch gtkEnum { case GTK_PAD_ACTION_BUTTON: - self = .button - case GTK_PAD_ACTION_RING: - self = .ring - case GTK_PAD_ACTION_STRIP: - self = .strip + self = .button +case GTK_PAD_ACTION_RING: + self = .ring +case GTK_PAD_ACTION_STRIP: + self = .strip +case GTK_PAD_ACTION_DIAL: + self = .dial default: fatalError("Unsupported GtkPadActionType enum value: \(gtkEnum.rawValue)") } @@ -31,11 +35,13 @@ public enum PadActionType: GValueRepresentableEnum { public func toGtk() -> GtkPadActionType { switch self { case .button: - return GTK_PAD_ACTION_BUTTON - case .ring: - return GTK_PAD_ACTION_RING - case .strip: - return GTK_PAD_ACTION_STRIP + return GTK_PAD_ACTION_BUTTON +case .ring: + return GTK_PAD_ACTION_RING +case .strip: + return GTK_PAD_ACTION_STRIP +case .dial: + return GTK_PAD_ACTION_DIAL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PageOrientation.swift b/Sources/Gtk/Generated/PageOrientation.swift index c58cf50992..11056e7960 100644 --- a/Sources/Gtk/Generated/PageOrientation.swift +++ b/Sources/Gtk/Generated/PageOrientation.swift @@ -5,28 +5,28 @@ public enum PageOrientation: GValueRepresentableEnum { public typealias GtkEnum = GtkPageOrientation /// Portrait mode. - case portrait - /// Landscape mode. - case landscape - /// Reverse portrait mode. - case reversePortrait - /// Reverse landscape mode. - case reverseLandscape +case portrait +/// Landscape mode. +case landscape +/// Reverse portrait mode. +case reversePortrait +/// Reverse landscape mode. +case reverseLandscape public static var type: GType { - gtk_page_orientation_get_type() - } + gtk_page_orientation_get_type() +} public init(from gtkEnum: GtkPageOrientation) { switch gtkEnum { case GTK_PAGE_ORIENTATION_PORTRAIT: - self = .portrait - case GTK_PAGE_ORIENTATION_LANDSCAPE: - self = .landscape - case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT: - self = .reversePortrait - case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE: - self = .reverseLandscape + self = .portrait +case GTK_PAGE_ORIENTATION_LANDSCAPE: + self = .landscape +case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT: + self = .reversePortrait +case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE: + self = .reverseLandscape default: fatalError("Unsupported GtkPageOrientation enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum PageOrientation: GValueRepresentableEnum { public func toGtk() -> GtkPageOrientation { switch self { case .portrait: - return GTK_PAGE_ORIENTATION_PORTRAIT - case .landscape: - return GTK_PAGE_ORIENTATION_LANDSCAPE - case .reversePortrait: - return GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT - case .reverseLandscape: - return GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE + return GTK_PAGE_ORIENTATION_PORTRAIT +case .landscape: + return GTK_PAGE_ORIENTATION_LANDSCAPE +case .reversePortrait: + return GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT +case .reverseLandscape: + return GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PageSet.swift b/Sources/Gtk/Generated/PageSet.swift index be8ebed1e7..74cc516b41 100644 --- a/Sources/Gtk/Generated/PageSet.swift +++ b/Sources/Gtk/Generated/PageSet.swift @@ -5,24 +5,24 @@ public enum PageSet: GValueRepresentableEnum { public typealias GtkEnum = GtkPageSet /// All pages. - case all - /// Even pages. - case even - /// Odd pages. - case odd +case all +/// Even pages. +case even +/// Odd pages. +case odd public static var type: GType { - gtk_page_set_get_type() - } + gtk_page_set_get_type() +} public init(from gtkEnum: GtkPageSet) { switch gtkEnum { case GTK_PAGE_SET_ALL: - self = .all - case GTK_PAGE_SET_EVEN: - self = .even - case GTK_PAGE_SET_ODD: - self = .odd + self = .all +case GTK_PAGE_SET_EVEN: + self = .even +case GTK_PAGE_SET_ODD: + self = .odd default: fatalError("Unsupported GtkPageSet enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ public enum PageSet: GValueRepresentableEnum { public func toGtk() -> GtkPageSet { switch self { case .all: - return GTK_PAGE_SET_ALL - case .even: - return GTK_PAGE_SET_EVEN - case .odd: - return GTK_PAGE_SET_ODD + return GTK_PAGE_SET_ALL +case .even: + return GTK_PAGE_SET_EVEN +case .odd: + return GTK_PAGE_SET_ODD } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PanDirection.swift b/Sources/Gtk/Generated/PanDirection.swift index 671e76d754..6c0f476926 100644 --- a/Sources/Gtk/Generated/PanDirection.swift +++ b/Sources/Gtk/Generated/PanDirection.swift @@ -5,28 +5,28 @@ public enum PanDirection: GValueRepresentableEnum { public typealias GtkEnum = GtkPanDirection /// Panned towards the left - case left - /// Panned towards the right - case right - /// Panned upwards - case up - /// Panned downwards - case down +case left +/// Panned towards the right +case right +/// Panned upwards +case up +/// Panned downwards +case down public static var type: GType { - gtk_pan_direction_get_type() - } + gtk_pan_direction_get_type() +} public init(from gtkEnum: GtkPanDirection) { switch gtkEnum { case GTK_PAN_DIRECTION_LEFT: - self = .left - case GTK_PAN_DIRECTION_RIGHT: - self = .right - case GTK_PAN_DIRECTION_UP: - self = .up - case GTK_PAN_DIRECTION_DOWN: - self = .down + self = .left +case GTK_PAN_DIRECTION_RIGHT: + self = .right +case GTK_PAN_DIRECTION_UP: + self = .up +case GTK_PAN_DIRECTION_DOWN: + self = .down default: fatalError("Unsupported GtkPanDirection enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum PanDirection: GValueRepresentableEnum { public func toGtk() -> GtkPanDirection { switch self { case .left: - return GTK_PAN_DIRECTION_LEFT - case .right: - return GTK_PAN_DIRECTION_RIGHT - case .up: - return GTK_PAN_DIRECTION_UP - case .down: - return GTK_PAN_DIRECTION_DOWN + return GTK_PAN_DIRECTION_LEFT +case .right: + return GTK_PAN_DIRECTION_RIGHT +case .up: + return GTK_PAN_DIRECTION_UP +case .down: + return GTK_PAN_DIRECTION_DOWN } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Picture.swift b/Sources/Gtk/Generated/Picture.swift index df026896e3..b75884c0a8 100644 --- a/Sources/Gtk/Generated/Picture.swift +++ b/Sources/Gtk/Generated/Picture.swift @@ -1,34 +1,34 @@ import CGtk /// Displays a `GdkPaintable`. -/// +/// /// picture>An example GtkPicture -/// +/// /// Many convenience functions are provided to make pictures simple to use. /// For example, if you want to load an image from a file, and then display /// it, there’s a convenience function to do this: -/// +/// /// ```c /// GtkWidget *widget = gtk_picture_new_for_filename ("myfile.png"); /// ``` -/// +/// /// If the file isn’t loaded successfully, the picture will contain a /// “broken image” icon similar to that used in many web browsers. /// If you want to handle errors in loading the file yourself, /// for example by displaying an error message, then load the image with -/// [ctor@Gdk.Texture.new_from_file], then create the `GtkPicture` with -/// [ctor@Gtk.Picture.new_for_paintable]. -/// +/// and image loading framework such as libglycin, then create the `GtkPicture` +/// with [ctor@Gtk.Picture.new_for_paintable]. +/// /// Sometimes an application will want to avoid depending on external data /// files, such as image files. See the documentation of `GResource` for details. /// In this case, [ctor@Gtk.Picture.new_for_resource] and /// [method@Gtk.Picture.set_resource] should be used. -/// +/// /// `GtkPicture` displays an image at its natural size. See [class@Gtk.Image] /// if you want to display a fixed-size image, such as an icon. -/// +/// /// ## Sizing the paintable -/// +/// /// You can influence how the paintable is displayed inside the `GtkPicture` /// by changing [property@Gtk.Picture:content-fit]. See [enum@Gtk.ContentFit] /// for details. [property@Gtk.Picture:can-shrink] can be unset to make sure @@ -38,150 +38,144 @@ import CGtk /// grow larger than the screen. And [property@Gtk.Widget:halign] and /// [property@Gtk.Widget:valign] can be used to make sure the paintable doesn't /// fill all available space but is instead displayed at its original size. -/// +/// /// ## CSS nodes -/// +/// /// `GtkPicture` has a single CSS node with the name `picture`. -/// +/// /// ## Accessibility -/// +/// /// `GtkPicture` uses the [enum@Gtk.AccessibleRole.img] role. open class Picture: Widget { /// Creates a new empty `GtkPicture` widget. - public convenience init() { - self.init( - gtk_picture_new() - ) +public convenience init() { + self.init( + gtk_picture_new() + ) +} + +/// Creates a new `GtkPicture` displaying the file @filename. +/// +/// This is a utility function that calls [ctor@Gtk.Picture.new_for_file]. +/// See that function for details. +public convenience init(filename: String) { + self.init( + gtk_picture_new_for_filename(filename) + ) +} + +/// Creates a new `GtkPicture` displaying @paintable. +/// +/// The `GtkPicture` will track changes to the @paintable and update +/// its size and contents in response to it. +public convenience init(paintable: OpaquePointer) { + self.init( + gtk_picture_new_for_paintable(paintable) + ) +} + +/// Creates a new `GtkPicture` displaying the resource at @resource_path. +/// +/// This is a utility function that calls [ctor@Gtk.Picture.new_for_file]. +/// See that function for details. +public convenience init(resourcePath: String) { + self.init( + gtk_picture_new_for_resource(resourcePath) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new `GtkPicture` displaying the file @filename. - /// - /// This is a utility function that calls [ctor@Gtk.Picture.new_for_file]. - /// See that function for details. - public convenience init(filename: String) { - self.init( - gtk_picture_new_for_filename(filename) - ) +addSignal(name: "notify::alternative-text", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAlternativeText?(self, param0) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new `GtkPicture` displaying @paintable. - /// - /// The `GtkPicture` will track changes to the @paintable and update - /// its size and contents in response to it. - public convenience init(paintable: OpaquePointer) { - self.init( - gtk_picture_new_for_paintable(paintable) - ) +addSignal(name: "notify::can-shrink", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCanShrink?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new `GtkPicture` displaying the resource at @resource_path. - /// - /// This is a utility function that calls [ctor@Gtk.Picture.new_for_file]. - /// See that function for details. - public convenience init(resourcePath: String) { - self.init( - gtk_picture_new_for_resource(resourcePath) - ) +addSignal(name: "notify::content-fit", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContentFit?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::alternative-text", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAlternativeText?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::can-shrink", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCanShrink?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::content-fit", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContentFit?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::file", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFile?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::keep-aspect-ratio", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyKeepAspectRatio?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::paintable", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPaintable?(self, param0) - } +addSignal(name: "notify::file", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFile?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::keep-aspect-ratio", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyKeepAspectRatio?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::paintable", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPaintable?(self, param0) +} +} + /// The alternative textual description for the picture. - @GObjectProperty(named: "alternative-text") public var alternativeText: String? +@GObjectProperty(named: "alternative-text") public var alternativeText: String? - /// If the `GtkPicture` can be made smaller than the natural size of its contents. - @GObjectProperty(named: "can-shrink") public var canShrink: Bool +/// If the `GtkPicture` can be made smaller than the natural size of its contents. +@GObjectProperty(named: "can-shrink") public var canShrink: Bool - /// Whether the GtkPicture will render its contents trying to preserve the aspect - /// ratio. - @GObjectProperty(named: "keep-aspect-ratio") public var keepAspectRatio: Bool +/// Whether the GtkPicture will render its contents trying to preserve the aspect +/// ratio. +@GObjectProperty(named: "keep-aspect-ratio") public var keepAspectRatio: Bool - /// The `GdkPaintable` to be displayed by this `GtkPicture`. - @GObjectProperty(named: "paintable") public var paintable: OpaquePointer? +/// The `GdkPaintable` to be displayed by this `GtkPicture`. +@GObjectProperty(named: "paintable") public var paintable: OpaquePointer? - public var notifyAlternativeText: ((Picture, OpaquePointer) -> Void)? - public var notifyCanShrink: ((Picture, OpaquePointer) -> Void)? +public var notifyAlternativeText: ((Picture, OpaquePointer) -> Void)? - public var notifyContentFit: ((Picture, OpaquePointer) -> Void)? - public var notifyFile: ((Picture, OpaquePointer) -> Void)? +public var notifyCanShrink: ((Picture, OpaquePointer) -> Void)? - public var notifyKeepAspectRatio: ((Picture, OpaquePointer) -> Void)? - public var notifyPaintable: ((Picture, OpaquePointer) -> Void)? -} +public var notifyContentFit: ((Picture, OpaquePointer) -> Void)? + + +public var notifyFile: ((Picture, OpaquePointer) -> Void)? + + +public var notifyKeepAspectRatio: ((Picture, OpaquePointer) -> Void)? + + +public var notifyPaintable: ((Picture, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PolicyType.swift b/Sources/Gtk/Generated/PolicyType.swift index 6c8b2f3718..723782bc54 100644 --- a/Sources/Gtk/Generated/PolicyType.swift +++ b/Sources/Gtk/Generated/PolicyType.swift @@ -6,33 +6,33 @@ public enum PolicyType: GValueRepresentableEnum { public typealias GtkEnum = GtkPolicyType /// The scrollbar is always visible. The view size is - /// independent of the content. - case always - /// The scrollbar will appear and disappear as necessary. - /// For example, when all of a `GtkTreeView` can not be seen. - case automatic - /// The scrollbar should never appear. In this mode the - /// content determines the size. - case never - /// Don't show a scrollbar, but don't force the - /// size to follow the content. This can be used e.g. to make multiple - /// scrolled windows share a scrollbar. - case external +/// independent of the content. +case always +/// The scrollbar will appear and disappear as necessary. +/// For example, when all of a `GtkTreeView` can not be seen. +case automatic +/// The scrollbar should never appear. In this mode the +/// content determines the size. +case never +/// Don't show a scrollbar, but don't force the +/// size to follow the content. This can be used e.g. to make multiple +/// scrolled windows share a scrollbar. +case external public static var type: GType { - gtk_policy_type_get_type() - } + gtk_policy_type_get_type() +} public init(from gtkEnum: GtkPolicyType) { switch gtkEnum { case GTK_POLICY_ALWAYS: - self = .always - case GTK_POLICY_AUTOMATIC: - self = .automatic - case GTK_POLICY_NEVER: - self = .never - case GTK_POLICY_EXTERNAL: - self = .external + self = .always +case GTK_POLICY_AUTOMATIC: + self = .automatic +case GTK_POLICY_NEVER: + self = .never +case GTK_POLICY_EXTERNAL: + self = .external default: fatalError("Unsupported GtkPolicyType enum value: \(gtkEnum.rawValue)") } @@ -41,13 +41,13 @@ public enum PolicyType: GValueRepresentableEnum { public func toGtk() -> GtkPolicyType { switch self { case .always: - return GTK_POLICY_ALWAYS - case .automatic: - return GTK_POLICY_AUTOMATIC - case .never: - return GTK_POLICY_NEVER - case .external: - return GTK_POLICY_EXTERNAL + return GTK_POLICY_ALWAYS +case .automatic: + return GTK_POLICY_AUTOMATIC +case .never: + return GTK_POLICY_NEVER +case .external: + return GTK_POLICY_EXTERNAL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Popover.swift b/Sources/Gtk/Generated/Popover.swift index 03aee0c25b..7095c5824c 100644 --- a/Sources/Gtk/Generated/Popover.swift +++ b/Sources/Gtk/Generated/Popover.swift @@ -1,67 +1,72 @@ import CGtk /// Presents a bubble-like popup. -/// +/// /// An example GtkPopover -/// +/// /// It is primarily meant to provide context-dependent information -/// or options. Popovers are attached to a parent widget. By default, -/// they point to the whole widget area, although this behavior can be -/// changed with [method@Gtk.Popover.set_pointing_to]. -/// +/// or options. Popovers are attached to a parent widget. The parent widget +/// must support popover children, as [class@Gtk.MenuButton] and +/// [class@Gtk.PopoverMenuBar] do. If you want to make a custom widget that +/// has an attached popover, you need to call [method@Gtk.Popover.present] +/// in your [vfunc@Gtk.Widget.size_allocate] vfunc, in order to update the +/// positioning of the popover. +/// /// The position of a popover relative to the widget it is attached to -/// can also be changed with [method@Gtk.Popover.set_position] -/// +/// can also be changed with [method@Gtk.Popover.set_position]. By default, +/// it points to the whole widget area, but it can be made to point to +/// a specific area using [method@Gtk.Popover.set_pointing_to]. +/// /// By default, `GtkPopover` performs a grab, in order to ensure input /// events get redirected to it while it is shown, and also so the popover /// is dismissed in the expected situations (clicks outside the popover, /// or the Escape key being pressed). If no such modal behavior is desired /// on a popover, [method@Gtk.Popover.set_autohide] may be called on it to /// tweak its behavior. -/// +/// /// ## GtkPopover as menu replacement -/// +/// /// `GtkPopover` is often used to replace menus. The best way to do this /// is to use the [class@Gtk.PopoverMenu] subclass which supports being /// populated from a `GMenuModel` with [ctor@Gtk.PopoverMenu.new_from_model]. -/// +/// /// ```xml ///
horizontal-buttonsCutapp.cutedit-cut-symbolicCopyapp.copyedit-copy-symbolicPasteapp.pasteedit-paste-symbolic
/// ``` -/// +/// /// # Shortcuts and Gestures -/// +/// /// `GtkPopover` supports the following keyboard shortcuts: -/// +/// /// - Escape closes the popover. /// - Alt makes the mnemonics visible. -/// +/// /// The following signals have default keybindings: -/// +/// /// - [signal@Gtk.Popover::activate-default] -/// +/// /// # CSS nodes -/// +/// /// ``` /// popover.background[.menu] /// ├── arrow /// ╰── contents /// ╰── /// ``` -/// +/// /// `GtkPopover` has a main node with name `popover`, an arrow with name `arrow`, /// and another node for the content named `contents`. The `popover` node always /// gets the `.background` style class. It also gets the `.menu` style class /// if the popover is menu-like, e.g. is a [class@Gtk.PopoverMenu]. -/// +/// /// Particular uses of `GtkPopover`, such as touch selection popups or /// magnifiers in `GtkEntry` or `GtkTextView` get style classes like /// `.touch-selection` or `.magnifier` to differentiate from plain popovers. -/// +/// /// When styling a popover directly, the `popover` node should usually /// not have any background. The visible part of the popover can have /// a shadow. To specify it in CSS, set the box-shadow of the `contents` node. -/// +/// /// Note that, in order to accomplish appropriate arrow visuals, `GtkPopover` /// uses custom drawing for the `arrow` node. This makes it possible for the /// arrow to change its shape dynamically, but it also limits the possibilities @@ -73,162 +78,154 @@ import CGtk /// used) and no box-shadow. open class Popover: Widget, Native, ShortcutManager { /// Creates a new `GtkPopover`. - public convenience init() { - self.init( - gtk_popover_new() - ) +public convenience init() { + self.init( + gtk_popover_new() + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate-default") { [weak self] () in + guard let self = self else { return } + self.activateDefault?(self) +} + +addSignal(name: "closed") { [weak self] () in + guard let self = self else { return } + self.closed?(self) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate-default") { [weak self] () in - guard let self = self else { return } - self.activateDefault?(self) - } - - addSignal(name: "closed") { [weak self] () in - guard let self = self else { return } - self.closed?(self) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::autohide", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAutohide?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::cascade-popdown", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCascadePopdown?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::child", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyChild?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::default-widget", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDefaultWidget?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::has-arrow", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasArrow?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::mnemonics-visible", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMnemonicsVisible?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::pointing-to", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPointingTo?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::position", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPosition?(self, param0) - } +addSignal(name: "notify::autohide", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAutohide?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::cascade-popdown", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCascadePopdown?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::child", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyChild?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::default-widget", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDefaultWidget?(self, param0) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::has-arrow", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasArrow?(self, param0) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::mnemonics-visible", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMnemonicsVisible?(self, param0) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::pointing-to", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPointingTo?(self, param0) +} + +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::position", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPosition?(self, param0) +} +} + /// Whether to dismiss the popover on outside clicks. - @GObjectProperty(named: "autohide") public var autohide: Bool +@GObjectProperty(named: "autohide") public var autohide: Bool - /// Whether the popover pops down after a child popover. - /// - /// This is used to implement the expected behavior of submenus. - @GObjectProperty(named: "cascade-popdown") public var cascadePopdown: Bool +/// Whether the popover pops down after a child popover. +/// +/// This is used to implement the expected behavior of submenus. +@GObjectProperty(named: "cascade-popdown") public var cascadePopdown: Bool - /// Whether to draw an arrow. - @GObjectProperty(named: "has-arrow") public var hasArrow: Bool +/// Whether to draw an arrow. +@GObjectProperty(named: "has-arrow") public var hasArrow: Bool - /// Whether mnemonics are currently visible in this popover. - @GObjectProperty(named: "mnemonics-visible") public var mnemonicsVisible: Bool +/// Whether mnemonics are currently visible in this popover. +@GObjectProperty(named: "mnemonics-visible") public var mnemonicsVisible: Bool - /// How to place the popover, relative to its parent. - @GObjectProperty(named: "position") public var position: PositionType +/// How to place the popover, relative to its parent. +@GObjectProperty(named: "position") public var position: PositionType - /// Emitted whend the user activates the default widget. - /// - /// This is a [keybinding signal](class.SignalAction.html). - /// - /// The default binding for this signal is Enter. - public var activateDefault: ((Popover) -> Void)? +/// Emitted whend the user activates the default widget. +/// +/// This is a [keybinding signal](class.SignalAction.html). +/// +/// The default binding for this signal is Enter. +public var activateDefault: ((Popover) -> Void)? - /// Emitted when the popover is closed. - public var closed: ((Popover) -> Void)? +/// Emitted when the popover is closed. +public var closed: ((Popover) -> Void)? - public var notifyAutohide: ((Popover, OpaquePointer) -> Void)? - public var notifyCascadePopdown: ((Popover, OpaquePointer) -> Void)? +public var notifyAutohide: ((Popover, OpaquePointer) -> Void)? - public var notifyChild: ((Popover, OpaquePointer) -> Void)? - public var notifyDefaultWidget: ((Popover, OpaquePointer) -> Void)? +public var notifyCascadePopdown: ((Popover, OpaquePointer) -> Void)? - public var notifyHasArrow: ((Popover, OpaquePointer) -> Void)? - public var notifyMnemonicsVisible: ((Popover, OpaquePointer) -> Void)? +public var notifyChild: ((Popover, OpaquePointer) -> Void)? - public var notifyPointingTo: ((Popover, OpaquePointer) -> Void)? - public var notifyPosition: ((Popover, OpaquePointer) -> Void)? -} +public var notifyDefaultWidget: ((Popover, OpaquePointer) -> Void)? + + +public var notifyHasArrow: ((Popover, OpaquePointer) -> Void)? + + +public var notifyMnemonicsVisible: ((Popover, OpaquePointer) -> Void)? + + +public var notifyPointingTo: ((Popover, OpaquePointer) -> Void)? + + +public var notifyPosition: ((Popover, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PositionType.swift b/Sources/Gtk/Generated/PositionType.swift index cd0c7bcd4e..1ae80235e0 100644 --- a/Sources/Gtk/Generated/PositionType.swift +++ b/Sources/Gtk/Generated/PositionType.swift @@ -1,35 +1,35 @@ import CGtk /// Describes which edge of a widget a certain feature is positioned at. -/// +/// /// For examples, see the tabs of a [class@Notebook], or the label /// of a [class@Scale]. public enum PositionType: GValueRepresentableEnum { public typealias GtkEnum = GtkPositionType /// The feature is at the left edge. - case left - /// The feature is at the right edge. - case right - /// The feature is at the top edge. - case top - /// The feature is at the bottom edge. - case bottom +case left +/// The feature is at the right edge. +case right +/// The feature is at the top edge. +case top +/// The feature is at the bottom edge. +case bottom public static var type: GType { - gtk_position_type_get_type() - } + gtk_position_type_get_type() +} public init(from gtkEnum: GtkPositionType) { switch gtkEnum { case GTK_POS_LEFT: - self = .left - case GTK_POS_RIGHT: - self = .right - case GTK_POS_TOP: - self = .top - case GTK_POS_BOTTOM: - self = .bottom + self = .left +case GTK_POS_RIGHT: + self = .right +case GTK_POS_TOP: + self = .top +case GTK_POS_BOTTOM: + self = .bottom default: fatalError("Unsupported GtkPositionType enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ public enum PositionType: GValueRepresentableEnum { public func toGtk() -> GtkPositionType { switch self { case .left: - return GTK_POS_LEFT - case .right: - return GTK_POS_RIGHT - case .top: - return GTK_POS_TOP - case .bottom: - return GTK_POS_BOTTOM + return GTK_POS_LEFT +case .right: + return GTK_POS_RIGHT +case .top: + return GTK_POS_TOP +case .bottom: + return GTK_POS_BOTTOM } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PrintDuplex.swift b/Sources/Gtk/Generated/PrintDuplex.swift index fdf4854f27..8d59014fc4 100644 --- a/Sources/Gtk/Generated/PrintDuplex.swift +++ b/Sources/Gtk/Generated/PrintDuplex.swift @@ -5,24 +5,24 @@ public enum PrintDuplex: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintDuplex /// No duplex. - case simplex - /// Horizontal duplex. - case horizontal - /// Vertical duplex. - case vertical +case simplex +/// Horizontal duplex. +case horizontal +/// Vertical duplex. +case vertical public static var type: GType { - gtk_print_duplex_get_type() - } + gtk_print_duplex_get_type() +} public init(from gtkEnum: GtkPrintDuplex) { switch gtkEnum { case GTK_PRINT_DUPLEX_SIMPLEX: - self = .simplex - case GTK_PRINT_DUPLEX_HORIZONTAL: - self = .horizontal - case GTK_PRINT_DUPLEX_VERTICAL: - self = .vertical + self = .simplex +case GTK_PRINT_DUPLEX_HORIZONTAL: + self = .horizontal +case GTK_PRINT_DUPLEX_VERTICAL: + self = .vertical default: fatalError("Unsupported GtkPrintDuplex enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ public enum PrintDuplex: GValueRepresentableEnum { public func toGtk() -> GtkPrintDuplex { switch self { case .simplex: - return GTK_PRINT_DUPLEX_SIMPLEX - case .horizontal: - return GTK_PRINT_DUPLEX_HORIZONTAL - case .vertical: - return GTK_PRINT_DUPLEX_VERTICAL + return GTK_PRINT_DUPLEX_SIMPLEX +case .horizontal: + return GTK_PRINT_DUPLEX_HORIZONTAL +case .vertical: + return GTK_PRINT_DUPLEX_VERTICAL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PrintError.swift b/Sources/Gtk/Generated/PrintError.swift index c4397c6f19..b61a09f4ab 100644 --- a/Sources/Gtk/Generated/PrintError.swift +++ b/Sources/Gtk/Generated/PrintError.swift @@ -6,29 +6,29 @@ public enum PrintError: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintError /// An unspecified error occurred. - case general - /// An internal error occurred. - case internalError - /// A memory allocation failed. - case nomem - /// An error occurred while loading a page setup - /// or paper size from a key file. - case invalidFile +case general +/// An internal error occurred. +case internalError +/// A memory allocation failed. +case nomem +/// An error occurred while loading a page setup +/// or paper size from a key file. +case invalidFile public static var type: GType { - gtk_print_error_get_type() - } + gtk_print_error_get_type() +} public init(from gtkEnum: GtkPrintError) { switch gtkEnum { case GTK_PRINT_ERROR_GENERAL: - self = .general - case GTK_PRINT_ERROR_INTERNAL_ERROR: - self = .internalError - case GTK_PRINT_ERROR_NOMEM: - self = .nomem - case GTK_PRINT_ERROR_INVALID_FILE: - self = .invalidFile + self = .general +case GTK_PRINT_ERROR_INTERNAL_ERROR: + self = .internalError +case GTK_PRINT_ERROR_NOMEM: + self = .nomem +case GTK_PRINT_ERROR_INVALID_FILE: + self = .invalidFile default: fatalError("Unsupported GtkPrintError enum value: \(gtkEnum.rawValue)") } @@ -37,13 +37,13 @@ public enum PrintError: GValueRepresentableEnum { public func toGtk() -> GtkPrintError { switch self { case .general: - return GTK_PRINT_ERROR_GENERAL - case .internalError: - return GTK_PRINT_ERROR_INTERNAL_ERROR - case .nomem: - return GTK_PRINT_ERROR_NOMEM - case .invalidFile: - return GTK_PRINT_ERROR_INVALID_FILE + return GTK_PRINT_ERROR_GENERAL +case .internalError: + return GTK_PRINT_ERROR_INTERNAL_ERROR +case .nomem: + return GTK_PRINT_ERROR_NOMEM +case .invalidFile: + return GTK_PRINT_ERROR_INVALID_FILE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PrintOperationAction.swift b/Sources/Gtk/Generated/PrintOperationAction.swift index dc3be60a12..3c4579d6cd 100644 --- a/Sources/Gtk/Generated/PrintOperationAction.swift +++ b/Sources/Gtk/Generated/PrintOperationAction.swift @@ -1,37 +1,37 @@ import CGtk /// Determines what action the print operation should perform. -/// +/// /// A parameter of this typs is passed to [method@Gtk.PrintOperation.run]. public enum PrintOperationAction: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintOperationAction /// Show the print dialog. - case printDialog - /// Start to print without showing - /// the print dialog, based on the current print settings, if possible. - /// Depending on the platform, a print dialog might appear anyway. - case print - /// Show the print preview. - case preview - /// Export to a file. This requires - /// the export-filename property to be set. - case export +case printDialog +/// Start to print without showing +/// the print dialog, based on the current print settings, if possible. +/// Depending on the platform, a print dialog might appear anyway. +case print +/// Show the print preview. +case preview +/// Export to a file. This requires +/// the export-filename property to be set. +case export public static var type: GType { - gtk_print_operation_action_get_type() - } + gtk_print_operation_action_get_type() +} public init(from gtkEnum: GtkPrintOperationAction) { switch gtkEnum { case GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG: - self = .printDialog - case GTK_PRINT_OPERATION_ACTION_PRINT: - self = .print - case GTK_PRINT_OPERATION_ACTION_PREVIEW: - self = .preview - case GTK_PRINT_OPERATION_ACTION_EXPORT: - self = .export + self = .printDialog +case GTK_PRINT_OPERATION_ACTION_PRINT: + self = .print +case GTK_PRINT_OPERATION_ACTION_PREVIEW: + self = .preview +case GTK_PRINT_OPERATION_ACTION_EXPORT: + self = .export default: fatalError("Unsupported GtkPrintOperationAction enum value: \(gtkEnum.rawValue)") } @@ -40,13 +40,13 @@ public enum PrintOperationAction: GValueRepresentableEnum { public func toGtk() -> GtkPrintOperationAction { switch self { case .printDialog: - return GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG - case .print: - return GTK_PRINT_OPERATION_ACTION_PRINT - case .preview: - return GTK_PRINT_OPERATION_ACTION_PREVIEW - case .export: - return GTK_PRINT_OPERATION_ACTION_EXPORT + return GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG +case .print: + return GTK_PRINT_OPERATION_ACTION_PRINT +case .preview: + return GTK_PRINT_OPERATION_ACTION_PREVIEW +case .export: + return GTK_PRINT_OPERATION_ACTION_EXPORT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PrintOperationResult.swift b/Sources/Gtk/Generated/PrintOperationResult.swift index 07a29bb38e..46bf28eb4d 100644 --- a/Sources/Gtk/Generated/PrintOperationResult.swift +++ b/Sources/Gtk/Generated/PrintOperationResult.swift @@ -1,36 +1,36 @@ import CGtk /// The result of a print operation. -/// +/// /// A value of this type is returned by [method@Gtk.PrintOperation.run]. public enum PrintOperationResult: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintOperationResult /// An error has occurred. - case error - /// The print settings should be stored. - case apply - /// The print operation has been canceled, - /// the print settings should not be stored. - case cancel - /// The print operation is not complete - /// yet. This value will only be returned when running asynchronously. - case inProgress +case error +/// The print settings should be stored. +case apply +/// The print operation has been canceled, +/// the print settings should not be stored. +case cancel +/// The print operation is not complete +/// yet. This value will only be returned when running asynchronously. +case inProgress public static var type: GType { - gtk_print_operation_result_get_type() - } + gtk_print_operation_result_get_type() +} public init(from gtkEnum: GtkPrintOperationResult) { switch gtkEnum { case GTK_PRINT_OPERATION_RESULT_ERROR: - self = .error - case GTK_PRINT_OPERATION_RESULT_APPLY: - self = .apply - case GTK_PRINT_OPERATION_RESULT_CANCEL: - self = .cancel - case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS: - self = .inProgress + self = .error +case GTK_PRINT_OPERATION_RESULT_APPLY: + self = .apply +case GTK_PRINT_OPERATION_RESULT_CANCEL: + self = .cancel +case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS: + self = .inProgress default: fatalError("Unsupported GtkPrintOperationResult enum value: \(gtkEnum.rawValue)") } @@ -39,13 +39,13 @@ public enum PrintOperationResult: GValueRepresentableEnum { public func toGtk() -> GtkPrintOperationResult { switch self { case .error: - return GTK_PRINT_OPERATION_RESULT_ERROR - case .apply: - return GTK_PRINT_OPERATION_RESULT_APPLY - case .cancel: - return GTK_PRINT_OPERATION_RESULT_CANCEL - case .inProgress: - return GTK_PRINT_OPERATION_RESULT_IN_PROGRESS + return GTK_PRINT_OPERATION_RESULT_ERROR +case .apply: + return GTK_PRINT_OPERATION_RESULT_APPLY +case .cancel: + return GTK_PRINT_OPERATION_RESULT_CANCEL +case .inProgress: + return GTK_PRINT_OPERATION_RESULT_IN_PROGRESS } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PrintPages.swift b/Sources/Gtk/Generated/PrintPages.swift index 6806476cf3..0daf9facdb 100644 --- a/Sources/Gtk/Generated/PrintPages.swift +++ b/Sources/Gtk/Generated/PrintPages.swift @@ -5,28 +5,28 @@ public enum PrintPages: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintPages /// All pages. - case all - /// Current page. - case current - /// Range of pages. - case ranges - /// Selected pages. - case selection +case all +/// Current page. +case current +/// Range of pages. +case ranges +/// Selected pages. +case selection public static var type: GType { - gtk_print_pages_get_type() - } + gtk_print_pages_get_type() +} public init(from gtkEnum: GtkPrintPages) { switch gtkEnum { case GTK_PRINT_PAGES_ALL: - self = .all - case GTK_PRINT_PAGES_CURRENT: - self = .current - case GTK_PRINT_PAGES_RANGES: - self = .ranges - case GTK_PRINT_PAGES_SELECTION: - self = .selection + self = .all +case GTK_PRINT_PAGES_CURRENT: + self = .current +case GTK_PRINT_PAGES_RANGES: + self = .ranges +case GTK_PRINT_PAGES_SELECTION: + self = .selection default: fatalError("Unsupported GtkPrintPages enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum PrintPages: GValueRepresentableEnum { public func toGtk() -> GtkPrintPages { switch self { case .all: - return GTK_PRINT_PAGES_ALL - case .current: - return GTK_PRINT_PAGES_CURRENT - case .ranges: - return GTK_PRINT_PAGES_RANGES - case .selection: - return GTK_PRINT_PAGES_SELECTION + return GTK_PRINT_PAGES_ALL +case .current: + return GTK_PRINT_PAGES_CURRENT +case .ranges: + return GTK_PRINT_PAGES_RANGES +case .selection: + return GTK_PRINT_PAGES_SELECTION } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PrintQuality.swift b/Sources/Gtk/Generated/PrintQuality.swift index 08c785ae17..66848c3d9c 100644 --- a/Sources/Gtk/Generated/PrintQuality.swift +++ b/Sources/Gtk/Generated/PrintQuality.swift @@ -5,28 +5,28 @@ public enum PrintQuality: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintQuality /// Low quality. - case low - /// Normal quality. - case normal - /// High quality. - case high - /// Draft quality. - case draft +case low +/// Normal quality. +case normal +/// High quality. +case high +/// Draft quality. +case draft public static var type: GType { - gtk_print_quality_get_type() - } + gtk_print_quality_get_type() +} public init(from gtkEnum: GtkPrintQuality) { switch gtkEnum { case GTK_PRINT_QUALITY_LOW: - self = .low - case GTK_PRINT_QUALITY_NORMAL: - self = .normal - case GTK_PRINT_QUALITY_HIGH: - self = .high - case GTK_PRINT_QUALITY_DRAFT: - self = .draft + self = .low +case GTK_PRINT_QUALITY_NORMAL: + self = .normal +case GTK_PRINT_QUALITY_HIGH: + self = .high +case GTK_PRINT_QUALITY_DRAFT: + self = .draft default: fatalError("Unsupported GtkPrintQuality enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum PrintQuality: GValueRepresentableEnum { public func toGtk() -> GtkPrintQuality { switch self { case .low: - return GTK_PRINT_QUALITY_LOW - case .normal: - return GTK_PRINT_QUALITY_NORMAL - case .high: - return GTK_PRINT_QUALITY_HIGH - case .draft: - return GTK_PRINT_QUALITY_DRAFT + return GTK_PRINT_QUALITY_LOW +case .normal: + return GTK_PRINT_QUALITY_NORMAL +case .high: + return GTK_PRINT_QUALITY_HIGH +case .draft: + return GTK_PRINT_QUALITY_DRAFT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PrintStatus.swift b/Sources/Gtk/Generated/PrintStatus.swift index 5078e9369f..9409b327c4 100644 --- a/Sources/Gtk/Generated/PrintStatus.swift +++ b/Sources/Gtk/Generated/PrintStatus.swift @@ -6,54 +6,54 @@ public enum PrintStatus: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintStatus /// The printing has not started yet; this - /// status is set initially, and while the print dialog is shown. - case initial - /// This status is set while the begin-print - /// signal is emitted and during pagination. - case preparing - /// This status is set while the - /// pages are being rendered. - case generatingData - /// The print job is being sent off to the - /// printer. - case sendingData - /// The print job has been sent to the printer, - /// but is not printed for some reason, e.g. the printer may be stopped. - case pending - /// Some problem has occurred during - /// printing, e.g. a paper jam. - case pendingIssue - /// The printer is processing the print job. - case printing - /// The printing has been completed successfully. - case finished - /// The printing has been aborted. - case finishedAborted +/// status is set initially, and while the print dialog is shown. +case initial +/// This status is set while the begin-print +/// signal is emitted and during pagination. +case preparing +/// This status is set while the +/// pages are being rendered. +case generatingData +/// The print job is being sent off to the +/// printer. +case sendingData +/// The print job has been sent to the printer, +/// but is not printed for some reason, e.g. the printer may be stopped. +case pending +/// Some problem has occurred during +/// printing, e.g. a paper jam. +case pendingIssue +/// The printer is processing the print job. +case printing +/// The printing has been completed successfully. +case finished +/// The printing has been aborted. +case finishedAborted public static var type: GType { - gtk_print_status_get_type() - } + gtk_print_status_get_type() +} public init(from gtkEnum: GtkPrintStatus) { switch gtkEnum { case GTK_PRINT_STATUS_INITIAL: - self = .initial - case GTK_PRINT_STATUS_PREPARING: - self = .preparing - case GTK_PRINT_STATUS_GENERATING_DATA: - self = .generatingData - case GTK_PRINT_STATUS_SENDING_DATA: - self = .sendingData - case GTK_PRINT_STATUS_PENDING: - self = .pending - case GTK_PRINT_STATUS_PENDING_ISSUE: - self = .pendingIssue - case GTK_PRINT_STATUS_PRINTING: - self = .printing - case GTK_PRINT_STATUS_FINISHED: - self = .finished - case GTK_PRINT_STATUS_FINISHED_ABORTED: - self = .finishedAborted + self = .initial +case GTK_PRINT_STATUS_PREPARING: + self = .preparing +case GTK_PRINT_STATUS_GENERATING_DATA: + self = .generatingData +case GTK_PRINT_STATUS_SENDING_DATA: + self = .sendingData +case GTK_PRINT_STATUS_PENDING: + self = .pending +case GTK_PRINT_STATUS_PENDING_ISSUE: + self = .pendingIssue +case GTK_PRINT_STATUS_PRINTING: + self = .printing +case GTK_PRINT_STATUS_FINISHED: + self = .finished +case GTK_PRINT_STATUS_FINISHED_ABORTED: + self = .finishedAborted default: fatalError("Unsupported GtkPrintStatus enum value: \(gtkEnum.rawValue)") } @@ -62,23 +62,23 @@ public enum PrintStatus: GValueRepresentableEnum { public func toGtk() -> GtkPrintStatus { switch self { case .initial: - return GTK_PRINT_STATUS_INITIAL - case .preparing: - return GTK_PRINT_STATUS_PREPARING - case .generatingData: - return GTK_PRINT_STATUS_GENERATING_DATA - case .sendingData: - return GTK_PRINT_STATUS_SENDING_DATA - case .pending: - return GTK_PRINT_STATUS_PENDING - case .pendingIssue: - return GTK_PRINT_STATUS_PENDING_ISSUE - case .printing: - return GTK_PRINT_STATUS_PRINTING - case .finished: - return GTK_PRINT_STATUS_FINISHED - case .finishedAborted: - return GTK_PRINT_STATUS_FINISHED_ABORTED + return GTK_PRINT_STATUS_INITIAL +case .preparing: + return GTK_PRINT_STATUS_PREPARING +case .generatingData: + return GTK_PRINT_STATUS_GENERATING_DATA +case .sendingData: + return GTK_PRINT_STATUS_SENDING_DATA +case .pending: + return GTK_PRINT_STATUS_PENDING +case .pendingIssue: + return GTK_PRINT_STATUS_PENDING_ISSUE +case .printing: + return GTK_PRINT_STATUS_PRINTING +case .finished: + return GTK_PRINT_STATUS_FINISHED +case .finishedAborted: + return GTK_PRINT_STATUS_FINISHED_ABORTED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ProgressBar.swift b/Sources/Gtk/Generated/ProgressBar.swift index 65796c4396..23d464f7d1 100644 --- a/Sources/Gtk/Generated/ProgressBar.swift +++ b/Sources/Gtk/Generated/ProgressBar.swift @@ -1,39 +1,39 @@ import CGtk /// Displays the progress of a long-running operation. -/// +/// /// `GtkProgressBar` provides a visual clue that processing is underway. /// It can be used in two different modes: percentage mode and activity mode. -/// +/// /// An example GtkProgressBar -/// +/// /// When an application can determine how much work needs to take place /// (e.g. read a fixed number of bytes from a file) and can monitor its /// progress, it can use the `GtkProgressBar` in percentage mode and the /// user sees a growing bar indicating the percentage of the work that /// has been completed. In this mode, the application is required to call /// [method@Gtk.ProgressBar.set_fraction] periodically to update the progress bar. -/// +/// /// When an application has no accurate way of knowing the amount of work /// to do, it can use the `GtkProgressBar` in activity mode, which shows /// activity by a block moving back and forth within the progress area. In /// this mode, the application is required to call [method@Gtk.ProgressBar.pulse] /// periodically to update the progress bar. -/// +/// /// There is quite a bit of flexibility provided to control the appearance /// of the `GtkProgressBar`. Functions are provided to control the orientation /// of the bar, optional text can be displayed along with the bar, and the /// step size used in activity mode can be set. -/// +/// /// # CSS nodes -/// +/// /// ``` /// progressbar[.osd] /// ├── [text] /// ╰── trough[.empty][.full] /// ╰── progress[.pulse] /// ``` -/// +/// /// `GtkProgressBar` has a main CSS node with name progressbar and subnodes with /// names text and trough, of which the latter has a subnode named progress. The /// text subnode is only present if text is shown. The progress subnode has the @@ -41,144 +41,137 @@ import CGtk /// .right, .top or .bottom added when the progress 'touches' the corresponding /// end of the GtkProgressBar. The .osd class on the progressbar node is for use /// in overlays like the one Epiphany has for page loading progress. -/// +/// /// # Accessibility -/// +/// /// `GtkProgressBar` uses the [enum@Gtk.AccessibleRole.progress_bar] role. open class ProgressBar: Widget, Orientable { /// Creates a new `GtkProgressBar`. - public convenience init() { - self.init( - gtk_progress_bar_new() - ) +public convenience init() { + self.init( + gtk_progress_bar_new() + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::ellipsize", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEllipsize?(self, param0) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::fraction", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFraction?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::inverted", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInverted?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::pulse-step", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPulseStep?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::ellipsize", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEllipsize?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::fraction", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFraction?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::inverted", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInverted?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::pulse-step", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPulseStep?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::show-text", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowText?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::text", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyText?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::orientation", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyOrientation?(self, param0) - } +addSignal(name: "notify::show-text", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowText?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::text", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyText?(self, param0) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::orientation", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyOrientation?(self, param0) +} +} + /// The fraction of total work that has been completed. - @GObjectProperty(named: "fraction") public var fraction: Double +@GObjectProperty(named: "fraction") public var fraction: Double - /// Invert the direction in which the progress bar grows. - @GObjectProperty(named: "inverted") public var inverted: Bool +/// Invert the direction in which the progress bar grows. +@GObjectProperty(named: "inverted") public var inverted: Bool - /// The fraction of total progress to move the bounding block when pulsed. - @GObjectProperty(named: "pulse-step") public var pulseStep: Double +/// The fraction of total progress to move the bounding block when pulsed. +@GObjectProperty(named: "pulse-step") public var pulseStep: Double - /// Sets whether the progress bar will show a text in addition - /// to the bar itself. - /// - /// The shown text is either the value of the [property@Gtk.ProgressBar:text] - /// property or, if that is %NULL, the [property@Gtk.ProgressBar:fraction] - /// value, as a percentage. - /// - /// To make a progress bar that is styled and sized suitably for showing text - /// (even if the actual text is blank), set [property@Gtk.ProgressBar:show-text] - /// to %TRUE and [property@Gtk.ProgressBar:text] to the empty string (not %NULL). - @GObjectProperty(named: "show-text") public var showText: Bool +/// Sets whether the progress bar will show a text in addition +/// to the bar itself. +/// +/// The shown text is either the value of the [property@Gtk.ProgressBar:text] +/// property or, if that is %NULL, the [property@Gtk.ProgressBar:fraction] +/// value, as a percentage. +/// +/// To make a progress bar that is styled and sized suitably for showing text +/// (even if the actual text is blank), set [property@Gtk.ProgressBar:show-text] +/// to %TRUE and [property@Gtk.ProgressBar:text] to the empty string (not %NULL). +@GObjectProperty(named: "show-text") public var showText: Bool - /// Text to be displayed in the progress bar. - @GObjectProperty(named: "text") public var text: String? +/// Text to be displayed in the progress bar. +@GObjectProperty(named: "text") public var text: String? - /// The orientation of the orientable. - @GObjectProperty(named: "orientation") public var orientation: Orientation +/// The orientation of the orientable. +@GObjectProperty(named: "orientation") public var orientation: Orientation - public var notifyEllipsize: ((ProgressBar, OpaquePointer) -> Void)? - public var notifyFraction: ((ProgressBar, OpaquePointer) -> Void)? +public var notifyEllipsize: ((ProgressBar, OpaquePointer) -> Void)? - public var notifyInverted: ((ProgressBar, OpaquePointer) -> Void)? - public var notifyPulseStep: ((ProgressBar, OpaquePointer) -> Void)? +public var notifyFraction: ((ProgressBar, OpaquePointer) -> Void)? - public var notifyShowText: ((ProgressBar, OpaquePointer) -> Void)? - public var notifyText: ((ProgressBar, OpaquePointer) -> Void)? +public var notifyInverted: ((ProgressBar, OpaquePointer) -> Void)? - public var notifyOrientation: ((ProgressBar, OpaquePointer) -> Void)? -} + +public var notifyPulseStep: ((ProgressBar, OpaquePointer) -> Void)? + + +public var notifyShowText: ((ProgressBar, OpaquePointer) -> Void)? + + +public var notifyText: ((ProgressBar, OpaquePointer) -> Void)? + + +public var notifyOrientation: ((ProgressBar, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PropagationLimit.swift b/Sources/Gtk/Generated/PropagationLimit.swift index 47544d5c1e..9b818c7b7f 100644 --- a/Sources/Gtk/Generated/PropagationLimit.swift +++ b/Sources/Gtk/Generated/PropagationLimit.swift @@ -6,24 +6,24 @@ public enum PropagationLimit: GValueRepresentableEnum { public typealias GtkEnum = GtkPropagationLimit /// Events are handled regardless of what their - /// target is. - case none - /// Events are only handled if their target is in - /// the same [iface@Native] (or widget with [property@Gtk.Widget:limit-events] - /// set) as the event controllers widget. - /// Note that some event types have two targets (origin and destination). - case sameNative +/// target is. +case none +/// Events are only handled if their target is in +/// the same [iface@Native] (or widget with [property@Gtk.Widget:limit-events] +/// set) as the event controllers widget. +/// Note that some event types have two targets (origin and destination). +case sameNative public static var type: GType { - gtk_propagation_limit_get_type() - } + gtk_propagation_limit_get_type() +} public init(from gtkEnum: GtkPropagationLimit) { switch gtkEnum { case GTK_LIMIT_NONE: - self = .none - case GTK_LIMIT_SAME_NATIVE: - self = .sameNative + self = .none +case GTK_LIMIT_SAME_NATIVE: + self = .sameNative default: fatalError("Unsupported GtkPropagationLimit enum value: \(gtkEnum.rawValue)") } @@ -32,9 +32,9 @@ public enum PropagationLimit: GValueRepresentableEnum { public func toGtk() -> GtkPropagationLimit { switch self { case .none: - return GTK_LIMIT_NONE - case .sameNative: - return GTK_LIMIT_SAME_NATIVE + return GTK_LIMIT_NONE +case .sameNative: + return GTK_LIMIT_SAME_NATIVE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PropagationPhase.swift b/Sources/Gtk/Generated/PropagationPhase.swift index fad15a5c44..c863676051 100644 --- a/Sources/Gtk/Generated/PropagationPhase.swift +++ b/Sources/Gtk/Generated/PropagationPhase.swift @@ -5,35 +5,35 @@ public enum PropagationPhase: GValueRepresentableEnum { public typealias GtkEnum = GtkPropagationPhase /// Events are not delivered. - case none - /// Events are delivered in the capture phase. The - /// capture phase happens before the bubble phase, runs from the toplevel down - /// to the event widget. This option should only be used on containers that - /// might possibly handle events before their children do. - case capture - /// Events are delivered in the bubble phase. The bubble - /// phase happens after the capture phase, and before the default handlers - /// are run. This phase runs from the event widget, up to the toplevel. - case bubble - /// Events are delivered in the default widget event handlers, - /// note that widget implementations must chain up on button, motion, touch and - /// grab broken handlers for controllers in this phase to be run. - case target +case none +/// Events are delivered in the capture phase. The +/// capture phase happens before the bubble phase, runs from the toplevel down +/// to the event widget. This option should only be used on containers that +/// might possibly handle events before their children do. +case capture +/// Events are delivered in the bubble phase. The bubble +/// phase happens after the capture phase, and before the default handlers +/// are run. This phase runs from the event widget, up to the toplevel. +case bubble +/// Events are delivered in the default widget event handlers, +/// note that widget implementations must chain up on button, motion, touch and +/// grab broken handlers for controllers in this phase to be run. +case target public static var type: GType { - gtk_propagation_phase_get_type() - } + gtk_propagation_phase_get_type() +} public init(from gtkEnum: GtkPropagationPhase) { switch gtkEnum { case GTK_PHASE_NONE: - self = .none - case GTK_PHASE_CAPTURE: - self = .capture - case GTK_PHASE_BUBBLE: - self = .bubble - case GTK_PHASE_TARGET: - self = .target + self = .none +case GTK_PHASE_CAPTURE: + self = .capture +case GTK_PHASE_BUBBLE: + self = .bubble +case GTK_PHASE_TARGET: + self = .target default: fatalError("Unsupported GtkPropagationPhase enum value: \(gtkEnum.rawValue)") } @@ -42,13 +42,13 @@ public enum PropagationPhase: GValueRepresentableEnum { public func toGtk() -> GtkPropagationPhase { switch self { case .none: - return GTK_PHASE_NONE - case .capture: - return GTK_PHASE_CAPTURE - case .bubble: - return GTK_PHASE_BUBBLE - case .target: - return GTK_PHASE_TARGET + return GTK_PHASE_NONE +case .capture: + return GTK_PHASE_CAPTURE +case .bubble: + return GTK_PHASE_BUBBLE +case .target: + return GTK_PHASE_TARGET } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Range.swift b/Sources/Gtk/Generated/Range.swift index 8bb7e472c1..de54f2c7d4 100644 --- a/Sources/Gtk/Generated/Range.swift +++ b/Sources/Gtk/Generated/Range.swift @@ -1,211 +1,198 @@ import CGtk /// Base class for widgets which visualize an adjustment. -/// +/// /// Widgets that are derived from `GtkRange` include /// [class@Gtk.Scale] and [class@Gtk.Scrollbar]. -/// +/// /// Apart from signals for monitoring the parameters of the adjustment, /// `GtkRange` provides properties and methods for setting a /// “fill level” on range widgets. See [method@Gtk.Range.set_fill_level]. -/// +/// /// # Shortcuts and Gestures -/// +/// /// The `GtkRange` slider is draggable. Holding the Shift key while /// dragging, or initiating the drag with a long-press will enable the /// fine-tuning mode. open class Range: Widget, Orientable { + - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "adjust-bounds", handler: gCallback(handler0)) { - [weak self] (param0: Double) in - guard let self = self else { return } - self.adjustBounds?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, GtkScrollType, Double, UnsafeMutableRawPointer) - -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "change-value", handler: gCallback(handler1)) { - [weak self] (param0: GtkScrollType, param1: Double) in - guard let self = self else { return } - self.changeValue?(self, param0, param1) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, GtkScrollType, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "move-slider", handler: gCallback(handler2)) { - [weak self] (param0: GtkScrollType) in - guard let self = self else { return } - self.moveSlider?(self, param0) - } - - addSignal(name: "value-changed") { [weak self] () in - guard let self = self else { return } - self.valueChanged?(self) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::adjustment", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAdjustment?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::fill-level", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFillLevel?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::inverted", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInverted?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::restrict-to-fill-level", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyRestrictToFillLevel?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::round-digits", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyRoundDigits?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::show-fill-level", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowFillLevel?(self, param0) - } - - let handler10: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::orientation", handler: gCallback(handler10)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyOrientation?(self, param0) - } + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: @convention(c) (UnsafeMutableRawPointer, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// The fill level (e.g. prebuffering of a network stream). - @GObjectProperty(named: "fill-level") public var fillLevel: Double +addSignal(name: "adjust-bounds", handler: gCallback(handler0)) { [weak self] (param0: Double) in + guard let self = self else { return } + self.adjustBounds?(self, param0) +} - /// If %TRUE, the direction in which the slider moves is inverted. - @GObjectProperty(named: "inverted") public var inverted: Bool +let handler1: @convention(c) (UnsafeMutableRawPointer, GtkScrollType, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } - /// Controls whether slider movement is restricted to an - /// upper boundary set by the fill level. - @GObjectProperty(named: "restrict-to-fill-level") public var restrictToFillLevel: Bool +addSignal(name: "change-value", handler: gCallback(handler1)) { [weak self] (param0: GtkScrollType, param1: Double) in + guard let self = self else { return } + self.changeValue?(self, param0, param1) +} - /// The number of digits to round the value to when - /// it changes. - /// - /// See [signal@Gtk.Range::change-value]. - @GObjectProperty(named: "round-digits") public var roundDigits: Int +let handler2: @convention(c) (UnsafeMutableRawPointer, GtkScrollType, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Controls whether fill level indicator graphics are displayed - /// on the trough. - @GObjectProperty(named: "show-fill-level") public var showFillLevel: Bool +addSignal(name: "move-slider", handler: gCallback(handler2)) { [weak self] (param0: GtkScrollType) in + guard let self = self else { return } + self.moveSlider?(self, param0) +} - /// The orientation of the orientable. - @GObjectProperty(named: "orientation") public var orientation: Orientation +addSignal(name: "value-changed") { [weak self] () in + guard let self = self else { return } + self.valueChanged?(self) +} - /// Emitted before clamping a value, to give the application a - /// chance to adjust the bounds. - public var adjustBounds: ((Range, Double) -> Void)? +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Emitted when a scroll action is performed on a range. - /// - /// It allows an application to determine the type of scroll event - /// that occurred and the resultant new value. The application can - /// handle the event itself and return %TRUE to prevent further - /// processing. Or, by returning %FALSE, it can pass the event to - /// other handlers until the default GTK handler is reached. - /// - /// The value parameter is unrounded. An application that overrides - /// the ::change-value signal is responsible for clamping the value - /// to the desired number of decimal digits; the default GTK - /// handler clamps the value based on [property@Gtk.Range:round-digits]. - public var changeValue: ((Range, GtkScrollType, Double) -> Void)? +addSignal(name: "notify::adjustment", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAdjustment?(self, param0) +} - /// Virtual function that moves the slider. - /// - /// Used for keybindings. - public var moveSlider: ((Range, GtkScrollType) -> Void)? +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Emitted when the range value changes. - public var valueChanged: ((Range) -> Void)? +addSignal(name: "notify::fill-level", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFillLevel?(self, param0) +} - public var notifyAdjustment: ((Range, OpaquePointer) -> Void)? +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyFillLevel: ((Range, OpaquePointer) -> Void)? +addSignal(name: "notify::inverted", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInverted?(self, param0) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::restrict-to-fill-level", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyRestrictToFillLevel?(self, param0) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyInverted: ((Range, OpaquePointer) -> Void)? +addSignal(name: "notify::round-digits", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyRoundDigits?(self, param0) +} - public var notifyRestrictToFillLevel: ((Range, OpaquePointer) -> Void)? +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyRoundDigits: ((Range, OpaquePointer) -> Void)? +addSignal(name: "notify::show-fill-level", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowFillLevel?(self, param0) +} - public var notifyShowFillLevel: ((Range, OpaquePointer) -> Void)? +let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyOrientation: ((Range, OpaquePointer) -> Void)? +addSignal(name: "notify::orientation", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyOrientation?(self, param0) +} } + + /// The fill level (e.g. prebuffering of a network stream). +@GObjectProperty(named: "fill-level") public var fillLevel: Double + +/// If %TRUE, the direction in which the slider moves is inverted. +@GObjectProperty(named: "inverted") public var inverted: Bool + +/// Controls whether slider movement is restricted to an +/// upper boundary set by the fill level. +@GObjectProperty(named: "restrict-to-fill-level") public var restrictToFillLevel: Bool + +/// The number of digits to round the value to when +/// it changes. +/// +/// See [signal@Gtk.Range::change-value]. +@GObjectProperty(named: "round-digits") public var roundDigits: Int + +/// Controls whether fill level indicator graphics are displayed +/// on the trough. +@GObjectProperty(named: "show-fill-level") public var showFillLevel: Bool + +/// The orientation of the orientable. +@GObjectProperty(named: "orientation") public var orientation: Orientation + +/// Emitted before clamping a value, to give the application a +/// chance to adjust the bounds. +public var adjustBounds: ((Range, Double) -> Void)? + +/// Emitted when a scroll action is performed on a range. +/// +/// It allows an application to determine the type of scroll event +/// that occurred and the resultant new value. The application can +/// handle the event itself and return %TRUE to prevent further +/// processing. Or, by returning %FALSE, it can pass the event to +/// other handlers until the default GTK handler is reached. +/// +/// The value parameter is unrounded. An application that overrides +/// the ::change-value signal is responsible for clamping the value +/// to the desired number of decimal digits; the default GTK +/// handler clamps the value based on [property@Gtk.Range:round-digits]. +public var changeValue: ((Range, GtkScrollType, Double) -> Void)? + +/// Virtual function that moves the slider. +/// +/// Used for keybindings. +public var moveSlider: ((Range, GtkScrollType) -> Void)? + +/// Emitted when the range value changes. +public var valueChanged: ((Range) -> Void)? + + +public var notifyAdjustment: ((Range, OpaquePointer) -> Void)? + + +public var notifyFillLevel: ((Range, OpaquePointer) -> Void)? + + +public var notifyInverted: ((Range, OpaquePointer) -> Void)? + + +public var notifyRestrictToFillLevel: ((Range, OpaquePointer) -> Void)? + + +public var notifyRoundDigits: ((Range, OpaquePointer) -> Void)? + + +public var notifyShowFillLevel: ((Range, OpaquePointer) -> Void)? + + +public var notifyOrientation: ((Range, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/RecentManagerError.swift b/Sources/Gtk/Generated/RecentManagerError.swift index f6dfdfa16f..2770a426a1 100644 --- a/Sources/Gtk/Generated/RecentManagerError.swift +++ b/Sources/Gtk/Generated/RecentManagerError.swift @@ -5,45 +5,45 @@ public enum RecentManagerError: GValueRepresentableEnum { public typealias GtkEnum = GtkRecentManagerError /// The URI specified does not exists in - /// the recently used resources list. - case notFound - /// The URI specified is not valid. - case invalidUri - /// The supplied string is not - /// UTF-8 encoded. - case invalidEncoding - /// No application has registered - /// the specified item. - case notRegistered - /// Failure while reading the recently used - /// resources file. - case read - /// Failure while writing the recently used - /// resources file. - case write - /// Unspecified error. - case unknown +/// the recently used resources list. +case notFound +/// The URI specified is not valid. +case invalidUri +/// The supplied string is not +/// UTF-8 encoded. +case invalidEncoding +/// No application has registered +/// the specified item. +case notRegistered +/// Failure while reading the recently used +/// resources file. +case read +/// Failure while writing the recently used +/// resources file. +case write +/// Unspecified error. +case unknown public static var type: GType { - gtk_recent_manager_error_get_type() - } + gtk_recent_manager_error_get_type() +} public init(from gtkEnum: GtkRecentManagerError) { switch gtkEnum { case GTK_RECENT_MANAGER_ERROR_NOT_FOUND: - self = .notFound - case GTK_RECENT_MANAGER_ERROR_INVALID_URI: - self = .invalidUri - case GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING: - self = .invalidEncoding - case GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED: - self = .notRegistered - case GTK_RECENT_MANAGER_ERROR_READ: - self = .read - case GTK_RECENT_MANAGER_ERROR_WRITE: - self = .write - case GTK_RECENT_MANAGER_ERROR_UNKNOWN: - self = .unknown + self = .notFound +case GTK_RECENT_MANAGER_ERROR_INVALID_URI: + self = .invalidUri +case GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING: + self = .invalidEncoding +case GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED: + self = .notRegistered +case GTK_RECENT_MANAGER_ERROR_READ: + self = .read +case GTK_RECENT_MANAGER_ERROR_WRITE: + self = .write +case GTK_RECENT_MANAGER_ERROR_UNKNOWN: + self = .unknown default: fatalError("Unsupported GtkRecentManagerError enum value: \(gtkEnum.rawValue)") } @@ -52,19 +52,19 @@ public enum RecentManagerError: GValueRepresentableEnum { public func toGtk() -> GtkRecentManagerError { switch self { case .notFound: - return GTK_RECENT_MANAGER_ERROR_NOT_FOUND - case .invalidUri: - return GTK_RECENT_MANAGER_ERROR_INVALID_URI - case .invalidEncoding: - return GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING - case .notRegistered: - return GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED - case .read: - return GTK_RECENT_MANAGER_ERROR_READ - case .write: - return GTK_RECENT_MANAGER_ERROR_WRITE - case .unknown: - return GTK_RECENT_MANAGER_ERROR_UNKNOWN + return GTK_RECENT_MANAGER_ERROR_NOT_FOUND +case .invalidUri: + return GTK_RECENT_MANAGER_ERROR_INVALID_URI +case .invalidEncoding: + return GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING +case .notRegistered: + return GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED +case .read: + return GTK_RECENT_MANAGER_ERROR_READ +case .write: + return GTK_RECENT_MANAGER_ERROR_WRITE +case .unknown: + return GTK_RECENT_MANAGER_ERROR_UNKNOWN } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ResponseType.swift b/Sources/Gtk/Generated/ResponseType.swift index 3fd9f7cffc..3c68948d07 100644 --- a/Sources/Gtk/Generated/ResponseType.swift +++ b/Sources/Gtk/Generated/ResponseType.swift @@ -1,64 +1,64 @@ import CGtk /// Predefined values for use as response ids in gtk_dialog_add_button(). -/// +/// /// All predefined values are negative; GTK leaves values of 0 or greater for /// application-defined response ids. public enum ResponseType: GValueRepresentableEnum { public typealias GtkEnum = GtkResponseType /// Returned if an action widget has no response id, - /// or if the dialog gets programmatically hidden or destroyed - case none - /// Generic response id, not used by GTK dialogs - case reject - /// Generic response id, not used by GTK dialogs - case accept - /// Returned if the dialog is deleted - case deleteEvent - /// Returned by OK buttons in GTK dialogs - case ok - /// Returned by Cancel buttons in GTK dialogs - case cancel - /// Returned by Close buttons in GTK dialogs - case close - /// Returned by Yes buttons in GTK dialogs - case yes - /// Returned by No buttons in GTK dialogs - case no - /// Returned by Apply buttons in GTK dialogs - case apply - /// Returned by Help buttons in GTK dialogs - case help +/// or if the dialog gets programmatically hidden or destroyed +case none +/// Generic response id, not used by GTK dialogs +case reject +/// Generic response id, not used by GTK dialogs +case accept +/// Returned if the dialog is deleted +case deleteEvent +/// Returned by OK buttons in GTK dialogs +case ok +/// Returned by Cancel buttons in GTK dialogs +case cancel +/// Returned by Close buttons in GTK dialogs +case close +/// Returned by Yes buttons in GTK dialogs +case yes +/// Returned by No buttons in GTK dialogs +case no +/// Returned by Apply buttons in GTK dialogs +case apply +/// Returned by Help buttons in GTK dialogs +case help public static var type: GType { - gtk_response_type_get_type() - } + gtk_response_type_get_type() +} public init(from gtkEnum: GtkResponseType) { switch gtkEnum { case GTK_RESPONSE_NONE: - self = .none - case GTK_RESPONSE_REJECT: - self = .reject - case GTK_RESPONSE_ACCEPT: - self = .accept - case GTK_RESPONSE_DELETE_EVENT: - self = .deleteEvent - case GTK_RESPONSE_OK: - self = .ok - case GTK_RESPONSE_CANCEL: - self = .cancel - case GTK_RESPONSE_CLOSE: - self = .close - case GTK_RESPONSE_YES: - self = .yes - case GTK_RESPONSE_NO: - self = .no - case GTK_RESPONSE_APPLY: - self = .apply - case GTK_RESPONSE_HELP: - self = .help + self = .none +case GTK_RESPONSE_REJECT: + self = .reject +case GTK_RESPONSE_ACCEPT: + self = .accept +case GTK_RESPONSE_DELETE_EVENT: + self = .deleteEvent +case GTK_RESPONSE_OK: + self = .ok +case GTK_RESPONSE_CANCEL: + self = .cancel +case GTK_RESPONSE_CLOSE: + self = .close +case GTK_RESPONSE_YES: + self = .yes +case GTK_RESPONSE_NO: + self = .no +case GTK_RESPONSE_APPLY: + self = .apply +case GTK_RESPONSE_HELP: + self = .help default: fatalError("Unsupported GtkResponseType enum value: \(gtkEnum.rawValue)") } @@ -67,27 +67,27 @@ public enum ResponseType: GValueRepresentableEnum { public func toGtk() -> GtkResponseType { switch self { case .none: - return GTK_RESPONSE_NONE - case .reject: - return GTK_RESPONSE_REJECT - case .accept: - return GTK_RESPONSE_ACCEPT - case .deleteEvent: - return GTK_RESPONSE_DELETE_EVENT - case .ok: - return GTK_RESPONSE_OK - case .cancel: - return GTK_RESPONSE_CANCEL - case .close: - return GTK_RESPONSE_CLOSE - case .yes: - return GTK_RESPONSE_YES - case .no: - return GTK_RESPONSE_NO - case .apply: - return GTK_RESPONSE_APPLY - case .help: - return GTK_RESPONSE_HELP + return GTK_RESPONSE_NONE +case .reject: + return GTK_RESPONSE_REJECT +case .accept: + return GTK_RESPONSE_ACCEPT +case .deleteEvent: + return GTK_RESPONSE_DELETE_EVENT +case .ok: + return GTK_RESPONSE_OK +case .cancel: + return GTK_RESPONSE_CANCEL +case .close: + return GTK_RESPONSE_CLOSE +case .yes: + return GTK_RESPONSE_YES +case .no: + return GTK_RESPONSE_NO +case .apply: + return GTK_RESPONSE_APPLY +case .help: + return GTK_RESPONSE_HELP } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/RevealerTransitionType.swift b/Sources/Gtk/Generated/RevealerTransitionType.swift index d7908fc3a2..3762a6d618 100644 --- a/Sources/Gtk/Generated/RevealerTransitionType.swift +++ b/Sources/Gtk/Generated/RevealerTransitionType.swift @@ -6,52 +6,52 @@ public enum RevealerTransitionType: GValueRepresentableEnum { public typealias GtkEnum = GtkRevealerTransitionType /// No transition - case none - /// Fade in - case crossfade - /// Slide in from the left - case slideRight - /// Slide in from the right - case slideLeft - /// Slide in from the bottom - case slideUp - /// Slide in from the top - case slideDown - /// Floop in from the left - case swingRight - /// Floop in from the right - case swingLeft - /// Floop in from the bottom - case swingUp - /// Floop in from the top - case swingDown +case none +/// Fade in +case crossfade +/// Slide in from the left +case slideRight +/// Slide in from the right +case slideLeft +/// Slide in from the bottom +case slideUp +/// Slide in from the top +case slideDown +/// Floop in from the left +case swingRight +/// Floop in from the right +case swingLeft +/// Floop in from the bottom +case swingUp +/// Floop in from the top +case swingDown public static var type: GType { - gtk_revealer_transition_type_get_type() - } + gtk_revealer_transition_type_get_type() +} public init(from gtkEnum: GtkRevealerTransitionType) { switch gtkEnum { case GTK_REVEALER_TRANSITION_TYPE_NONE: - self = .none - case GTK_REVEALER_TRANSITION_TYPE_CROSSFADE: - self = .crossfade - case GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT: - self = .slideRight - case GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT: - self = .slideLeft - case GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP: - self = .slideUp - case GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN: - self = .slideDown - case GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT: - self = .swingRight - case GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT: - self = .swingLeft - case GTK_REVEALER_TRANSITION_TYPE_SWING_UP: - self = .swingUp - case GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN: - self = .swingDown + self = .none +case GTK_REVEALER_TRANSITION_TYPE_CROSSFADE: + self = .crossfade +case GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT: + self = .slideRight +case GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT: + self = .slideLeft +case GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP: + self = .slideUp +case GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN: + self = .slideDown +case GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT: + self = .swingRight +case GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT: + self = .swingLeft +case GTK_REVEALER_TRANSITION_TYPE_SWING_UP: + self = .swingUp +case GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN: + self = .swingDown default: fatalError("Unsupported GtkRevealerTransitionType enum value: \(gtkEnum.rawValue)") } @@ -60,25 +60,25 @@ public enum RevealerTransitionType: GValueRepresentableEnum { public func toGtk() -> GtkRevealerTransitionType { switch self { case .none: - return GTK_REVEALER_TRANSITION_TYPE_NONE - case .crossfade: - return GTK_REVEALER_TRANSITION_TYPE_CROSSFADE - case .slideRight: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT - case .slideLeft: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT - case .slideUp: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP - case .slideDown: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN - case .swingRight: - return GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT - case .swingLeft: - return GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT - case .swingUp: - return GTK_REVEALER_TRANSITION_TYPE_SWING_UP - case .swingDown: - return GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN + return GTK_REVEALER_TRANSITION_TYPE_NONE +case .crossfade: + return GTK_REVEALER_TRANSITION_TYPE_CROSSFADE +case .slideRight: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT +case .slideLeft: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT +case .slideUp: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP +case .slideDown: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN +case .swingRight: + return GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT +case .swingLeft: + return GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT +case .swingUp: + return GTK_REVEALER_TRANSITION_TYPE_SWING_UP +case .swingDown: + return GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Root.swift b/Sources/Gtk/Generated/Root.swift index c2dd7d45e0..b398cdbd3c 100644 --- a/Sources/Gtk/Generated/Root.swift +++ b/Sources/Gtk/Generated/Root.swift @@ -1,18 +1,20 @@ import CGtk /// An interface for widgets that can act as the root of a widget hierarchy. -/// +/// /// The root widget takes care of providing the connection to the windowing /// system and manages layout, drawing and event delivery for its widget /// hierarchy. -/// +/// /// The obvious example of a `GtkRoot` is `GtkWindow`. -/// +/// /// To get the display to which a `GtkRoot` belongs, use /// [method@Gtk.Root.get_display]. -/// +/// /// `GtkRoot` also maintains the location of keyboard focus inside its widget /// hierarchy, with [method@Gtk.Root.set_focus] and [method@Gtk.Root.get_focus]. public protocol Root: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Scale.swift b/Sources/Gtk/Generated/Scale.swift index 7d9d13b964..c73941ef80 100644 --- a/Sources/Gtk/Generated/Scale.swift +++ b/Sources/Gtk/Generated/Scale.swift @@ -1,40 +1,40 @@ import CGtk /// Allows to select a numeric value with a slider control. -/// +/// /// An example GtkScale -/// +/// /// To use it, you’ll probably want to investigate the methods on its base /// class, [class@Gtk.Range], in addition to the methods for `GtkScale` itself. /// To set the value of a scale, you would normally use [method@Gtk.Range.set_value]. /// To detect changes to the value, you would normally use the /// [signal@Gtk.Range::value-changed] signal. -/// +/// /// Note that using the same upper and lower bounds for the `GtkScale` (through /// the `GtkRange` methods) will hide the slider itself. This is useful for /// applications that want to show an undeterminate value on the scale, without /// changing the layout of the application (such as movie or music players). -/// +/// /// # GtkScale as GtkBuildable -/// +/// /// `GtkScale` supports a custom `` element, which can contain multiple /// `` elements. The “value” and “position” attributes have the same /// meaning as [method@Gtk.Scale.add_mark] parameters of the same name. If /// the element is not empty, its content is taken as the markup to show at /// the mark. It can be translated with the usual ”translatable” and /// “context” attributes. -/// +/// /// # Shortcuts and Gestures -/// +/// /// `GtkPopoverMenu` supports the following keyboard shortcuts: -/// +/// /// - Arrow keys, + and - will increment or decrement /// by step, or by page when combined with Ctrl. /// - PgUp and PgDn will increment or decrement by page. /// - Home and End will set the minimum or maximum value. -/// +/// /// # CSS nodes -/// +/// /// ``` /// scale[.fine-tune][.marks-before][.marks-after] /// ├── [value][.top][.right][.bottom][.left] @@ -55,138 +55,130 @@ import CGtk /// ├── [highlight] /// ╰── slider /// ``` -/// +/// /// `GtkScale` has a main CSS node with name scale and a subnode for its contents, /// with subnodes named trough and slider. -/// +/// /// The main node gets the style class .fine-tune added when the scale is in /// 'fine-tuning' mode. -/// +/// /// If the scale has an origin (see [method@Gtk.Scale.set_has_origin]), there is /// a subnode with name highlight below the trough node that is used for rendering /// the highlighted part of the trough. -/// +/// /// If the scale is showing a fill level (see [method@Gtk.Range.set_show_fill_level]), /// there is a subnode with name fill below the trough node that is used for /// rendering the filled in part of the trough. -/// +/// /// If marks are present, there is a marks subnode before or after the trough /// node, below which each mark gets a node with name mark. The marks nodes get /// either the .top or .bottom style class. -/// +/// /// The mark node has a subnode named indicator. If the mark has text, it also /// has a subnode named label. When the mark is either above or left of the /// scale, the label subnode is the first when present. Otherwise, the indicator /// subnode is the first. -/// +/// /// The main CSS node gets the 'marks-before' and/or 'marks-after' style classes /// added depending on what marks are present. -/// +/// /// If the scale is displaying the value (see [property@Gtk.Scale:draw-value]), /// there is subnode with name value. This node will get the .top or .bottom style /// classes similar to the marks node. -/// +/// /// # Accessibility -/// +/// /// `GtkScale` uses the [enum@Gtk.AccessibleRole.slider] role. open class Scale: Range { /// Creates a new `GtkScale`. - public convenience init( - orientation: GtkOrientation, adjustment: UnsafeMutablePointer! - ) { - self.init( - gtk_scale_new(orientation, adjustment) - ) +public convenience init(orientation: GtkOrientation, adjustment: UnsafeMutablePointer!) { + self.init( + gtk_scale_new(orientation, adjustment) + ) +} + +/// Creates a new scale widget with a range from @min to @max. +/// +/// The returns scale will have the given orientation and will let the +/// user input a number between @min and @max (including @min and @max) +/// with the increment @step. @step must be nonzero; it’s the distance +/// the slider moves when using the arrow keys to adjust the scale +/// value. +/// +/// Note that the way in which the precision is derived works best if +/// @step is a power of ten. If the resulting precision is not suitable +/// for your needs, use [method@Gtk.Scale.set_digits] to correct it. +public convenience init(range orientation: GtkOrientation, min: Double, max: Double, step: Double) { + self.init( + gtk_scale_new_with_range(orientation, min, max, step) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new scale widget with a range from @min to @max. - /// - /// The returns scale will have the given orientation and will let the - /// user input a number between @min and @max (including @min and @max) - /// with the increment @step. @step must be nonzero; it’s the distance - /// the slider moves when using the arrow keys to adjust the scale - /// value. - /// - /// Note that the way in which the precision is derived works best if - /// @step is a power of ten. If the resulting precision is not suitable - /// for your needs, use [method@Gtk.Scale.set_digits] to correct it. - public convenience init( - range orientation: GtkOrientation, min: Double, max: Double, step: Double - ) { - self.init( - gtk_scale_new_with_range(orientation, min, max, step) - ) +addSignal(name: "notify::digits", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDigits?(self, param0) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::digits", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDigits?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::draw-value", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDrawValue?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::has-origin", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasOrigin?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::value-pos", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyValuePos?(self, param0) - } +addSignal(name: "notify::draw-value", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDrawValue?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::has-origin", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasOrigin?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::value-pos", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyValuePos?(self, param0) +} +} + /// The number of decimal places that are displayed in the value. - @GObjectProperty(named: "digits") public var digits: Int +@GObjectProperty(named: "digits") public var digits: Int - /// Whether the current value is displayed as a string next to the slider. - @GObjectProperty(named: "draw-value") public var drawValue: Bool +/// Whether the current value is displayed as a string next to the slider. +@GObjectProperty(named: "draw-value") public var drawValue: Bool - /// Whether the scale has an origin. - @GObjectProperty(named: "has-origin") public var hasOrigin: Bool +/// Whether the scale has an origin. +@GObjectProperty(named: "has-origin") public var hasOrigin: Bool - /// The position in which the current value is displayed. - @GObjectProperty(named: "value-pos") public var valuePos: PositionType +/// The position in which the current value is displayed. +@GObjectProperty(named: "value-pos") public var valuePos: PositionType - public var notifyDigits: ((Scale, OpaquePointer) -> Void)? - public var notifyDrawValue: ((Scale, OpaquePointer) -> Void)? +public var notifyDigits: ((Scale, OpaquePointer) -> Void)? - public var notifyHasOrigin: ((Scale, OpaquePointer) -> Void)? - public var notifyValuePos: ((Scale, OpaquePointer) -> Void)? -} +public var notifyDrawValue: ((Scale, OpaquePointer) -> Void)? + + +public var notifyHasOrigin: ((Scale, OpaquePointer) -> Void)? + + +public var notifyValuePos: ((Scale, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ScrollStep.swift b/Sources/Gtk/Generated/ScrollStep.swift index 0432f12244..4b408bad16 100644 --- a/Sources/Gtk/Generated/ScrollStep.swift +++ b/Sources/Gtk/Generated/ScrollStep.swift @@ -5,36 +5,36 @@ public enum ScrollStep: GValueRepresentableEnum { public typealias GtkEnum = GtkScrollStep /// Scroll in steps. - case steps - /// Scroll by pages. - case pages - /// Scroll to ends. - case ends - /// Scroll in horizontal steps. - case horizontalSteps - /// Scroll by horizontal pages. - case horizontalPages - /// Scroll to the horizontal ends. - case horizontalEnds +case steps +/// Scroll by pages. +case pages +/// Scroll to ends. +case ends +/// Scroll in horizontal steps. +case horizontalSteps +/// Scroll by horizontal pages. +case horizontalPages +/// Scroll to the horizontal ends. +case horizontalEnds public static var type: GType { - gtk_scroll_step_get_type() - } + gtk_scroll_step_get_type() +} public init(from gtkEnum: GtkScrollStep) { switch gtkEnum { case GTK_SCROLL_STEPS: - self = .steps - case GTK_SCROLL_PAGES: - self = .pages - case GTK_SCROLL_ENDS: - self = .ends - case GTK_SCROLL_HORIZONTAL_STEPS: - self = .horizontalSteps - case GTK_SCROLL_HORIZONTAL_PAGES: - self = .horizontalPages - case GTK_SCROLL_HORIZONTAL_ENDS: - self = .horizontalEnds + self = .steps +case GTK_SCROLL_PAGES: + self = .pages +case GTK_SCROLL_ENDS: + self = .ends +case GTK_SCROLL_HORIZONTAL_STEPS: + self = .horizontalSteps +case GTK_SCROLL_HORIZONTAL_PAGES: + self = .horizontalPages +case GTK_SCROLL_HORIZONTAL_ENDS: + self = .horizontalEnds default: fatalError("Unsupported GtkScrollStep enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ public enum ScrollStep: GValueRepresentableEnum { public func toGtk() -> GtkScrollStep { switch self { case .steps: - return GTK_SCROLL_STEPS - case .pages: - return GTK_SCROLL_PAGES - case .ends: - return GTK_SCROLL_ENDS - case .horizontalSteps: - return GTK_SCROLL_HORIZONTAL_STEPS - case .horizontalPages: - return GTK_SCROLL_HORIZONTAL_PAGES - case .horizontalEnds: - return GTK_SCROLL_HORIZONTAL_ENDS + return GTK_SCROLL_STEPS +case .pages: + return GTK_SCROLL_PAGES +case .ends: + return GTK_SCROLL_ENDS +case .horizontalSteps: + return GTK_SCROLL_HORIZONTAL_STEPS +case .horizontalPages: + return GTK_SCROLL_HORIZONTAL_PAGES +case .horizontalEnds: + return GTK_SCROLL_HORIZONTAL_ENDS } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ScrollType.swift b/Sources/Gtk/Generated/ScrollType.swift index 88054fa724..d952af8897 100644 --- a/Sources/Gtk/Generated/ScrollType.swift +++ b/Sources/Gtk/Generated/ScrollType.swift @@ -5,76 +5,76 @@ public enum ScrollType: GValueRepresentableEnum { public typealias GtkEnum = GtkScrollType /// No scrolling. - case none - /// Jump to new location. - case jump - /// Step backward. - case stepBackward - /// Step forward. - case stepForward - /// Page backward. - case pageBackward - /// Page forward. - case pageForward - /// Step up. - case stepUp - /// Step down. - case stepDown - /// Page up. - case pageUp - /// Page down. - case pageDown - /// Step to the left. - case stepLeft - /// Step to the right. - case stepRight - /// Page to the left. - case pageLeft - /// Page to the right. - case pageRight - /// Scroll to start. - case start - /// Scroll to end. - case end +case none +/// Jump to new location. +case jump +/// Step backward. +case stepBackward +/// Step forward. +case stepForward +/// Page backward. +case pageBackward +/// Page forward. +case pageForward +/// Step up. +case stepUp +/// Step down. +case stepDown +/// Page up. +case pageUp +/// Page down. +case pageDown +/// Step to the left. +case stepLeft +/// Step to the right. +case stepRight +/// Page to the left. +case pageLeft +/// Page to the right. +case pageRight +/// Scroll to start. +case start +/// Scroll to end. +case end public static var type: GType { - gtk_scroll_type_get_type() - } + gtk_scroll_type_get_type() +} public init(from gtkEnum: GtkScrollType) { switch gtkEnum { case GTK_SCROLL_NONE: - self = .none - case GTK_SCROLL_JUMP: - self = .jump - case GTK_SCROLL_STEP_BACKWARD: - self = .stepBackward - case GTK_SCROLL_STEP_FORWARD: - self = .stepForward - case GTK_SCROLL_PAGE_BACKWARD: - self = .pageBackward - case GTK_SCROLL_PAGE_FORWARD: - self = .pageForward - case GTK_SCROLL_STEP_UP: - self = .stepUp - case GTK_SCROLL_STEP_DOWN: - self = .stepDown - case GTK_SCROLL_PAGE_UP: - self = .pageUp - case GTK_SCROLL_PAGE_DOWN: - self = .pageDown - case GTK_SCROLL_STEP_LEFT: - self = .stepLeft - case GTK_SCROLL_STEP_RIGHT: - self = .stepRight - case GTK_SCROLL_PAGE_LEFT: - self = .pageLeft - case GTK_SCROLL_PAGE_RIGHT: - self = .pageRight - case GTK_SCROLL_START: - self = .start - case GTK_SCROLL_END: - self = .end + self = .none +case GTK_SCROLL_JUMP: + self = .jump +case GTK_SCROLL_STEP_BACKWARD: + self = .stepBackward +case GTK_SCROLL_STEP_FORWARD: + self = .stepForward +case GTK_SCROLL_PAGE_BACKWARD: + self = .pageBackward +case GTK_SCROLL_PAGE_FORWARD: + self = .pageForward +case GTK_SCROLL_STEP_UP: + self = .stepUp +case GTK_SCROLL_STEP_DOWN: + self = .stepDown +case GTK_SCROLL_PAGE_UP: + self = .pageUp +case GTK_SCROLL_PAGE_DOWN: + self = .pageDown +case GTK_SCROLL_STEP_LEFT: + self = .stepLeft +case GTK_SCROLL_STEP_RIGHT: + self = .stepRight +case GTK_SCROLL_PAGE_LEFT: + self = .pageLeft +case GTK_SCROLL_PAGE_RIGHT: + self = .pageRight +case GTK_SCROLL_START: + self = .start +case GTK_SCROLL_END: + self = .end default: fatalError("Unsupported GtkScrollType enum value: \(gtkEnum.rawValue)") } @@ -83,37 +83,37 @@ public enum ScrollType: GValueRepresentableEnum { public func toGtk() -> GtkScrollType { switch self { case .none: - return GTK_SCROLL_NONE - case .jump: - return GTK_SCROLL_JUMP - case .stepBackward: - return GTK_SCROLL_STEP_BACKWARD - case .stepForward: - return GTK_SCROLL_STEP_FORWARD - case .pageBackward: - return GTK_SCROLL_PAGE_BACKWARD - case .pageForward: - return GTK_SCROLL_PAGE_FORWARD - case .stepUp: - return GTK_SCROLL_STEP_UP - case .stepDown: - return GTK_SCROLL_STEP_DOWN - case .pageUp: - return GTK_SCROLL_PAGE_UP - case .pageDown: - return GTK_SCROLL_PAGE_DOWN - case .stepLeft: - return GTK_SCROLL_STEP_LEFT - case .stepRight: - return GTK_SCROLL_STEP_RIGHT - case .pageLeft: - return GTK_SCROLL_PAGE_LEFT - case .pageRight: - return GTK_SCROLL_PAGE_RIGHT - case .start: - return GTK_SCROLL_START - case .end: - return GTK_SCROLL_END + return GTK_SCROLL_NONE +case .jump: + return GTK_SCROLL_JUMP +case .stepBackward: + return GTK_SCROLL_STEP_BACKWARD +case .stepForward: + return GTK_SCROLL_STEP_FORWARD +case .pageBackward: + return GTK_SCROLL_PAGE_BACKWARD +case .pageForward: + return GTK_SCROLL_PAGE_FORWARD +case .stepUp: + return GTK_SCROLL_STEP_UP +case .stepDown: + return GTK_SCROLL_STEP_DOWN +case .pageUp: + return GTK_SCROLL_PAGE_UP +case .pageDown: + return GTK_SCROLL_PAGE_DOWN +case .stepLeft: + return GTK_SCROLL_STEP_LEFT +case .stepRight: + return GTK_SCROLL_STEP_RIGHT +case .pageLeft: + return GTK_SCROLL_PAGE_LEFT +case .pageRight: + return GTK_SCROLL_PAGE_RIGHT +case .start: + return GTK_SCROLL_START +case .end: + return GTK_SCROLL_END } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Scrollable.swift b/Sources/Gtk/Generated/Scrollable.swift index 10f42ccffd..9e9cf83579 100644 --- a/Sources/Gtk/Generated/Scrollable.swift +++ b/Sources/Gtk/Generated/Scrollable.swift @@ -1,38 +1,39 @@ import CGtk /// An interface for widgets with native scrolling ability. -/// +/// /// To implement this interface you should override the /// [property@Gtk.Scrollable:hadjustment] and /// [property@Gtk.Scrollable:vadjustment] properties. -/// +/// /// ## Creating a scrollable widget -/// +/// /// All scrollable widgets should do the following. -/// +/// /// - When a parent widget sets the scrollable child widget’s adjustments, /// the widget should connect to the [signal@Gtk.Adjustment::value-changed] /// signal. The child widget should then populate the adjustments’ properties /// as soon as possible, which usually means queueing an allocation right away /// and populating the properties in the [vfunc@Gtk.Widget.size_allocate] /// implementation. -/// +/// /// - Because its preferred size is the size for a fully expanded widget, /// the scrollable widget must be able to cope with underallocations. /// This means that it must accept any value passed to its /// [vfunc@Gtk.Widget.size_allocate] implementation. -/// +/// /// - When the parent allocates space to the scrollable child widget, /// the widget must ensure the adjustments’ property values are correct and up /// to date, for example using [method@Gtk.Adjustment.configure]. -/// +/// /// - When any of the adjustments emits the [signal@Gtk.Adjustment::value-changed] /// signal, the scrollable widget should scroll its contents. public protocol Scrollable: GObjectRepresentable { /// Determines when horizontal scrolling should start. - var hscrollPolicy: ScrollablePolicy { get set } +var hscrollPolicy: ScrollablePolicy { get set } - /// Determines when vertical scrolling should start. - var vscrollPolicy: ScrollablePolicy { get set } +/// Determines when vertical scrolling should start. +var vscrollPolicy: ScrollablePolicy { get set } -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ScrollablePolicy.swift b/Sources/Gtk/Generated/ScrollablePolicy.swift index 1e47fa44d0..5b2f2cd335 100644 --- a/Sources/Gtk/Generated/ScrollablePolicy.swift +++ b/Sources/Gtk/Generated/ScrollablePolicy.swift @@ -6,20 +6,20 @@ public enum ScrollablePolicy: GValueRepresentableEnum { public typealias GtkEnum = GtkScrollablePolicy /// Scrollable adjustments are based on the minimum size - case minimum - /// Scrollable adjustments are based on the natural size - case natural +case minimum +/// Scrollable adjustments are based on the natural size +case natural public static var type: GType { - gtk_scrollable_policy_get_type() - } + gtk_scrollable_policy_get_type() +} public init(from gtkEnum: GtkScrollablePolicy) { switch gtkEnum { case GTK_SCROLL_MINIMUM: - self = .minimum - case GTK_SCROLL_NATURAL: - self = .natural + self = .minimum +case GTK_SCROLL_NATURAL: + self = .natural default: fatalError("Unsupported GtkScrollablePolicy enum value: \(gtkEnum.rawValue)") } @@ -28,9 +28,9 @@ public enum ScrollablePolicy: GValueRepresentableEnum { public func toGtk() -> GtkScrollablePolicy { switch self { case .minimum: - return GTK_SCROLL_MINIMUM - case .natural: - return GTK_SCROLL_NATURAL + return GTK_SCROLL_MINIMUM +case .natural: + return GTK_SCROLL_NATURAL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SelectionMode.swift b/Sources/Gtk/Generated/SelectionMode.swift index c97d0a94b3..594b4d82d9 100644 --- a/Sources/Gtk/Generated/SelectionMode.swift +++ b/Sources/Gtk/Generated/SelectionMode.swift @@ -5,36 +5,36 @@ public enum SelectionMode: GValueRepresentableEnum { public typealias GtkEnum = GtkSelectionMode /// No selection is possible. - case none - /// Zero or one element may be selected. - case single - /// Exactly one element is selected. - /// In some circumstances, such as initially or during a search - /// operation, it’s possible for no element to be selected with - /// %GTK_SELECTION_BROWSE. What is really enforced is that the user - /// can’t deselect a currently selected element except by selecting - /// another element. - case browse - /// Any number of elements may be selected. - /// The Ctrl key may be used to enlarge the selection, and Shift - /// key to select between the focus and the child pointed to. - /// Some widgets may also allow Click-drag to select a range of elements. - case multiple +case none +/// Zero or one element may be selected. +case single +/// Exactly one element is selected. +/// In some circumstances, such as initially or during a search +/// operation, it’s possible for no element to be selected with +/// %GTK_SELECTION_BROWSE. What is really enforced is that the user +/// can’t deselect a currently selected element except by selecting +/// another element. +case browse +/// Any number of elements may be selected. +/// The Ctrl key may be used to enlarge the selection, and Shift +/// key to select between the focus and the child pointed to. +/// Some widgets may also allow Click-drag to select a range of elements. +case multiple public static var type: GType { - gtk_selection_mode_get_type() - } + gtk_selection_mode_get_type() +} public init(from gtkEnum: GtkSelectionMode) { switch gtkEnum { case GTK_SELECTION_NONE: - self = .none - case GTK_SELECTION_SINGLE: - self = .single - case GTK_SELECTION_BROWSE: - self = .browse - case GTK_SELECTION_MULTIPLE: - self = .multiple + self = .none +case GTK_SELECTION_SINGLE: + self = .single +case GTK_SELECTION_BROWSE: + self = .browse +case GTK_SELECTION_MULTIPLE: + self = .multiple default: fatalError("Unsupported GtkSelectionMode enum value: \(gtkEnum.rawValue)") } @@ -43,13 +43,13 @@ public enum SelectionMode: GValueRepresentableEnum { public func toGtk() -> GtkSelectionMode { switch self { case .none: - return GTK_SELECTION_NONE - case .single: - return GTK_SELECTION_SINGLE - case .browse: - return GTK_SELECTION_BROWSE - case .multiple: - return GTK_SELECTION_MULTIPLE + return GTK_SELECTION_NONE +case .single: + return GTK_SELECTION_SINGLE +case .browse: + return GTK_SELECTION_BROWSE +case .multiple: + return GTK_SELECTION_MULTIPLE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SelectionModel.swift b/Sources/Gtk/Generated/SelectionModel.swift index 4b401bb239..fd59aa71c9 100644 --- a/Sources/Gtk/Generated/SelectionModel.swift +++ b/Sources/Gtk/Generated/SelectionModel.swift @@ -1,14 +1,14 @@ import CGtk /// An interface that adds support for selection to list models. -/// +/// /// This support is then used by widgets using list models to add the ability /// to select and unselect various items. -/// +/// /// GTK provides default implementations of the most common selection modes such /// as [class@Gtk.SingleSelection], so you will only need to implement this /// interface if you want detailed control about how selections should be handled. -/// +/// /// A `GtkSelectionModel` supports a single boolean per item indicating if an item is /// selected or not. This can be queried via [method@Gtk.SelectionModel.is_selected]. /// When the selected state of one or more items changes, the model will emit the @@ -18,32 +18,33 @@ import CGtk /// requirement. If new items added to the model via the /// [signal@Gio.ListModel::items-changed] signal are selected or not is up to the /// implementation. -/// +/// /// Note that items added via [signal@Gio.ListModel::items-changed] may already /// be selected and no [signal@Gtk.SelectionModel::selection-changed] will be /// emitted for them. So to track which items are selected, it is necessary to /// listen to both signals. -/// +/// /// Additionally, the interface can expose functionality to select and unselect /// items. If these functions are implemented, GTK's list widgets will allow users /// to select and unselect items. However, `GtkSelectionModel`s are free to only /// implement them partially or not at all. In that case the widgets will not /// support the unimplemented operations. -/// +/// /// When selecting or unselecting is supported by a model, the return values of /// the selection functions do *not* indicate if selection or unselection happened. /// They are only meant to indicate complete failure, like when this mode of /// selecting is not supported by the model. -/// +/// /// Selections may happen asynchronously, so the only reliable way to find out /// when an item was selected is to listen to the signals that indicate selection. public protocol SelectionModel: GObjectRepresentable { + /// Emitted when the selection state of some of the items in @model changes. - /// - /// Note that this signal does not specify the new selection state of the - /// items, they need to be queried manually. It is also not necessary for - /// a model to change the selection state of any of the items in the selection - /// model, though it would be rather useless to emit such a signal. - var selectionChanged: ((Self, UInt, UInt) -> Void)? { get set } -} +/// +/// Note that this signal does not specify the new selection state of the +/// items, they need to be queried manually. It is also not necessary for +/// a model to change the selection state of any of the items in the selection +/// model, though it would be rather useless to emit such a signal. +var selectionChanged: ((Self, UInt, UInt) -> Void)? { get set } +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SensitivityType.swift b/Sources/Gtk/Generated/SensitivityType.swift index df5c24ecb6..edff95c786 100644 --- a/Sources/Gtk/Generated/SensitivityType.swift +++ b/Sources/Gtk/Generated/SensitivityType.swift @@ -6,25 +6,25 @@ public enum SensitivityType: GValueRepresentableEnum { public typealias GtkEnum = GtkSensitivityType /// The control is made insensitive if no - /// action can be triggered - case auto - /// The control is always sensitive - case on - /// The control is always insensitive - case off +/// action can be triggered +case auto +/// The control is always sensitive +case on +/// The control is always insensitive +case off public static var type: GType { - gtk_sensitivity_type_get_type() - } + gtk_sensitivity_type_get_type() +} public init(from gtkEnum: GtkSensitivityType) { switch gtkEnum { case GTK_SENSITIVITY_AUTO: - self = .auto - case GTK_SENSITIVITY_ON: - self = .on - case GTK_SENSITIVITY_OFF: - self = .off + self = .auto +case GTK_SENSITIVITY_ON: + self = .on +case GTK_SENSITIVITY_OFF: + self = .off default: fatalError("Unsupported GtkSensitivityType enum value: \(gtkEnum.rawValue)") } @@ -33,11 +33,11 @@ public enum SensitivityType: GValueRepresentableEnum { public func toGtk() -> GtkSensitivityType { switch self { case .auto: - return GTK_SENSITIVITY_AUTO - case .on: - return GTK_SENSITIVITY_ON - case .off: - return GTK_SENSITIVITY_OFF + return GTK_SENSITIVITY_AUTO +case .on: + return GTK_SENSITIVITY_ON +case .off: + return GTK_SENSITIVITY_OFF } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ShortcutManager.swift b/Sources/Gtk/Generated/ShortcutManager.swift index 793602901d..9faa713766 100644 --- a/Sources/Gtk/Generated/ShortcutManager.swift +++ b/Sources/Gtk/Generated/ShortcutManager.swift @@ -1,16 +1,18 @@ import CGtk /// An interface that is used to implement shortcut scopes. -/// +/// /// This is important for [iface@Gtk.Native] widgets that have their /// own surface, since the event controllers that are used to implement /// managed and global scopes are limited to the same native. -/// +/// /// Examples for widgets implementing `GtkShortcutManager` are /// [class@Gtk.Window] and [class@Gtk.Popover]. -/// +/// /// Every widget that implements `GtkShortcutManager` will be used as a /// `GTK_SHORTCUT_SCOPE_MANAGED`. public protocol ShortcutManager: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ShortcutScope.swift b/Sources/Gtk/Generated/ShortcutScope.swift index 52c905c929..5f52020322 100644 --- a/Sources/Gtk/Generated/ShortcutScope.swift +++ b/Sources/Gtk/Generated/ShortcutScope.swift @@ -6,27 +6,27 @@ public enum ShortcutScope: GValueRepresentableEnum { public typealias GtkEnum = GtkShortcutScope /// Shortcuts are handled inside - /// the widget the controller belongs to. - case local - /// Shortcuts are handled by - /// the first ancestor that is a [iface@ShortcutManager] - case managed - /// Shortcuts are handled by - /// the root widget. - case global +/// the widget the controller belongs to. +case local +/// Shortcuts are handled by +/// the first ancestor that is a [iface@ShortcutManager] +case managed +/// Shortcuts are handled by +/// the root widget. +case global public static var type: GType { - gtk_shortcut_scope_get_type() - } + gtk_shortcut_scope_get_type() +} public init(from gtkEnum: GtkShortcutScope) { switch gtkEnum { case GTK_SHORTCUT_SCOPE_LOCAL: - self = .local - case GTK_SHORTCUT_SCOPE_MANAGED: - self = .managed - case GTK_SHORTCUT_SCOPE_GLOBAL: - self = .global + self = .local +case GTK_SHORTCUT_SCOPE_MANAGED: + self = .managed +case GTK_SHORTCUT_SCOPE_GLOBAL: + self = .global default: fatalError("Unsupported GtkShortcutScope enum value: \(gtkEnum.rawValue)") } @@ -35,11 +35,11 @@ public enum ShortcutScope: GValueRepresentableEnum { public func toGtk() -> GtkShortcutScope { switch self { case .local: - return GTK_SHORTCUT_SCOPE_LOCAL - case .managed: - return GTK_SHORTCUT_SCOPE_MANAGED - case .global: - return GTK_SHORTCUT_SCOPE_GLOBAL + return GTK_SHORTCUT_SCOPE_LOCAL +case .managed: + return GTK_SHORTCUT_SCOPE_MANAGED +case .global: + return GTK_SHORTCUT_SCOPE_GLOBAL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ShortcutType.swift b/Sources/Gtk/Generated/ShortcutType.swift index 8461c30a95..a3d57b53c7 100644 --- a/Sources/Gtk/Generated/ShortcutType.swift +++ b/Sources/Gtk/Generated/ShortcutType.swift @@ -1,60 +1,60 @@ import CGtk /// GtkShortcutType specifies the kind of shortcut that is being described. -/// +/// /// More values may be added to this enumeration over time. public enum ShortcutType: GValueRepresentableEnum { public typealias GtkEnum = GtkShortcutType /// The shortcut is a keyboard accelerator. The GtkShortcutsShortcut:accelerator - /// property will be used. - case accelerator - /// The shortcut is a pinch gesture. GTK provides an icon and subtitle. - case gesturePinch - /// The shortcut is a stretch gesture. GTK provides an icon and subtitle. - case gestureStretch - /// The shortcut is a clockwise rotation gesture. GTK provides an icon and subtitle. - case gestureRotateClockwise - /// The shortcut is a counterclockwise rotation gesture. GTK provides an icon and subtitle. - case gestureRotateCounterclockwise - /// The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle. - case gestureTwoFingerSwipeLeft - /// The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle. - case gestureTwoFingerSwipeRight - /// The shortcut is a gesture. The GtkShortcutsShortcut:icon property will be - /// used. - case gesture - /// The shortcut is a swipe gesture. GTK provides an icon and subtitle. - case gestureSwipeLeft - /// The shortcut is a swipe gesture. GTK provides an icon and subtitle. - case gestureSwipeRight +/// property will be used. +case accelerator +/// The shortcut is a pinch gesture. GTK provides an icon and subtitle. +case gesturePinch +/// The shortcut is a stretch gesture. GTK provides an icon and subtitle. +case gestureStretch +/// The shortcut is a clockwise rotation gesture. GTK provides an icon and subtitle. +case gestureRotateClockwise +/// The shortcut is a counterclockwise rotation gesture. GTK provides an icon and subtitle. +case gestureRotateCounterclockwise +/// The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle. +case gestureTwoFingerSwipeLeft +/// The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle. +case gestureTwoFingerSwipeRight +/// The shortcut is a gesture. The GtkShortcutsShortcut:icon property will be +/// used. +case gesture +/// The shortcut is a swipe gesture. GTK provides an icon and subtitle. +case gestureSwipeLeft +/// The shortcut is a swipe gesture. GTK provides an icon and subtitle. +case gestureSwipeRight public static var type: GType { - gtk_shortcut_type_get_type() - } + gtk_shortcut_type_get_type() +} public init(from gtkEnum: GtkShortcutType) { switch gtkEnum { case GTK_SHORTCUT_ACCELERATOR: - self = .accelerator - case GTK_SHORTCUT_GESTURE_PINCH: - self = .gesturePinch - case GTK_SHORTCUT_GESTURE_STRETCH: - self = .gestureStretch - case GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE: - self = .gestureRotateClockwise - case GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE: - self = .gestureRotateCounterclockwise - case GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT: - self = .gestureTwoFingerSwipeLeft - case GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT: - self = .gestureTwoFingerSwipeRight - case GTK_SHORTCUT_GESTURE: - self = .gesture - case GTK_SHORTCUT_GESTURE_SWIPE_LEFT: - self = .gestureSwipeLeft - case GTK_SHORTCUT_GESTURE_SWIPE_RIGHT: - self = .gestureSwipeRight + self = .accelerator +case GTK_SHORTCUT_GESTURE_PINCH: + self = .gesturePinch +case GTK_SHORTCUT_GESTURE_STRETCH: + self = .gestureStretch +case GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE: + self = .gestureRotateClockwise +case GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE: + self = .gestureRotateCounterclockwise +case GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT: + self = .gestureTwoFingerSwipeLeft +case GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT: + self = .gestureTwoFingerSwipeRight +case GTK_SHORTCUT_GESTURE: + self = .gesture +case GTK_SHORTCUT_GESTURE_SWIPE_LEFT: + self = .gestureSwipeLeft +case GTK_SHORTCUT_GESTURE_SWIPE_RIGHT: + self = .gestureSwipeRight default: fatalError("Unsupported GtkShortcutType enum value: \(gtkEnum.rawValue)") } @@ -63,25 +63,25 @@ public enum ShortcutType: GValueRepresentableEnum { public func toGtk() -> GtkShortcutType { switch self { case .accelerator: - return GTK_SHORTCUT_ACCELERATOR - case .gesturePinch: - return GTK_SHORTCUT_GESTURE_PINCH - case .gestureStretch: - return GTK_SHORTCUT_GESTURE_STRETCH - case .gestureRotateClockwise: - return GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE - case .gestureRotateCounterclockwise: - return GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE - case .gestureTwoFingerSwipeLeft: - return GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT - case .gestureTwoFingerSwipeRight: - return GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT - case .gesture: - return GTK_SHORTCUT_GESTURE - case .gestureSwipeLeft: - return GTK_SHORTCUT_GESTURE_SWIPE_LEFT - case .gestureSwipeRight: - return GTK_SHORTCUT_GESTURE_SWIPE_RIGHT + return GTK_SHORTCUT_ACCELERATOR +case .gesturePinch: + return GTK_SHORTCUT_GESTURE_PINCH +case .gestureStretch: + return GTK_SHORTCUT_GESTURE_STRETCH +case .gestureRotateClockwise: + return GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE +case .gestureRotateCounterclockwise: + return GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE +case .gestureTwoFingerSwipeLeft: + return GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT +case .gestureTwoFingerSwipeRight: + return GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT +case .gesture: + return GTK_SHORTCUT_GESTURE +case .gestureSwipeLeft: + return GTK_SHORTCUT_GESTURE_SWIPE_LEFT +case .gestureSwipeRight: + return GTK_SHORTCUT_GESTURE_SWIPE_RIGHT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SizeGroupMode.swift b/Sources/Gtk/Generated/SizeGroupMode.swift index 5a4a684fbd..bd98e748f7 100644 --- a/Sources/Gtk/Generated/SizeGroupMode.swift +++ b/Sources/Gtk/Generated/SizeGroupMode.swift @@ -6,28 +6,28 @@ public enum SizeGroupMode: GValueRepresentableEnum { public typealias GtkEnum = GtkSizeGroupMode /// Group has no effect - case none - /// Group affects horizontal requisition - case horizontal - /// Group affects vertical requisition - case vertical - /// Group affects both horizontal and vertical requisition - case both +case none +/// Group affects horizontal requisition +case horizontal +/// Group affects vertical requisition +case vertical +/// Group affects both horizontal and vertical requisition +case both public static var type: GType { - gtk_size_group_mode_get_type() - } + gtk_size_group_mode_get_type() +} public init(from gtkEnum: GtkSizeGroupMode) { switch gtkEnum { case GTK_SIZE_GROUP_NONE: - self = .none - case GTK_SIZE_GROUP_HORIZONTAL: - self = .horizontal - case GTK_SIZE_GROUP_VERTICAL: - self = .vertical - case GTK_SIZE_GROUP_BOTH: - self = .both + self = .none +case GTK_SIZE_GROUP_HORIZONTAL: + self = .horizontal +case GTK_SIZE_GROUP_VERTICAL: + self = .vertical +case GTK_SIZE_GROUP_BOTH: + self = .both default: fatalError("Unsupported GtkSizeGroupMode enum value: \(gtkEnum.rawValue)") } @@ -36,13 +36,13 @@ public enum SizeGroupMode: GValueRepresentableEnum { public func toGtk() -> GtkSizeGroupMode { switch self { case .none: - return GTK_SIZE_GROUP_NONE - case .horizontal: - return GTK_SIZE_GROUP_HORIZONTAL - case .vertical: - return GTK_SIZE_GROUP_VERTICAL - case .both: - return GTK_SIZE_GROUP_BOTH + return GTK_SIZE_GROUP_NONE +case .horizontal: + return GTK_SIZE_GROUP_HORIZONTAL +case .vertical: + return GTK_SIZE_GROUP_VERTICAL +case .both: + return GTK_SIZE_GROUP_BOTH } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SizeRequestMode.swift b/Sources/Gtk/Generated/SizeRequestMode.swift index 4ed9def07c..14b590f8e2 100644 --- a/Sources/Gtk/Generated/SizeRequestMode.swift +++ b/Sources/Gtk/Generated/SizeRequestMode.swift @@ -6,24 +6,24 @@ public enum SizeRequestMode: GValueRepresentableEnum { public typealias GtkEnum = GtkSizeRequestMode /// Prefer height-for-width geometry management - case heightForWidth - /// Prefer width-for-height geometry management - case widthForHeight - /// Don’t trade height-for-width or width-for-height - case constantSize +case heightForWidth +/// Prefer width-for-height geometry management +case widthForHeight +/// Don’t trade height-for-width or width-for-height +case constantSize public static var type: GType { - gtk_size_request_mode_get_type() - } + gtk_size_request_mode_get_type() +} public init(from gtkEnum: GtkSizeRequestMode) { switch gtkEnum { case GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH: - self = .heightForWidth - case GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT: - self = .widthForHeight - case GTK_SIZE_REQUEST_CONSTANT_SIZE: - self = .constantSize + self = .heightForWidth +case GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT: + self = .widthForHeight +case GTK_SIZE_REQUEST_CONSTANT_SIZE: + self = .constantSize default: fatalError("Unsupported GtkSizeRequestMode enum value: \(gtkEnum.rawValue)") } @@ -32,11 +32,11 @@ public enum SizeRequestMode: GValueRepresentableEnum { public func toGtk() -> GtkSizeRequestMode { switch self { case .heightForWidth: - return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH - case .widthForHeight: - return GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT - case .constantSize: - return GTK_SIZE_REQUEST_CONSTANT_SIZE + return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH +case .widthForHeight: + return GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT +case .constantSize: + return GTK_SIZE_REQUEST_CONSTANT_SIZE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SortType.swift b/Sources/Gtk/Generated/SortType.swift index 2a19d30b89..78d4dab6ae 100644 --- a/Sources/Gtk/Generated/SortType.swift +++ b/Sources/Gtk/Generated/SortType.swift @@ -5,20 +5,20 @@ public enum SortType: GValueRepresentableEnum { public typealias GtkEnum = GtkSortType /// Sorting is in ascending order. - case ascending - /// Sorting is in descending order. - case descending +case ascending +/// Sorting is in descending order. +case descending public static var type: GType { - gtk_sort_type_get_type() - } + gtk_sort_type_get_type() +} public init(from gtkEnum: GtkSortType) { switch gtkEnum { case GTK_SORT_ASCENDING: - self = .ascending - case GTK_SORT_DESCENDING: - self = .descending + self = .ascending +case GTK_SORT_DESCENDING: + self = .descending default: fatalError("Unsupported GtkSortType enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ public enum SortType: GValueRepresentableEnum { public func toGtk() -> GtkSortType { switch self { case .ascending: - return GTK_SORT_ASCENDING - case .descending: - return GTK_SORT_DESCENDING + return GTK_SORT_ASCENDING +case .descending: + return GTK_SORT_DESCENDING } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SorterChange.swift b/Sources/Gtk/Generated/SorterChange.swift index a7cf38e399..1624530ab0 100644 --- a/Sources/Gtk/Generated/SorterChange.swift +++ b/Sources/Gtk/Generated/SorterChange.swift @@ -6,33 +6,33 @@ public enum SorterChange: GValueRepresentableEnum { public typealias GtkEnum = GtkSorterChange /// The sorter change cannot be described - /// by any of the other enumeration values - case different - /// The sort order was inverted. Comparisons - /// that returned %GTK_ORDERING_SMALLER now return %GTK_ORDERING_LARGER - /// and vice versa. Other comparisons return the same values as before. - case inverted - /// The sorter is less strict: Comparisons - /// may now return %GTK_ORDERING_EQUAL that did not do so before. - case lessStrict - /// The sorter is more strict: Comparisons - /// that did return %GTK_ORDERING_EQUAL may not do so anymore. - case moreStrict +/// by any of the other enumeration values +case different +/// The sort order was inverted. Comparisons +/// that returned %GTK_ORDERING_SMALLER now return %GTK_ORDERING_LARGER +/// and vice versa. Other comparisons return the same values as before. +case inverted +/// The sorter is less strict: Comparisons +/// may now return %GTK_ORDERING_EQUAL that did not do so before. +case lessStrict +/// The sorter is more strict: Comparisons +/// that did return %GTK_ORDERING_EQUAL may not do so anymore. +case moreStrict public static var type: GType { - gtk_sorter_change_get_type() - } + gtk_sorter_change_get_type() +} public init(from gtkEnum: GtkSorterChange) { switch gtkEnum { case GTK_SORTER_CHANGE_DIFFERENT: - self = .different - case GTK_SORTER_CHANGE_INVERTED: - self = .inverted - case GTK_SORTER_CHANGE_LESS_STRICT: - self = .lessStrict - case GTK_SORTER_CHANGE_MORE_STRICT: - self = .moreStrict + self = .different +case GTK_SORTER_CHANGE_INVERTED: + self = .inverted +case GTK_SORTER_CHANGE_LESS_STRICT: + self = .lessStrict +case GTK_SORTER_CHANGE_MORE_STRICT: + self = .moreStrict default: fatalError("Unsupported GtkSorterChange enum value: \(gtkEnum.rawValue)") } @@ -41,13 +41,13 @@ public enum SorterChange: GValueRepresentableEnum { public func toGtk() -> GtkSorterChange { switch self { case .different: - return GTK_SORTER_CHANGE_DIFFERENT - case .inverted: - return GTK_SORTER_CHANGE_INVERTED - case .lessStrict: - return GTK_SORTER_CHANGE_LESS_STRICT - case .moreStrict: - return GTK_SORTER_CHANGE_MORE_STRICT + return GTK_SORTER_CHANGE_DIFFERENT +case .inverted: + return GTK_SORTER_CHANGE_INVERTED +case .lessStrict: + return GTK_SORTER_CHANGE_LESS_STRICT +case .moreStrict: + return GTK_SORTER_CHANGE_MORE_STRICT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SorterOrder.swift b/Sources/Gtk/Generated/SorterOrder.swift index 193596801b..4fb6394d40 100644 --- a/Sources/Gtk/Generated/SorterOrder.swift +++ b/Sources/Gtk/Generated/SorterOrder.swift @@ -5,27 +5,27 @@ public enum SorterOrder: GValueRepresentableEnum { public typealias GtkEnum = GtkSorterOrder /// A partial order. Any `GtkOrdering` is possible. - case partial - /// No order, all elements are considered equal. - /// gtk_sorter_compare() will only return %GTK_ORDERING_EQUAL. - case none - /// A total order. gtk_sorter_compare() will only - /// return %GTK_ORDERING_EQUAL if an item is compared with itself. Two - /// different items will never cause this value to be returned. - case total +case partial +/// No order, all elements are considered equal. +/// gtk_sorter_compare() will only return %GTK_ORDERING_EQUAL. +case none +/// A total order. gtk_sorter_compare() will only +/// return %GTK_ORDERING_EQUAL if an item is compared with itself. Two +/// different items will never cause this value to be returned. +case total public static var type: GType { - gtk_sorter_order_get_type() - } + gtk_sorter_order_get_type() +} public init(from gtkEnum: GtkSorterOrder) { switch gtkEnum { case GTK_SORTER_ORDER_PARTIAL: - self = .partial - case GTK_SORTER_ORDER_NONE: - self = .none - case GTK_SORTER_ORDER_TOTAL: - self = .total + self = .partial +case GTK_SORTER_ORDER_NONE: + self = .none +case GTK_SORTER_ORDER_TOTAL: + self = .total default: fatalError("Unsupported GtkSorterOrder enum value: \(gtkEnum.rawValue)") } @@ -34,11 +34,11 @@ public enum SorterOrder: GValueRepresentableEnum { public func toGtk() -> GtkSorterOrder { switch self { case .partial: - return GTK_SORTER_ORDER_PARTIAL - case .none: - return GTK_SORTER_ORDER_NONE - case .total: - return GTK_SORTER_ORDER_TOTAL + return GTK_SORTER_ORDER_PARTIAL +case .none: + return GTK_SORTER_ORDER_NONE +case .total: + return GTK_SORTER_ORDER_TOTAL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SpinButtonUpdatePolicy.swift b/Sources/Gtk/Generated/SpinButtonUpdatePolicy.swift index f2064ada87..14e0410ba8 100644 --- a/Sources/Gtk/Generated/SpinButtonUpdatePolicy.swift +++ b/Sources/Gtk/Generated/SpinButtonUpdatePolicy.swift @@ -2,29 +2,29 @@ import CGtk /// Determines whether the spin button displays values outside the adjustment /// bounds. -/// +/// /// See [method@Gtk.SpinButton.set_update_policy]. public enum SpinButtonUpdatePolicy: GValueRepresentableEnum { public typealias GtkEnum = GtkSpinButtonUpdatePolicy /// When refreshing your `GtkSpinButton`, the value is - /// always displayed - case always - /// When refreshing your `GtkSpinButton`, the value is - /// only displayed if it is valid within the bounds of the spin button's - /// adjustment - case ifValid +/// always displayed +case always +/// When refreshing your `GtkSpinButton`, the value is +/// only displayed if it is valid within the bounds of the spin button's +/// adjustment +case ifValid public static var type: GType { - gtk_spin_button_update_policy_get_type() - } + gtk_spin_button_update_policy_get_type() +} public init(from gtkEnum: GtkSpinButtonUpdatePolicy) { switch gtkEnum { case GTK_UPDATE_ALWAYS: - self = .always - case GTK_UPDATE_IF_VALID: - self = .ifValid + self = .always +case GTK_UPDATE_IF_VALID: + self = .ifValid default: fatalError("Unsupported GtkSpinButtonUpdatePolicy enum value: \(gtkEnum.rawValue)") } @@ -33,9 +33,9 @@ public enum SpinButtonUpdatePolicy: GValueRepresentableEnum { public func toGtk() -> GtkSpinButtonUpdatePolicy { switch self { case .always: - return GTK_UPDATE_ALWAYS - case .ifValid: - return GTK_UPDATE_IF_VALID + return GTK_UPDATE_ALWAYS +case .ifValid: + return GTK_UPDATE_IF_VALID } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SpinType.swift b/Sources/Gtk/Generated/SpinType.swift index 495515dffa..da575388ec 100644 --- a/Sources/Gtk/Generated/SpinType.swift +++ b/Sources/Gtk/Generated/SpinType.swift @@ -6,40 +6,40 @@ public enum SpinType: GValueRepresentableEnum { public typealias GtkEnum = GtkSpinType /// Increment by the adjustments step increment. - case stepForward - /// Decrement by the adjustments step increment. - case stepBackward - /// Increment by the adjustments page increment. - case pageForward - /// Decrement by the adjustments page increment. - case pageBackward - /// Go to the adjustments lower bound. - case home - /// Go to the adjustments upper bound. - case end - /// Change by a specified amount. - case userDefined +case stepForward +/// Decrement by the adjustments step increment. +case stepBackward +/// Increment by the adjustments page increment. +case pageForward +/// Decrement by the adjustments page increment. +case pageBackward +/// Go to the adjustments lower bound. +case home +/// Go to the adjustments upper bound. +case end +/// Change by a specified amount. +case userDefined public static var type: GType { - gtk_spin_type_get_type() - } + gtk_spin_type_get_type() +} public init(from gtkEnum: GtkSpinType) { switch gtkEnum { case GTK_SPIN_STEP_FORWARD: - self = .stepForward - case GTK_SPIN_STEP_BACKWARD: - self = .stepBackward - case GTK_SPIN_PAGE_FORWARD: - self = .pageForward - case GTK_SPIN_PAGE_BACKWARD: - self = .pageBackward - case GTK_SPIN_HOME: - self = .home - case GTK_SPIN_END: - self = .end - case GTK_SPIN_USER_DEFINED: - self = .userDefined + self = .stepForward +case GTK_SPIN_STEP_BACKWARD: + self = .stepBackward +case GTK_SPIN_PAGE_FORWARD: + self = .pageForward +case GTK_SPIN_PAGE_BACKWARD: + self = .pageBackward +case GTK_SPIN_HOME: + self = .home +case GTK_SPIN_END: + self = .end +case GTK_SPIN_USER_DEFINED: + self = .userDefined default: fatalError("Unsupported GtkSpinType enum value: \(gtkEnum.rawValue)") } @@ -48,19 +48,19 @@ public enum SpinType: GValueRepresentableEnum { public func toGtk() -> GtkSpinType { switch self { case .stepForward: - return GTK_SPIN_STEP_FORWARD - case .stepBackward: - return GTK_SPIN_STEP_BACKWARD - case .pageForward: - return GTK_SPIN_PAGE_FORWARD - case .pageBackward: - return GTK_SPIN_PAGE_BACKWARD - case .home: - return GTK_SPIN_HOME - case .end: - return GTK_SPIN_END - case .userDefined: - return GTK_SPIN_USER_DEFINED + return GTK_SPIN_STEP_FORWARD +case .stepBackward: + return GTK_SPIN_STEP_BACKWARD +case .pageForward: + return GTK_SPIN_PAGE_FORWARD +case .pageBackward: + return GTK_SPIN_PAGE_BACKWARD +case .home: + return GTK_SPIN_HOME +case .end: + return GTK_SPIN_END +case .userDefined: + return GTK_SPIN_USER_DEFINED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Spinner.swift b/Sources/Gtk/Generated/Spinner.swift index 3ba1db393c..b3394a0ac2 100644 --- a/Sources/Gtk/Generated/Spinner.swift +++ b/Sources/Gtk/Generated/Spinner.swift @@ -1,46 +1,45 @@ import CGtk /// Displays an icon-size spinning animation. -/// +/// /// It is often used as an alternative to a [class@Gtk.ProgressBar] /// for displaying indefinite activity, instead of actual progress. -/// +/// /// An example GtkSpinner -/// +/// /// To start the animation, use [method@Gtk.Spinner.start], to stop it /// use [method@Gtk.Spinner.stop]. -/// +/// /// # CSS nodes -/// +/// /// `GtkSpinner` has a single CSS node with the name spinner. /// When the animation is active, the :checked pseudoclass is /// added to this node. open class Spinner: Widget { /// Returns a new spinner widget. Not yet started. - public convenience init() { - self.init( - gtk_spinner_new() - ) - } - - override func didMoveToParent() { - super.didMoveToParent() +public convenience init() { + self.init( + gtk_spinner_new() + ) +} - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + override func didMoveToParent() { + super.didMoveToParent() - addSignal(name: "notify::spinning", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySpinning?(self, param0) - } + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::spinning", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySpinning?(self, param0) +} +} + /// Whether the spinner is spinning - @GObjectProperty(named: "spinning") public var spinning: Bool +@GObjectProperty(named: "spinning") public var spinning: Bool - public var notifySpinning: ((Spinner, OpaquePointer) -> Void)? -} + +public var notifySpinning: ((Spinner, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/StackTransitionType.swift b/Sources/Gtk/Generated/StackTransitionType.swift index 670e993e87..6c06a23b37 100644 --- a/Sources/Gtk/Generated/StackTransitionType.swift +++ b/Sources/Gtk/Generated/StackTransitionType.swift @@ -1,110 +1,110 @@ import CGtk /// Possible transitions between pages in a `GtkStack` widget. -/// +/// /// New values may be added to this enumeration over time. public enum StackTransitionType: GValueRepresentableEnum { public typealias GtkEnum = GtkStackTransitionType /// No transition - case none - /// A cross-fade - case crossfade - /// Slide from left to right - case slideRight - /// Slide from right to left - case slideLeft - /// Slide from bottom up - case slideUp - /// Slide from top down - case slideDown - /// Slide from left or right according to the children order - case slideLeftRight - /// Slide from top down or bottom up according to the order - case slideUpDown - /// Cover the old page by sliding up - case overUp - /// Cover the old page by sliding down - case overDown - /// Cover the old page by sliding to the left - case overLeft - /// Cover the old page by sliding to the right - case overRight - /// Uncover the new page by sliding up - case underUp - /// Uncover the new page by sliding down - case underDown - /// Uncover the new page by sliding to the left - case underLeft - /// Uncover the new page by sliding to the right - case underRight - /// Cover the old page sliding up or uncover the new page sliding down, according to order - case overUpDown - /// Cover the old page sliding down or uncover the new page sliding up, according to order - case overDownUp - /// Cover the old page sliding left or uncover the new page sliding right, according to order - case overLeftRight - /// Cover the old page sliding right or uncover the new page sliding left, according to order - case overRightLeft - /// Pretend the pages are sides of a cube and rotate that cube to the left - case rotateLeft - /// Pretend the pages are sides of a cube and rotate that cube to the right - case rotateRight - /// Pretend the pages are sides of a cube and rotate that cube to the left or right according to the children order - case rotateLeftRight +case none +/// A cross-fade +case crossfade +/// Slide from left to right +case slideRight +/// Slide from right to left +case slideLeft +/// Slide from bottom up +case slideUp +/// Slide from top down +case slideDown +/// Slide from left or right according to the children order +case slideLeftRight +/// Slide from top down or bottom up according to the order +case slideUpDown +/// Cover the old page by sliding up +case overUp +/// Cover the old page by sliding down +case overDown +/// Cover the old page by sliding to the left +case overLeft +/// Cover the old page by sliding to the right +case overRight +/// Uncover the new page by sliding up +case underUp +/// Uncover the new page by sliding down +case underDown +/// Uncover the new page by sliding to the left +case underLeft +/// Uncover the new page by sliding to the right +case underRight +/// Cover the old page sliding up or uncover the new page sliding down, according to order +case overUpDown +/// Cover the old page sliding down or uncover the new page sliding up, according to order +case overDownUp +/// Cover the old page sliding left or uncover the new page sliding right, according to order +case overLeftRight +/// Cover the old page sliding right or uncover the new page sliding left, according to order +case overRightLeft +/// Pretend the pages are sides of a cube and rotate that cube to the left +case rotateLeft +/// Pretend the pages are sides of a cube and rotate that cube to the right +case rotateRight +/// Pretend the pages are sides of a cube and rotate that cube to the left or right according to the children order +case rotateLeftRight public static var type: GType { - gtk_stack_transition_type_get_type() - } + gtk_stack_transition_type_get_type() +} public init(from gtkEnum: GtkStackTransitionType) { switch gtkEnum { case GTK_STACK_TRANSITION_TYPE_NONE: - self = .none - case GTK_STACK_TRANSITION_TYPE_CROSSFADE: - self = .crossfade - case GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT: - self = .slideRight - case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT: - self = .slideLeft - case GTK_STACK_TRANSITION_TYPE_SLIDE_UP: - self = .slideUp - case GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN: - self = .slideDown - case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT: - self = .slideLeftRight - case GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN: - self = .slideUpDown - case GTK_STACK_TRANSITION_TYPE_OVER_UP: - self = .overUp - case GTK_STACK_TRANSITION_TYPE_OVER_DOWN: - self = .overDown - case GTK_STACK_TRANSITION_TYPE_OVER_LEFT: - self = .overLeft - case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT: - self = .overRight - case GTK_STACK_TRANSITION_TYPE_UNDER_UP: - self = .underUp - case GTK_STACK_TRANSITION_TYPE_UNDER_DOWN: - self = .underDown - case GTK_STACK_TRANSITION_TYPE_UNDER_LEFT: - self = .underLeft - case GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT: - self = .underRight - case GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN: - self = .overUpDown - case GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP: - self = .overDownUp - case GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT: - self = .overLeftRight - case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT: - self = .overRightLeft - case GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT: - self = .rotateLeft - case GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT: - self = .rotateRight - case GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT: - self = .rotateLeftRight + self = .none +case GTK_STACK_TRANSITION_TYPE_CROSSFADE: + self = .crossfade +case GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT: + self = .slideRight +case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT: + self = .slideLeft +case GTK_STACK_TRANSITION_TYPE_SLIDE_UP: + self = .slideUp +case GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN: + self = .slideDown +case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT: + self = .slideLeftRight +case GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN: + self = .slideUpDown +case GTK_STACK_TRANSITION_TYPE_OVER_UP: + self = .overUp +case GTK_STACK_TRANSITION_TYPE_OVER_DOWN: + self = .overDown +case GTK_STACK_TRANSITION_TYPE_OVER_LEFT: + self = .overLeft +case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT: + self = .overRight +case GTK_STACK_TRANSITION_TYPE_UNDER_UP: + self = .underUp +case GTK_STACK_TRANSITION_TYPE_UNDER_DOWN: + self = .underDown +case GTK_STACK_TRANSITION_TYPE_UNDER_LEFT: + self = .underLeft +case GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT: + self = .underRight +case GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN: + self = .overUpDown +case GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP: + self = .overDownUp +case GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT: + self = .overLeftRight +case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT: + self = .overRightLeft +case GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT: + self = .rotateLeft +case GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT: + self = .rotateRight +case GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT: + self = .rotateLeftRight default: fatalError("Unsupported GtkStackTransitionType enum value: \(gtkEnum.rawValue)") } @@ -113,51 +113,51 @@ public enum StackTransitionType: GValueRepresentableEnum { public func toGtk() -> GtkStackTransitionType { switch self { case .none: - return GTK_STACK_TRANSITION_TYPE_NONE - case .crossfade: - return GTK_STACK_TRANSITION_TYPE_CROSSFADE - case .slideRight: - return GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT - case .slideLeft: - return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT - case .slideUp: - return GTK_STACK_TRANSITION_TYPE_SLIDE_UP - case .slideDown: - return GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN - case .slideLeftRight: - return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT - case .slideUpDown: - return GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN - case .overUp: - return GTK_STACK_TRANSITION_TYPE_OVER_UP - case .overDown: - return GTK_STACK_TRANSITION_TYPE_OVER_DOWN - case .overLeft: - return GTK_STACK_TRANSITION_TYPE_OVER_LEFT - case .overRight: - return GTK_STACK_TRANSITION_TYPE_OVER_RIGHT - case .underUp: - return GTK_STACK_TRANSITION_TYPE_UNDER_UP - case .underDown: - return GTK_STACK_TRANSITION_TYPE_UNDER_DOWN - case .underLeft: - return GTK_STACK_TRANSITION_TYPE_UNDER_LEFT - case .underRight: - return GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT - case .overUpDown: - return GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN - case .overDownUp: - return GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP - case .overLeftRight: - return GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT - case .overRightLeft: - return GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT - case .rotateLeft: - return GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT - case .rotateRight: - return GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT - case .rotateLeftRight: - return GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT + return GTK_STACK_TRANSITION_TYPE_NONE +case .crossfade: + return GTK_STACK_TRANSITION_TYPE_CROSSFADE +case .slideRight: + return GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT +case .slideLeft: + return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT +case .slideUp: + return GTK_STACK_TRANSITION_TYPE_SLIDE_UP +case .slideDown: + return GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN +case .slideLeftRight: + return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT +case .slideUpDown: + return GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN +case .overUp: + return GTK_STACK_TRANSITION_TYPE_OVER_UP +case .overDown: + return GTK_STACK_TRANSITION_TYPE_OVER_DOWN +case .overLeft: + return GTK_STACK_TRANSITION_TYPE_OVER_LEFT +case .overRight: + return GTK_STACK_TRANSITION_TYPE_OVER_RIGHT +case .underUp: + return GTK_STACK_TRANSITION_TYPE_UNDER_UP +case .underDown: + return GTK_STACK_TRANSITION_TYPE_UNDER_DOWN +case .underLeft: + return GTK_STACK_TRANSITION_TYPE_UNDER_LEFT +case .underRight: + return GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT +case .overUpDown: + return GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN +case .overDownUp: + return GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP +case .overLeftRight: + return GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT +case .overRightLeft: + return GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT +case .rotateLeft: + return GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT +case .rotateRight: + return GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT +case .rotateLeftRight: + return GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/StringFilterMatchMode.swift b/Sources/Gtk/Generated/StringFilterMatchMode.swift index c0b77f93d6..97dcadcf51 100644 --- a/Sources/Gtk/Generated/StringFilterMatchMode.swift +++ b/Sources/Gtk/Generated/StringFilterMatchMode.swift @@ -5,27 +5,27 @@ public enum StringFilterMatchMode: GValueRepresentableEnum { public typealias GtkEnum = GtkStringFilterMatchMode /// The search string and - /// text must match exactly - case exact - /// The search string - /// must be contained as a substring inside the text - case substring - /// The text must begin - /// with the search string - case prefix +/// text must match exactly +case exact +/// The search string +/// must be contained as a substring inside the text +case substring +/// The text must begin +/// with the search string +case prefix public static var type: GType { - gtk_string_filter_match_mode_get_type() - } + gtk_string_filter_match_mode_get_type() +} public init(from gtkEnum: GtkStringFilterMatchMode) { switch gtkEnum { case GTK_STRING_FILTER_MATCH_MODE_EXACT: - self = .exact - case GTK_STRING_FILTER_MATCH_MODE_SUBSTRING: - self = .substring - case GTK_STRING_FILTER_MATCH_MODE_PREFIX: - self = .prefix + self = .exact +case GTK_STRING_FILTER_MATCH_MODE_SUBSTRING: + self = .substring +case GTK_STRING_FILTER_MATCH_MODE_PREFIX: + self = .prefix default: fatalError("Unsupported GtkStringFilterMatchMode enum value: \(gtkEnum.rawValue)") } @@ -34,11 +34,11 @@ public enum StringFilterMatchMode: GValueRepresentableEnum { public func toGtk() -> GtkStringFilterMatchMode { switch self { case .exact: - return GTK_STRING_FILTER_MATCH_MODE_EXACT - case .substring: - return GTK_STRING_FILTER_MATCH_MODE_SUBSTRING - case .prefix: - return GTK_STRING_FILTER_MATCH_MODE_PREFIX + return GTK_STRING_FILTER_MATCH_MODE_EXACT +case .substring: + return GTK_STRING_FILTER_MATCH_MODE_SUBSTRING +case .prefix: + return GTK_STRING_FILTER_MATCH_MODE_PREFIX } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/StyleProvider.swift b/Sources/Gtk/Generated/StyleProvider.swift index d5587188a7..9318cb5a4b 100644 --- a/Sources/Gtk/Generated/StyleProvider.swift +++ b/Sources/Gtk/Generated/StyleProvider.swift @@ -1,14 +1,16 @@ import CGtk /// An interface for style information used by [class@Gtk.StyleContext]. -/// +/// /// See [method@Gtk.StyleContext.add_provider] and /// [func@Gtk.StyleContext.add_provider_for_display] for /// adding `GtkStyleProviders`. -/// +/// /// GTK uses the `GtkStyleProvider` implementation for CSS in /// [class@Gtk.CssProvider]. public protocol StyleProvider: GObjectRepresentable { + - var gtkPrivateChanged: ((Self) -> Void)? { get set } -} + +var gtkPrivateChanged: ((Self) -> Void)? { get set } +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Switch.swift b/Sources/Gtk/Generated/Switch.swift index e4145d8e1e..00b294198a 100644 --- a/Sources/Gtk/Generated/Switch.swift +++ b/Sources/Gtk/Generated/Switch.swift @@ -1,157 +1,152 @@ import CGtk /// Shows a "light switch" that has two states: on or off. -/// +/// /// An example GtkSwitch -/// +/// /// The user can control which state should be active by clicking the /// empty area, or by dragging the slider. -/// +/// /// `GtkSwitch` can also express situations where the underlying state changes /// with a delay. In this case, the slider position indicates the user's recent /// change (represented by the [property@Gtk.Switch:active] property), while the /// trough color indicates the present underlying state (represented by the /// [property@Gtk.Switch:state] property). -/// +/// /// GtkSwitch with delayed state change -/// +/// /// See [signal@Gtk.Switch::state-set] for details. -/// +/// /// # Shortcuts and Gestures -/// +/// /// `GtkSwitch` supports pan and drag gestures to move the slider. -/// +/// /// # CSS nodes -/// +/// /// ``` /// switch /// ├── image /// ├── image /// ╰── slider /// ``` -/// +/// /// `GtkSwitch` has four css nodes, the main node with the name switch and /// subnodes for the slider and the on and off images. Neither of them is /// using any style classes. -/// +/// /// # Accessibility -/// +/// /// `GtkSwitch` uses the [enum@Gtk.AccessibleRole.switch] role. open class Switch: Widget, Actionable { /// Creates a new `GtkSwitch` widget. - public convenience init() { - self.init( - gtk_switch_new() - ) +public convenience init() { + self.init( + gtk_switch_new() + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, Bool, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, Bool, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "state-set", handler: gCallback(handler1)) { [weak self] (param0: Bool) in - guard let self = self else { return } - self.stateSet?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::active", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActive?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::state", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyState?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::action-name", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionName?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::action-target", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionTarget?(self, param0) - } +addSignal(name: "state-set", handler: gCallback(handler1)) { [weak self] (param0: Bool) in + guard let self = self else { return } + self.stateSet?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Whether the `GtkSwitch` widget is in its on or off state. - @GObjectProperty(named: "active") public var active: Bool - - /// The backend state that is controlled by the switch. - /// - /// Applications should usually set the [property@Gtk.Switch:active] property, - /// except when indicating a change to the backend state which occurs - /// separately from the user's interaction. - /// - /// See [signal@Gtk.Switch::state-set] for details. - @GObjectProperty(named: "state") public var state: Bool - - /// The name of the action with which this widget should be associated. - @GObjectProperty(named: "action-name") public var actionName: String? - - /// Emitted to animate the switch. - /// - /// Applications should never connect to this signal, - /// but use the [property@Gtk.Switch:active] property. - public var activate: ((Switch) -> Void)? - - /// Emitted to change the underlying state. - /// - /// The ::state-set signal is emitted when the user changes the switch - /// position. The default handler calls [method@Gtk.Switch.set_state] with the - /// value of @state. - /// - /// To implement delayed state change, applications can connect to this - /// signal, initiate the change of the underlying state, and call - /// [method@Gtk.Switch.set_state] when the underlying state change is - /// complete. The signal handler should return %TRUE to prevent the - /// default handler from running. - public var stateSet: ((Switch, Bool) -> Void)? - - public var notifyActive: ((Switch, OpaquePointer) -> Void)? - - public var notifyState: ((Switch, OpaquePointer) -> Void)? - - public var notifyActionName: ((Switch, OpaquePointer) -> Void)? - - public var notifyActionTarget: ((Switch, OpaquePointer) -> Void)? +addSignal(name: "notify::active", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActive?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::state", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyState?(self, param0) } + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::action-name", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionName?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::action-target", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionTarget?(self, param0) +} +} + + /// Whether the `GtkSwitch` widget is in its on or off state. +@GObjectProperty(named: "active") public var active: Bool + +/// The backend state that is controlled by the switch. +/// +/// Applications should usually set the [property@Gtk.Switch:active] property, +/// except when indicating a change to the backend state which occurs +/// separately from the user's interaction. +/// +/// See [signal@Gtk.Switch::state-set] for details. +@GObjectProperty(named: "state") public var state: Bool + +/// The name of the action with which this widget should be associated. +@GObjectProperty(named: "action-name") public var actionName: String? + +/// Emitted to animate the switch. +/// +/// Applications should never connect to this signal, +/// but use the [property@Gtk.Switch:active] property. +public var activate: ((Switch) -> Void)? + +/// Emitted to change the underlying state. +/// +/// The ::state-set signal is emitted when the user changes the switch +/// position. The default handler calls [method@Gtk.Switch.set_state] with the +/// value of @state. +/// +/// To implement delayed state change, applications can connect to this +/// signal, initiate the change of the underlying state, and call +/// [method@Gtk.Switch.set_state] when the underlying state change is +/// complete. The signal handler should return %TRUE to prevent the +/// default handler from running. +public var stateSet: ((Switch, Bool) -> Void)? + + +public var notifyActive: ((Switch, OpaquePointer) -> Void)? + + +public var notifyState: ((Switch, OpaquePointer) -> Void)? + + +public var notifyActionName: ((Switch, OpaquePointer) -> Void)? + + +public var notifyActionTarget: ((Switch, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SystemSetting.swift b/Sources/Gtk/Generated/SystemSetting.swift index ca7b9b4d36..69a3b88a13 100644 --- a/Sources/Gtk/Generated/SystemSetting.swift +++ b/Sources/Gtk/Generated/SystemSetting.swift @@ -2,50 +2,50 @@ import CGtk /// Values that can be passed to the [vfunc@Gtk.Widget.system_setting_changed] /// vfunc. -/// +/// /// The values indicate which system setting has changed. /// Widgets may need to drop caches, or react otherwise. -/// +/// /// Most of the values correspond to [class@Settings] properties. -/// +/// /// More values may be added over time. public enum SystemSetting: GValueRepresentableEnum { public typealias GtkEnum = GtkSystemSetting /// The [property@Gtk.Settings:gtk-xft-dpi] setting has changed - case dpi - /// The [property@Gtk.Settings:gtk-font-name] setting has changed - case fontName - /// The font configuration has changed in a way that - /// requires text to be redrawn. This can be any of the - /// [property@Gtk.Settings:gtk-xft-antialias], - /// [property@Gtk.Settings:gtk-xft-hinting], - /// [property@Gtk.Settings:gtk-xft-hintstyle], - /// [property@Gtk.Settings:gtk-xft-rgba] or - /// [property@Gtk.Settings:gtk-fontconfig-timestamp] settings - case fontConfig - /// The display has changed - case display - /// The icon theme has changed in a way that requires - /// icons to be looked up again - case iconTheme +case dpi +/// The [property@Gtk.Settings:gtk-font-name] setting has changed +case fontName +/// The font configuration has changed in a way that +/// requires text to be redrawn. This can be any of the +/// [property@Gtk.Settings:gtk-xft-antialias], +/// [property@Gtk.Settings:gtk-xft-hinting], +/// [property@Gtk.Settings:gtk-xft-hintstyle], +/// [property@Gtk.Settings:gtk-xft-rgba] or +/// [property@Gtk.Settings:gtk-fontconfig-timestamp] settings +case fontConfig +/// The display has changed +case display +/// The icon theme has changed in a way that requires +/// icons to be looked up again +case iconTheme public static var type: GType { - gtk_system_setting_get_type() - } + gtk_system_setting_get_type() +} public init(from gtkEnum: GtkSystemSetting) { switch gtkEnum { case GTK_SYSTEM_SETTING_DPI: - self = .dpi - case GTK_SYSTEM_SETTING_FONT_NAME: - self = .fontName - case GTK_SYSTEM_SETTING_FONT_CONFIG: - self = .fontConfig - case GTK_SYSTEM_SETTING_DISPLAY: - self = .display - case GTK_SYSTEM_SETTING_ICON_THEME: - self = .iconTheme + self = .dpi +case GTK_SYSTEM_SETTING_FONT_NAME: + self = .fontName +case GTK_SYSTEM_SETTING_FONT_CONFIG: + self = .fontConfig +case GTK_SYSTEM_SETTING_DISPLAY: + self = .display +case GTK_SYSTEM_SETTING_ICON_THEME: + self = .iconTheme default: fatalError("Unsupported GtkSystemSetting enum value: \(gtkEnum.rawValue)") } @@ -54,15 +54,15 @@ public enum SystemSetting: GValueRepresentableEnum { public func toGtk() -> GtkSystemSetting { switch self { case .dpi: - return GTK_SYSTEM_SETTING_DPI - case .fontName: - return GTK_SYSTEM_SETTING_FONT_NAME - case .fontConfig: - return GTK_SYSTEM_SETTING_FONT_CONFIG - case .display: - return GTK_SYSTEM_SETTING_DISPLAY - case .iconTheme: - return GTK_SYSTEM_SETTING_ICON_THEME + return GTK_SYSTEM_SETTING_DPI +case .fontName: + return GTK_SYSTEM_SETTING_FONT_NAME +case .fontConfig: + return GTK_SYSTEM_SETTING_FONT_CONFIG +case .display: + return GTK_SYSTEM_SETTING_DISPLAY +case .iconTheme: + return GTK_SYSTEM_SETTING_ICON_THEME } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TextDirection.swift b/Sources/Gtk/Generated/TextDirection.swift index 1ab684b607..8c3b951114 100644 --- a/Sources/Gtk/Generated/TextDirection.swift +++ b/Sources/Gtk/Generated/TextDirection.swift @@ -5,24 +5,24 @@ public enum TextDirection: GValueRepresentableEnum { public typealias GtkEnum = GtkTextDirection /// No direction. - case none - /// Left to right text direction. - case ltr - /// Right to left text direction. - case rtl +case none +/// Left to right text direction. +case ltr +/// Right to left text direction. +case rtl public static var type: GType { - gtk_text_direction_get_type() - } + gtk_text_direction_get_type() +} public init(from gtkEnum: GtkTextDirection) { switch gtkEnum { case GTK_TEXT_DIR_NONE: - self = .none - case GTK_TEXT_DIR_LTR: - self = .ltr - case GTK_TEXT_DIR_RTL: - self = .rtl + self = .none +case GTK_TEXT_DIR_LTR: + self = .ltr +case GTK_TEXT_DIR_RTL: + self = .rtl default: fatalError("Unsupported GtkTextDirection enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ public enum TextDirection: GValueRepresentableEnum { public func toGtk() -> GtkTextDirection { switch self { case .none: - return GTK_TEXT_DIR_NONE - case .ltr: - return GTK_TEXT_DIR_LTR - case .rtl: - return GTK_TEXT_DIR_RTL + return GTK_TEXT_DIR_NONE +case .ltr: + return GTK_TEXT_DIR_LTR +case .rtl: + return GTK_TEXT_DIR_RTL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TextExtendSelection.swift b/Sources/Gtk/Generated/TextExtendSelection.swift index c83f57ecec..9883a0b27e 100644 --- a/Sources/Gtk/Generated/TextExtendSelection.swift +++ b/Sources/Gtk/Generated/TextExtendSelection.swift @@ -6,22 +6,22 @@ public enum TextExtendSelection: GValueRepresentableEnum { public typealias GtkEnum = GtkTextExtendSelection /// Selects the current word. It is triggered by - /// a double-click for example. - case word - /// Selects the current line. It is triggered by - /// a triple-click for example. - case line +/// a double-click for example. +case word +/// Selects the current line. It is triggered by +/// a triple-click for example. +case line public static var type: GType { - gtk_text_extend_selection_get_type() - } + gtk_text_extend_selection_get_type() +} public init(from gtkEnum: GtkTextExtendSelection) { switch gtkEnum { case GTK_TEXT_EXTEND_SELECTION_WORD: - self = .word - case GTK_TEXT_EXTEND_SELECTION_LINE: - self = .line + self = .word +case GTK_TEXT_EXTEND_SELECTION_LINE: + self = .line default: fatalError("Unsupported GtkTextExtendSelection enum value: \(gtkEnum.rawValue)") } @@ -30,9 +30,9 @@ public enum TextExtendSelection: GValueRepresentableEnum { public func toGtk() -> GtkTextExtendSelection { switch self { case .word: - return GTK_TEXT_EXTEND_SELECTION_WORD - case .line: - return GTK_TEXT_EXTEND_SELECTION_LINE + return GTK_TEXT_EXTEND_SELECTION_WORD +case .line: + return GTK_TEXT_EXTEND_SELECTION_LINE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TextViewLayer.swift b/Sources/Gtk/Generated/TextViewLayer.swift index bd391ea8bd..ee137729f9 100644 --- a/Sources/Gtk/Generated/TextViewLayer.swift +++ b/Sources/Gtk/Generated/TextViewLayer.swift @@ -6,20 +6,20 @@ public enum TextViewLayer: GValueRepresentableEnum { public typealias GtkEnum = GtkTextViewLayer /// The layer rendered below the text (but above the background). - case belowText - /// The layer rendered above the text. - case aboveText +case belowText +/// The layer rendered above the text. +case aboveText public static var type: GType { - gtk_text_view_layer_get_type() - } + gtk_text_view_layer_get_type() +} public init(from gtkEnum: GtkTextViewLayer) { switch gtkEnum { case GTK_TEXT_VIEW_LAYER_BELOW_TEXT: - self = .belowText - case GTK_TEXT_VIEW_LAYER_ABOVE_TEXT: - self = .aboveText + self = .belowText +case GTK_TEXT_VIEW_LAYER_ABOVE_TEXT: + self = .aboveText default: fatalError("Unsupported GtkTextViewLayer enum value: \(gtkEnum.rawValue)") } @@ -28,9 +28,9 @@ public enum TextViewLayer: GValueRepresentableEnum { public func toGtk() -> GtkTextViewLayer { switch self { case .belowText: - return GTK_TEXT_VIEW_LAYER_BELOW_TEXT - case .aboveText: - return GTK_TEXT_VIEW_LAYER_ABOVE_TEXT + return GTK_TEXT_VIEW_LAYER_BELOW_TEXT +case .aboveText: + return GTK_TEXT_VIEW_LAYER_ABOVE_TEXT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TextWindowType.swift b/Sources/Gtk/Generated/TextWindowType.swift index 2457d73e97..96fbb93dfa 100644 --- a/Sources/Gtk/Generated/TextWindowType.swift +++ b/Sources/Gtk/Generated/TextWindowType.swift @@ -5,36 +5,36 @@ public enum TextWindowType: GValueRepresentableEnum { public typealias GtkEnum = GtkTextWindowType /// Window that floats over scrolling areas. - case widget - /// Scrollable text window. - case text - /// Left side border window. - case left - /// Right side border window. - case right - /// Top border window. - case top - /// Bottom border window. - case bottom +case widget +/// Scrollable text window. +case text +/// Left side border window. +case left +/// Right side border window. +case right +/// Top border window. +case top +/// Bottom border window. +case bottom public static var type: GType { - gtk_text_window_type_get_type() - } + gtk_text_window_type_get_type() +} public init(from gtkEnum: GtkTextWindowType) { switch gtkEnum { case GTK_TEXT_WINDOW_WIDGET: - self = .widget - case GTK_TEXT_WINDOW_TEXT: - self = .text - case GTK_TEXT_WINDOW_LEFT: - self = .left - case GTK_TEXT_WINDOW_RIGHT: - self = .right - case GTK_TEXT_WINDOW_TOP: - self = .top - case GTK_TEXT_WINDOW_BOTTOM: - self = .bottom + self = .widget +case GTK_TEXT_WINDOW_TEXT: + self = .text +case GTK_TEXT_WINDOW_LEFT: + self = .left +case GTK_TEXT_WINDOW_RIGHT: + self = .right +case GTK_TEXT_WINDOW_TOP: + self = .top +case GTK_TEXT_WINDOW_BOTTOM: + self = .bottom default: fatalError("Unsupported GtkTextWindowType enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ public enum TextWindowType: GValueRepresentableEnum { public func toGtk() -> GtkTextWindowType { switch self { case .widget: - return GTK_TEXT_WINDOW_WIDGET - case .text: - return GTK_TEXT_WINDOW_TEXT - case .left: - return GTK_TEXT_WINDOW_LEFT - case .right: - return GTK_TEXT_WINDOW_RIGHT - case .top: - return GTK_TEXT_WINDOW_TOP - case .bottom: - return GTK_TEXT_WINDOW_BOTTOM + return GTK_TEXT_WINDOW_WIDGET +case .text: + return GTK_TEXT_WINDOW_TEXT +case .left: + return GTK_TEXT_WINDOW_LEFT +case .right: + return GTK_TEXT_WINDOW_RIGHT +case .top: + return GTK_TEXT_WINDOW_TOP +case .bottom: + return GTK_TEXT_WINDOW_BOTTOM } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TreeDragDest.swift b/Sources/Gtk/Generated/TreeDragDest.swift index c10b696543..f7da7eae8f 100644 --- a/Sources/Gtk/Generated/TreeDragDest.swift +++ b/Sources/Gtk/Generated/TreeDragDest.swift @@ -2,5 +2,7 @@ import CGtk /// Interface for Drag-and-Drop destinations in `GtkTreeView`. public protocol TreeDragDest: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TreeDragSource.swift b/Sources/Gtk/Generated/TreeDragSource.swift index 6541757be8..4176d40441 100644 --- a/Sources/Gtk/Generated/TreeDragSource.swift +++ b/Sources/Gtk/Generated/TreeDragSource.swift @@ -2,5 +2,7 @@ import CGtk /// Interface for Drag-and-Drop destinations in `GtkTreeView`. public protocol TreeDragSource: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TreeSortable.swift b/Sources/Gtk/Generated/TreeSortable.swift index 289b07112c..3f202bafd4 100644 --- a/Sources/Gtk/Generated/TreeSortable.swift +++ b/Sources/Gtk/Generated/TreeSortable.swift @@ -1,14 +1,15 @@ import CGtk /// The interface for sortable models used by GtkTreeView -/// +/// /// `GtkTreeSortable` is an interface to be implemented by tree models which /// support sorting. The `GtkTreeView` uses the methods provided by this interface /// to sort the model. public protocol TreeSortable: GObjectRepresentable { + /// The ::sort-column-changed signal is emitted when the sort column - /// or sort order of @sortable is changed. The signal is emitted before - /// the contents of @sortable are resorted. - var sortColumnChanged: ((Self) -> Void)? { get set } -} +/// or sort order of @sortable is changed. The signal is emitted before +/// the contents of @sortable are resorted. +var sortColumnChanged: ((Self) -> Void)? { get set } +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TreeViewColumnSizing.swift b/Sources/Gtk/Generated/TreeViewColumnSizing.swift index 05b581761f..325e951105 100644 --- a/Sources/Gtk/Generated/TreeViewColumnSizing.swift +++ b/Sources/Gtk/Generated/TreeViewColumnSizing.swift @@ -7,24 +7,24 @@ public enum TreeViewColumnSizing: GValueRepresentableEnum { public typealias GtkEnum = GtkTreeViewColumnSizing /// Columns only get bigger in reaction to changes in the model - case growOnly - /// Columns resize to be the optimal size every time the model changes. - case autosize - /// Columns are a fixed numbers of pixels wide. - case fixed +case growOnly +/// Columns resize to be the optimal size every time the model changes. +case autosize +/// Columns are a fixed numbers of pixels wide. +case fixed public static var type: GType { - gtk_tree_view_column_sizing_get_type() - } + gtk_tree_view_column_sizing_get_type() +} public init(from gtkEnum: GtkTreeViewColumnSizing) { switch gtkEnum { case GTK_TREE_VIEW_COLUMN_GROW_ONLY: - self = .growOnly - case GTK_TREE_VIEW_COLUMN_AUTOSIZE: - self = .autosize - case GTK_TREE_VIEW_COLUMN_FIXED: - self = .fixed + self = .growOnly +case GTK_TREE_VIEW_COLUMN_AUTOSIZE: + self = .autosize +case GTK_TREE_VIEW_COLUMN_FIXED: + self = .fixed default: fatalError("Unsupported GtkTreeViewColumnSizing enum value: \(gtkEnum.rawValue)") } @@ -33,11 +33,11 @@ public enum TreeViewColumnSizing: GValueRepresentableEnum { public func toGtk() -> GtkTreeViewColumnSizing { switch self { case .growOnly: - return GTK_TREE_VIEW_COLUMN_GROW_ONLY - case .autosize: - return GTK_TREE_VIEW_COLUMN_AUTOSIZE - case .fixed: - return GTK_TREE_VIEW_COLUMN_FIXED + return GTK_TREE_VIEW_COLUMN_GROW_ONLY +case .autosize: + return GTK_TREE_VIEW_COLUMN_AUTOSIZE +case .fixed: + return GTK_TREE_VIEW_COLUMN_FIXED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TreeViewDropPosition.swift b/Sources/Gtk/Generated/TreeViewDropPosition.swift index d86aa2ce20..24b116d9ae 100644 --- a/Sources/Gtk/Generated/TreeViewDropPosition.swift +++ b/Sources/Gtk/Generated/TreeViewDropPosition.swift @@ -5,28 +5,28 @@ public enum TreeViewDropPosition: GValueRepresentableEnum { public typealias GtkEnum = GtkTreeViewDropPosition /// Dropped row is inserted before - case before - /// Dropped row is inserted after - case after - /// Dropped row becomes a child or is inserted before - case intoOrBefore - /// Dropped row becomes a child or is inserted after - case intoOrAfter +case before +/// Dropped row is inserted after +case after +/// Dropped row becomes a child or is inserted before +case intoOrBefore +/// Dropped row becomes a child or is inserted after +case intoOrAfter public static var type: GType { - gtk_tree_view_drop_position_get_type() - } + gtk_tree_view_drop_position_get_type() +} public init(from gtkEnum: GtkTreeViewDropPosition) { switch gtkEnum { case GTK_TREE_VIEW_DROP_BEFORE: - self = .before - case GTK_TREE_VIEW_DROP_AFTER: - self = .after - case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: - self = .intoOrBefore - case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: - self = .intoOrAfter + self = .before +case GTK_TREE_VIEW_DROP_AFTER: + self = .after +case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: + self = .intoOrBefore +case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: + self = .intoOrAfter default: fatalError("Unsupported GtkTreeViewDropPosition enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum TreeViewDropPosition: GValueRepresentableEnum { public func toGtk() -> GtkTreeViewDropPosition { switch self { case .before: - return GTK_TREE_VIEW_DROP_BEFORE - case .after: - return GTK_TREE_VIEW_DROP_AFTER - case .intoOrBefore: - return GTK_TREE_VIEW_DROP_INTO_OR_BEFORE - case .intoOrAfter: - return GTK_TREE_VIEW_DROP_INTO_OR_AFTER + return GTK_TREE_VIEW_DROP_BEFORE +case .after: + return GTK_TREE_VIEW_DROP_AFTER +case .intoOrBefore: + return GTK_TREE_VIEW_DROP_INTO_OR_BEFORE +case .intoOrAfter: + return GTK_TREE_VIEW_DROP_INTO_OR_AFTER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TreeViewGridLines.swift b/Sources/Gtk/Generated/TreeViewGridLines.swift index 7c03e8ce3e..e6a64dee59 100644 --- a/Sources/Gtk/Generated/TreeViewGridLines.swift +++ b/Sources/Gtk/Generated/TreeViewGridLines.swift @@ -5,28 +5,28 @@ public enum TreeViewGridLines: GValueRepresentableEnum { public typealias GtkEnum = GtkTreeViewGridLines /// No grid lines. - case none - /// Horizontal grid lines. - case horizontal - /// Vertical grid lines. - case vertical - /// Horizontal and vertical grid lines. - case both +case none +/// Horizontal grid lines. +case horizontal +/// Vertical grid lines. +case vertical +/// Horizontal and vertical grid lines. +case both public static var type: GType { - gtk_tree_view_grid_lines_get_type() - } + gtk_tree_view_grid_lines_get_type() +} public init(from gtkEnum: GtkTreeViewGridLines) { switch gtkEnum { case GTK_TREE_VIEW_GRID_LINES_NONE: - self = .none - case GTK_TREE_VIEW_GRID_LINES_HORIZONTAL: - self = .horizontal - case GTK_TREE_VIEW_GRID_LINES_VERTICAL: - self = .vertical - case GTK_TREE_VIEW_GRID_LINES_BOTH: - self = .both + self = .none +case GTK_TREE_VIEW_GRID_LINES_HORIZONTAL: + self = .horizontal +case GTK_TREE_VIEW_GRID_LINES_VERTICAL: + self = .vertical +case GTK_TREE_VIEW_GRID_LINES_BOTH: + self = .both default: fatalError("Unsupported GtkTreeViewGridLines enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum TreeViewGridLines: GValueRepresentableEnum { public func toGtk() -> GtkTreeViewGridLines { switch self { case .none: - return GTK_TREE_VIEW_GRID_LINES_NONE - case .horizontal: - return GTK_TREE_VIEW_GRID_LINES_HORIZONTAL - case .vertical: - return GTK_TREE_VIEW_GRID_LINES_VERTICAL - case .both: - return GTK_TREE_VIEW_GRID_LINES_BOTH + return GTK_TREE_VIEW_GRID_LINES_NONE +case .horizontal: + return GTK_TREE_VIEW_GRID_LINES_HORIZONTAL +case .vertical: + return GTK_TREE_VIEW_GRID_LINES_VERTICAL +case .both: + return GTK_TREE_VIEW_GRID_LINES_BOTH } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Unit.swift b/Sources/Gtk/Generated/Unit.swift index f67046e8f4..4d301c3f0f 100644 --- a/Sources/Gtk/Generated/Unit.swift +++ b/Sources/Gtk/Generated/Unit.swift @@ -5,28 +5,28 @@ public enum Unit: GValueRepresentableEnum { public typealias GtkEnum = GtkUnit /// No units. - case none - /// Dimensions in points. - case points - /// Dimensions in inches. - case inch - /// Dimensions in millimeters - case mm +case none +/// Dimensions in points. +case points +/// Dimensions in inches. +case inch +/// Dimensions in millimeters +case mm public static var type: GType { - gtk_unit_get_type() - } + gtk_unit_get_type() +} public init(from gtkEnum: GtkUnit) { switch gtkEnum { case GTK_UNIT_NONE: - self = .none - case GTK_UNIT_POINTS: - self = .points - case GTK_UNIT_INCH: - self = .inch - case GTK_UNIT_MM: - self = .mm + self = .none +case GTK_UNIT_POINTS: + self = .points +case GTK_UNIT_INCH: + self = .inch +case GTK_UNIT_MM: + self = .mm default: fatalError("Unsupported GtkUnit enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum Unit: GValueRepresentableEnum { public func toGtk() -> GtkUnit { switch self { case .none: - return GTK_UNIT_NONE - case .points: - return GTK_UNIT_POINTS - case .inch: - return GTK_UNIT_INCH - case .mm: - return GTK_UNIT_MM + return GTK_UNIT_NONE +case .points: + return GTK_UNIT_POINTS +case .inch: + return GTK_UNIT_INCH +case .mm: + return GTK_UNIT_MM } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/WrapMode.swift b/Sources/Gtk/Generated/WrapMode.swift index 2c48a3a945..130400c5f3 100644 --- a/Sources/Gtk/Generated/WrapMode.swift +++ b/Sources/Gtk/Generated/WrapMode.swift @@ -5,31 +5,31 @@ public enum WrapMode: GValueRepresentableEnum { public typealias GtkEnum = GtkWrapMode /// Do not wrap lines; just make the text area wider - case none - /// Wrap text, breaking lines anywhere the cursor can - /// appear (between characters, usually - if you want to be technical, - /// between graphemes, see pango_get_log_attrs()) - case character - /// Wrap text, breaking lines in between words - case word - /// Wrap text, breaking lines in between words, or if - /// that is not enough, also between graphemes - case wordCharacter +case none +/// Wrap text, breaking lines anywhere the cursor can +/// appear (between characters, usually - if you want to be technical, +/// between graphemes, see pango_get_log_attrs()) +case character +/// Wrap text, breaking lines in between words +case word +/// Wrap text, breaking lines in between words, or if +/// that is not enough, also between graphemes +case wordCharacter public static var type: GType { - gtk_wrap_mode_get_type() - } + gtk_wrap_mode_get_type() +} public init(from gtkEnum: GtkWrapMode) { switch gtkEnum { case GTK_WRAP_NONE: - self = .none - case GTK_WRAP_CHAR: - self = .character - case GTK_WRAP_WORD: - self = .word - case GTK_WRAP_WORD_CHAR: - self = .wordCharacter + self = .none +case GTK_WRAP_CHAR: + self = .character +case GTK_WRAP_WORD: + self = .word +case GTK_WRAP_WORD_CHAR: + self = .wordCharacter default: fatalError("Unsupported GtkWrapMode enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ public enum WrapMode: GValueRepresentableEnum { public func toGtk() -> GtkWrapMode { switch self { case .none: - return GTK_WRAP_NONE - case .character: - return GTK_WRAP_CHAR - case .word: - return GTK_WRAP_WORD - case .wordCharacter: - return GTK_WRAP_WORD_CHAR + return GTK_WRAP_NONE +case .character: + return GTK_WRAP_CHAR +case .word: + return GTK_WRAP_WORD +case .wordCharacter: + return GTK_WRAP_WORD_CHAR } } -} +} \ No newline at end of file diff --git a/Sources/GtkBackend/GtkBackend.swift b/Sources/GtkBackend/GtkBackend.swift index f5ac86a878..6d3498318b 100644 --- a/Sources/GtkBackend/GtkBackend.swift +++ b/Sources/GtkBackend/GtkBackend.swift @@ -1284,6 +1284,25 @@ public final class GtkBackend: AppBackend { } } } + + public func createHoverTarget(wrapping child: Widget) -> Widget { + child.addEventController(EventControllerMotion()) + return child + } + + public func updateHoverTarget(_ hoverTarget: Widget, + environment: EnvironmentValues, + action: @escaping (Bool) -> Void) { + let gesture = hoverTarget.eventControllers.first { $0 is EventControllerMotion } as! EventControllerMotion + gesture.enter = { _, _, _ in + guard environment.isEnabled else { return } + action(true) + } + gesture.leave = { _ in + guard environment.isEnabled else { return } + action(false) + } + } // MARK: Paths diff --git a/Sources/GtkCodeGen/GtkCodeGen.swift b/Sources/GtkCodeGen/GtkCodeGen.swift index bf590e1900..a2b96888fb 100644 --- a/Sources/GtkCodeGen/GtkCodeGen.swift +++ b/Sources/GtkCodeGen/GtkCodeGen.swift @@ -113,7 +113,7 @@ struct GtkCodeGen { "CheckButton", ] let gtk3AllowListedClasses = ["MenuShell", "EventBox"] - let gtk4AllowListedClasses = ["Picture", "DropDown", "Popover", "ListBox"] + let gtk4AllowListedClasses = ["Picture", "DropDown", "Popover", "ListBox", "EventControllerMotion"] for class_ in gir.namespace.classes { guard allowListedClasses.contains(class_.name) From b8b3912405b170f9d9c6baca869e873ccd46cdbb Mon Sep 17 00:00:00 2001 From: Mia Koring Date: Sun, 7 Sep 2025 23:22:24 +0200 Subject: [PATCH 06/15] added winUI backend support --- Sources/WinUIBackend/WinUIBackend.swift | 42 +++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/Sources/WinUIBackend/WinUIBackend.swift b/Sources/WinUIBackend/WinUIBackend.swift index 3e7206c881..3f00ae8373 100644 --- a/Sources/WinUIBackend/WinUIBackend.swift +++ b/Sources/WinUIBackend/WinUIBackend.swift @@ -1377,6 +1377,42 @@ public final class WinUIBackend: AppBackend { tapGestureTarget.height = tapGestureTarget.child!.height } + public func createHoverTarget(wrapping child: Widget) -> Widget { + let hoverTarget = HoverGestureTarget() + addChild(child, to: hoverTarget) + hoverTarget.child = child + + // Ensure the hover target covers the full area of the child. + // Use a transparent background so the visual appearance doesn't change but + // the hit-testing covers the whole region. + let brush = SolidColorBrush() + brush.color = UWP.Color(a: 0, r: 0, g: 0, b: 0) + hoverTarget.background = brush + + hoverTarget.pointerEntered.addHandler { [weak hoverTarget] _, _ in + guard let hoverTarget else { return } + hoverTarget.enterHandler?() + } + hoverTarget.pointerExited.addHandler { [weak hoverTarget] _, _ in + guard let hoverTarget else { return } + hoverTarget.exitHandler?() + } + return hoverTarget + } + + public func updateHoverTarget( + _ hoverTarget: Widget, + environment: EnvironmentValues, + action: @escaping (Bool) -> Void + ) { + let hoverTarget = hoverTarget as! HoverGestureTarget + hoverTarget.enterHandler = environment.isEnabled ? { action(true) } : {} + hoverTarget.exitHandler = environment.isEnabled ? { action(false) } : {} + + hoverTarget.width = hoverTarget.child!.width + hoverTarget.height = hoverTarget.child!.height + } + public func createProgressSpinner() -> Widget { let spinner = ProgressRing() spinner.isIndeterminate = true @@ -1815,6 +1851,12 @@ final class TapGestureTarget: WinUI.Canvas { var child: WinUI.FrameworkElement? } +final class HoverGestureTarget: WinUI.Canvas { + var enterHandler: (() -> Void)? + var exitHandler: (() -> Void)? + var child: WinUI.FrameworkElement? +} + class SwiftIInitializeWithWindow: WindowsFoundation.IUnknown { override class var IID: WindowsFoundation.IID { WindowsFoundation.IID( From badbdfbabbcf1771d115fce780f603398533a4a3 Mon Sep 17 00:00:00 2001 From: Mia Koring Date: Sun, 7 Sep 2025 23:47:20 +0200 Subject: [PATCH 07/15] post format_and_lint --- Examples/Sources/HoverExample/HoverApp.swift | 4 +- Sources/AppKitBackend/AppKitBackend.swift | 32 +- Sources/Gtk/Generated/Accessible.swift | 23 +- .../Generated/AccessibleAutocomplete.swift | 64 +- .../Generated/AccessibleInvalidState.swift | 50 +- .../Gtk/Generated/AccessibleProperty.swift | 288 +-- .../Gtk/Generated/AccessibleRelation.swift | 268 +-- Sources/Gtk/Generated/AccessibleRole.swift | 986 +++++----- Sources/Gtk/Generated/AccessibleSort.swift | 50 +- Sources/Gtk/Generated/AccessibleState.swift | 122 +- .../Gtk/Generated/AccessibleTristate.swift | 38 +- Sources/Gtk/Generated/Actionable.swift | 9 +- Sources/Gtk/Generated/Align.swift | 56 +- Sources/Gtk/Generated/AppChooser.swift | 15 +- Sources/Gtk/Generated/ArrowType.swift | 60 +- Sources/Gtk/Generated/AssistantPageType.swift | 96 +- Sources/Gtk/Generated/BaselinePosition.swift | 38 +- Sources/Gtk/Generated/BorderStyle.swift | 120 +- Sources/Gtk/Generated/Buildable.swift | 10 +- Sources/Gtk/Generated/BuilderError.swift | 202 +- Sources/Gtk/Generated/BuilderScope.swift | 14 +- Sources/Gtk/Generated/Button.swift | 350 ++-- Sources/Gtk/Generated/ButtonsType.swift | 76 +- Sources/Gtk/Generated/CellEditable.swift | 53 +- Sources/Gtk/Generated/CellLayout.swift | 40 +- .../Gtk/Generated/CellRendererAccelMode.swift | 24 +- Sources/Gtk/Generated/CellRendererMode.swift | 42 +- Sources/Gtk/Generated/CheckButton.swift | 354 ++-- .../Gtk/Generated/ConstraintAttribute.swift | 162 +- .../Gtk/Generated/ConstraintRelation.swift | 36 +- .../Gtk/Generated/ConstraintStrength.swift | 50 +- Sources/Gtk/Generated/ConstraintTarget.swift | 6 +- .../Generated/ConstraintVflParserError.swift | 75 +- Sources/Gtk/Generated/CornerType.swift | 58 +- Sources/Gtk/Generated/CssParserError.swift | 62 +- Sources/Gtk/Generated/CssParserWarning.swift | 42 +- Sources/Gtk/Generated/DeleteType.swift | 108 +- Sources/Gtk/Generated/DirectionType.swift | 72 +- Sources/Gtk/Generated/DrawingArea.swift | 130 +- Sources/Gtk/Generated/DropDown.swift | 343 ++-- Sources/Gtk/Generated/Editable.swift | 130 +- .../Gtk/Generated/EditableProperties.swift | 110 +- Sources/Gtk/Generated/Entry.swift | 1704 +++++++++-------- Sources/Gtk/Generated/EntryIconPosition.swift | 24 +- Sources/Gtk/Generated/EventController.swift | 121 +- .../Gtk/Generated/EventControllerMotion.swift | 178 +- .../Gtk/Generated/EventSequenceState.swift | 36 +- Sources/Gtk/Generated/FileChooser.swift | 59 +- Sources/Gtk/Generated/FileChooserAction.swift | 46 +- Sources/Gtk/Generated/FileChooserError.swift | 52 +- Sources/Gtk/Generated/FileChooserNative.swift | 339 ++-- Sources/Gtk/Generated/FilterChange.swift | 50 +- Sources/Gtk/Generated/FilterMatch.swift | 44 +- Sources/Gtk/Generated/FontChooser.swift | 38 +- Sources/Gtk/Generated/GLArea.swift | 427 +++-- Sources/Gtk/Generated/Gesture.swift | 273 +-- Sources/Gtk/Generated/GestureClick.swift | 122 +- Sources/Gtk/Generated/GestureLongPress.swift | 86 +- Sources/Gtk/Generated/GestureSingle.swift | 98 +- Sources/Gtk/Generated/IconSize.swift | 40 +- Sources/Gtk/Generated/IconThemeError.swift | 24 +- .../Gtk/Generated/IconViewDropPosition.swift | 72 +- Sources/Gtk/Generated/Image.swift | 433 +++-- Sources/Gtk/Generated/ImageType.swift | 52 +- Sources/Gtk/Generated/InputPurpose.swift | 140 +- Sources/Gtk/Generated/Justification.swift | 48 +- Sources/Gtk/Generated/Label.swift | 980 +++++----- Sources/Gtk/Generated/LevelBarMode.swift | 26 +- Sources/Gtk/Generated/ListBox.swift | 348 ++-- Sources/Gtk/Generated/MessageType.swift | 60 +- Sources/Gtk/Generated/MovementStep.swift | 120 +- Sources/Gtk/Generated/Native.swift | 12 +- Sources/Gtk/Generated/NativeDialog.swift | 156 +- Sources/Gtk/Generated/NotebookTab.swift | 24 +- Sources/Gtk/Generated/NumberUpLayout.swift | 96 +- Sources/Gtk/Generated/Ordering.swift | 38 +- Sources/Gtk/Generated/Orientation.swift | 26 +- Sources/Gtk/Generated/Overflow.swift | 30 +- Sources/Gtk/Generated/PackType.swift | 26 +- Sources/Gtk/Generated/PadActionType.swift | 48 +- Sources/Gtk/Generated/PageOrientation.swift | 48 +- Sources/Gtk/Generated/PageSet.swift | 36 +- Sources/Gtk/Generated/PanDirection.swift | 48 +- Sources/Gtk/Generated/Picture.swift | 252 +-- Sources/Gtk/Generated/PolicyType.swift | 58 +- Sources/Gtk/Generated/Popover.swift | 308 +-- Sources/Gtk/Generated/PositionType.swift | 50 +- Sources/Gtk/Generated/PrintDuplex.swift | 36 +- Sources/Gtk/Generated/PrintError.swift | 50 +- .../Gtk/Generated/PrintOperationAction.swift | 56 +- .../Gtk/Generated/PrintOperationResult.swift | 54 +- Sources/Gtk/Generated/PrintPages.swift | 48 +- Sources/Gtk/Generated/PrintQuality.swift | 48 +- Sources/Gtk/Generated/PrintStatus.swift | 120 +- Sources/Gtk/Generated/ProgressBar.swift | 249 +-- Sources/Gtk/Generated/PropagationLimit.swift | 32 +- Sources/Gtk/Generated/PropagationPhase.swift | 62 +- Sources/Gtk/Generated/Range.swift | 343 ++-- .../Gtk/Generated/RecentManagerError.swift | 94 +- Sources/Gtk/Generated/ResponseType.swift | 136 +- .../Generated/RevealerTransitionType.swift | 120 +- Sources/Gtk/Generated/Root.swift | 12 +- Sources/Gtk/Generated/Scale.swift | 202 +- Sources/Gtk/Generated/ScrollStep.swift | 72 +- Sources/Gtk/Generated/ScrollType.swift | 192 +- Sources/Gtk/Generated/Scrollable.swift | 23 +- Sources/Gtk/Generated/ScrollablePolicy.swift | 24 +- Sources/Gtk/Generated/SelectionMode.swift | 64 +- Sources/Gtk/Generated/SelectionModel.swift | 29 +- Sources/Gtk/Generated/SensitivityType.swift | 38 +- Sources/Gtk/Generated/ShortcutManager.swift | 10 +- Sources/Gtk/Generated/ShortcutScope.swift | 42 +- Sources/Gtk/Generated/ShortcutType.swift | 126 +- Sources/Gtk/Generated/SizeGroupMode.swift | 48 +- Sources/Gtk/Generated/SizeRequestMode.swift | 36 +- Sources/Gtk/Generated/SortType.swift | 24 +- Sources/Gtk/Generated/SorterChange.swift | 58 +- Sources/Gtk/Generated/SorterOrder.swift | 42 +- .../Generated/SpinButtonUpdatePolicy.swift | 32 +- Sources/Gtk/Generated/SpinType.swift | 84 +- Sources/Gtk/Generated/Spinner.swift | 51 +- .../Gtk/Generated/StackTransitionType.swift | 278 +-- .../Gtk/Generated/StringFilterMatchMode.swift | 42 +- Sources/Gtk/Generated/StyleProvider.swift | 10 +- Sources/Gtk/Generated/Switch.swift | 241 +-- Sources/Gtk/Generated/SystemSetting.swift | 80 +- Sources/Gtk/Generated/TextDirection.swift | 36 +- .../Gtk/Generated/TextExtendSelection.swift | 28 +- Sources/Gtk/Generated/TextViewLayer.swift | 24 +- Sources/Gtk/Generated/TextWindowType.swift | 72 +- Sources/Gtk/Generated/TreeDragDest.swift | 4 +- Sources/Gtk/Generated/TreeDragSource.swift | 4 +- Sources/Gtk/Generated/TreeSortable.swift | 11 +- .../Gtk/Generated/TreeViewColumnSizing.swift | 36 +- .../Gtk/Generated/TreeViewDropPosition.swift | 48 +- Sources/Gtk/Generated/TreeViewGridLines.swift | 48 +- Sources/Gtk/Generated/Unit.swift | 48 +- Sources/Gtk/Generated/WrapMode.swift | 54 +- .../Widgets/DrawingArea+ManualAdditions.swift | 11 +- Sources/GtkBackend/GtkBackend.swift | 16 +- Sources/GtkCodeGen/GtkCodeGen.swift | 4 +- Sources/SwiftCrossUI/Backend/AppBackend.swift | 97 +- Sources/SwiftCrossUI/Views/EitherView.swift | 12 +- .../UIKitBackend/UIKitBackend+Control.swift | 24 +- Sources/UIKitBackend/UIKitBackend+Menu.swift | 4 +- Sources/WinUIBackend/HWNDInterop.swift | 14 +- Sources/WinUIBackend/WinUIBackend.swift | 2 +- 147 files changed, 8160 insertions(+), 7909 deletions(-) diff --git a/Examples/Sources/HoverExample/HoverApp.swift b/Examples/Sources/HoverExample/HoverApp.swift index 292c87f56c..d6170d966a 100644 --- a/Examples/Sources/HoverExample/HoverApp.swift +++ b/Examples/Sources/HoverExample/HoverApp.swift @@ -1,6 +1,6 @@ import DefaultBackend -import SwiftCrossUI import Foundation +import SwiftCrossUI #if canImport(SwiftBundlerRuntime) import SwiftBundlerRuntime @@ -32,7 +32,7 @@ struct CellView: View { @State var timer: Timer? @Environment(\.colorScheme) var colorScheme @State var opacity: Float = 0.0 - + var body: some View { Rectangle() .foregroundColor(Color.blue.opacity(opacity)) diff --git a/Sources/AppKitBackend/AppKitBackend.swift b/Sources/AppKitBackend/AppKitBackend.swift index 8ce36b93a7..02e62f8282 100644 --- a/Sources/AppKitBackend/AppKitBackend.swift +++ b/Sources/AppKitBackend/AppKitBackend.swift @@ -1424,7 +1424,7 @@ public final class AppKitBackend: AppBackend { tapGestureTarget.longPressHandler = action } } - + public func createHoverTarget(wrapping child: Widget) -> Widget { let container = NSView() @@ -1449,7 +1449,7 @@ public final class AppKitBackend: AppBackend { return container } - + public func updateHoverTarget( _ container: Widget, environment: EnvironmentValues, @@ -1764,12 +1764,13 @@ final class NSCustomHoverTarget: NSView { if hoverChangesHandler != nil && trackingArea == nil { let options: NSTrackingArea.Options = [ .mouseEnteredAndExited, - .activeInKeyWindow + .activeInKeyWindow, ] - let area = NSTrackingArea(rect: self.bounds, - options: options, - owner: self, - userInfo: nil) + let area = NSTrackingArea( + rect: self.bounds, + options: options, + owner: self, + userInfo: nil) addTrackingArea(area) trackingArea = area } else if hoverChangesHandler == nil, let trackingArea { @@ -1790,20 +1791,21 @@ final class NSCustomHoverTarget: NSView { } let options: NSTrackingArea.Options = [ .mouseEnteredAndExited, - .activeInKeyWindow + .activeInKeyWindow, ] - - trackingArea = NSTrackingArea(rect: self.bounds, - options: options, - owner: self, - userInfo: nil) + + trackingArea = NSTrackingArea( + rect: self.bounds, + options: options, + owner: self, + userInfo: nil) self.addTrackingArea(trackingArea!) } - + override func mouseEntered(with event: NSEvent) { hoverChangesHandler?(true) } - + override func mouseExited(with event: NSEvent) { // Mouse exited the view's bounds hoverChangesHandler?(false) diff --git a/Sources/Gtk/Generated/Accessible.swift b/Sources/Gtk/Generated/Accessible.swift index 4a356e0d18..4659bc8e0f 100644 --- a/Sources/Gtk/Generated/Accessible.swift +++ b/Sources/Gtk/Generated/Accessible.swift @@ -1,30 +1,30 @@ import CGtk /// An interface for describing UI elements for Assistive Technologies. -/// +/// /// Every accessible implementation has: -/// +/// /// - a “role”, represented by a value of the [enum@Gtk.AccessibleRole] enumeration /// - “attributes”, represented by a set of [enum@Gtk.AccessibleState], /// [enum@Gtk.AccessibleProperty] and [enum@Gtk.AccessibleRelation] values -/// +/// /// The role cannot be changed after instantiating a `GtkAccessible` /// implementation. -/// +/// /// The attributes are updated every time a UI element's state changes in /// a way that should be reflected by assistive technologies. For instance, /// if a `GtkWidget` visibility changes, the %GTK_ACCESSIBLE_STATE_HIDDEN /// state will also change to reflect the [property@Gtk.Widget:visible] property. -/// +/// /// Every accessible implementation is part of a tree of accessible objects. /// Normally, this tree corresponds to the widget tree, but can be customized /// by reimplementing the [vfunc@Gtk.Accessible.get_accessible_parent], /// [vfunc@Gtk.Accessible.get_first_accessible_child] and /// [vfunc@Gtk.Accessible.get_next_accessible_sibling] virtual functions. -/// +/// /// Note that you can not create a top-level accessible object as of now, /// which means that you must always have a parent accessible object. -/// +/// /// Also note that when an accessible object does not correspond to a widget, /// and it has children, whose implementation you don't control, /// it is necessary to ensure the correct shape of the a11y tree @@ -32,9 +32,8 @@ import CGtk /// updating the sibling by [method@Gtk.Accessible.update_next_accessible_sibling]. public protocol Accessible: GObjectRepresentable { /// The accessible role of the given `GtkAccessible` implementation. -/// -/// The accessible role cannot be changed once set. -var accessibleRole: AccessibleRole { get set } + /// + /// The accessible role cannot be changed once set. + var accessibleRole: AccessibleRole { get set } - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AccessibleAutocomplete.swift b/Sources/Gtk/Generated/AccessibleAutocomplete.swift index f877f61ae8..1af0f8d331 100644 --- a/Sources/Gtk/Generated/AccessibleAutocomplete.swift +++ b/Sources/Gtk/Generated/AccessibleAutocomplete.swift @@ -6,36 +6,36 @@ public enum AccessibleAutocomplete: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleAutocomplete /// Automatic suggestions are not displayed. -case none -/// When a user is providing input, text -/// suggesting one way to complete the provided input may be dynamically -/// inserted after the caret. -case inline -/// When a user is providing input, an element -/// containing a collection of values that could complete the provided input -/// may be displayed. -case list -/// When a user is providing input, an element -/// containing a collection of values that could complete the provided input -/// may be displayed. If displayed, one value in the collection is automatically -/// selected, and the text needed to complete the automatically selected value -/// appears after the caret in the input. -case both + case none + /// When a user is providing input, text + /// suggesting one way to complete the provided input may be dynamically + /// inserted after the caret. + case inline + /// When a user is providing input, an element + /// containing a collection of values that could complete the provided input + /// may be displayed. + case list + /// When a user is providing input, an element + /// containing a collection of values that could complete the provided input + /// may be displayed. If displayed, one value in the collection is automatically + /// selected, and the text needed to complete the automatically selected value + /// appears after the caret in the input. + case both public static var type: GType { - gtk_accessible_autocomplete_get_type() -} + gtk_accessible_autocomplete_get_type() + } public init(from gtkEnum: GtkAccessibleAutocomplete) { switch gtkEnum { case GTK_ACCESSIBLE_AUTOCOMPLETE_NONE: - self = .none -case GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE: - self = .inline -case GTK_ACCESSIBLE_AUTOCOMPLETE_LIST: - self = .list -case GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH: - self = .both + self = .none + case GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE: + self = .inline + case GTK_ACCESSIBLE_AUTOCOMPLETE_LIST: + self = .list + case GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH: + self = .both default: fatalError("Unsupported GtkAccessibleAutocomplete enum value: \(gtkEnum.rawValue)") } @@ -44,13 +44,13 @@ case GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH: public func toGtk() -> GtkAccessibleAutocomplete { switch self { case .none: - return GTK_ACCESSIBLE_AUTOCOMPLETE_NONE -case .inline: - return GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE -case .list: - return GTK_ACCESSIBLE_AUTOCOMPLETE_LIST -case .both: - return GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH + return GTK_ACCESSIBLE_AUTOCOMPLETE_NONE + case .inline: + return GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE + case .list: + return GTK_ACCESSIBLE_AUTOCOMPLETE_LIST + case .both: + return GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AccessibleInvalidState.swift b/Sources/Gtk/Generated/AccessibleInvalidState.swift index 76c2055efe..be5eff22c3 100644 --- a/Sources/Gtk/Generated/AccessibleInvalidState.swift +++ b/Sources/Gtk/Generated/AccessibleInvalidState.swift @@ -2,7 +2,7 @@ import CGtk /// The possible values for the %GTK_ACCESSIBLE_STATE_INVALID /// accessible state. -/// +/// /// Note that the %GTK_ACCESSIBLE_INVALID_FALSE and /// %GTK_ACCESSIBLE_INVALID_TRUE have the same values /// as %FALSE and %TRUE. @@ -10,28 +10,28 @@ public enum AccessibleInvalidState: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleInvalidState /// There are no detected errors in the value -case false_ -/// The value entered by the user has failed validation -case true_ -/// A grammatical error was detected -case grammar -/// A spelling error was detected -case spelling + case false_ + /// The value entered by the user has failed validation + case true_ + /// A grammatical error was detected + case grammar + /// A spelling error was detected + case spelling public static var type: GType { - gtk_accessible_invalid_state_get_type() -} + gtk_accessible_invalid_state_get_type() + } public init(from gtkEnum: GtkAccessibleInvalidState) { switch gtkEnum { case GTK_ACCESSIBLE_INVALID_FALSE: - self = .false_ -case GTK_ACCESSIBLE_INVALID_TRUE: - self = .true_ -case GTK_ACCESSIBLE_INVALID_GRAMMAR: - self = .grammar -case GTK_ACCESSIBLE_INVALID_SPELLING: - self = .spelling + self = .false_ + case GTK_ACCESSIBLE_INVALID_TRUE: + self = .true_ + case GTK_ACCESSIBLE_INVALID_GRAMMAR: + self = .grammar + case GTK_ACCESSIBLE_INVALID_SPELLING: + self = .spelling default: fatalError("Unsupported GtkAccessibleInvalidState enum value: \(gtkEnum.rawValue)") } @@ -40,13 +40,13 @@ case GTK_ACCESSIBLE_INVALID_SPELLING: public func toGtk() -> GtkAccessibleInvalidState { switch self { case .false_: - return GTK_ACCESSIBLE_INVALID_FALSE -case .true_: - return GTK_ACCESSIBLE_INVALID_TRUE -case .grammar: - return GTK_ACCESSIBLE_INVALID_GRAMMAR -case .spelling: - return GTK_ACCESSIBLE_INVALID_SPELLING + return GTK_ACCESSIBLE_INVALID_FALSE + case .true_: + return GTK_ACCESSIBLE_INVALID_TRUE + case .grammar: + return GTK_ACCESSIBLE_INVALID_GRAMMAR + case .spelling: + return GTK_ACCESSIBLE_INVALID_SPELLING } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AccessibleProperty.swift b/Sources/Gtk/Generated/AccessibleProperty.swift index a98b3b4e67..a30c276c15 100644 --- a/Sources/Gtk/Generated/AccessibleProperty.swift +++ b/Sources/Gtk/Generated/AccessibleProperty.swift @@ -5,118 +5,118 @@ public enum AccessibleProperty: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleProperty /// Indicates whether inputting text -/// could trigger display of one or more predictions of the user's intended -/// value for a combobox, searchbox, or textbox and specifies how predictions -/// would be presented if they were made. Value type: [enum@AccessibleAutocomplete] -case autocomplete -/// Defines a string value that describes -/// or annotates the current element. Value type: string -case description -/// Indicates the availability and type of -/// interactive popup element, such as menu or dialog, that can be triggered -/// by an element. -case hasPopup -/// Indicates keyboard shortcuts that an -/// author has implemented to activate or give focus to an element. Value type: -/// string. The format of the value is a space-separated list of shortcuts, with -/// each shortcut consisting of one or more modifiers (`Control`, `Alt` or `Shift`), -/// followed by a non-modifier key, all separated by `+`. -/// Examples: `F2`, `Alt-F`, `Control+Shift+N` -case keyShortcuts -/// Defines a string value that labels the current -/// element. Value type: string -case label -/// Defines the hierarchical level of an element -/// within a structure. Value type: integer -case level -/// Indicates whether an element is modal when -/// displayed. Value type: boolean -case modal -/// Indicates whether a text box accepts -/// multiple lines of input or only a single line. Value type: boolean -case multiLine -/// Indicates that the user may select -/// more than one item from the current selectable descendants. Value type: -/// boolean -case multiSelectable -/// Indicates whether the element's -/// orientation is horizontal, vertical, or unknown/ambiguous. Value type: -/// [enum@Orientation] -case orientation -/// Defines a short hint (a word or short -/// phrase) intended to aid the user with data entry when the control has no -/// value. A hint could be a sample value or a brief description of the expected -/// format. Value type: string -case placeholder -/// Indicates that the element is not editable, -/// but is otherwise operable. Value type: boolean -case readOnly -/// Indicates that user input is required on -/// the element before a form may be submitted. Value type: boolean -case required -/// Defines a human-readable, -/// author-localized description for the role of an element. Value type: string -case roleDescription -/// Indicates if items in a table or grid are -/// sorted in ascending or descending order. Value type: [enum@AccessibleSort] -case sort -/// Defines the maximum allowed value for a -/// range widget. Value type: double -case valueMax -/// Defines the minimum allowed value for a -/// range widget. Value type: double -case valueMin -/// Defines the current value for a range widget. -/// Value type: double -case valueNow -/// Defines the human readable text alternative -/// of aria-valuenow for a range widget. Value type: string -case valueText + /// could trigger display of one or more predictions of the user's intended + /// value for a combobox, searchbox, or textbox and specifies how predictions + /// would be presented if they were made. Value type: [enum@AccessibleAutocomplete] + case autocomplete + /// Defines a string value that describes + /// or annotates the current element. Value type: string + case description + /// Indicates the availability and type of + /// interactive popup element, such as menu or dialog, that can be triggered + /// by an element. + case hasPopup + /// Indicates keyboard shortcuts that an + /// author has implemented to activate or give focus to an element. Value type: + /// string. The format of the value is a space-separated list of shortcuts, with + /// each shortcut consisting of one or more modifiers (`Control`, `Alt` or `Shift`), + /// followed by a non-modifier key, all separated by `+`. + /// Examples: `F2`, `Alt-F`, `Control+Shift+N` + case keyShortcuts + /// Defines a string value that labels the current + /// element. Value type: string + case label + /// Defines the hierarchical level of an element + /// within a structure. Value type: integer + case level + /// Indicates whether an element is modal when + /// displayed. Value type: boolean + case modal + /// Indicates whether a text box accepts + /// multiple lines of input or only a single line. Value type: boolean + case multiLine + /// Indicates that the user may select + /// more than one item from the current selectable descendants. Value type: + /// boolean + case multiSelectable + /// Indicates whether the element's + /// orientation is horizontal, vertical, or unknown/ambiguous. Value type: + /// [enum@Orientation] + case orientation + /// Defines a short hint (a word or short + /// phrase) intended to aid the user with data entry when the control has no + /// value. A hint could be a sample value or a brief description of the expected + /// format. Value type: string + case placeholder + /// Indicates that the element is not editable, + /// but is otherwise operable. Value type: boolean + case readOnly + /// Indicates that user input is required on + /// the element before a form may be submitted. Value type: boolean + case required + /// Defines a human-readable, + /// author-localized description for the role of an element. Value type: string + case roleDescription + /// Indicates if items in a table or grid are + /// sorted in ascending or descending order. Value type: [enum@AccessibleSort] + case sort + /// Defines the maximum allowed value for a + /// range widget. Value type: double + case valueMax + /// Defines the minimum allowed value for a + /// range widget. Value type: double + case valueMin + /// Defines the current value for a range widget. + /// Value type: double + case valueNow + /// Defines the human readable text alternative + /// of aria-valuenow for a range widget. Value type: string + case valueText public static var type: GType { - gtk_accessible_property_get_type() -} + gtk_accessible_property_get_type() + } public init(from gtkEnum: GtkAccessibleProperty) { switch gtkEnum { case GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE: - self = .autocomplete -case GTK_ACCESSIBLE_PROPERTY_DESCRIPTION: - self = .description -case GTK_ACCESSIBLE_PROPERTY_HAS_POPUP: - self = .hasPopup -case GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS: - self = .keyShortcuts -case GTK_ACCESSIBLE_PROPERTY_LABEL: - self = .label -case GTK_ACCESSIBLE_PROPERTY_LEVEL: - self = .level -case GTK_ACCESSIBLE_PROPERTY_MODAL: - self = .modal -case GTK_ACCESSIBLE_PROPERTY_MULTI_LINE: - self = .multiLine -case GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE: - self = .multiSelectable -case GTK_ACCESSIBLE_PROPERTY_ORIENTATION: - self = .orientation -case GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER: - self = .placeholder -case GTK_ACCESSIBLE_PROPERTY_READ_ONLY: - self = .readOnly -case GTK_ACCESSIBLE_PROPERTY_REQUIRED: - self = .required -case GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION: - self = .roleDescription -case GTK_ACCESSIBLE_PROPERTY_SORT: - self = .sort -case GTK_ACCESSIBLE_PROPERTY_VALUE_MAX: - self = .valueMax -case GTK_ACCESSIBLE_PROPERTY_VALUE_MIN: - self = .valueMin -case GTK_ACCESSIBLE_PROPERTY_VALUE_NOW: - self = .valueNow -case GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT: - self = .valueText + self = .autocomplete + case GTK_ACCESSIBLE_PROPERTY_DESCRIPTION: + self = .description + case GTK_ACCESSIBLE_PROPERTY_HAS_POPUP: + self = .hasPopup + case GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS: + self = .keyShortcuts + case GTK_ACCESSIBLE_PROPERTY_LABEL: + self = .label + case GTK_ACCESSIBLE_PROPERTY_LEVEL: + self = .level + case GTK_ACCESSIBLE_PROPERTY_MODAL: + self = .modal + case GTK_ACCESSIBLE_PROPERTY_MULTI_LINE: + self = .multiLine + case GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE: + self = .multiSelectable + case GTK_ACCESSIBLE_PROPERTY_ORIENTATION: + self = .orientation + case GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER: + self = .placeholder + case GTK_ACCESSIBLE_PROPERTY_READ_ONLY: + self = .readOnly + case GTK_ACCESSIBLE_PROPERTY_REQUIRED: + self = .required + case GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION: + self = .roleDescription + case GTK_ACCESSIBLE_PROPERTY_SORT: + self = .sort + case GTK_ACCESSIBLE_PROPERTY_VALUE_MAX: + self = .valueMax + case GTK_ACCESSIBLE_PROPERTY_VALUE_MIN: + self = .valueMin + case GTK_ACCESSIBLE_PROPERTY_VALUE_NOW: + self = .valueNow + case GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT: + self = .valueText default: fatalError("Unsupported GtkAccessibleProperty enum value: \(gtkEnum.rawValue)") } @@ -125,43 +125,43 @@ case GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT: public func toGtk() -> GtkAccessibleProperty { switch self { case .autocomplete: - return GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE -case .description: - return GTK_ACCESSIBLE_PROPERTY_DESCRIPTION -case .hasPopup: - return GTK_ACCESSIBLE_PROPERTY_HAS_POPUP -case .keyShortcuts: - return GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS -case .label: - return GTK_ACCESSIBLE_PROPERTY_LABEL -case .level: - return GTK_ACCESSIBLE_PROPERTY_LEVEL -case .modal: - return GTK_ACCESSIBLE_PROPERTY_MODAL -case .multiLine: - return GTK_ACCESSIBLE_PROPERTY_MULTI_LINE -case .multiSelectable: - return GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE -case .orientation: - return GTK_ACCESSIBLE_PROPERTY_ORIENTATION -case .placeholder: - return GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER -case .readOnly: - return GTK_ACCESSIBLE_PROPERTY_READ_ONLY -case .required: - return GTK_ACCESSIBLE_PROPERTY_REQUIRED -case .roleDescription: - return GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION -case .sort: - return GTK_ACCESSIBLE_PROPERTY_SORT -case .valueMax: - return GTK_ACCESSIBLE_PROPERTY_VALUE_MAX -case .valueMin: - return GTK_ACCESSIBLE_PROPERTY_VALUE_MIN -case .valueNow: - return GTK_ACCESSIBLE_PROPERTY_VALUE_NOW -case .valueText: - return GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT + return GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE + case .description: + return GTK_ACCESSIBLE_PROPERTY_DESCRIPTION + case .hasPopup: + return GTK_ACCESSIBLE_PROPERTY_HAS_POPUP + case .keyShortcuts: + return GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS + case .label: + return GTK_ACCESSIBLE_PROPERTY_LABEL + case .level: + return GTK_ACCESSIBLE_PROPERTY_LEVEL + case .modal: + return GTK_ACCESSIBLE_PROPERTY_MODAL + case .multiLine: + return GTK_ACCESSIBLE_PROPERTY_MULTI_LINE + case .multiSelectable: + return GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE + case .orientation: + return GTK_ACCESSIBLE_PROPERTY_ORIENTATION + case .placeholder: + return GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER + case .readOnly: + return GTK_ACCESSIBLE_PROPERTY_READ_ONLY + case .required: + return GTK_ACCESSIBLE_PROPERTY_REQUIRED + case .roleDescription: + return GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION + case .sort: + return GTK_ACCESSIBLE_PROPERTY_SORT + case .valueMax: + return GTK_ACCESSIBLE_PROPERTY_VALUE_MAX + case .valueMin: + return GTK_ACCESSIBLE_PROPERTY_VALUE_MIN + case .valueNow: + return GTK_ACCESSIBLE_PROPERTY_VALUE_NOW + case .valueText: + return GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AccessibleRelation.swift b/Sources/Gtk/Generated/AccessibleRelation.swift index a88676ffc6..8e6cba4ed1 100644 --- a/Sources/Gtk/Generated/AccessibleRelation.swift +++ b/Sources/Gtk/Generated/AccessibleRelation.swift @@ -1,116 +1,116 @@ import CGtk /// The possible accessible relations of a [iface@Accessible]. -/// +/// /// Accessible relations can be references to other widgets, /// integers or strings. public enum AccessibleRelation: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleRelation /// Identifies the currently active -/// element when focus is on a composite widget, combobox, textbox, group, -/// or application. Value type: reference -case activeDescendant -/// Defines the total number of columns -/// in a table, grid, or treegrid. Value type: integer -case colCount -/// Defines an element's column index or -/// position with respect to the total number of columns within a table, -/// grid, or treegrid. Value type: integer -case colIndex -/// Defines a human readable text -/// alternative of %GTK_ACCESSIBLE_RELATION_COL_INDEX. Value type: string -case colIndexText -/// Defines the number of columns spanned -/// by a cell or gridcell within a table, grid, or treegrid. Value type: integer -case colSpan -/// Identifies the element (or elements) whose -/// contents or presence are controlled by the current element. Value type: reference -case controls -/// Identifies the element (or elements) -/// that describes the object. Value type: reference -case describedBy -/// Identifies the element (or elements) that -/// provide additional information related to the object. Value type: reference -case details -/// Identifies the element (or elements) that -/// provide an error message for an object. Value type: reference -case errorMessage -/// Identifies the next element (or elements) -/// in an alternate reading order of content which, at the user's discretion, -/// allows assistive technology to override the general default of reading in -/// document source order. Value type: reference -case flowTo -/// Identifies the element (or elements) -/// that labels the current element. Value type: reference -case labelledBy -/// Identifies an element (or elements) in order -/// to define a visual, functional, or contextual parent/child relationship -/// between elements where the widget hierarchy cannot be used to represent -/// the relationship. Value type: reference -case owns -/// Defines an element's number or position -/// in the current set of listitems or treeitems. Value type: integer -case posInSet -/// Defines the total number of rows in a table, -/// grid, or treegrid. Value type: integer -case rowCount -/// Defines an element's row index or position -/// with respect to the total number of rows within a table, grid, or treegrid. -/// Value type: integer -case rowIndex -/// Defines a human readable text -/// alternative of aria-rowindex. Value type: string -case rowIndexText -/// Defines the number of rows spanned by a -/// cell or gridcell within a table, grid, or treegrid. Value type: integer -case rowSpan -/// Defines the number of items in the current -/// set of listitems or treeitems. Value type: integer -case setSize + /// element when focus is on a composite widget, combobox, textbox, group, + /// or application. Value type: reference + case activeDescendant + /// Defines the total number of columns + /// in a table, grid, or treegrid. Value type: integer + case colCount + /// Defines an element's column index or + /// position with respect to the total number of columns within a table, + /// grid, or treegrid. Value type: integer + case colIndex + /// Defines a human readable text + /// alternative of %GTK_ACCESSIBLE_RELATION_COL_INDEX. Value type: string + case colIndexText + /// Defines the number of columns spanned + /// by a cell or gridcell within a table, grid, or treegrid. Value type: integer + case colSpan + /// Identifies the element (or elements) whose + /// contents or presence are controlled by the current element. Value type: reference + case controls + /// Identifies the element (or elements) + /// that describes the object. Value type: reference + case describedBy + /// Identifies the element (or elements) that + /// provide additional information related to the object. Value type: reference + case details + /// Identifies the element (or elements) that + /// provide an error message for an object. Value type: reference + case errorMessage + /// Identifies the next element (or elements) + /// in an alternate reading order of content which, at the user's discretion, + /// allows assistive technology to override the general default of reading in + /// document source order. Value type: reference + case flowTo + /// Identifies the element (or elements) + /// that labels the current element. Value type: reference + case labelledBy + /// Identifies an element (or elements) in order + /// to define a visual, functional, or contextual parent/child relationship + /// between elements where the widget hierarchy cannot be used to represent + /// the relationship. Value type: reference + case owns + /// Defines an element's number or position + /// in the current set of listitems or treeitems. Value type: integer + case posInSet + /// Defines the total number of rows in a table, + /// grid, or treegrid. Value type: integer + case rowCount + /// Defines an element's row index or position + /// with respect to the total number of rows within a table, grid, or treegrid. + /// Value type: integer + case rowIndex + /// Defines a human readable text + /// alternative of aria-rowindex. Value type: string + case rowIndexText + /// Defines the number of rows spanned by a + /// cell or gridcell within a table, grid, or treegrid. Value type: integer + case rowSpan + /// Defines the number of items in the current + /// set of listitems or treeitems. Value type: integer + case setSize public static var type: GType { - gtk_accessible_relation_get_type() -} + gtk_accessible_relation_get_type() + } public init(from gtkEnum: GtkAccessibleRelation) { switch gtkEnum { case GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT: - self = .activeDescendant -case GTK_ACCESSIBLE_RELATION_COL_COUNT: - self = .colCount -case GTK_ACCESSIBLE_RELATION_COL_INDEX: - self = .colIndex -case GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT: - self = .colIndexText -case GTK_ACCESSIBLE_RELATION_COL_SPAN: - self = .colSpan -case GTK_ACCESSIBLE_RELATION_CONTROLS: - self = .controls -case GTK_ACCESSIBLE_RELATION_DESCRIBED_BY: - self = .describedBy -case GTK_ACCESSIBLE_RELATION_DETAILS: - self = .details -case GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE: - self = .errorMessage -case GTK_ACCESSIBLE_RELATION_FLOW_TO: - self = .flowTo -case GTK_ACCESSIBLE_RELATION_LABELLED_BY: - self = .labelledBy -case GTK_ACCESSIBLE_RELATION_OWNS: - self = .owns -case GTK_ACCESSIBLE_RELATION_POS_IN_SET: - self = .posInSet -case GTK_ACCESSIBLE_RELATION_ROW_COUNT: - self = .rowCount -case GTK_ACCESSIBLE_RELATION_ROW_INDEX: - self = .rowIndex -case GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT: - self = .rowIndexText -case GTK_ACCESSIBLE_RELATION_ROW_SPAN: - self = .rowSpan -case GTK_ACCESSIBLE_RELATION_SET_SIZE: - self = .setSize + self = .activeDescendant + case GTK_ACCESSIBLE_RELATION_COL_COUNT: + self = .colCount + case GTK_ACCESSIBLE_RELATION_COL_INDEX: + self = .colIndex + case GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT: + self = .colIndexText + case GTK_ACCESSIBLE_RELATION_COL_SPAN: + self = .colSpan + case GTK_ACCESSIBLE_RELATION_CONTROLS: + self = .controls + case GTK_ACCESSIBLE_RELATION_DESCRIBED_BY: + self = .describedBy + case GTK_ACCESSIBLE_RELATION_DETAILS: + self = .details + case GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE: + self = .errorMessage + case GTK_ACCESSIBLE_RELATION_FLOW_TO: + self = .flowTo + case GTK_ACCESSIBLE_RELATION_LABELLED_BY: + self = .labelledBy + case GTK_ACCESSIBLE_RELATION_OWNS: + self = .owns + case GTK_ACCESSIBLE_RELATION_POS_IN_SET: + self = .posInSet + case GTK_ACCESSIBLE_RELATION_ROW_COUNT: + self = .rowCount + case GTK_ACCESSIBLE_RELATION_ROW_INDEX: + self = .rowIndex + case GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT: + self = .rowIndexText + case GTK_ACCESSIBLE_RELATION_ROW_SPAN: + self = .rowSpan + case GTK_ACCESSIBLE_RELATION_SET_SIZE: + self = .setSize default: fatalError("Unsupported GtkAccessibleRelation enum value: \(gtkEnum.rawValue)") } @@ -119,41 +119,41 @@ case GTK_ACCESSIBLE_RELATION_SET_SIZE: public func toGtk() -> GtkAccessibleRelation { switch self { case .activeDescendant: - return GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT -case .colCount: - return GTK_ACCESSIBLE_RELATION_COL_COUNT -case .colIndex: - return GTK_ACCESSIBLE_RELATION_COL_INDEX -case .colIndexText: - return GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT -case .colSpan: - return GTK_ACCESSIBLE_RELATION_COL_SPAN -case .controls: - return GTK_ACCESSIBLE_RELATION_CONTROLS -case .describedBy: - return GTK_ACCESSIBLE_RELATION_DESCRIBED_BY -case .details: - return GTK_ACCESSIBLE_RELATION_DETAILS -case .errorMessage: - return GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE -case .flowTo: - return GTK_ACCESSIBLE_RELATION_FLOW_TO -case .labelledBy: - return GTK_ACCESSIBLE_RELATION_LABELLED_BY -case .owns: - return GTK_ACCESSIBLE_RELATION_OWNS -case .posInSet: - return GTK_ACCESSIBLE_RELATION_POS_IN_SET -case .rowCount: - return GTK_ACCESSIBLE_RELATION_ROW_COUNT -case .rowIndex: - return GTK_ACCESSIBLE_RELATION_ROW_INDEX -case .rowIndexText: - return GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT -case .rowSpan: - return GTK_ACCESSIBLE_RELATION_ROW_SPAN -case .setSize: - return GTK_ACCESSIBLE_RELATION_SET_SIZE + return GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT + case .colCount: + return GTK_ACCESSIBLE_RELATION_COL_COUNT + case .colIndex: + return GTK_ACCESSIBLE_RELATION_COL_INDEX + case .colIndexText: + return GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT + case .colSpan: + return GTK_ACCESSIBLE_RELATION_COL_SPAN + case .controls: + return GTK_ACCESSIBLE_RELATION_CONTROLS + case .describedBy: + return GTK_ACCESSIBLE_RELATION_DESCRIBED_BY + case .details: + return GTK_ACCESSIBLE_RELATION_DETAILS + case .errorMessage: + return GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE + case .flowTo: + return GTK_ACCESSIBLE_RELATION_FLOW_TO + case .labelledBy: + return GTK_ACCESSIBLE_RELATION_LABELLED_BY + case .owns: + return GTK_ACCESSIBLE_RELATION_OWNS + case .posInSet: + return GTK_ACCESSIBLE_RELATION_POS_IN_SET + case .rowCount: + return GTK_ACCESSIBLE_RELATION_ROW_COUNT + case .rowIndex: + return GTK_ACCESSIBLE_RELATION_ROW_INDEX + case .rowIndexText: + return GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT + case .rowSpan: + return GTK_ACCESSIBLE_RELATION_ROW_SPAN + case .setSize: + return GTK_ACCESSIBLE_RELATION_SET_SIZE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AccessibleRole.swift b/Sources/Gtk/Generated/AccessibleRole.swift index c9e2ceb871..b2e0c1d12d 100644 --- a/Sources/Gtk/Generated/AccessibleRole.swift +++ b/Sources/Gtk/Generated/AccessibleRole.swift @@ -1,355 +1,355 @@ import CGtk /// The accessible role for a [iface@Accessible] implementation. -/// +/// /// Abstract roles are only used as part of the ontology; application /// developers must not use abstract roles in their code. public enum AccessibleRole: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleRole /// An element with important, and usually -/// time-sensitive, information -case alert -/// A type of dialog that contains an -/// alert message -case alertDialog -/// Unused -case banner -/// An input element that allows for -/// user-triggered actions when clicked or pressed -case button -/// Unused -case caption -/// Unused -case cell -/// A checkable input element that has -/// three possible values: `true`, `false`, or `mixed` -case checkbox -/// A header in a columned list. -case columnHeader -/// An input that controls another element, -/// such as a list or a grid, that can dynamically pop up to help the user -/// set the value of the input -case comboBox -/// Abstract role. -case command -/// Abstract role. -case composite -/// A dialog is a window that is designed to interrupt -/// the current processing of an application in order to prompt the user to enter -/// information or require a response. -case dialog -/// Content that assistive technology users may want to -/// browse in a reading mode. -case document -/// Unused -case feed -/// Unused -case form -/// A nameless container that has no semantic meaning -/// of its own. This is the role that GTK uses by default for widgets. -case generic -/// A grid of items. -case grid -/// An item in a grid or tree grid. -case gridCell -/// An element that groups multiple related widgets. GTK uses -/// this role for various containers, like [class@Gtk.HeaderBar] or [class@Gtk.Notebook]. -case group -/// Unused -case heading -/// An image. -case img -/// Abstract role. -case input -/// A visible name or caption for a user interface component. -case label -/// Abstract role. -case landmark -/// Unused -case legend -/// A clickable link. -case link -/// A list of items. -case list -/// Unused. -case listBox -/// An item in a list. -case listItem -/// Unused -case log -/// Unused -case main -/// Unused -case marquee -/// Unused -case math -/// An element that represents a value within a known range. -case meter -/// A menu. -case menu -/// A menubar. -case menuBar -/// An item in a menu. -case menuItem -/// A check item in a menu. -case menuItemCheckbox -/// A radio item in a menu. -case menuItemRadio -/// Unused -case navigation -/// An element that is not represented to accessibility technologies. -/// This role is synonymous to @GTK_ACCESSIBLE_ROLE_PRESENTATION. -case none -/// Unused -case note -/// Unused -case option -/// An element that is not represented to accessibility technologies. -/// This role is synonymous to @GTK_ACCESSIBLE_ROLE_NONE. -case presentation -/// An element that displays the progress -/// status for tasks that take a long time. -case progressBar -/// A checkable input in a group of radio roles, -/// only one of which can be checked at a time. -case radio -/// Unused -case radioGroup -/// Abstract role. -case range -/// Unused -case region -/// A row in a columned list. -case row -/// Unused -case rowGroup -/// Unused -case rowHeader -/// A graphical object that controls the scrolling -/// of content within a viewing area, regardless of whether the content is fully -/// displayed within the viewing area. -case scrollbar -/// Unused -case search -/// A type of textbox intended for specifying -/// search criteria. -case searchBox -/// Abstract role. -case section -/// Abstract role. -case sectionHead -/// Abstract role. -case select -/// A divider that separates and distinguishes -/// sections of content or groups of menuitems. -case separator -/// A user input where the user selects a value -/// from within a given range. -case slider -/// A form of range that expects the user to -/// select from among discrete choices. -case spinButton -/// Unused -case status -/// Abstract role. -case structure -/// A type of checkbox that represents on/off values, -/// as opposed to checked/unchecked values. -case switch_ -/// An item in a list of tab used for switching pages. -case tab -/// Unused -case table -/// A list of tabs for switching pages. -case tabList -/// A page in a notebook or stack. -case tabPanel -/// A type of input that allows free-form text -/// as its value. -case textBox -/// Unused -case time -/// Unused -case timer -/// Unused -case toolbar -/// Unused -case tooltip -/// Unused -case tree -/// A treeview-like, columned list. -case treeGrid -/// Unused -case treeItem -/// Abstract role for interactive components of a -/// graphical user interface -case widget -/// Abstract role for windows. -case window + /// time-sensitive, information + case alert + /// A type of dialog that contains an + /// alert message + case alertDialog + /// Unused + case banner + /// An input element that allows for + /// user-triggered actions when clicked or pressed + case button + /// Unused + case caption + /// Unused + case cell + /// A checkable input element that has + /// three possible values: `true`, `false`, or `mixed` + case checkbox + /// A header in a columned list. + case columnHeader + /// An input that controls another element, + /// such as a list or a grid, that can dynamically pop up to help the user + /// set the value of the input + case comboBox + /// Abstract role. + case command + /// Abstract role. + case composite + /// A dialog is a window that is designed to interrupt + /// the current processing of an application in order to prompt the user to enter + /// information or require a response. + case dialog + /// Content that assistive technology users may want to + /// browse in a reading mode. + case document + /// Unused + case feed + /// Unused + case form + /// A nameless container that has no semantic meaning + /// of its own. This is the role that GTK uses by default for widgets. + case generic + /// A grid of items. + case grid + /// An item in a grid or tree grid. + case gridCell + /// An element that groups multiple related widgets. GTK uses + /// this role for various containers, like [class@Gtk.HeaderBar] or [class@Gtk.Notebook]. + case group + /// Unused + case heading + /// An image. + case img + /// Abstract role. + case input + /// A visible name or caption for a user interface component. + case label + /// Abstract role. + case landmark + /// Unused + case legend + /// A clickable link. + case link + /// A list of items. + case list + /// Unused. + case listBox + /// An item in a list. + case listItem + /// Unused + case log + /// Unused + case main + /// Unused + case marquee + /// Unused + case math + /// An element that represents a value within a known range. + case meter + /// A menu. + case menu + /// A menubar. + case menuBar + /// An item in a menu. + case menuItem + /// A check item in a menu. + case menuItemCheckbox + /// A radio item in a menu. + case menuItemRadio + /// Unused + case navigation + /// An element that is not represented to accessibility technologies. + /// This role is synonymous to @GTK_ACCESSIBLE_ROLE_PRESENTATION. + case none + /// Unused + case note + /// Unused + case option + /// An element that is not represented to accessibility technologies. + /// This role is synonymous to @GTK_ACCESSIBLE_ROLE_NONE. + case presentation + /// An element that displays the progress + /// status for tasks that take a long time. + case progressBar + /// A checkable input in a group of radio roles, + /// only one of which can be checked at a time. + case radio + /// Unused + case radioGroup + /// Abstract role. + case range + /// Unused + case region + /// A row in a columned list. + case row + /// Unused + case rowGroup + /// Unused + case rowHeader + /// A graphical object that controls the scrolling + /// of content within a viewing area, regardless of whether the content is fully + /// displayed within the viewing area. + case scrollbar + /// Unused + case search + /// A type of textbox intended for specifying + /// search criteria. + case searchBox + /// Abstract role. + case section + /// Abstract role. + case sectionHead + /// Abstract role. + case select + /// A divider that separates and distinguishes + /// sections of content or groups of menuitems. + case separator + /// A user input where the user selects a value + /// from within a given range. + case slider + /// A form of range that expects the user to + /// select from among discrete choices. + case spinButton + /// Unused + case status + /// Abstract role. + case structure + /// A type of checkbox that represents on/off values, + /// as opposed to checked/unchecked values. + case switch_ + /// An item in a list of tab used for switching pages. + case tab + /// Unused + case table + /// A list of tabs for switching pages. + case tabList + /// A page in a notebook or stack. + case tabPanel + /// A type of input that allows free-form text + /// as its value. + case textBox + /// Unused + case time + /// Unused + case timer + /// Unused + case toolbar + /// Unused + case tooltip + /// Unused + case tree + /// A treeview-like, columned list. + case treeGrid + /// Unused + case treeItem + /// Abstract role for interactive components of a + /// graphical user interface + case widget + /// Abstract role for windows. + case window public static var type: GType { - gtk_accessible_role_get_type() -} + gtk_accessible_role_get_type() + } public init(from gtkEnum: GtkAccessibleRole) { switch gtkEnum { case GTK_ACCESSIBLE_ROLE_ALERT: - self = .alert -case GTK_ACCESSIBLE_ROLE_ALERT_DIALOG: - self = .alertDialog -case GTK_ACCESSIBLE_ROLE_BANNER: - self = .banner -case GTK_ACCESSIBLE_ROLE_BUTTON: - self = .button -case GTK_ACCESSIBLE_ROLE_CAPTION: - self = .caption -case GTK_ACCESSIBLE_ROLE_CELL: - self = .cell -case GTK_ACCESSIBLE_ROLE_CHECKBOX: - self = .checkbox -case GTK_ACCESSIBLE_ROLE_COLUMN_HEADER: - self = .columnHeader -case GTK_ACCESSIBLE_ROLE_COMBO_BOX: - self = .comboBox -case GTK_ACCESSIBLE_ROLE_COMMAND: - self = .command -case GTK_ACCESSIBLE_ROLE_COMPOSITE: - self = .composite -case GTK_ACCESSIBLE_ROLE_DIALOG: - self = .dialog -case GTK_ACCESSIBLE_ROLE_DOCUMENT: - self = .document -case GTK_ACCESSIBLE_ROLE_FEED: - self = .feed -case GTK_ACCESSIBLE_ROLE_FORM: - self = .form -case GTK_ACCESSIBLE_ROLE_GENERIC: - self = .generic -case GTK_ACCESSIBLE_ROLE_GRID: - self = .grid -case GTK_ACCESSIBLE_ROLE_GRID_CELL: - self = .gridCell -case GTK_ACCESSIBLE_ROLE_GROUP: - self = .group -case GTK_ACCESSIBLE_ROLE_HEADING: - self = .heading -case GTK_ACCESSIBLE_ROLE_IMG: - self = .img -case GTK_ACCESSIBLE_ROLE_INPUT: - self = .input -case GTK_ACCESSIBLE_ROLE_LABEL: - self = .label -case GTK_ACCESSIBLE_ROLE_LANDMARK: - self = .landmark -case GTK_ACCESSIBLE_ROLE_LEGEND: - self = .legend -case GTK_ACCESSIBLE_ROLE_LINK: - self = .link -case GTK_ACCESSIBLE_ROLE_LIST: - self = .list -case GTK_ACCESSIBLE_ROLE_LIST_BOX: - self = .listBox -case GTK_ACCESSIBLE_ROLE_LIST_ITEM: - self = .listItem -case GTK_ACCESSIBLE_ROLE_LOG: - self = .log -case GTK_ACCESSIBLE_ROLE_MAIN: - self = .main -case GTK_ACCESSIBLE_ROLE_MARQUEE: - self = .marquee -case GTK_ACCESSIBLE_ROLE_MATH: - self = .math -case GTK_ACCESSIBLE_ROLE_METER: - self = .meter -case GTK_ACCESSIBLE_ROLE_MENU: - self = .menu -case GTK_ACCESSIBLE_ROLE_MENU_BAR: - self = .menuBar -case GTK_ACCESSIBLE_ROLE_MENU_ITEM: - self = .menuItem -case GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX: - self = .menuItemCheckbox -case GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO: - self = .menuItemRadio -case GTK_ACCESSIBLE_ROLE_NAVIGATION: - self = .navigation -case GTK_ACCESSIBLE_ROLE_NONE: - self = .none -case GTK_ACCESSIBLE_ROLE_NOTE: - self = .note -case GTK_ACCESSIBLE_ROLE_OPTION: - self = .option -case GTK_ACCESSIBLE_ROLE_PRESENTATION: - self = .presentation -case GTK_ACCESSIBLE_ROLE_PROGRESS_BAR: - self = .progressBar -case GTK_ACCESSIBLE_ROLE_RADIO: - self = .radio -case GTK_ACCESSIBLE_ROLE_RADIO_GROUP: - self = .radioGroup -case GTK_ACCESSIBLE_ROLE_RANGE: - self = .range -case GTK_ACCESSIBLE_ROLE_REGION: - self = .region -case GTK_ACCESSIBLE_ROLE_ROW: - self = .row -case GTK_ACCESSIBLE_ROLE_ROW_GROUP: - self = .rowGroup -case GTK_ACCESSIBLE_ROLE_ROW_HEADER: - self = .rowHeader -case GTK_ACCESSIBLE_ROLE_SCROLLBAR: - self = .scrollbar -case GTK_ACCESSIBLE_ROLE_SEARCH: - self = .search -case GTK_ACCESSIBLE_ROLE_SEARCH_BOX: - self = .searchBox -case GTK_ACCESSIBLE_ROLE_SECTION: - self = .section -case GTK_ACCESSIBLE_ROLE_SECTION_HEAD: - self = .sectionHead -case GTK_ACCESSIBLE_ROLE_SELECT: - self = .select -case GTK_ACCESSIBLE_ROLE_SEPARATOR: - self = .separator -case GTK_ACCESSIBLE_ROLE_SLIDER: - self = .slider -case GTK_ACCESSIBLE_ROLE_SPIN_BUTTON: - self = .spinButton -case GTK_ACCESSIBLE_ROLE_STATUS: - self = .status -case GTK_ACCESSIBLE_ROLE_STRUCTURE: - self = .structure -case GTK_ACCESSIBLE_ROLE_SWITCH: - self = .switch_ -case GTK_ACCESSIBLE_ROLE_TAB: - self = .tab -case GTK_ACCESSIBLE_ROLE_TABLE: - self = .table -case GTK_ACCESSIBLE_ROLE_TAB_LIST: - self = .tabList -case GTK_ACCESSIBLE_ROLE_TAB_PANEL: - self = .tabPanel -case GTK_ACCESSIBLE_ROLE_TEXT_BOX: - self = .textBox -case GTK_ACCESSIBLE_ROLE_TIME: - self = .time -case GTK_ACCESSIBLE_ROLE_TIMER: - self = .timer -case GTK_ACCESSIBLE_ROLE_TOOLBAR: - self = .toolbar -case GTK_ACCESSIBLE_ROLE_TOOLTIP: - self = .tooltip -case GTK_ACCESSIBLE_ROLE_TREE: - self = .tree -case GTK_ACCESSIBLE_ROLE_TREE_GRID: - self = .treeGrid -case GTK_ACCESSIBLE_ROLE_TREE_ITEM: - self = .treeItem -case GTK_ACCESSIBLE_ROLE_WIDGET: - self = .widget -case GTK_ACCESSIBLE_ROLE_WINDOW: - self = .window + self = .alert + case GTK_ACCESSIBLE_ROLE_ALERT_DIALOG: + self = .alertDialog + case GTK_ACCESSIBLE_ROLE_BANNER: + self = .banner + case GTK_ACCESSIBLE_ROLE_BUTTON: + self = .button + case GTK_ACCESSIBLE_ROLE_CAPTION: + self = .caption + case GTK_ACCESSIBLE_ROLE_CELL: + self = .cell + case GTK_ACCESSIBLE_ROLE_CHECKBOX: + self = .checkbox + case GTK_ACCESSIBLE_ROLE_COLUMN_HEADER: + self = .columnHeader + case GTK_ACCESSIBLE_ROLE_COMBO_BOX: + self = .comboBox + case GTK_ACCESSIBLE_ROLE_COMMAND: + self = .command + case GTK_ACCESSIBLE_ROLE_COMPOSITE: + self = .composite + case GTK_ACCESSIBLE_ROLE_DIALOG: + self = .dialog + case GTK_ACCESSIBLE_ROLE_DOCUMENT: + self = .document + case GTK_ACCESSIBLE_ROLE_FEED: + self = .feed + case GTK_ACCESSIBLE_ROLE_FORM: + self = .form + case GTK_ACCESSIBLE_ROLE_GENERIC: + self = .generic + case GTK_ACCESSIBLE_ROLE_GRID: + self = .grid + case GTK_ACCESSIBLE_ROLE_GRID_CELL: + self = .gridCell + case GTK_ACCESSIBLE_ROLE_GROUP: + self = .group + case GTK_ACCESSIBLE_ROLE_HEADING: + self = .heading + case GTK_ACCESSIBLE_ROLE_IMG: + self = .img + case GTK_ACCESSIBLE_ROLE_INPUT: + self = .input + case GTK_ACCESSIBLE_ROLE_LABEL: + self = .label + case GTK_ACCESSIBLE_ROLE_LANDMARK: + self = .landmark + case GTK_ACCESSIBLE_ROLE_LEGEND: + self = .legend + case GTK_ACCESSIBLE_ROLE_LINK: + self = .link + case GTK_ACCESSIBLE_ROLE_LIST: + self = .list + case GTK_ACCESSIBLE_ROLE_LIST_BOX: + self = .listBox + case GTK_ACCESSIBLE_ROLE_LIST_ITEM: + self = .listItem + case GTK_ACCESSIBLE_ROLE_LOG: + self = .log + case GTK_ACCESSIBLE_ROLE_MAIN: + self = .main + case GTK_ACCESSIBLE_ROLE_MARQUEE: + self = .marquee + case GTK_ACCESSIBLE_ROLE_MATH: + self = .math + case GTK_ACCESSIBLE_ROLE_METER: + self = .meter + case GTK_ACCESSIBLE_ROLE_MENU: + self = .menu + case GTK_ACCESSIBLE_ROLE_MENU_BAR: + self = .menuBar + case GTK_ACCESSIBLE_ROLE_MENU_ITEM: + self = .menuItem + case GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX: + self = .menuItemCheckbox + case GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO: + self = .menuItemRadio + case GTK_ACCESSIBLE_ROLE_NAVIGATION: + self = .navigation + case GTK_ACCESSIBLE_ROLE_NONE: + self = .none + case GTK_ACCESSIBLE_ROLE_NOTE: + self = .note + case GTK_ACCESSIBLE_ROLE_OPTION: + self = .option + case GTK_ACCESSIBLE_ROLE_PRESENTATION: + self = .presentation + case GTK_ACCESSIBLE_ROLE_PROGRESS_BAR: + self = .progressBar + case GTK_ACCESSIBLE_ROLE_RADIO: + self = .radio + case GTK_ACCESSIBLE_ROLE_RADIO_GROUP: + self = .radioGroup + case GTK_ACCESSIBLE_ROLE_RANGE: + self = .range + case GTK_ACCESSIBLE_ROLE_REGION: + self = .region + case GTK_ACCESSIBLE_ROLE_ROW: + self = .row + case GTK_ACCESSIBLE_ROLE_ROW_GROUP: + self = .rowGroup + case GTK_ACCESSIBLE_ROLE_ROW_HEADER: + self = .rowHeader + case GTK_ACCESSIBLE_ROLE_SCROLLBAR: + self = .scrollbar + case GTK_ACCESSIBLE_ROLE_SEARCH: + self = .search + case GTK_ACCESSIBLE_ROLE_SEARCH_BOX: + self = .searchBox + case GTK_ACCESSIBLE_ROLE_SECTION: + self = .section + case GTK_ACCESSIBLE_ROLE_SECTION_HEAD: + self = .sectionHead + case GTK_ACCESSIBLE_ROLE_SELECT: + self = .select + case GTK_ACCESSIBLE_ROLE_SEPARATOR: + self = .separator + case GTK_ACCESSIBLE_ROLE_SLIDER: + self = .slider + case GTK_ACCESSIBLE_ROLE_SPIN_BUTTON: + self = .spinButton + case GTK_ACCESSIBLE_ROLE_STATUS: + self = .status + case GTK_ACCESSIBLE_ROLE_STRUCTURE: + self = .structure + case GTK_ACCESSIBLE_ROLE_SWITCH: + self = .switch_ + case GTK_ACCESSIBLE_ROLE_TAB: + self = .tab + case GTK_ACCESSIBLE_ROLE_TABLE: + self = .table + case GTK_ACCESSIBLE_ROLE_TAB_LIST: + self = .tabList + case GTK_ACCESSIBLE_ROLE_TAB_PANEL: + self = .tabPanel + case GTK_ACCESSIBLE_ROLE_TEXT_BOX: + self = .textBox + case GTK_ACCESSIBLE_ROLE_TIME: + self = .time + case GTK_ACCESSIBLE_ROLE_TIMER: + self = .timer + case GTK_ACCESSIBLE_ROLE_TOOLBAR: + self = .toolbar + case GTK_ACCESSIBLE_ROLE_TOOLTIP: + self = .tooltip + case GTK_ACCESSIBLE_ROLE_TREE: + self = .tree + case GTK_ACCESSIBLE_ROLE_TREE_GRID: + self = .treeGrid + case GTK_ACCESSIBLE_ROLE_TREE_ITEM: + self = .treeItem + case GTK_ACCESSIBLE_ROLE_WIDGET: + self = .widget + case GTK_ACCESSIBLE_ROLE_WINDOW: + self = .window default: fatalError("Unsupported GtkAccessibleRole enum value: \(gtkEnum.rawValue)") } @@ -358,161 +358,161 @@ case GTK_ACCESSIBLE_ROLE_WINDOW: public func toGtk() -> GtkAccessibleRole { switch self { case .alert: - return GTK_ACCESSIBLE_ROLE_ALERT -case .alertDialog: - return GTK_ACCESSIBLE_ROLE_ALERT_DIALOG -case .banner: - return GTK_ACCESSIBLE_ROLE_BANNER -case .button: - return GTK_ACCESSIBLE_ROLE_BUTTON -case .caption: - return GTK_ACCESSIBLE_ROLE_CAPTION -case .cell: - return GTK_ACCESSIBLE_ROLE_CELL -case .checkbox: - return GTK_ACCESSIBLE_ROLE_CHECKBOX -case .columnHeader: - return GTK_ACCESSIBLE_ROLE_COLUMN_HEADER -case .comboBox: - return GTK_ACCESSIBLE_ROLE_COMBO_BOX -case .command: - return GTK_ACCESSIBLE_ROLE_COMMAND -case .composite: - return GTK_ACCESSIBLE_ROLE_COMPOSITE -case .dialog: - return GTK_ACCESSIBLE_ROLE_DIALOG -case .document: - return GTK_ACCESSIBLE_ROLE_DOCUMENT -case .feed: - return GTK_ACCESSIBLE_ROLE_FEED -case .form: - return GTK_ACCESSIBLE_ROLE_FORM -case .generic: - return GTK_ACCESSIBLE_ROLE_GENERIC -case .grid: - return GTK_ACCESSIBLE_ROLE_GRID -case .gridCell: - return GTK_ACCESSIBLE_ROLE_GRID_CELL -case .group: - return GTK_ACCESSIBLE_ROLE_GROUP -case .heading: - return GTK_ACCESSIBLE_ROLE_HEADING -case .img: - return GTK_ACCESSIBLE_ROLE_IMG -case .input: - return GTK_ACCESSIBLE_ROLE_INPUT -case .label: - return GTK_ACCESSIBLE_ROLE_LABEL -case .landmark: - return GTK_ACCESSIBLE_ROLE_LANDMARK -case .legend: - return GTK_ACCESSIBLE_ROLE_LEGEND -case .link: - return GTK_ACCESSIBLE_ROLE_LINK -case .list: - return GTK_ACCESSIBLE_ROLE_LIST -case .listBox: - return GTK_ACCESSIBLE_ROLE_LIST_BOX -case .listItem: - return GTK_ACCESSIBLE_ROLE_LIST_ITEM -case .log: - return GTK_ACCESSIBLE_ROLE_LOG -case .main: - return GTK_ACCESSIBLE_ROLE_MAIN -case .marquee: - return GTK_ACCESSIBLE_ROLE_MARQUEE -case .math: - return GTK_ACCESSIBLE_ROLE_MATH -case .meter: - return GTK_ACCESSIBLE_ROLE_METER -case .menu: - return GTK_ACCESSIBLE_ROLE_MENU -case .menuBar: - return GTK_ACCESSIBLE_ROLE_MENU_BAR -case .menuItem: - return GTK_ACCESSIBLE_ROLE_MENU_ITEM -case .menuItemCheckbox: - return GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX -case .menuItemRadio: - return GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO -case .navigation: - return GTK_ACCESSIBLE_ROLE_NAVIGATION -case .none: - return GTK_ACCESSIBLE_ROLE_NONE -case .note: - return GTK_ACCESSIBLE_ROLE_NOTE -case .option: - return GTK_ACCESSIBLE_ROLE_OPTION -case .presentation: - return GTK_ACCESSIBLE_ROLE_PRESENTATION -case .progressBar: - return GTK_ACCESSIBLE_ROLE_PROGRESS_BAR -case .radio: - return GTK_ACCESSIBLE_ROLE_RADIO -case .radioGroup: - return GTK_ACCESSIBLE_ROLE_RADIO_GROUP -case .range: - return GTK_ACCESSIBLE_ROLE_RANGE -case .region: - return GTK_ACCESSIBLE_ROLE_REGION -case .row: - return GTK_ACCESSIBLE_ROLE_ROW -case .rowGroup: - return GTK_ACCESSIBLE_ROLE_ROW_GROUP -case .rowHeader: - return GTK_ACCESSIBLE_ROLE_ROW_HEADER -case .scrollbar: - return GTK_ACCESSIBLE_ROLE_SCROLLBAR -case .search: - return GTK_ACCESSIBLE_ROLE_SEARCH -case .searchBox: - return GTK_ACCESSIBLE_ROLE_SEARCH_BOX -case .section: - return GTK_ACCESSIBLE_ROLE_SECTION -case .sectionHead: - return GTK_ACCESSIBLE_ROLE_SECTION_HEAD -case .select: - return GTK_ACCESSIBLE_ROLE_SELECT -case .separator: - return GTK_ACCESSIBLE_ROLE_SEPARATOR -case .slider: - return GTK_ACCESSIBLE_ROLE_SLIDER -case .spinButton: - return GTK_ACCESSIBLE_ROLE_SPIN_BUTTON -case .status: - return GTK_ACCESSIBLE_ROLE_STATUS -case .structure: - return GTK_ACCESSIBLE_ROLE_STRUCTURE -case .switch_: - return GTK_ACCESSIBLE_ROLE_SWITCH -case .tab: - return GTK_ACCESSIBLE_ROLE_TAB -case .table: - return GTK_ACCESSIBLE_ROLE_TABLE -case .tabList: - return GTK_ACCESSIBLE_ROLE_TAB_LIST -case .tabPanel: - return GTK_ACCESSIBLE_ROLE_TAB_PANEL -case .textBox: - return GTK_ACCESSIBLE_ROLE_TEXT_BOX -case .time: - return GTK_ACCESSIBLE_ROLE_TIME -case .timer: - return GTK_ACCESSIBLE_ROLE_TIMER -case .toolbar: - return GTK_ACCESSIBLE_ROLE_TOOLBAR -case .tooltip: - return GTK_ACCESSIBLE_ROLE_TOOLTIP -case .tree: - return GTK_ACCESSIBLE_ROLE_TREE -case .treeGrid: - return GTK_ACCESSIBLE_ROLE_TREE_GRID -case .treeItem: - return GTK_ACCESSIBLE_ROLE_TREE_ITEM -case .widget: - return GTK_ACCESSIBLE_ROLE_WIDGET -case .window: - return GTK_ACCESSIBLE_ROLE_WINDOW + return GTK_ACCESSIBLE_ROLE_ALERT + case .alertDialog: + return GTK_ACCESSIBLE_ROLE_ALERT_DIALOG + case .banner: + return GTK_ACCESSIBLE_ROLE_BANNER + case .button: + return GTK_ACCESSIBLE_ROLE_BUTTON + case .caption: + return GTK_ACCESSIBLE_ROLE_CAPTION + case .cell: + return GTK_ACCESSIBLE_ROLE_CELL + case .checkbox: + return GTK_ACCESSIBLE_ROLE_CHECKBOX + case .columnHeader: + return GTK_ACCESSIBLE_ROLE_COLUMN_HEADER + case .comboBox: + return GTK_ACCESSIBLE_ROLE_COMBO_BOX + case .command: + return GTK_ACCESSIBLE_ROLE_COMMAND + case .composite: + return GTK_ACCESSIBLE_ROLE_COMPOSITE + case .dialog: + return GTK_ACCESSIBLE_ROLE_DIALOG + case .document: + return GTK_ACCESSIBLE_ROLE_DOCUMENT + case .feed: + return GTK_ACCESSIBLE_ROLE_FEED + case .form: + return GTK_ACCESSIBLE_ROLE_FORM + case .generic: + return GTK_ACCESSIBLE_ROLE_GENERIC + case .grid: + return GTK_ACCESSIBLE_ROLE_GRID + case .gridCell: + return GTK_ACCESSIBLE_ROLE_GRID_CELL + case .group: + return GTK_ACCESSIBLE_ROLE_GROUP + case .heading: + return GTK_ACCESSIBLE_ROLE_HEADING + case .img: + return GTK_ACCESSIBLE_ROLE_IMG + case .input: + return GTK_ACCESSIBLE_ROLE_INPUT + case .label: + return GTK_ACCESSIBLE_ROLE_LABEL + case .landmark: + return GTK_ACCESSIBLE_ROLE_LANDMARK + case .legend: + return GTK_ACCESSIBLE_ROLE_LEGEND + case .link: + return GTK_ACCESSIBLE_ROLE_LINK + case .list: + return GTK_ACCESSIBLE_ROLE_LIST + case .listBox: + return GTK_ACCESSIBLE_ROLE_LIST_BOX + case .listItem: + return GTK_ACCESSIBLE_ROLE_LIST_ITEM + case .log: + return GTK_ACCESSIBLE_ROLE_LOG + case .main: + return GTK_ACCESSIBLE_ROLE_MAIN + case .marquee: + return GTK_ACCESSIBLE_ROLE_MARQUEE + case .math: + return GTK_ACCESSIBLE_ROLE_MATH + case .meter: + return GTK_ACCESSIBLE_ROLE_METER + case .menu: + return GTK_ACCESSIBLE_ROLE_MENU + case .menuBar: + return GTK_ACCESSIBLE_ROLE_MENU_BAR + case .menuItem: + return GTK_ACCESSIBLE_ROLE_MENU_ITEM + case .menuItemCheckbox: + return GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX + case .menuItemRadio: + return GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO + case .navigation: + return GTK_ACCESSIBLE_ROLE_NAVIGATION + case .none: + return GTK_ACCESSIBLE_ROLE_NONE + case .note: + return GTK_ACCESSIBLE_ROLE_NOTE + case .option: + return GTK_ACCESSIBLE_ROLE_OPTION + case .presentation: + return GTK_ACCESSIBLE_ROLE_PRESENTATION + case .progressBar: + return GTK_ACCESSIBLE_ROLE_PROGRESS_BAR + case .radio: + return GTK_ACCESSIBLE_ROLE_RADIO + case .radioGroup: + return GTK_ACCESSIBLE_ROLE_RADIO_GROUP + case .range: + return GTK_ACCESSIBLE_ROLE_RANGE + case .region: + return GTK_ACCESSIBLE_ROLE_REGION + case .row: + return GTK_ACCESSIBLE_ROLE_ROW + case .rowGroup: + return GTK_ACCESSIBLE_ROLE_ROW_GROUP + case .rowHeader: + return GTK_ACCESSIBLE_ROLE_ROW_HEADER + case .scrollbar: + return GTK_ACCESSIBLE_ROLE_SCROLLBAR + case .search: + return GTK_ACCESSIBLE_ROLE_SEARCH + case .searchBox: + return GTK_ACCESSIBLE_ROLE_SEARCH_BOX + case .section: + return GTK_ACCESSIBLE_ROLE_SECTION + case .sectionHead: + return GTK_ACCESSIBLE_ROLE_SECTION_HEAD + case .select: + return GTK_ACCESSIBLE_ROLE_SELECT + case .separator: + return GTK_ACCESSIBLE_ROLE_SEPARATOR + case .slider: + return GTK_ACCESSIBLE_ROLE_SLIDER + case .spinButton: + return GTK_ACCESSIBLE_ROLE_SPIN_BUTTON + case .status: + return GTK_ACCESSIBLE_ROLE_STATUS + case .structure: + return GTK_ACCESSIBLE_ROLE_STRUCTURE + case .switch_: + return GTK_ACCESSIBLE_ROLE_SWITCH + case .tab: + return GTK_ACCESSIBLE_ROLE_TAB + case .table: + return GTK_ACCESSIBLE_ROLE_TABLE + case .tabList: + return GTK_ACCESSIBLE_ROLE_TAB_LIST + case .tabPanel: + return GTK_ACCESSIBLE_ROLE_TAB_PANEL + case .textBox: + return GTK_ACCESSIBLE_ROLE_TEXT_BOX + case .time: + return GTK_ACCESSIBLE_ROLE_TIME + case .timer: + return GTK_ACCESSIBLE_ROLE_TIMER + case .toolbar: + return GTK_ACCESSIBLE_ROLE_TOOLBAR + case .tooltip: + return GTK_ACCESSIBLE_ROLE_TOOLTIP + case .tree: + return GTK_ACCESSIBLE_ROLE_TREE + case .treeGrid: + return GTK_ACCESSIBLE_ROLE_TREE_GRID + case .treeItem: + return GTK_ACCESSIBLE_ROLE_TREE_ITEM + case .widget: + return GTK_ACCESSIBLE_ROLE_WIDGET + case .window: + return GTK_ACCESSIBLE_ROLE_WINDOW } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AccessibleSort.swift b/Sources/Gtk/Generated/AccessibleSort.swift index 393573ab31..35f91845e7 100644 --- a/Sources/Gtk/Generated/AccessibleSort.swift +++ b/Sources/Gtk/Generated/AccessibleSort.swift @@ -6,29 +6,29 @@ public enum AccessibleSort: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleSort /// There is no defined sort applied to the column. -case none -/// Items are sorted in ascending order by this column. -case ascending -/// Items are sorted in descending order by this column. -case descending -/// A sort algorithm other than ascending or -/// descending has been applied. -case other + case none + /// Items are sorted in ascending order by this column. + case ascending + /// Items are sorted in descending order by this column. + case descending + /// A sort algorithm other than ascending or + /// descending has been applied. + case other public static var type: GType { - gtk_accessible_sort_get_type() -} + gtk_accessible_sort_get_type() + } public init(from gtkEnum: GtkAccessibleSort) { switch gtkEnum { case GTK_ACCESSIBLE_SORT_NONE: - self = .none -case GTK_ACCESSIBLE_SORT_ASCENDING: - self = .ascending -case GTK_ACCESSIBLE_SORT_DESCENDING: - self = .descending -case GTK_ACCESSIBLE_SORT_OTHER: - self = .other + self = .none + case GTK_ACCESSIBLE_SORT_ASCENDING: + self = .ascending + case GTK_ACCESSIBLE_SORT_DESCENDING: + self = .descending + case GTK_ACCESSIBLE_SORT_OTHER: + self = .other default: fatalError("Unsupported GtkAccessibleSort enum value: \(gtkEnum.rawValue)") } @@ -37,13 +37,13 @@ case GTK_ACCESSIBLE_SORT_OTHER: public func toGtk() -> GtkAccessibleSort { switch self { case .none: - return GTK_ACCESSIBLE_SORT_NONE -case .ascending: - return GTK_ACCESSIBLE_SORT_ASCENDING -case .descending: - return GTK_ACCESSIBLE_SORT_DESCENDING -case .other: - return GTK_ACCESSIBLE_SORT_OTHER + return GTK_ACCESSIBLE_SORT_NONE + case .ascending: + return GTK_ACCESSIBLE_SORT_ASCENDING + case .descending: + return GTK_ACCESSIBLE_SORT_DESCENDING + case .other: + return GTK_ACCESSIBLE_SORT_OTHER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AccessibleState.swift b/Sources/Gtk/Generated/AccessibleState.swift index 3ddaa60b89..7cfbf36ba3 100644 --- a/Sources/Gtk/Generated/AccessibleState.swift +++ b/Sources/Gtk/Generated/AccessibleState.swift @@ -5,57 +5,57 @@ public enum AccessibleState: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleState /// A “busy” state. This state has boolean values -case busy -/// A “checked” state; indicates the current -/// state of a [class@CheckButton]. Value type: [enum@AccessibleTristate] -case checked -/// A “disabled” state; corresponds to the -/// [property@Widget:sensitive] property. It indicates a UI element -/// that is perceivable, but not editable or operable. Value type: boolean -case disabled -/// An “expanded” state; corresponds to the -/// [property@Expander:expanded] property. Value type: boolean -/// or undefined -case expanded -/// A “hidden” state; corresponds to the -/// [property@Widget:visible] property. You can use this state -/// explicitly on UI elements that should not be exposed to an assistive -/// technology. Value type: boolean -/// See also: %GTK_ACCESSIBLE_STATE_DISABLED -case hidden -/// An “invalid” state; set when a widget -/// is showing an error. Value type: [enum@AccessibleInvalidState] -case invalid -/// A “pressed” state; indicates the current -/// state of a [class@ToggleButton]. Value type: [enum@AccessibleTristate] -/// enumeration -case pressed -/// A “selected” state; set when a widget -/// is selected. Value type: boolean or undefined -case selected + case busy + /// A “checked” state; indicates the current + /// state of a [class@CheckButton]. Value type: [enum@AccessibleTristate] + case checked + /// A “disabled” state; corresponds to the + /// [property@Widget:sensitive] property. It indicates a UI element + /// that is perceivable, but not editable or operable. Value type: boolean + case disabled + /// An “expanded” state; corresponds to the + /// [property@Expander:expanded] property. Value type: boolean + /// or undefined + case expanded + /// A “hidden” state; corresponds to the + /// [property@Widget:visible] property. You can use this state + /// explicitly on UI elements that should not be exposed to an assistive + /// technology. Value type: boolean + /// See also: %GTK_ACCESSIBLE_STATE_DISABLED + case hidden + /// An “invalid” state; set when a widget + /// is showing an error. Value type: [enum@AccessibleInvalidState] + case invalid + /// A “pressed” state; indicates the current + /// state of a [class@ToggleButton]. Value type: [enum@AccessibleTristate] + /// enumeration + case pressed + /// A “selected” state; set when a widget + /// is selected. Value type: boolean or undefined + case selected public static var type: GType { - gtk_accessible_state_get_type() -} + gtk_accessible_state_get_type() + } public init(from gtkEnum: GtkAccessibleState) { switch gtkEnum { case GTK_ACCESSIBLE_STATE_BUSY: - self = .busy -case GTK_ACCESSIBLE_STATE_CHECKED: - self = .checked -case GTK_ACCESSIBLE_STATE_DISABLED: - self = .disabled -case GTK_ACCESSIBLE_STATE_EXPANDED: - self = .expanded -case GTK_ACCESSIBLE_STATE_HIDDEN: - self = .hidden -case GTK_ACCESSIBLE_STATE_INVALID: - self = .invalid -case GTK_ACCESSIBLE_STATE_PRESSED: - self = .pressed -case GTK_ACCESSIBLE_STATE_SELECTED: - self = .selected + self = .busy + case GTK_ACCESSIBLE_STATE_CHECKED: + self = .checked + case GTK_ACCESSIBLE_STATE_DISABLED: + self = .disabled + case GTK_ACCESSIBLE_STATE_EXPANDED: + self = .expanded + case GTK_ACCESSIBLE_STATE_HIDDEN: + self = .hidden + case GTK_ACCESSIBLE_STATE_INVALID: + self = .invalid + case GTK_ACCESSIBLE_STATE_PRESSED: + self = .pressed + case GTK_ACCESSIBLE_STATE_SELECTED: + self = .selected default: fatalError("Unsupported GtkAccessibleState enum value: \(gtkEnum.rawValue)") } @@ -64,21 +64,21 @@ case GTK_ACCESSIBLE_STATE_SELECTED: public func toGtk() -> GtkAccessibleState { switch self { case .busy: - return GTK_ACCESSIBLE_STATE_BUSY -case .checked: - return GTK_ACCESSIBLE_STATE_CHECKED -case .disabled: - return GTK_ACCESSIBLE_STATE_DISABLED -case .expanded: - return GTK_ACCESSIBLE_STATE_EXPANDED -case .hidden: - return GTK_ACCESSIBLE_STATE_HIDDEN -case .invalid: - return GTK_ACCESSIBLE_STATE_INVALID -case .pressed: - return GTK_ACCESSIBLE_STATE_PRESSED -case .selected: - return GTK_ACCESSIBLE_STATE_SELECTED + return GTK_ACCESSIBLE_STATE_BUSY + case .checked: + return GTK_ACCESSIBLE_STATE_CHECKED + case .disabled: + return GTK_ACCESSIBLE_STATE_DISABLED + case .expanded: + return GTK_ACCESSIBLE_STATE_EXPANDED + case .hidden: + return GTK_ACCESSIBLE_STATE_HIDDEN + case .invalid: + return GTK_ACCESSIBLE_STATE_INVALID + case .pressed: + return GTK_ACCESSIBLE_STATE_PRESSED + case .selected: + return GTK_ACCESSIBLE_STATE_SELECTED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AccessibleTristate.swift b/Sources/Gtk/Generated/AccessibleTristate.swift index 56d1a4ac1f..ea5f6b8b5b 100644 --- a/Sources/Gtk/Generated/AccessibleTristate.swift +++ b/Sources/Gtk/Generated/AccessibleTristate.swift @@ -2,7 +2,7 @@ import CGtk /// The possible values for the %GTK_ACCESSIBLE_STATE_PRESSED /// accessible state. -/// +/// /// Note that the %GTK_ACCESSIBLE_TRISTATE_FALSE and /// %GTK_ACCESSIBLE_TRISTATE_TRUE have the same values /// as %FALSE and %TRUE. @@ -10,24 +10,24 @@ public enum AccessibleTristate: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleTristate /// The state is `false` -case false_ -/// The state is `true` -case true_ -/// The state is `mixed` -case mixed + case false_ + /// The state is `true` + case true_ + /// The state is `mixed` + case mixed public static var type: GType { - gtk_accessible_tristate_get_type() -} + gtk_accessible_tristate_get_type() + } public init(from gtkEnum: GtkAccessibleTristate) { switch gtkEnum { case GTK_ACCESSIBLE_TRISTATE_FALSE: - self = .false_ -case GTK_ACCESSIBLE_TRISTATE_TRUE: - self = .true_ -case GTK_ACCESSIBLE_TRISTATE_MIXED: - self = .mixed + self = .false_ + case GTK_ACCESSIBLE_TRISTATE_TRUE: + self = .true_ + case GTK_ACCESSIBLE_TRISTATE_MIXED: + self = .mixed default: fatalError("Unsupported GtkAccessibleTristate enum value: \(gtkEnum.rawValue)") } @@ -36,11 +36,11 @@ case GTK_ACCESSIBLE_TRISTATE_MIXED: public func toGtk() -> GtkAccessibleTristate { switch self { case .false_: - return GTK_ACCESSIBLE_TRISTATE_FALSE -case .true_: - return GTK_ACCESSIBLE_TRISTATE_TRUE -case .mixed: - return GTK_ACCESSIBLE_TRISTATE_MIXED + return GTK_ACCESSIBLE_TRISTATE_FALSE + case .true_: + return GTK_ACCESSIBLE_TRISTATE_TRUE + case .mixed: + return GTK_ACCESSIBLE_TRISTATE_MIXED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Actionable.swift b/Sources/Gtk/Generated/Actionable.swift index 129d7093a6..5a4713d18d 100644 --- a/Sources/Gtk/Generated/Actionable.swift +++ b/Sources/Gtk/Generated/Actionable.swift @@ -1,11 +1,11 @@ import CGtk /// Provides a way to associate widgets with actions. -/// +/// /// It primarily consists of two properties: [property@Gtk.Actionable:action-name] /// and [property@Gtk.Actionable:action-target]. There are also some convenience /// APIs for setting these properties. -/// +/// /// The action will be looked up in action groups that are found among /// the widgets ancestors. Most commonly, these will be the actions with /// the “win.” or “app.” prefix that are associated with the @@ -14,7 +14,6 @@ import CGtk /// as well. public protocol Actionable: GObjectRepresentable { /// The name of the action with which this widget should be associated. -var actionName: String? { get set } + var actionName: String? { get set } - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Align.swift b/Sources/Gtk/Generated/Align.swift index b711436f4c..120d4707f9 100644 --- a/Sources/Gtk/Generated/Align.swift +++ b/Sources/Gtk/Generated/Align.swift @@ -1,17 +1,17 @@ import CGtk /// Controls how a widget deals with extra space in a single dimension. -/// +/// /// Alignment only matters if the widget receives a “too large” allocation, /// for example if you packed the widget with the [property@Gtk.Widget:hexpand] /// property inside a [class@Box], then the widget might get extra space. /// If you have for example a 16x16 icon inside a 32x32 space, the icon /// could be scaled and stretched, it could be centered, or it could be /// positioned to one side of the space. -/// +/// /// Note that in horizontal context `GTK_ALIGN_START` and `GTK_ALIGN_END` /// are interpreted relative to text direction. -/// +/// /// Baseline support is optional for containers and widgets, and is only available /// for vertical alignment. `GTK_ALIGN_BASELINE_CENTER` and `GTK_ALIGN_BASELINE_FILL` /// are treated similar to `GTK_ALIGN_CENTER` and `GTK_ALIGN_FILL`, except that it @@ -20,29 +20,29 @@ public enum Align: GValueRepresentableEnum { public typealias GtkEnum = GtkAlign /// Stretch to fill all space if possible, center if -/// no meaningful way to stretch -case fill -/// Snap to left or top side, leaving space on right or bottom -case start -/// Snap to right or bottom side, leaving space on left or top -case end -/// Center natural width of widget inside the allocation -case center + /// no meaningful way to stretch + case fill + /// Snap to left or top side, leaving space on right or bottom + case start + /// Snap to right or bottom side, leaving space on left or top + case end + /// Center natural width of widget inside the allocation + case center public static var type: GType { - gtk_align_get_type() -} + gtk_align_get_type() + } public init(from gtkEnum: GtkAlign) { switch gtkEnum { case GTK_ALIGN_FILL: - self = .fill -case GTK_ALIGN_START: - self = .start -case GTK_ALIGN_END: - self = .end -case GTK_ALIGN_CENTER: - self = .center + self = .fill + case GTK_ALIGN_START: + self = .start + case GTK_ALIGN_END: + self = .end + case GTK_ALIGN_CENTER: + self = .center default: fatalError("Unsupported GtkAlign enum value: \(gtkEnum.rawValue)") } @@ -51,13 +51,13 @@ case GTK_ALIGN_CENTER: public func toGtk() -> GtkAlign { switch self { case .fill: - return GTK_ALIGN_FILL -case .start: - return GTK_ALIGN_START -case .end: - return GTK_ALIGN_END -case .center: - return GTK_ALIGN_CENTER + return GTK_ALIGN_FILL + case .start: + return GTK_ALIGN_START + case .end: + return GTK_ALIGN_END + case .center: + return GTK_ALIGN_CENTER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AppChooser.swift b/Sources/Gtk/Generated/AppChooser.swift index 142bef0320..5d4489089c 100644 --- a/Sources/Gtk/Generated/AppChooser.swift +++ b/Sources/Gtk/Generated/AppChooser.swift @@ -2,11 +2,11 @@ import CGtk /// `GtkAppChooser` is an interface for widgets which allow the user to /// choose an application. -/// +/// /// The main objects that implement this interface are /// [class@Gtk.AppChooserWidget], /// [class@Gtk.AppChooserDialog] and [class@Gtk.AppChooserButton]. -/// +/// /// Applications are represented by GIO `GAppInfo` objects here. /// GIO has a concept of recommended and fallback applications for a /// given content type. Recommended applications are those that claim @@ -16,14 +16,13 @@ import CGtk /// type. The `GtkAppChooserWidget` provides detailed control over /// whether the shown list of applications should include default, /// recommended or fallback applications. -/// +/// /// To obtain the application that has been selected in a `GtkAppChooser`, /// use [method@Gtk.AppChooser.get_app_info]. public protocol AppChooser: GObjectRepresentable { /// The content type of the `GtkAppChooser` object. -/// -/// See `GContentType` for more information about content types. -var contentType: String { get set } + /// + /// See `GContentType` for more information about content types. + var contentType: String { get set } - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ArrowType.swift b/Sources/Gtk/Generated/ArrowType.swift index 2e6a4a3dd6..8c591c0df6 100644 --- a/Sources/Gtk/Generated/ArrowType.swift +++ b/Sources/Gtk/Generated/ArrowType.swift @@ -5,32 +5,32 @@ public enum ArrowType: GValueRepresentableEnum { public typealias GtkEnum = GtkArrowType /// Represents an upward pointing arrow. -case up -/// Represents a downward pointing arrow. -case down -/// Represents a left pointing arrow. -case left -/// Represents a right pointing arrow. -case right -/// No arrow. -case none + case up + /// Represents a downward pointing arrow. + case down + /// Represents a left pointing arrow. + case left + /// Represents a right pointing arrow. + case right + /// No arrow. + case none public static var type: GType { - gtk_arrow_type_get_type() -} + gtk_arrow_type_get_type() + } public init(from gtkEnum: GtkArrowType) { switch gtkEnum { case GTK_ARROW_UP: - self = .up -case GTK_ARROW_DOWN: - self = .down -case GTK_ARROW_LEFT: - self = .left -case GTK_ARROW_RIGHT: - self = .right -case GTK_ARROW_NONE: - self = .none + self = .up + case GTK_ARROW_DOWN: + self = .down + case GTK_ARROW_LEFT: + self = .left + case GTK_ARROW_RIGHT: + self = .right + case GTK_ARROW_NONE: + self = .none default: fatalError("Unsupported GtkArrowType enum value: \(gtkEnum.rawValue)") } @@ -39,15 +39,15 @@ case GTK_ARROW_NONE: public func toGtk() -> GtkArrowType { switch self { case .up: - return GTK_ARROW_UP -case .down: - return GTK_ARROW_DOWN -case .left: - return GTK_ARROW_LEFT -case .right: - return GTK_ARROW_RIGHT -case .none: - return GTK_ARROW_NONE + return GTK_ARROW_UP + case .down: + return GTK_ARROW_DOWN + case .left: + return GTK_ARROW_LEFT + case .right: + return GTK_ARROW_RIGHT + case .none: + return GTK_ARROW_NONE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AssistantPageType.swift b/Sources/Gtk/Generated/AssistantPageType.swift index a160f080c1..35e0bfdc55 100644 --- a/Sources/Gtk/Generated/AssistantPageType.swift +++ b/Sources/Gtk/Generated/AssistantPageType.swift @@ -1,58 +1,58 @@ import CGtk /// Determines the role of a page inside a `GtkAssistant`. -/// +/// /// The role is used to handle buttons sensitivity and visibility. -/// +/// /// Note that an assistant needs to end its page flow with a page of type /// %GTK_ASSISTANT_PAGE_CONFIRM, %GTK_ASSISTANT_PAGE_SUMMARY or /// %GTK_ASSISTANT_PAGE_PROGRESS to be correct. -/// +/// /// The Cancel button will only be shown if the page isn’t “committed”. /// See gtk_assistant_commit() for details. public enum AssistantPageType: GValueRepresentableEnum { public typealias GtkEnum = GtkAssistantPageType /// The page has regular contents. Both the -/// Back and forward buttons will be shown. -case content -/// The page contains an introduction to the -/// assistant task. Only the Forward button will be shown if there is a -/// next page. -case intro -/// The page lets the user confirm or deny the -/// changes. The Back and Apply buttons will be shown. -case confirm -/// The page informs the user of the changes -/// done. Only the Close button will be shown. -case summary -/// Used for tasks that take a long time to -/// complete, blocks the assistant until the page is marked as complete. -/// Only the back button will be shown. -case progress -/// Used for when other page types are not -/// appropriate. No buttons will be shown, and the application must -/// add its own buttons through gtk_assistant_add_action_widget(). -case custom + /// Back and forward buttons will be shown. + case content + /// The page contains an introduction to the + /// assistant task. Only the Forward button will be shown if there is a + /// next page. + case intro + /// The page lets the user confirm or deny the + /// changes. The Back and Apply buttons will be shown. + case confirm + /// The page informs the user of the changes + /// done. Only the Close button will be shown. + case summary + /// Used for tasks that take a long time to + /// complete, blocks the assistant until the page is marked as complete. + /// Only the back button will be shown. + case progress + /// Used for when other page types are not + /// appropriate. No buttons will be shown, and the application must + /// add its own buttons through gtk_assistant_add_action_widget(). + case custom public static var type: GType { - gtk_assistant_page_type_get_type() -} + gtk_assistant_page_type_get_type() + } public init(from gtkEnum: GtkAssistantPageType) { switch gtkEnum { case GTK_ASSISTANT_PAGE_CONTENT: - self = .content -case GTK_ASSISTANT_PAGE_INTRO: - self = .intro -case GTK_ASSISTANT_PAGE_CONFIRM: - self = .confirm -case GTK_ASSISTANT_PAGE_SUMMARY: - self = .summary -case GTK_ASSISTANT_PAGE_PROGRESS: - self = .progress -case GTK_ASSISTANT_PAGE_CUSTOM: - self = .custom + self = .content + case GTK_ASSISTANT_PAGE_INTRO: + self = .intro + case GTK_ASSISTANT_PAGE_CONFIRM: + self = .confirm + case GTK_ASSISTANT_PAGE_SUMMARY: + self = .summary + case GTK_ASSISTANT_PAGE_PROGRESS: + self = .progress + case GTK_ASSISTANT_PAGE_CUSTOM: + self = .custom default: fatalError("Unsupported GtkAssistantPageType enum value: \(gtkEnum.rawValue)") } @@ -61,17 +61,17 @@ case GTK_ASSISTANT_PAGE_CUSTOM: public func toGtk() -> GtkAssistantPageType { switch self { case .content: - return GTK_ASSISTANT_PAGE_CONTENT -case .intro: - return GTK_ASSISTANT_PAGE_INTRO -case .confirm: - return GTK_ASSISTANT_PAGE_CONFIRM -case .summary: - return GTK_ASSISTANT_PAGE_SUMMARY -case .progress: - return GTK_ASSISTANT_PAGE_PROGRESS -case .custom: - return GTK_ASSISTANT_PAGE_CUSTOM + return GTK_ASSISTANT_PAGE_CONTENT + case .intro: + return GTK_ASSISTANT_PAGE_INTRO + case .confirm: + return GTK_ASSISTANT_PAGE_CONFIRM + case .summary: + return GTK_ASSISTANT_PAGE_SUMMARY + case .progress: + return GTK_ASSISTANT_PAGE_PROGRESS + case .custom: + return GTK_ASSISTANT_PAGE_CUSTOM } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/BaselinePosition.swift b/Sources/Gtk/Generated/BaselinePosition.swift index dc9baaee71..9a1efe3a51 100644 --- a/Sources/Gtk/Generated/BaselinePosition.swift +++ b/Sources/Gtk/Generated/BaselinePosition.swift @@ -1,7 +1,7 @@ import CGtk /// Baseline position in a row of widgets. -/// +/// /// Whenever a container has some form of natural row it may align /// children in that row along a common typographical baseline. If /// the amount of vertical space in the row is taller than the total @@ -12,24 +12,24 @@ public enum BaselinePosition: GValueRepresentableEnum { public typealias GtkEnum = GtkBaselinePosition /// Align the baseline at the top -case top -/// Center the baseline -case center -/// Align the baseline at the bottom -case bottom + case top + /// Center the baseline + case center + /// Align the baseline at the bottom + case bottom public static var type: GType { - gtk_baseline_position_get_type() -} + gtk_baseline_position_get_type() + } public init(from gtkEnum: GtkBaselinePosition) { switch gtkEnum { case GTK_BASELINE_POSITION_TOP: - self = .top -case GTK_BASELINE_POSITION_CENTER: - self = .center -case GTK_BASELINE_POSITION_BOTTOM: - self = .bottom + self = .top + case GTK_BASELINE_POSITION_CENTER: + self = .center + case GTK_BASELINE_POSITION_BOTTOM: + self = .bottom default: fatalError("Unsupported GtkBaselinePosition enum value: \(gtkEnum.rawValue)") } @@ -38,11 +38,11 @@ case GTK_BASELINE_POSITION_BOTTOM: public func toGtk() -> GtkBaselinePosition { switch self { case .top: - return GTK_BASELINE_POSITION_TOP -case .center: - return GTK_BASELINE_POSITION_CENTER -case .bottom: - return GTK_BASELINE_POSITION_BOTTOM + return GTK_BASELINE_POSITION_TOP + case .center: + return GTK_BASELINE_POSITION_CENTER + case .bottom: + return GTK_BASELINE_POSITION_BOTTOM } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/BorderStyle.swift b/Sources/Gtk/Generated/BorderStyle.swift index 65b71ef962..e29013f349 100644 --- a/Sources/Gtk/Generated/BorderStyle.swift +++ b/Sources/Gtk/Generated/BorderStyle.swift @@ -5,52 +5,52 @@ public enum BorderStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkBorderStyle /// No visible border -case none -/// Same as %GTK_BORDER_STYLE_NONE -case hidden -/// A single line segment -case solid -/// Looks as if the content is sunken into the canvas -case inset -/// Looks as if the content is coming out of the canvas -case outset -/// A series of round dots -case dotted -/// A series of square-ended dashes -case dashed -/// Two parallel lines with some space between them -case double -/// Looks as if it were carved in the canvas -case groove -/// Looks as if it were coming out of the canvas -case ridge + case none + /// Same as %GTK_BORDER_STYLE_NONE + case hidden + /// A single line segment + case solid + /// Looks as if the content is sunken into the canvas + case inset + /// Looks as if the content is coming out of the canvas + case outset + /// A series of round dots + case dotted + /// A series of square-ended dashes + case dashed + /// Two parallel lines with some space between them + case double + /// Looks as if it were carved in the canvas + case groove + /// Looks as if it were coming out of the canvas + case ridge public static var type: GType { - gtk_border_style_get_type() -} + gtk_border_style_get_type() + } public init(from gtkEnum: GtkBorderStyle) { switch gtkEnum { case GTK_BORDER_STYLE_NONE: - self = .none -case GTK_BORDER_STYLE_HIDDEN: - self = .hidden -case GTK_BORDER_STYLE_SOLID: - self = .solid -case GTK_BORDER_STYLE_INSET: - self = .inset -case GTK_BORDER_STYLE_OUTSET: - self = .outset -case GTK_BORDER_STYLE_DOTTED: - self = .dotted -case GTK_BORDER_STYLE_DASHED: - self = .dashed -case GTK_BORDER_STYLE_DOUBLE: - self = .double -case GTK_BORDER_STYLE_GROOVE: - self = .groove -case GTK_BORDER_STYLE_RIDGE: - self = .ridge + self = .none + case GTK_BORDER_STYLE_HIDDEN: + self = .hidden + case GTK_BORDER_STYLE_SOLID: + self = .solid + case GTK_BORDER_STYLE_INSET: + self = .inset + case GTK_BORDER_STYLE_OUTSET: + self = .outset + case GTK_BORDER_STYLE_DOTTED: + self = .dotted + case GTK_BORDER_STYLE_DASHED: + self = .dashed + case GTK_BORDER_STYLE_DOUBLE: + self = .double + case GTK_BORDER_STYLE_GROOVE: + self = .groove + case GTK_BORDER_STYLE_RIDGE: + self = .ridge default: fatalError("Unsupported GtkBorderStyle enum value: \(gtkEnum.rawValue)") } @@ -59,25 +59,25 @@ case GTK_BORDER_STYLE_RIDGE: public func toGtk() -> GtkBorderStyle { switch self { case .none: - return GTK_BORDER_STYLE_NONE -case .hidden: - return GTK_BORDER_STYLE_HIDDEN -case .solid: - return GTK_BORDER_STYLE_SOLID -case .inset: - return GTK_BORDER_STYLE_INSET -case .outset: - return GTK_BORDER_STYLE_OUTSET -case .dotted: - return GTK_BORDER_STYLE_DOTTED -case .dashed: - return GTK_BORDER_STYLE_DASHED -case .double: - return GTK_BORDER_STYLE_DOUBLE -case .groove: - return GTK_BORDER_STYLE_GROOVE -case .ridge: - return GTK_BORDER_STYLE_RIDGE + return GTK_BORDER_STYLE_NONE + case .hidden: + return GTK_BORDER_STYLE_HIDDEN + case .solid: + return GTK_BORDER_STYLE_SOLID + case .inset: + return GTK_BORDER_STYLE_INSET + case .outset: + return GTK_BORDER_STYLE_OUTSET + case .dotted: + return GTK_BORDER_STYLE_DOTTED + case .dashed: + return GTK_BORDER_STYLE_DASHED + case .double: + return GTK_BORDER_STYLE_DOUBLE + case .groove: + return GTK_BORDER_STYLE_GROOVE + case .ridge: + return GTK_BORDER_STYLE_RIDGE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Buildable.swift b/Sources/Gtk/Generated/Buildable.swift index 954cb37f73..a72135d704 100644 --- a/Sources/Gtk/Generated/Buildable.swift +++ b/Sources/Gtk/Generated/Buildable.swift @@ -1,19 +1,17 @@ import CGtk /// Allows objects to extend and customize deserialization from ui files. -/// +/// /// The `GtkBuildable` interface includes methods for setting names and /// properties of objects, parsing custom tags and constructing child objects. -/// +/// /// It is implemented by all widgets and many of the non-widget objects that are /// provided by GTK. The main user of this interface is [class@Gtk.Builder]. /// There should be very little need for applications to call any of these /// functions directly. -/// +/// /// An object only needs to implement this interface if it needs to extend the /// `GtkBuilder` XML format or run any extra routines at deserialization time. public protocol Buildable: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/BuilderError.swift b/Sources/Gtk/Generated/BuilderError.swift index c41097eab7..aff20af88a 100644 --- a/Sources/Gtk/Generated/BuilderError.swift +++ b/Sources/Gtk/Generated/BuilderError.swift @@ -6,83 +6,83 @@ public enum BuilderError: GValueRepresentableEnum { public typealias GtkEnum = GtkBuilderError /// A type-func attribute didn’t name -/// a function that returns a `GType`. -case invalidTypeFunction -/// The input contained a tag that `GtkBuilder` -/// can’t handle. -case unhandledTag -/// An attribute that is required by -/// `GtkBuilder` was missing. -case missingAttribute -/// `GtkBuilder` found an attribute that -/// it doesn’t understand. -case invalidAttribute -/// `GtkBuilder` found a tag that -/// it doesn’t understand. -case invalidTag -/// A required property value was -/// missing. -case missingPropertyValue -/// `GtkBuilder` couldn’t parse -/// some attribute value. -case invalidValue -/// The input file requires a newer version -/// of GTK. -case versionMismatch -/// An object id occurred twice. -case duplicateId -/// A specified object type is of the same type or -/// derived from the type of the composite class being extended with builder XML. -case objectTypeRefused -/// The wrong type was specified in a composite class’s template XML -case templateMismatch -/// The specified property is unknown for the object class. -case invalidProperty -/// The specified signal is unknown for the object class. -case invalidSignal -/// An object id is unknown. -case invalidId -/// A function could not be found. This often happens -/// when symbols are set to be kept private. Compiling code with -rdynamic or using the -/// `gmodule-export-2.0` pkgconfig module can fix this problem. -case invalidFunction + /// a function that returns a `GType`. + case invalidTypeFunction + /// The input contained a tag that `GtkBuilder` + /// can’t handle. + case unhandledTag + /// An attribute that is required by + /// `GtkBuilder` was missing. + case missingAttribute + /// `GtkBuilder` found an attribute that + /// it doesn’t understand. + case invalidAttribute + /// `GtkBuilder` found a tag that + /// it doesn’t understand. + case invalidTag + /// A required property value was + /// missing. + case missingPropertyValue + /// `GtkBuilder` couldn’t parse + /// some attribute value. + case invalidValue + /// The input file requires a newer version + /// of GTK. + case versionMismatch + /// An object id occurred twice. + case duplicateId + /// A specified object type is of the same type or + /// derived from the type of the composite class being extended with builder XML. + case objectTypeRefused + /// The wrong type was specified in a composite class’s template XML + case templateMismatch + /// The specified property is unknown for the object class. + case invalidProperty + /// The specified signal is unknown for the object class. + case invalidSignal + /// An object id is unknown. + case invalidId + /// A function could not be found. This often happens + /// when symbols are set to be kept private. Compiling code with -rdynamic or using the + /// `gmodule-export-2.0` pkgconfig module can fix this problem. + case invalidFunction public static var type: GType { - gtk_builder_error_get_type() -} + gtk_builder_error_get_type() + } public init(from gtkEnum: GtkBuilderError) { switch gtkEnum { case GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION: - self = .invalidTypeFunction -case GTK_BUILDER_ERROR_UNHANDLED_TAG: - self = .unhandledTag -case GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: - self = .missingAttribute -case GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: - self = .invalidAttribute -case GTK_BUILDER_ERROR_INVALID_TAG: - self = .invalidTag -case GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: - self = .missingPropertyValue -case GTK_BUILDER_ERROR_INVALID_VALUE: - self = .invalidValue -case GTK_BUILDER_ERROR_VERSION_MISMATCH: - self = .versionMismatch -case GTK_BUILDER_ERROR_DUPLICATE_ID: - self = .duplicateId -case GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED: - self = .objectTypeRefused -case GTK_BUILDER_ERROR_TEMPLATE_MISMATCH: - self = .templateMismatch -case GTK_BUILDER_ERROR_INVALID_PROPERTY: - self = .invalidProperty -case GTK_BUILDER_ERROR_INVALID_SIGNAL: - self = .invalidSignal -case GTK_BUILDER_ERROR_INVALID_ID: - self = .invalidId -case GTK_BUILDER_ERROR_INVALID_FUNCTION: - self = .invalidFunction + self = .invalidTypeFunction + case GTK_BUILDER_ERROR_UNHANDLED_TAG: + self = .unhandledTag + case GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: + self = .missingAttribute + case GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: + self = .invalidAttribute + case GTK_BUILDER_ERROR_INVALID_TAG: + self = .invalidTag + case GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: + self = .missingPropertyValue + case GTK_BUILDER_ERROR_INVALID_VALUE: + self = .invalidValue + case GTK_BUILDER_ERROR_VERSION_MISMATCH: + self = .versionMismatch + case GTK_BUILDER_ERROR_DUPLICATE_ID: + self = .duplicateId + case GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED: + self = .objectTypeRefused + case GTK_BUILDER_ERROR_TEMPLATE_MISMATCH: + self = .templateMismatch + case GTK_BUILDER_ERROR_INVALID_PROPERTY: + self = .invalidProperty + case GTK_BUILDER_ERROR_INVALID_SIGNAL: + self = .invalidSignal + case GTK_BUILDER_ERROR_INVALID_ID: + self = .invalidId + case GTK_BUILDER_ERROR_INVALID_FUNCTION: + self = .invalidFunction default: fatalError("Unsupported GtkBuilderError enum value: \(gtkEnum.rawValue)") } @@ -91,35 +91,35 @@ case GTK_BUILDER_ERROR_INVALID_FUNCTION: public func toGtk() -> GtkBuilderError { switch self { case .invalidTypeFunction: - return GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION -case .unhandledTag: - return GTK_BUILDER_ERROR_UNHANDLED_TAG -case .missingAttribute: - return GTK_BUILDER_ERROR_MISSING_ATTRIBUTE -case .invalidAttribute: - return GTK_BUILDER_ERROR_INVALID_ATTRIBUTE -case .invalidTag: - return GTK_BUILDER_ERROR_INVALID_TAG -case .missingPropertyValue: - return GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE -case .invalidValue: - return GTK_BUILDER_ERROR_INVALID_VALUE -case .versionMismatch: - return GTK_BUILDER_ERROR_VERSION_MISMATCH -case .duplicateId: - return GTK_BUILDER_ERROR_DUPLICATE_ID -case .objectTypeRefused: - return GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED -case .templateMismatch: - return GTK_BUILDER_ERROR_TEMPLATE_MISMATCH -case .invalidProperty: - return GTK_BUILDER_ERROR_INVALID_PROPERTY -case .invalidSignal: - return GTK_BUILDER_ERROR_INVALID_SIGNAL -case .invalidId: - return GTK_BUILDER_ERROR_INVALID_ID -case .invalidFunction: - return GTK_BUILDER_ERROR_INVALID_FUNCTION + return GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION + case .unhandledTag: + return GTK_BUILDER_ERROR_UNHANDLED_TAG + case .missingAttribute: + return GTK_BUILDER_ERROR_MISSING_ATTRIBUTE + case .invalidAttribute: + return GTK_BUILDER_ERROR_INVALID_ATTRIBUTE + case .invalidTag: + return GTK_BUILDER_ERROR_INVALID_TAG + case .missingPropertyValue: + return GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE + case .invalidValue: + return GTK_BUILDER_ERROR_INVALID_VALUE + case .versionMismatch: + return GTK_BUILDER_ERROR_VERSION_MISMATCH + case .duplicateId: + return GTK_BUILDER_ERROR_DUPLICATE_ID + case .objectTypeRefused: + return GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED + case .templateMismatch: + return GTK_BUILDER_ERROR_TEMPLATE_MISMATCH + case .invalidProperty: + return GTK_BUILDER_ERROR_INVALID_PROPERTY + case .invalidSignal: + return GTK_BUILDER_ERROR_INVALID_SIGNAL + case .invalidId: + return GTK_BUILDER_ERROR_INVALID_ID + case .invalidFunction: + return GTK_BUILDER_ERROR_INVALID_FUNCTION } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/BuilderScope.swift b/Sources/Gtk/Generated/BuilderScope.swift index 3aae527b45..2390cbc4bf 100644 --- a/Sources/Gtk/Generated/BuilderScope.swift +++ b/Sources/Gtk/Generated/BuilderScope.swift @@ -1,24 +1,22 @@ import CGtk /// Provides language binding support to `GtkBuilder`. -/// +/// /// The goal of `GtkBuilderScope` is to look up programming-language-specific /// values for strings that are given in a `GtkBuilder` UI file. -/// +/// /// The primary intended audience is bindings that want to provide deeper /// integration of `GtkBuilder` into the language. -/// +/// /// A `GtkBuilderScope` instance may be used with multiple `GtkBuilder` objects, /// even at once. -/// +/// /// By default, GTK will use its own implementation of `GtkBuilderScope` /// for the C language which can be created via [ctor@Gtk.BuilderCScope.new]. -/// +/// /// If you implement `GtkBuilderScope` for a language binding, you /// may want to (partially) derive from or fall back to a [class@Gtk.BuilderCScope], /// as that class implements support for automatic lookups from C symbols. public protocol BuilderScope: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Button.swift b/Sources/Gtk/Generated/Button.swift index 32a2c7b9a1..b932a6ac92 100644 --- a/Sources/Gtk/Generated/Button.swift +++ b/Sources/Gtk/Generated/Button.swift @@ -1,224 +1,232 @@ import CGtk /// Calls a callback function when the button is clicked. -/// +/// /// An example GtkButton -/// +/// /// The `GtkButton` widget can hold any valid child widget. That is, it can hold /// almost any other standard `GtkWidget`. The most commonly used child is the /// `GtkLabel`. -/// +/// /// # Shortcuts and Gestures -/// +/// /// The following signals have default keybindings: -/// +/// /// - [signal@Gtk.Button::activate] -/// +/// /// # CSS nodes -/// +/// /// `GtkButton` has a single CSS node with name button. The node will get the /// style classes .image-button or .text-button, if the content is just an /// image or label, respectively. It may also receive the .flat style class. /// When activating a button via the keyboard, the button will temporarily /// gain the .keyboard-activating style class. -/// +/// /// Other style classes that are commonly used with `GtkButton` include /// .suggested-action and .destructive-action. In special cases, buttons /// can be made round by adding the .circular style class. -/// +/// /// Button-like widgets like [class@Gtk.ToggleButton], [class@Gtk.MenuButton], /// [class@Gtk.VolumeButton], [class@Gtk.LockButton], [class@Gtk.ColorButton] /// or [class@Gtk.FontButton] use style classes such as .toggle, .popup, .scale, /// .lock, .color on the button node to differentiate themselves from a plain /// `GtkButton`. -/// +/// /// # Accessibility -/// +/// /// `GtkButton` uses the [enum@Gtk.AccessibleRole.button] role. open class Button: Widget, Actionable { /// Creates a new `GtkButton` widget. -/// -/// To add a child widget to the button, use [method@Gtk.Button.set_child]. -public convenience init() { - self.init( - gtk_button_new() - ) -} - -/// Creates a new button containing an icon from the current icon theme. -/// -/// If the icon name isn’t known, a “broken image” icon will be -/// displayed instead. If the current icon theme is changed, the icon -/// will be updated appropriately. -public convenience init(iconName: String) { - self.init( - gtk_button_new_from_icon_name(iconName) - ) -} - -/// Creates a `GtkButton` widget with a `GtkLabel` child. -public convenience init(label: String) { - self.init( - gtk_button_new_with_label(label) - ) -} - -/// Creates a new `GtkButton` containing a label. -/// -/// If characters in @label are preceded by an underscore, they are underlined. -/// If you need a literal underscore character in a label, use “__” (two -/// underscores). The first underlined character represents a keyboard -/// accelerator called a mnemonic. Pressing Alt and that key -/// activates the button. -public convenience init(mnemonic label: String) { - self.init( - gtk_button_new_with_mnemonic(label) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) -} - -addSignal(name: "clicked") { [weak self] () in - guard let self = self else { return } - self.clicked?(self) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// + /// To add a child widget to the button, use [method@Gtk.Button.set_child]. + public convenience init() { + self.init( + gtk_button_new() + ) } -addSignal(name: "notify::can-shrink", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCanShrink?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new button containing an icon from the current icon theme. + /// + /// If the icon name isn’t known, a “broken image” icon will be + /// displayed instead. If the current icon theme is changed, the icon + /// will be updated appropriately. + public convenience init(iconName: String) { + self.init( + gtk_button_new_from_icon_name(iconName) + ) } -addSignal(name: "notify::child", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyChild?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a `GtkButton` widget with a `GtkLabel` child. + public convenience init(label: String) { + self.init( + gtk_button_new_with_label(label) + ) } -addSignal(name: "notify::has-frame", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasFrame?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new `GtkButton` containing a label. + /// + /// If characters in @label are preceded by an underscore, they are underlined. + /// If you need a literal underscore character in a label, use “__” (two + /// underscores). The first underlined character represents a keyboard + /// accelerator called a mnemonic. Pressing Alt and that key + /// activates the button. + public convenience init(mnemonic label: String) { + self.init( + gtk_button_new_with_mnemonic(label) + ) } -addSignal(name: "notify::icon-name", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIconName?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) + } + + addSignal(name: "clicked") { [weak self] () in + guard let self = self else { return } + self.clicked?(self) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::can-shrink", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCanShrink?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::child", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyChild?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::has-frame", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasFrame?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::icon-name", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIconName?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::label", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLabel?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-underline", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseUnderline?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::action-name", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionName?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::action-target", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionTarget?(self, param0) + } } -addSignal(name: "notify::label", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLabel?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::use-underline", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseUnderline?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::action-name", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionName?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::action-target", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionTarget?(self, param0) -} -} - /// Whether the button has a frame. -@GObjectProperty(named: "has-frame") public var hasFrame: Bool - -/// The name of the icon used to automatically populate the button. -@GObjectProperty(named: "icon-name") public var iconName: String? - -/// Text of the label inside the button, if the button contains a label widget. -@GObjectProperty(named: "label") public var label: String? - -/// If set, an underline in the text indicates that the following character is -/// to be used as mnemonic. -@GObjectProperty(named: "use-underline") public var useUnderline: Bool - -/// The name of the action with which this widget should be associated. -@GObjectProperty(named: "action-name") public var actionName: String? + @GObjectProperty(named: "has-frame") public var hasFrame: Bool -/// Emitted to animate press then release. -/// -/// This is an action signal. Applications should never connect -/// to this signal, but use the [signal@Gtk.Button::clicked] signal. -/// -/// The default bindings for this signal are all forms of the -/// and Enter keys. -public var activate: ((Button) -> Void)? + /// The name of the icon used to automatically populate the button. + @GObjectProperty(named: "icon-name") public var iconName: String? -/// Emitted when the button has been activated (pressed and released). -public var clicked: ((Button) -> Void)? + /// Text of the label inside the button, if the button contains a label widget. + @GObjectProperty(named: "label") public var label: String? + /// If set, an underline in the text indicates that the following character is + /// to be used as mnemonic. + @GObjectProperty(named: "use-underline") public var useUnderline: Bool -public var notifyCanShrink: ((Button, OpaquePointer) -> Void)? + /// The name of the action with which this widget should be associated. + @GObjectProperty(named: "action-name") public var actionName: String? + /// Emitted to animate press then release. + /// + /// This is an action signal. Applications should never connect + /// to this signal, but use the [signal@Gtk.Button::clicked] signal. + /// + /// The default bindings for this signal are all forms of the + /// and Enter keys. + public var activate: ((Button) -> Void)? -public var notifyChild: ((Button, OpaquePointer) -> Void)? + /// Emitted when the button has been activated (pressed and released). + public var clicked: ((Button) -> Void)? + public var notifyCanShrink: ((Button, OpaquePointer) -> Void)? -public var notifyHasFrame: ((Button, OpaquePointer) -> Void)? + public var notifyChild: ((Button, OpaquePointer) -> Void)? + public var notifyHasFrame: ((Button, OpaquePointer) -> Void)? -public var notifyIconName: ((Button, OpaquePointer) -> Void)? + public var notifyIconName: ((Button, OpaquePointer) -> Void)? + public var notifyLabel: ((Button, OpaquePointer) -> Void)? -public var notifyLabel: ((Button, OpaquePointer) -> Void)? + public var notifyUseUnderline: ((Button, OpaquePointer) -> Void)? + public var notifyActionName: ((Button, OpaquePointer) -> Void)? -public var notifyUseUnderline: ((Button, OpaquePointer) -> Void)? - - -public var notifyActionName: ((Button, OpaquePointer) -> Void)? - - -public var notifyActionTarget: ((Button, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyActionTarget: ((Button, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/ButtonsType.swift b/Sources/Gtk/Generated/ButtonsType.swift index daa430f79a..ae70565d91 100644 --- a/Sources/Gtk/Generated/ButtonsType.swift +++ b/Sources/Gtk/Generated/ButtonsType.swift @@ -1,10 +1,10 @@ import CGtk /// Prebuilt sets of buttons for `GtkDialog`. -/// +/// /// If none of these choices are appropriate, simply use /// %GTK_BUTTONS_NONE and call [method@Gtk.Dialog.add_buttons]. -/// +/// /// > Please note that %GTK_BUTTONS_OK, %GTK_BUTTONS_YES_NO /// > and %GTK_BUTTONS_OK_CANCEL are discouraged by the /// > [GNOME Human Interface Guidelines](https://developer.gnome.org/hig/). @@ -12,36 +12,36 @@ public enum ButtonsType: GValueRepresentableEnum { public typealias GtkEnum = GtkButtonsType /// No buttons at all -case none -/// An OK button -case ok -/// A Close button -case close -/// A Cancel button -case cancel -/// Yes and No buttons -case yesNo -/// OK and Cancel buttons -case okCancel + case none + /// An OK button + case ok + /// A Close button + case close + /// A Cancel button + case cancel + /// Yes and No buttons + case yesNo + /// OK and Cancel buttons + case okCancel public static var type: GType { - gtk_buttons_type_get_type() -} + gtk_buttons_type_get_type() + } public init(from gtkEnum: GtkButtonsType) { switch gtkEnum { case GTK_BUTTONS_NONE: - self = .none -case GTK_BUTTONS_OK: - self = .ok -case GTK_BUTTONS_CLOSE: - self = .close -case GTK_BUTTONS_CANCEL: - self = .cancel -case GTK_BUTTONS_YES_NO: - self = .yesNo -case GTK_BUTTONS_OK_CANCEL: - self = .okCancel + self = .none + case GTK_BUTTONS_OK: + self = .ok + case GTK_BUTTONS_CLOSE: + self = .close + case GTK_BUTTONS_CANCEL: + self = .cancel + case GTK_BUTTONS_YES_NO: + self = .yesNo + case GTK_BUTTONS_OK_CANCEL: + self = .okCancel default: fatalError("Unsupported GtkButtonsType enum value: \(gtkEnum.rawValue)") } @@ -50,17 +50,17 @@ case GTK_BUTTONS_OK_CANCEL: public func toGtk() -> GtkButtonsType { switch self { case .none: - return GTK_BUTTONS_NONE -case .ok: - return GTK_BUTTONS_OK -case .close: - return GTK_BUTTONS_CLOSE -case .cancel: - return GTK_BUTTONS_CANCEL -case .yesNo: - return GTK_BUTTONS_YES_NO -case .okCancel: - return GTK_BUTTONS_OK_CANCEL + return GTK_BUTTONS_NONE + case .ok: + return GTK_BUTTONS_OK + case .close: + return GTK_BUTTONS_CLOSE + case .cancel: + return GTK_BUTTONS_CANCEL + case .yesNo: + return GTK_BUTTONS_YES_NO + case .okCancel: + return GTK_BUTTONS_OK_CANCEL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/CellEditable.swift b/Sources/Gtk/Generated/CellEditable.swift index 918485f6a2..fa4c171a02 100644 --- a/Sources/Gtk/Generated/CellEditable.swift +++ b/Sources/Gtk/Generated/CellEditable.swift @@ -1,37 +1,36 @@ import CGtk /// Interface for widgets that can be used for editing cells -/// +/// /// The `GtkCellEditable` interface must be implemented for widgets to be usable /// to edit the contents of a `GtkTreeView` cell. It provides a way to specify how /// temporary widgets should be configured for editing, get the new value, etc. public protocol CellEditable: GObjectRepresentable { - /// This signal is a sign for the cell renderer to update its -/// value from the @cell_editable. -/// -/// Implementations of `GtkCellEditable` are responsible for -/// emitting this signal when they are done editing, e.g. -/// `GtkEntry` emits this signal when the user presses Enter. Typical things to -/// do in a handler for ::editing-done are to capture the edited value, -/// disconnect the @cell_editable from signals on the `GtkCellRenderer`, etc. -/// -/// gtk_cell_editable_editing_done() is a convenience method -/// for emitting `GtkCellEditable::editing-done`. -var editingDone: ((Self) -> Void)? { get set } + /// value from the @cell_editable. + /// + /// Implementations of `GtkCellEditable` are responsible for + /// emitting this signal when they are done editing, e.g. + /// `GtkEntry` emits this signal when the user presses Enter. Typical things to + /// do in a handler for ::editing-done are to capture the edited value, + /// disconnect the @cell_editable from signals on the `GtkCellRenderer`, etc. + /// + /// gtk_cell_editable_editing_done() is a convenience method + /// for emitting `GtkCellEditable::editing-done`. + var editingDone: ((Self) -> Void)? { get set } -/// This signal is meant to indicate that the cell is finished -/// editing, and the @cell_editable widget is being removed and may -/// subsequently be destroyed. -/// -/// Implementations of `GtkCellEditable` are responsible for -/// emitting this signal when they are done editing. It must -/// be emitted after the `GtkCellEditable::editing-done` signal, -/// to give the cell renderer a chance to update the cell's value -/// before the widget is removed. -/// -/// gtk_cell_editable_remove_widget() is a convenience method -/// for emitting `GtkCellEditable::remove-widget`. -var removeWidget: ((Self) -> Void)? { get set } -} \ No newline at end of file + /// This signal is meant to indicate that the cell is finished + /// editing, and the @cell_editable widget is being removed and may + /// subsequently be destroyed. + /// + /// Implementations of `GtkCellEditable` are responsible for + /// emitting this signal when they are done editing. It must + /// be emitted after the `GtkCellEditable::editing-done` signal, + /// to give the cell renderer a chance to update the cell's value + /// before the widget is removed. + /// + /// gtk_cell_editable_remove_widget() is a convenience method + /// for emitting `GtkCellEditable::remove-widget`. + var removeWidget: ((Self) -> Void)? { get set } +} diff --git a/Sources/Gtk/Generated/CellLayout.swift b/Sources/Gtk/Generated/CellLayout.swift index 51c91867db..2aa7aa88b5 100644 --- a/Sources/Gtk/Generated/CellLayout.swift +++ b/Sources/Gtk/Generated/CellLayout.swift @@ -1,11 +1,11 @@ import CGtk /// An interface for packing cells -/// +/// /// `GtkCellLayout` is an interface to be implemented by all objects which /// want to provide a `GtkTreeViewColumn` like API for packing cells, /// setting attributes and data funcs. -/// +/// /// One of the notable features provided by implementations of /// `GtkCellLayout` are attributes. Attributes let you set the properties /// in flexible ways. They can just be set to constant values like regular @@ -15,9 +15,9 @@ import CGtk /// the cell renderer. Finally, it is possible to specify a function with /// gtk_cell_layout_set_cell_data_func() that is called to determine the /// value of the attribute for each cell that is rendered. -/// +/// /// ## GtkCellLayouts as GtkBuildable -/// +/// /// Implementations of GtkCellLayout which also implement the GtkBuildable /// interface (`GtkCellView`, `GtkIconView`, `GtkComboBox`, /// `GtkEntryCompletion`, `GtkTreeViewColumn`) accept `GtkCellRenderer` objects @@ -26,38 +26,38 @@ import CGtk /// elements. Each `` element has a name attribute which specifies /// a property of the cell renderer; the content of the element is the /// attribute value. -/// +/// /// This is an example of a UI definition fragment specifying attributes: -/// +/// /// ```xml /// 0 /// ``` -/// +/// /// Furthermore for implementations of `GtkCellLayout` that use a `GtkCellArea` /// to lay out cells (all `GtkCellLayout`s in GTK use a `GtkCellArea`) /// [cell properties](class.CellArea.html#cell-properties) can also be defined /// in the format by specifying the custom `` attribute which can /// contain multiple `` elements. -/// +/// /// Here is a UI definition fragment specifying cell properties: -/// +/// /// ```xml /// TrueFalse /// ``` -/// +/// /// ## Subclassing GtkCellLayout implementations -/// +/// /// When subclassing a widget that implements `GtkCellLayout` like /// `GtkIconView` or `GtkComboBox`, there are some considerations related /// to the fact that these widgets internally use a `GtkCellArea`. /// The cell area is exposed as a construct-only property by these /// widgets. This means that it is possible to e.g. do -/// +/// /// ```c /// GtkWIdget *combo = /// g_object_new (GTK_TYPE_COMBO_BOX, "cell-area", my_cell_area, NULL); /// ``` -/// +/// /// to use a custom cell area with a combo box. But construct properties /// are only initialized after instance `init()` /// functions have run, which means that using functions which rely on @@ -65,21 +65,21 @@ import CGtk /// cause the default cell area to be instantiated. In this case, a provided /// construct property value will be ignored (with a warning, to alert /// you to the problem). -/// +/// /// ```c /// static void /// my_combo_box_init (MyComboBox *b) /// { /// GtkCellRenderer *cell; -/// +/// /// cell = gtk_cell_renderer_pixbuf_new (); -/// +/// /// // The following call causes the default cell area for combo boxes, /// // a GtkCellAreaBox, to be instantiated /// gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (b), cell, FALSE); /// ... /// } -/// +/// /// GtkWidget * /// my_combo_box_new (GtkCellArea *area) /// { @@ -87,14 +87,12 @@ import CGtk /// return g_object_new (MY_TYPE_COMBO_BOX, "cell-area", area, NULL); /// } /// ``` -/// +/// /// If supporting alternative cell areas with your derived widget is /// not important, then this does not have to concern you. If you want /// to support alternative cell areas, you can do so by moving the /// problematic calls out of `init()` and into a `constructor()` /// for your class. public protocol CellLayout: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/CellRendererAccelMode.swift b/Sources/Gtk/Generated/CellRendererAccelMode.swift index 4952def369..80a29bf5bd 100644 --- a/Sources/Gtk/Generated/CellRendererAccelMode.swift +++ b/Sources/Gtk/Generated/CellRendererAccelMode.swift @@ -5,20 +5,20 @@ public enum CellRendererAccelMode: GValueRepresentableEnum { public typealias GtkEnum = GtkCellRendererAccelMode /// GTK accelerators mode -case gtk -/// Other accelerator mode -case other + case gtk + /// Other accelerator mode + case other public static var type: GType { - gtk_cell_renderer_accel_mode_get_type() -} + gtk_cell_renderer_accel_mode_get_type() + } public init(from gtkEnum: GtkCellRendererAccelMode) { switch gtkEnum { case GTK_CELL_RENDERER_ACCEL_MODE_GTK: - self = .gtk -case GTK_CELL_RENDERER_ACCEL_MODE_OTHER: - self = .other + self = .gtk + case GTK_CELL_RENDERER_ACCEL_MODE_OTHER: + self = .other default: fatalError("Unsupported GtkCellRendererAccelMode enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ case GTK_CELL_RENDERER_ACCEL_MODE_OTHER: public func toGtk() -> GtkCellRendererAccelMode { switch self { case .gtk: - return GTK_CELL_RENDERER_ACCEL_MODE_GTK -case .other: - return GTK_CELL_RENDERER_ACCEL_MODE_OTHER + return GTK_CELL_RENDERER_ACCEL_MODE_GTK + case .other: + return GTK_CELL_RENDERER_ACCEL_MODE_OTHER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/CellRendererMode.swift b/Sources/Gtk/Generated/CellRendererMode.swift index 74d702f294..b073354ea2 100644 --- a/Sources/Gtk/Generated/CellRendererMode.swift +++ b/Sources/Gtk/Generated/CellRendererMode.swift @@ -5,27 +5,27 @@ public enum CellRendererMode: GValueRepresentableEnum { public typealias GtkEnum = GtkCellRendererMode /// The cell is just for display -/// and cannot be interacted with. Note that this doesn’t mean that eg. the -/// row being drawn can’t be selected -- just that a particular element of -/// it cannot be individually modified. -case inert -/// The cell can be clicked. -case activatable -/// The cell can be edited or otherwise modified. -case editable + /// and cannot be interacted with. Note that this doesn’t mean that eg. the + /// row being drawn can’t be selected -- just that a particular element of + /// it cannot be individually modified. + case inert + /// The cell can be clicked. + case activatable + /// The cell can be edited or otherwise modified. + case editable public static var type: GType { - gtk_cell_renderer_mode_get_type() -} + gtk_cell_renderer_mode_get_type() + } public init(from gtkEnum: GtkCellRendererMode) { switch gtkEnum { case GTK_CELL_RENDERER_MODE_INERT: - self = .inert -case GTK_CELL_RENDERER_MODE_ACTIVATABLE: - self = .activatable -case GTK_CELL_RENDERER_MODE_EDITABLE: - self = .editable + self = .inert + case GTK_CELL_RENDERER_MODE_ACTIVATABLE: + self = .activatable + case GTK_CELL_RENDERER_MODE_EDITABLE: + self = .editable default: fatalError("Unsupported GtkCellRendererMode enum value: \(gtkEnum.rawValue)") } @@ -34,11 +34,11 @@ case GTK_CELL_RENDERER_MODE_EDITABLE: public func toGtk() -> GtkCellRendererMode { switch self { case .inert: - return GTK_CELL_RENDERER_MODE_INERT -case .activatable: - return GTK_CELL_RENDERER_MODE_ACTIVATABLE -case .editable: - return GTK_CELL_RENDERER_MODE_EDITABLE + return GTK_CELL_RENDERER_MODE_INERT + case .activatable: + return GTK_CELL_RENDERER_MODE_ACTIVATABLE + case .editable: + return GTK_CELL_RENDERER_MODE_EDITABLE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/CheckButton.swift b/Sources/Gtk/Generated/CheckButton.swift index 9c15409bac..287ea926a3 100644 --- a/Sources/Gtk/Generated/CheckButton.swift +++ b/Sources/Gtk/Generated/CheckButton.swift @@ -1,243 +1,251 @@ import CGtk /// Places a label next to an indicator. -/// +/// /// Example GtkCheckButtons -/// +/// /// A `GtkCheckButton` is created by calling either [ctor@Gtk.CheckButton.new] /// or [ctor@Gtk.CheckButton.new_with_label]. -/// +/// /// The state of a `GtkCheckButton` can be set specifically using /// [method@Gtk.CheckButton.set_active], and retrieved using /// [method@Gtk.CheckButton.get_active]. -/// +/// /// # Inconsistent state -/// +/// /// In addition to "on" and "off", check buttons can be an /// "in between" state that is neither on nor off. This can be used /// e.g. when the user has selected a range of elements (such as some /// text or spreadsheet cells) that are affected by a check button, /// and the current values in that range are inconsistent. -/// +/// /// To set a `GtkCheckButton` to inconsistent state, use /// [method@Gtk.CheckButton.set_inconsistent]. -/// +/// /// # Grouping -/// +/// /// Check buttons can be grouped together, to form mutually exclusive /// groups - only one of the buttons can be toggled at a time, and toggling /// another one will switch the currently toggled one off. -/// +/// /// Grouped check buttons use a different indicator, and are commonly referred /// to as *radio buttons*. -/// +/// /// Example GtkRadioButtons -/// +/// /// To add a `GtkCheckButton` to a group, use [method@Gtk.CheckButton.set_group]. -/// +/// /// When the code must keep track of the state of a group of radio buttons, it /// is recommended to keep track of such state through a stateful /// `GAction` with a target for each button. Using the `toggled` signals to keep /// track of the group changes and state is discouraged. -/// +/// /// # Shortcuts and Gestures -/// +/// /// `GtkCheckButton` supports the following keyboard shortcuts: -/// +/// /// - or Enter activates the button. -/// +/// /// # CSS nodes -/// +/// /// ``` /// checkbutton[.text-button][.grouped] /// ├── check /// ╰── [label] /// ``` -/// +/// /// A `GtkCheckButton` has a main node with name checkbutton. If the /// [property@Gtk.CheckButton:label] or [property@Gtk.CheckButton:child] /// properties are set, it contains a child widget. The indicator node /// is named check when no group is set, and radio if the checkbutton /// is grouped together with other checkbuttons. -/// +/// /// # Accessibility -/// +/// /// `GtkCheckButton` uses the [enum@Gtk.AccessibleRole.checkbox] role. open class CheckButton: Widget, Actionable { /// Creates a new `GtkCheckButton`. -public convenience init() { - self.init( - gtk_check_button_new() - ) -} - -/// Creates a new `GtkCheckButton` with the given text. -public convenience init(label: String) { - self.init( - gtk_check_button_new_with_label(label) - ) -} - -/// Creates a new `GtkCheckButton` with the given text and a mnemonic. -public convenience init(mnemonic label: String) { - self.init( - gtk_check_button_new_with_mnemonic(label) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) -} - -addSignal(name: "toggled") { [weak self] () in - guard let self = self else { return } - self.toggled?(self) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_check_button_new() + ) } -addSignal(name: "notify::active", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActive?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new `GtkCheckButton` with the given text. + public convenience init(label: String) { + self.init( + gtk_check_button_new_with_label(label) + ) } -addSignal(name: "notify::child", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyChild?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new `GtkCheckButton` with the given text and a mnemonic. + public convenience init(mnemonic label: String) { + self.init( + gtk_check_button_new_with_mnemonic(label) + ) } -addSignal(name: "notify::group", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyGroup?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) + } + + addSignal(name: "toggled") { [weak self] () in + guard let self = self else { return } + self.toggled?(self) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::active", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActive?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::child", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyChild?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::group", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyGroup?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::inconsistent", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInconsistent?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::label", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLabel?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-underline", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseUnderline?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::action-name", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionName?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::action-target", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionTarget?(self, param0) + } } -addSignal(name: "notify::inconsistent", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInconsistent?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::label", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLabel?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::use-underline", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseUnderline?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::action-name", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionName?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::action-target", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionTarget?(self, param0) -} -} - /// If the check button is active. -/// -/// Setting `active` to %TRUE will add the `:checked:` state to both -/// the check button and the indicator CSS node. -@GObjectProperty(named: "active") public var active: Bool - -/// If the check button is in an “in between” state. -/// -/// The inconsistent state only affects visual appearance, -/// not the semantics of the button. -@GObjectProperty(named: "inconsistent") public var inconsistent: Bool - -/// Text of the label inside the check button, if it contains a label widget. -@GObjectProperty(named: "label") public var label: String? - -/// If set, an underline in the text indicates that the following -/// character is to be used as mnemonic. -@GObjectProperty(named: "use-underline") public var useUnderline: Bool - -/// The name of the action with which this widget should be associated. -@GObjectProperty(named: "action-name") public var actionName: String? + /// + /// Setting `active` to %TRUE will add the `:checked:` state to both + /// the check button and the indicator CSS node. + @GObjectProperty(named: "active") public var active: Bool -/// Emitted to when the check button is activated. -/// -/// The `::activate` signal on `GtkCheckButton` is an action signal and -/// emitting it causes the button to animate press then release. -/// -/// Applications should never connect to this signal, but use the -/// [signal@Gtk.CheckButton::toggled] signal. -/// -/// The default bindings for this signal are all forms of the -/// and Enter keys. -public var activate: ((CheckButton) -> Void)? + /// If the check button is in an “in between” state. + /// + /// The inconsistent state only affects visual appearance, + /// not the semantics of the button. + @GObjectProperty(named: "inconsistent") public var inconsistent: Bool -/// Emitted when the buttons's [property@Gtk.CheckButton:active] -/// property changes. -public var toggled: ((CheckButton) -> Void)? + /// Text of the label inside the check button, if it contains a label widget. + @GObjectProperty(named: "label") public var label: String? + /// If set, an underline in the text indicates that the following + /// character is to be used as mnemonic. + @GObjectProperty(named: "use-underline") public var useUnderline: Bool -public var notifyActive: ((CheckButton, OpaquePointer) -> Void)? + /// The name of the action with which this widget should be associated. + @GObjectProperty(named: "action-name") public var actionName: String? + /// Emitted to when the check button is activated. + /// + /// The `::activate` signal on `GtkCheckButton` is an action signal and + /// emitting it causes the button to animate press then release. + /// + /// Applications should never connect to this signal, but use the + /// [signal@Gtk.CheckButton::toggled] signal. + /// + /// The default bindings for this signal are all forms of the + /// and Enter keys. + public var activate: ((CheckButton) -> Void)? -public var notifyChild: ((CheckButton, OpaquePointer) -> Void)? + /// Emitted when the buttons's [property@Gtk.CheckButton:active] + /// property changes. + public var toggled: ((CheckButton) -> Void)? + public var notifyActive: ((CheckButton, OpaquePointer) -> Void)? -public var notifyGroup: ((CheckButton, OpaquePointer) -> Void)? + public var notifyChild: ((CheckButton, OpaquePointer) -> Void)? + public var notifyGroup: ((CheckButton, OpaquePointer) -> Void)? -public var notifyInconsistent: ((CheckButton, OpaquePointer) -> Void)? + public var notifyInconsistent: ((CheckButton, OpaquePointer) -> Void)? + public var notifyLabel: ((CheckButton, OpaquePointer) -> Void)? -public var notifyLabel: ((CheckButton, OpaquePointer) -> Void)? + public var notifyUseUnderline: ((CheckButton, OpaquePointer) -> Void)? + public var notifyActionName: ((CheckButton, OpaquePointer) -> Void)? -public var notifyUseUnderline: ((CheckButton, OpaquePointer) -> Void)? - - -public var notifyActionName: ((CheckButton, OpaquePointer) -> Void)? - - -public var notifyActionTarget: ((CheckButton, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyActionTarget: ((CheckButton, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/ConstraintAttribute.swift b/Sources/Gtk/Generated/ConstraintAttribute.swift index 1e5c0ce066..1bc24638df 100644 --- a/Sources/Gtk/Generated/ConstraintAttribute.swift +++ b/Sources/Gtk/Generated/ConstraintAttribute.swift @@ -5,69 +5,69 @@ public enum ConstraintAttribute: GValueRepresentableEnum { public typealias GtkEnum = GtkConstraintAttribute /// No attribute, used for constant -/// relations -case none -/// The left edge of a widget, regardless of -/// text direction -case left -/// The right edge of a widget, regardless -/// of text direction -case right -/// The top edge of a widget -case top -/// The bottom edge of a widget -case bottom -/// The leading edge of a widget, depending -/// on text direction; equivalent to %GTK_CONSTRAINT_ATTRIBUTE_LEFT for LTR -/// languages, and %GTK_CONSTRAINT_ATTRIBUTE_RIGHT for RTL ones -case start -/// The trailing edge of a widget, depending -/// on text direction; equivalent to %GTK_CONSTRAINT_ATTRIBUTE_RIGHT for LTR -/// languages, and %GTK_CONSTRAINT_ATTRIBUTE_LEFT for RTL ones -case end -/// The width of a widget -case width -/// The height of a widget -case height -/// The center of a widget, on the -/// horizontal axis -case centerX -/// The center of a widget, on the -/// vertical axis -case centerY -/// The baseline of a widget -case baseline + /// relations + case none + /// The left edge of a widget, regardless of + /// text direction + case left + /// The right edge of a widget, regardless + /// of text direction + case right + /// The top edge of a widget + case top + /// The bottom edge of a widget + case bottom + /// The leading edge of a widget, depending + /// on text direction; equivalent to %GTK_CONSTRAINT_ATTRIBUTE_LEFT for LTR + /// languages, and %GTK_CONSTRAINT_ATTRIBUTE_RIGHT for RTL ones + case start + /// The trailing edge of a widget, depending + /// on text direction; equivalent to %GTK_CONSTRAINT_ATTRIBUTE_RIGHT for LTR + /// languages, and %GTK_CONSTRAINT_ATTRIBUTE_LEFT for RTL ones + case end + /// The width of a widget + case width + /// The height of a widget + case height + /// The center of a widget, on the + /// horizontal axis + case centerX + /// The center of a widget, on the + /// vertical axis + case centerY + /// The baseline of a widget + case baseline public static var type: GType { - gtk_constraint_attribute_get_type() -} + gtk_constraint_attribute_get_type() + } public init(from gtkEnum: GtkConstraintAttribute) { switch gtkEnum { case GTK_CONSTRAINT_ATTRIBUTE_NONE: - self = .none -case GTK_CONSTRAINT_ATTRIBUTE_LEFT: - self = .left -case GTK_CONSTRAINT_ATTRIBUTE_RIGHT: - self = .right -case GTK_CONSTRAINT_ATTRIBUTE_TOP: - self = .top -case GTK_CONSTRAINT_ATTRIBUTE_BOTTOM: - self = .bottom -case GTK_CONSTRAINT_ATTRIBUTE_START: - self = .start -case GTK_CONSTRAINT_ATTRIBUTE_END: - self = .end -case GTK_CONSTRAINT_ATTRIBUTE_WIDTH: - self = .width -case GTK_CONSTRAINT_ATTRIBUTE_HEIGHT: - self = .height -case GTK_CONSTRAINT_ATTRIBUTE_CENTER_X: - self = .centerX -case GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y: - self = .centerY -case GTK_CONSTRAINT_ATTRIBUTE_BASELINE: - self = .baseline + self = .none + case GTK_CONSTRAINT_ATTRIBUTE_LEFT: + self = .left + case GTK_CONSTRAINT_ATTRIBUTE_RIGHT: + self = .right + case GTK_CONSTRAINT_ATTRIBUTE_TOP: + self = .top + case GTK_CONSTRAINT_ATTRIBUTE_BOTTOM: + self = .bottom + case GTK_CONSTRAINT_ATTRIBUTE_START: + self = .start + case GTK_CONSTRAINT_ATTRIBUTE_END: + self = .end + case GTK_CONSTRAINT_ATTRIBUTE_WIDTH: + self = .width + case GTK_CONSTRAINT_ATTRIBUTE_HEIGHT: + self = .height + case GTK_CONSTRAINT_ATTRIBUTE_CENTER_X: + self = .centerX + case GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y: + self = .centerY + case GTK_CONSTRAINT_ATTRIBUTE_BASELINE: + self = .baseline default: fatalError("Unsupported GtkConstraintAttribute enum value: \(gtkEnum.rawValue)") } @@ -76,29 +76,29 @@ case GTK_CONSTRAINT_ATTRIBUTE_BASELINE: public func toGtk() -> GtkConstraintAttribute { switch self { case .none: - return GTK_CONSTRAINT_ATTRIBUTE_NONE -case .left: - return GTK_CONSTRAINT_ATTRIBUTE_LEFT -case .right: - return GTK_CONSTRAINT_ATTRIBUTE_RIGHT -case .top: - return GTK_CONSTRAINT_ATTRIBUTE_TOP -case .bottom: - return GTK_CONSTRAINT_ATTRIBUTE_BOTTOM -case .start: - return GTK_CONSTRAINT_ATTRIBUTE_START -case .end: - return GTK_CONSTRAINT_ATTRIBUTE_END -case .width: - return GTK_CONSTRAINT_ATTRIBUTE_WIDTH -case .height: - return GTK_CONSTRAINT_ATTRIBUTE_HEIGHT -case .centerX: - return GTK_CONSTRAINT_ATTRIBUTE_CENTER_X -case .centerY: - return GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y -case .baseline: - return GTK_CONSTRAINT_ATTRIBUTE_BASELINE + return GTK_CONSTRAINT_ATTRIBUTE_NONE + case .left: + return GTK_CONSTRAINT_ATTRIBUTE_LEFT + case .right: + return GTK_CONSTRAINT_ATTRIBUTE_RIGHT + case .top: + return GTK_CONSTRAINT_ATTRIBUTE_TOP + case .bottom: + return GTK_CONSTRAINT_ATTRIBUTE_BOTTOM + case .start: + return GTK_CONSTRAINT_ATTRIBUTE_START + case .end: + return GTK_CONSTRAINT_ATTRIBUTE_END + case .width: + return GTK_CONSTRAINT_ATTRIBUTE_WIDTH + case .height: + return GTK_CONSTRAINT_ATTRIBUTE_HEIGHT + case .centerX: + return GTK_CONSTRAINT_ATTRIBUTE_CENTER_X + case .centerY: + return GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y + case .baseline: + return GTK_CONSTRAINT_ATTRIBUTE_BASELINE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ConstraintRelation.swift b/Sources/Gtk/Generated/ConstraintRelation.swift index 78cd718df6..58e75a256e 100644 --- a/Sources/Gtk/Generated/ConstraintRelation.swift +++ b/Sources/Gtk/Generated/ConstraintRelation.swift @@ -5,24 +5,24 @@ public enum ConstraintRelation: GValueRepresentableEnum { public typealias GtkEnum = GtkConstraintRelation /// Less than, or equal -case le -/// Equal -case eq -/// Greater than, or equal -case ge + case le + /// Equal + case eq + /// Greater than, or equal + case ge public static var type: GType { - gtk_constraint_relation_get_type() -} + gtk_constraint_relation_get_type() + } public init(from gtkEnum: GtkConstraintRelation) { switch gtkEnum { case GTK_CONSTRAINT_RELATION_LE: - self = .le -case GTK_CONSTRAINT_RELATION_EQ: - self = .eq -case GTK_CONSTRAINT_RELATION_GE: - self = .ge + self = .le + case GTK_CONSTRAINT_RELATION_EQ: + self = .eq + case GTK_CONSTRAINT_RELATION_GE: + self = .ge default: fatalError("Unsupported GtkConstraintRelation enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ case GTK_CONSTRAINT_RELATION_GE: public func toGtk() -> GtkConstraintRelation { switch self { case .le: - return GTK_CONSTRAINT_RELATION_LE -case .eq: - return GTK_CONSTRAINT_RELATION_EQ -case .ge: - return GTK_CONSTRAINT_RELATION_GE + return GTK_CONSTRAINT_RELATION_LE + case .eq: + return GTK_CONSTRAINT_RELATION_EQ + case .ge: + return GTK_CONSTRAINT_RELATION_GE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ConstraintStrength.swift b/Sources/Gtk/Generated/ConstraintStrength.swift index 56e0c59e20..0e0fa5367b 100644 --- a/Sources/Gtk/Generated/ConstraintStrength.swift +++ b/Sources/Gtk/Generated/ConstraintStrength.swift @@ -1,35 +1,35 @@ import CGtk /// The strength of a constraint, expressed as a symbolic constant. -/// +/// /// The strength of a [class@Constraint] can be expressed with any positive /// integer; the values of this enumeration can be used for readability. public enum ConstraintStrength: GValueRepresentableEnum { public typealias GtkEnum = GtkConstraintStrength /// The constraint is required towards solving the layout -case required -/// A strong constraint -case strong -/// A medium constraint -case medium -/// A weak constraint -case weak + case required + /// A strong constraint + case strong + /// A medium constraint + case medium + /// A weak constraint + case weak public static var type: GType { - gtk_constraint_strength_get_type() -} + gtk_constraint_strength_get_type() + } public init(from gtkEnum: GtkConstraintStrength) { switch gtkEnum { case GTK_CONSTRAINT_STRENGTH_REQUIRED: - self = .required -case GTK_CONSTRAINT_STRENGTH_STRONG: - self = .strong -case GTK_CONSTRAINT_STRENGTH_MEDIUM: - self = .medium -case GTK_CONSTRAINT_STRENGTH_WEAK: - self = .weak + self = .required + case GTK_CONSTRAINT_STRENGTH_STRONG: + self = .strong + case GTK_CONSTRAINT_STRENGTH_MEDIUM: + self = .medium + case GTK_CONSTRAINT_STRENGTH_WEAK: + self = .weak default: fatalError("Unsupported GtkConstraintStrength enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ case GTK_CONSTRAINT_STRENGTH_WEAK: public func toGtk() -> GtkConstraintStrength { switch self { case .required: - return GTK_CONSTRAINT_STRENGTH_REQUIRED -case .strong: - return GTK_CONSTRAINT_STRENGTH_STRONG -case .medium: - return GTK_CONSTRAINT_STRENGTH_MEDIUM -case .weak: - return GTK_CONSTRAINT_STRENGTH_WEAK + return GTK_CONSTRAINT_STRENGTH_REQUIRED + case .strong: + return GTK_CONSTRAINT_STRENGTH_STRONG + case .medium: + return GTK_CONSTRAINT_STRENGTH_MEDIUM + case .weak: + return GTK_CONSTRAINT_STRENGTH_WEAK } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ConstraintTarget.swift b/Sources/Gtk/Generated/ConstraintTarget.swift index 222de0a185..07bfaf33b9 100644 --- a/Sources/Gtk/Generated/ConstraintTarget.swift +++ b/Sources/Gtk/Generated/ConstraintTarget.swift @@ -2,10 +2,8 @@ import CGtk /// Makes it possible to use an object as source or target in a /// [class@Gtk.Constraint]. -/// +/// /// Besides `GtkWidget`, it is also implemented by `GtkConstraintGuide`. public protocol ConstraintTarget: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ConstraintVflParserError.swift b/Sources/Gtk/Generated/ConstraintVflParserError.swift index 8bda010e9e..1b485c06f8 100644 --- a/Sources/Gtk/Generated/ConstraintVflParserError.swift +++ b/Sources/Gtk/Generated/ConstraintVflParserError.swift @@ -5,55 +5,56 @@ public enum ConstraintVflParserError: GValueRepresentableEnum { public typealias GtkEnum = GtkConstraintVflParserError /// Invalid or unknown symbol -case symbol -/// Invalid or unknown attribute -case attribute -/// Invalid or unknown view -case view -/// Invalid or unknown metric -case metric -/// Invalid or unknown priority -case priority -/// Invalid or unknown relation -case relation + case symbol + /// Invalid or unknown attribute + case attribute + /// Invalid or unknown view + case view + /// Invalid or unknown metric + case metric + /// Invalid or unknown priority + case priority + /// Invalid or unknown relation + case relation public static var type: GType { - gtk_constraint_vfl_parser_error_get_type() -} + gtk_constraint_vfl_parser_error_get_type() + } public init(from gtkEnum: GtkConstraintVflParserError) { switch gtkEnum { case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL: - self = .symbol -case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE: - self = .attribute -case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW: - self = .view -case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC: - self = .metric -case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY: - self = .priority -case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION: - self = .relation + self = .symbol + case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE: + self = .attribute + case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW: + self = .view + case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC: + self = .metric + case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY: + self = .priority + case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION: + self = .relation default: - fatalError("Unsupported GtkConstraintVflParserError enum value: \(gtkEnum.rawValue)") + fatalError( + "Unsupported GtkConstraintVflParserError enum value: \(gtkEnum.rawValue)") } } public func toGtk() -> GtkConstraintVflParserError { switch self { case .symbol: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL -case .attribute: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE -case .view: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW -case .metric: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC -case .priority: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY -case .relation: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL + case .attribute: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE + case .view: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW + case .metric: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC + case .priority: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY + case .relation: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/CornerType.swift b/Sources/Gtk/Generated/CornerType.swift index 4224f19381..8d6999bae6 100644 --- a/Sources/Gtk/Generated/CornerType.swift +++ b/Sources/Gtk/Generated/CornerType.swift @@ -2,38 +2,38 @@ import CGtk /// Specifies which corner a child widget should be placed in when packed into /// a `GtkScrolledWindow.` -/// +/// /// This is effectively the opposite of where the scroll bars are placed. public enum CornerType: GValueRepresentableEnum { public typealias GtkEnum = GtkCornerType /// Place the scrollbars on the right and bottom of the -/// widget (default behaviour). -case topLeft -/// Place the scrollbars on the top and right of the -/// widget. -case bottomLeft -/// Place the scrollbars on the left and bottom of the -/// widget. -case topRight -/// Place the scrollbars on the top and left of the -/// widget. -case bottomRight + /// widget (default behaviour). + case topLeft + /// Place the scrollbars on the top and right of the + /// widget. + case bottomLeft + /// Place the scrollbars on the left and bottom of the + /// widget. + case topRight + /// Place the scrollbars on the top and left of the + /// widget. + case bottomRight public static var type: GType { - gtk_corner_type_get_type() -} + gtk_corner_type_get_type() + } public init(from gtkEnum: GtkCornerType) { switch gtkEnum { case GTK_CORNER_TOP_LEFT: - self = .topLeft -case GTK_CORNER_BOTTOM_LEFT: - self = .bottomLeft -case GTK_CORNER_TOP_RIGHT: - self = .topRight -case GTK_CORNER_BOTTOM_RIGHT: - self = .bottomRight + self = .topLeft + case GTK_CORNER_BOTTOM_LEFT: + self = .bottomLeft + case GTK_CORNER_TOP_RIGHT: + self = .topRight + case GTK_CORNER_BOTTOM_RIGHT: + self = .bottomRight default: fatalError("Unsupported GtkCornerType enum value: \(gtkEnum.rawValue)") } @@ -42,13 +42,13 @@ case GTK_CORNER_BOTTOM_RIGHT: public func toGtk() -> GtkCornerType { switch self { case .topLeft: - return GTK_CORNER_TOP_LEFT -case .bottomLeft: - return GTK_CORNER_BOTTOM_LEFT -case .topRight: - return GTK_CORNER_TOP_RIGHT -case .bottomRight: - return GTK_CORNER_BOTTOM_RIGHT + return GTK_CORNER_TOP_LEFT + case .bottomLeft: + return GTK_CORNER_BOTTOM_LEFT + case .topRight: + return GTK_CORNER_TOP_RIGHT + case .bottomRight: + return GTK_CORNER_BOTTOM_RIGHT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/CssParserError.swift b/Sources/Gtk/Generated/CssParserError.swift index 9566e2db89..8036a95f88 100644 --- a/Sources/Gtk/Generated/CssParserError.swift +++ b/Sources/Gtk/Generated/CssParserError.swift @@ -1,39 +1,39 @@ import CGtk /// Errors that can occur while parsing CSS. -/// +/// /// These errors are unexpected and will cause parts of the given CSS /// to be ignored. public enum CssParserError: GValueRepresentableEnum { public typealias GtkEnum = GtkCssParserError /// Unknown failure. -case failed -/// The given text does not form valid syntax -case syntax -/// Failed to import a resource -case import_ -/// The given name has not been defined -case name -/// The given value is not correct -case unknownValue + case failed + /// The given text does not form valid syntax + case syntax + /// Failed to import a resource + case import_ + /// The given name has not been defined + case name + /// The given value is not correct + case unknownValue public static var type: GType { - gtk_css_parser_error_get_type() -} + gtk_css_parser_error_get_type() + } public init(from gtkEnum: GtkCssParserError) { switch gtkEnum { case GTK_CSS_PARSER_ERROR_FAILED: - self = .failed -case GTK_CSS_PARSER_ERROR_SYNTAX: - self = .syntax -case GTK_CSS_PARSER_ERROR_IMPORT: - self = .import_ -case GTK_CSS_PARSER_ERROR_NAME: - self = .name -case GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE: - self = .unknownValue + self = .failed + case GTK_CSS_PARSER_ERROR_SYNTAX: + self = .syntax + case GTK_CSS_PARSER_ERROR_IMPORT: + self = .import_ + case GTK_CSS_PARSER_ERROR_NAME: + self = .name + case GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE: + self = .unknownValue default: fatalError("Unsupported GtkCssParserError enum value: \(gtkEnum.rawValue)") } @@ -42,15 +42,15 @@ case GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE: public func toGtk() -> GtkCssParserError { switch self { case .failed: - return GTK_CSS_PARSER_ERROR_FAILED -case .syntax: - return GTK_CSS_PARSER_ERROR_SYNTAX -case .import_: - return GTK_CSS_PARSER_ERROR_IMPORT -case .name: - return GTK_CSS_PARSER_ERROR_NAME -case .unknownValue: - return GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE + return GTK_CSS_PARSER_ERROR_FAILED + case .syntax: + return GTK_CSS_PARSER_ERROR_SYNTAX + case .import_: + return GTK_CSS_PARSER_ERROR_IMPORT + case .name: + return GTK_CSS_PARSER_ERROR_NAME + case .unknownValue: + return GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/CssParserWarning.swift b/Sources/Gtk/Generated/CssParserWarning.swift index 459ecb80b9..3050bfa3f3 100644 --- a/Sources/Gtk/Generated/CssParserWarning.swift +++ b/Sources/Gtk/Generated/CssParserWarning.swift @@ -1,33 +1,33 @@ import CGtk /// Warnings that can occur while parsing CSS. -/// +/// /// Unlike `GtkCssParserError`s, warnings do not cause the parser to /// skip any input, but they indicate issues that should be fixed. public enum CssParserWarning: GValueRepresentableEnum { public typealias GtkEnum = GtkCssParserWarning /// The given construct is -/// deprecated and will be removed in a future version -case deprecated -/// A syntax construct was used -/// that should be avoided -case syntax -/// A feature is not implemented -case unimplemented + /// deprecated and will be removed in a future version + case deprecated + /// A syntax construct was used + /// that should be avoided + case syntax + /// A feature is not implemented + case unimplemented public static var type: GType { - gtk_css_parser_warning_get_type() -} + gtk_css_parser_warning_get_type() + } public init(from gtkEnum: GtkCssParserWarning) { switch gtkEnum { case GTK_CSS_PARSER_WARNING_DEPRECATED: - self = .deprecated -case GTK_CSS_PARSER_WARNING_SYNTAX: - self = .syntax -case GTK_CSS_PARSER_WARNING_UNIMPLEMENTED: - self = .unimplemented + self = .deprecated + case GTK_CSS_PARSER_WARNING_SYNTAX: + self = .syntax + case GTK_CSS_PARSER_WARNING_UNIMPLEMENTED: + self = .unimplemented default: fatalError("Unsupported GtkCssParserWarning enum value: \(gtkEnum.rawValue)") } @@ -36,11 +36,11 @@ case GTK_CSS_PARSER_WARNING_UNIMPLEMENTED: public func toGtk() -> GtkCssParserWarning { switch self { case .deprecated: - return GTK_CSS_PARSER_WARNING_DEPRECATED -case .syntax: - return GTK_CSS_PARSER_WARNING_SYNTAX -case .unimplemented: - return GTK_CSS_PARSER_WARNING_UNIMPLEMENTED + return GTK_CSS_PARSER_WARNING_DEPRECATED + case .syntax: + return GTK_CSS_PARSER_WARNING_SYNTAX + case .unimplemented: + return GTK_CSS_PARSER_WARNING_UNIMPLEMENTED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/DeleteType.swift b/Sources/Gtk/Generated/DeleteType.swift index 7b22266c3e..9d5197ef0c 100644 --- a/Sources/Gtk/Generated/DeleteType.swift +++ b/Sources/Gtk/Generated/DeleteType.swift @@ -5,50 +5,50 @@ public enum DeleteType: GValueRepresentableEnum { public typealias GtkEnum = GtkDeleteType /// Delete characters. -case chars -/// Delete only the portion of the word to the -/// left/right of cursor if we’re in the middle of a word. -case wordEnds -/// Delete words. -case words -/// Delete display-lines. Display-lines -/// refers to the visible lines, with respect to the current line -/// breaks. As opposed to paragraphs, which are defined by line -/// breaks in the input. -case displayLines -/// Delete only the portion of the -/// display-line to the left/right of cursor. -case displayLineEnds -/// Delete to the end of the -/// paragraph. Like C-k in Emacs (or its reverse). -case paragraphEnds -/// Delete entire line. Like C-k in pico. -case paragraphs -/// Delete only whitespace. Like M-\ in Emacs. -case whitespace + case chars + /// Delete only the portion of the word to the + /// left/right of cursor if we’re in the middle of a word. + case wordEnds + /// Delete words. + case words + /// Delete display-lines. Display-lines + /// refers to the visible lines, with respect to the current line + /// breaks. As opposed to paragraphs, which are defined by line + /// breaks in the input. + case displayLines + /// Delete only the portion of the + /// display-line to the left/right of cursor. + case displayLineEnds + /// Delete to the end of the + /// paragraph. Like C-k in Emacs (or its reverse). + case paragraphEnds + /// Delete entire line. Like C-k in pico. + case paragraphs + /// Delete only whitespace. Like M-\ in Emacs. + case whitespace public static var type: GType { - gtk_delete_type_get_type() -} + gtk_delete_type_get_type() + } public init(from gtkEnum: GtkDeleteType) { switch gtkEnum { case GTK_DELETE_CHARS: - self = .chars -case GTK_DELETE_WORD_ENDS: - self = .wordEnds -case GTK_DELETE_WORDS: - self = .words -case GTK_DELETE_DISPLAY_LINES: - self = .displayLines -case GTK_DELETE_DISPLAY_LINE_ENDS: - self = .displayLineEnds -case GTK_DELETE_PARAGRAPH_ENDS: - self = .paragraphEnds -case GTK_DELETE_PARAGRAPHS: - self = .paragraphs -case GTK_DELETE_WHITESPACE: - self = .whitespace + self = .chars + case GTK_DELETE_WORD_ENDS: + self = .wordEnds + case GTK_DELETE_WORDS: + self = .words + case GTK_DELETE_DISPLAY_LINES: + self = .displayLines + case GTK_DELETE_DISPLAY_LINE_ENDS: + self = .displayLineEnds + case GTK_DELETE_PARAGRAPH_ENDS: + self = .paragraphEnds + case GTK_DELETE_PARAGRAPHS: + self = .paragraphs + case GTK_DELETE_WHITESPACE: + self = .whitespace default: fatalError("Unsupported GtkDeleteType enum value: \(gtkEnum.rawValue)") } @@ -57,21 +57,21 @@ case GTK_DELETE_WHITESPACE: public func toGtk() -> GtkDeleteType { switch self { case .chars: - return GTK_DELETE_CHARS -case .wordEnds: - return GTK_DELETE_WORD_ENDS -case .words: - return GTK_DELETE_WORDS -case .displayLines: - return GTK_DELETE_DISPLAY_LINES -case .displayLineEnds: - return GTK_DELETE_DISPLAY_LINE_ENDS -case .paragraphEnds: - return GTK_DELETE_PARAGRAPH_ENDS -case .paragraphs: - return GTK_DELETE_PARAGRAPHS -case .whitespace: - return GTK_DELETE_WHITESPACE + return GTK_DELETE_CHARS + case .wordEnds: + return GTK_DELETE_WORD_ENDS + case .words: + return GTK_DELETE_WORDS + case .displayLines: + return GTK_DELETE_DISPLAY_LINES + case .displayLineEnds: + return GTK_DELETE_DISPLAY_LINE_ENDS + case .paragraphEnds: + return GTK_DELETE_PARAGRAPH_ENDS + case .paragraphs: + return GTK_DELETE_PARAGRAPHS + case .whitespace: + return GTK_DELETE_WHITESPACE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/DirectionType.swift b/Sources/Gtk/Generated/DirectionType.swift index bd80042ac2..af0b146996 100644 --- a/Sources/Gtk/Generated/DirectionType.swift +++ b/Sources/Gtk/Generated/DirectionType.swift @@ -5,36 +5,36 @@ public enum DirectionType: GValueRepresentableEnum { public typealias GtkEnum = GtkDirectionType /// Move forward. -case tabForward -/// Move backward. -case tabBackward -/// Move up. -case up -/// Move down. -case down -/// Move left. -case left -/// Move right. -case right + case tabForward + /// Move backward. + case tabBackward + /// Move up. + case up + /// Move down. + case down + /// Move left. + case left + /// Move right. + case right public static var type: GType { - gtk_direction_type_get_type() -} + gtk_direction_type_get_type() + } public init(from gtkEnum: GtkDirectionType) { switch gtkEnum { case GTK_DIR_TAB_FORWARD: - self = .tabForward -case GTK_DIR_TAB_BACKWARD: - self = .tabBackward -case GTK_DIR_UP: - self = .up -case GTK_DIR_DOWN: - self = .down -case GTK_DIR_LEFT: - self = .left -case GTK_DIR_RIGHT: - self = .right + self = .tabForward + case GTK_DIR_TAB_BACKWARD: + self = .tabBackward + case GTK_DIR_UP: + self = .up + case GTK_DIR_DOWN: + self = .down + case GTK_DIR_LEFT: + self = .left + case GTK_DIR_RIGHT: + self = .right default: fatalError("Unsupported GtkDirectionType enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ case GTK_DIR_RIGHT: public func toGtk() -> GtkDirectionType { switch self { case .tabForward: - return GTK_DIR_TAB_FORWARD -case .tabBackward: - return GTK_DIR_TAB_BACKWARD -case .up: - return GTK_DIR_UP -case .down: - return GTK_DIR_DOWN -case .left: - return GTK_DIR_LEFT -case .right: - return GTK_DIR_RIGHT + return GTK_DIR_TAB_FORWARD + case .tabBackward: + return GTK_DIR_TAB_BACKWARD + case .up: + return GTK_DIR_UP + case .down: + return GTK_DIR_DOWN + case .left: + return GTK_DIR_LEFT + case .right: + return GTK_DIR_RIGHT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/DrawingArea.swift b/Sources/Gtk/Generated/DrawingArea.swift index c24736f50a..4fa422c1dc 100644 --- a/Sources/Gtk/Generated/DrawingArea.swift +++ b/Sources/Gtk/Generated/DrawingArea.swift @@ -1,28 +1,28 @@ import CGtk /// Allows drawing with cairo. -/// +/// /// An example GtkDrawingArea -/// +/// /// It’s essentially a blank widget; you can draw on it. After /// creating a drawing area, the application may want to connect to: -/// +/// /// - The [signal@Gtk.Widget::realize] signal to take any necessary actions /// when the widget is instantiated on a particular display. /// (Create GDK resources in response to this signal.) -/// +/// /// - The [signal@Gtk.DrawingArea::resize] signal to take any necessary /// actions when the widget changes size. -/// +/// /// - Call [method@Gtk.DrawingArea.set_draw_func] to handle redrawing the /// contents of the widget. -/// +/// /// The following code portion demonstrates using a drawing /// area to display a circle in the normal widget foreground /// color. -/// +/// /// ## Simple GtkDrawingArea usage -/// +/// /// ```c /// static void /// draw_function (GtkDrawingArea *area, @@ -32,24 +32,24 @@ import CGtk /// gpointer data) /// { /// GdkRGBA color; -/// +/// /// cairo_arc (cr, /// width / 2.0, height / 2.0, /// MIN (width, height) / 2.0, /// 0, 2 * G_PI); -/// +/// /// gtk_widget_get_color (GTK_WIDGET (area), /// &color); /// gdk_cairo_set_source_rgba (cr, &color); -/// +/// /// cairo_fill (cr); /// } -/// +/// /// int /// main (int argc, char **argv) /// { /// gtk_init (); -/// +/// /// GtkWidget *area = gtk_drawing_area_new (); /// gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (area), 100); /// gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (area), 100); @@ -59,83 +59,87 @@ import CGtk /// return 0; /// } /// ``` -/// +/// /// The draw function is normally called when a drawing area first comes /// onscreen, or when it’s covered by another window and then uncovered. /// You can also force a redraw by adding to the “damage region” of the /// drawing area’s window using [method@Gtk.Widget.queue_draw]. /// This will cause the drawing area to call the draw function again. -/// +/// /// The available routines for drawing are documented in the /// [Cairo documentation](https://www.cairographics.org/manual/); GDK /// offers additional API to integrate with Cairo, like [func@Gdk.cairo_set_source_rgba] /// or [func@Gdk.cairo_set_source_pixbuf]. -/// +/// /// To receive mouse events on a drawing area, you will need to use /// event controllers. To receive keyboard events, you will need to set /// the “can-focus” property on the drawing area, and you should probably /// draw some user-visible indication that the drawing area is focused. -/// +/// /// If you need more complex control over your widget, you should consider /// creating your own `GtkWidget` subclass. open class DrawingArea: Widget { /// Creates a new drawing area. -public convenience init() { - self.init( - gtk_drawing_area_new() - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) + public convenience init() { + self.init( + gtk_drawing_area_new() + ) } -addSignal(name: "resize", handler: gCallback(handler0)) { [weak self] (param0: Int, param1: Int) in - guard let self = self else { return } - self.resize?(self, param0, param1) -} + override func didMoveToParent() { + super.didMoveToParent() -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + let handler0: + @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } -addSignal(name: "notify::content-height", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContentHeight?(self, param0) -} + addSignal(name: "resize", handler: gCallback(handler0)) { + [weak self] (param0: Int, param1: Int) in + guard let self = self else { return } + self.resize?(self, param0, param1) + } -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } -addSignal(name: "notify::content-width", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContentWidth?(self, param0) -} -} + addSignal(name: "notify::content-height", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContentHeight?(self, param0) + } - /// The content height. -@GObjectProperty(named: "content-height") public var contentHeight: Int + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } -/// The content width. -@GObjectProperty(named: "content-width") public var contentWidth: Int + addSignal(name: "notify::content-width", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContentWidth?(self, param0) + } + } -/// Emitted once when the widget is realized, and then each time the widget -/// is changed while realized. -/// -/// This is useful in order to keep state up to date with the widget size, -/// like for instance a backing surface. -public var resize: ((DrawingArea, Int, Int) -> Void)? + /// The content height. + @GObjectProperty(named: "content-height") public var contentHeight: Int + /// The content width. + @GObjectProperty(named: "content-width") public var contentWidth: Int -public var notifyContentHeight: ((DrawingArea, OpaquePointer) -> Void)? + /// Emitted once when the widget is realized, and then each time the widget + /// is changed while realized. + /// + /// This is useful in order to keep state up to date with the widget size, + /// like for instance a backing surface. + public var resize: ((DrawingArea, Int, Int) -> Void)? + public var notifyContentHeight: ((DrawingArea, OpaquePointer) -> Void)? -public var notifyContentWidth: ((DrawingArea, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyContentWidth: ((DrawingArea, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/DropDown.swift b/Sources/Gtk/Generated/DropDown.swift index 16265c0ffb..5ff024cbf5 100644 --- a/Sources/Gtk/Generated/DropDown.swift +++ b/Sources/Gtk/Generated/DropDown.swift @@ -1,219 +1,230 @@ import CGtk /// Allows the user to choose an item from a list of options. -/// +/// /// An example GtkDropDown -/// +/// /// The `GtkDropDown` displays the [selected][property@Gtk.DropDown:selected] /// choice. -/// +/// /// The options are given to `GtkDropDown` in the form of `GListModel` /// and how the individual options are represented is determined by /// a [class@Gtk.ListItemFactory]. The default factory displays simple strings, /// and adds a checkmark to the selected item in the popup. -/// +/// /// To set your own factory, use [method@Gtk.DropDown.set_factory]. It is /// possible to use a separate factory for the items in the popup, with /// [method@Gtk.DropDown.set_list_factory]. -/// +/// /// `GtkDropDown` knows how to obtain strings from the items in a /// [class@Gtk.StringList]; for other models, you have to provide an expression /// to find the strings via [method@Gtk.DropDown.set_expression]. -/// +/// /// `GtkDropDown` can optionally allow search in the popup, which is /// useful if the list of options is long. To enable the search entry, /// use [method@Gtk.DropDown.set_enable_search]. -/// +/// /// Here is a UI definition example for `GtkDropDown` with a simple model: -/// +/// /// ```xml /// FactoryHomeSubway /// ``` -/// +/// /// If a `GtkDropDown` is created in this manner, or with /// [ctor@Gtk.DropDown.new_from_strings], for instance, the object returned from /// [method@Gtk.DropDown.get_selected_item] will be a [class@Gtk.StringObject]. -/// +/// /// To learn more about the list widget framework, see the /// [overview](section-list-widget.html). -/// +/// /// ## CSS nodes -/// +/// /// `GtkDropDown` has a single CSS node with name dropdown, /// with the button and popover nodes as children. -/// +/// /// ## Accessibility -/// +/// /// `GtkDropDown` uses the [enum@Gtk.AccessibleRole.combo_box] role. open class DropDown: Widget { /// Creates a new `GtkDropDown` that is populated with -/// the strings. -public convenience init(strings: [String]) { - self.init( - gtk_drop_down_new_from_strings(strings - .map({ UnsafePointer($0.unsafeUTF8Copy().baseAddress) }) - .unsafeCopy() - .baseAddress!) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::enable-search", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEnableSearch?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// the strings. + public convenience init(strings: [String]) { + self.init( + gtk_drop_down_new_from_strings( + strings + .map({ UnsafePointer($0.unsafeUTF8Copy().baseAddress) }) + .unsafeCopy() + .baseAddress!) + ) } -addSignal(name: "notify::expression", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExpression?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::factory", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFactory?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::header-factory", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHeaderFactory?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::list-factory", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyListFactory?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::model", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyModel?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::enable-search", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEnableSearch?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::expression", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExpression?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::factory", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFactory?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::header-factory", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHeaderFactory?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::list-factory", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyListFactory?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::model", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyModel?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::search-match-mode", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySearchMatchMode?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::selected", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelected?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::selected-item", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectedItem?(self, param0) + } + + let handler10: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::show-arrow", handler: gCallback(handler10)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowArrow?(self, param0) + } } -addSignal(name: "notify::search-match-mode", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySearchMatchMode?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::selected", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelected?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::selected-item", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectedItem?(self, param0) -} - -let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::show-arrow", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowArrow?(self, param0) -} -} - /// Whether to show a search entry in the popup. -/// -/// Note that search requires [property@Gtk.DropDown:expression] -/// to be set. -@GObjectProperty(named: "enable-search") public var enableSearch: Bool - -/// Model for the displayed items. -@GObjectProperty(named: "model") public var model: OpaquePointer? - -/// The position of the selected item. -/// -/// If no item is selected, the property has the value -/// %GTK_INVALID_LIST_POSITION. -@GObjectProperty(named: "selected") public var selected: Int - -/// Emitted to when the drop down is activated. -/// -/// The `::activate` signal on `GtkDropDown` is an action signal and -/// emitting it causes the drop down to pop up its dropdown. -public var activate: ((DropDown) -> Void)? - - -public var notifyEnableSearch: ((DropDown, OpaquePointer) -> Void)? + /// + /// Note that search requires [property@Gtk.DropDown:expression] + /// to be set. + @GObjectProperty(named: "enable-search") public var enableSearch: Bool + /// Model for the displayed items. + @GObjectProperty(named: "model") public var model: OpaquePointer? -public var notifyExpression: ((DropDown, OpaquePointer) -> Void)? + /// The position of the selected item. + /// + /// If no item is selected, the property has the value + /// %GTK_INVALID_LIST_POSITION. + @GObjectProperty(named: "selected") public var selected: Int + /// Emitted to when the drop down is activated. + /// + /// The `::activate` signal on `GtkDropDown` is an action signal and + /// emitting it causes the drop down to pop up its dropdown. + public var activate: ((DropDown) -> Void)? -public var notifyFactory: ((DropDown, OpaquePointer) -> Void)? + public var notifyEnableSearch: ((DropDown, OpaquePointer) -> Void)? + public var notifyExpression: ((DropDown, OpaquePointer) -> Void)? -public var notifyHeaderFactory: ((DropDown, OpaquePointer) -> Void)? + public var notifyFactory: ((DropDown, OpaquePointer) -> Void)? + public var notifyHeaderFactory: ((DropDown, OpaquePointer) -> Void)? -public var notifyListFactory: ((DropDown, OpaquePointer) -> Void)? + public var notifyListFactory: ((DropDown, OpaquePointer) -> Void)? + public var notifyModel: ((DropDown, OpaquePointer) -> Void)? -public var notifyModel: ((DropDown, OpaquePointer) -> Void)? + public var notifySearchMatchMode: ((DropDown, OpaquePointer) -> Void)? + public var notifySelected: ((DropDown, OpaquePointer) -> Void)? -public var notifySearchMatchMode: ((DropDown, OpaquePointer) -> Void)? + public var notifySelectedItem: ((DropDown, OpaquePointer) -> Void)? - -public var notifySelected: ((DropDown, OpaquePointer) -> Void)? - - -public var notifySelectedItem: ((DropDown, OpaquePointer) -> Void)? - - -public var notifyShowArrow: ((DropDown, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyShowArrow: ((DropDown, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/Editable.swift b/Sources/Gtk/Generated/Editable.swift index b36043e6ab..7f75a1573c 100644 --- a/Sources/Gtk/Generated/Editable.swift +++ b/Sources/Gtk/Generated/Editable.swift @@ -1,22 +1,22 @@ import CGtk /// Interface for single-line text editing widgets. -/// +/// /// Typical examples of editable widgets are [class@Gtk.Entry] and /// [class@Gtk.SpinButton]. It contains functions for generically manipulating /// an editable widget, a large number of action signals used for key bindings, /// and several signals that an application can connect to modify the behavior /// of a widget. -/// +/// /// As an example of the latter usage, by connecting the following handler to /// [signal@Gtk.Editable::insert-text], an application can convert all entry /// into a widget into uppercase. -/// +/// /// ## Forcing entry to uppercase. -/// +/// /// ```c /// #include -/// +/// /// void /// insert_text_handler (GtkEditable *editable, /// const char *text, @@ -25,29 +25,29 @@ import CGtk /// gpointer data) /// { /// char *result = g_utf8_strup (text, length); -/// +/// /// g_signal_handlers_block_by_func (editable, /// (gpointer) insert_text_handler, data); /// gtk_editable_insert_text (editable, result, length, position); /// g_signal_handlers_unblock_by_func (editable, /// (gpointer) insert_text_handler, data); -/// +/// /// g_signal_stop_emission_by_name (editable, "insert_text"); -/// +/// /// g_free (result); /// } /// ``` -/// +/// /// ## Implementing GtkEditable -/// +/// /// The most likely scenario for implementing `GtkEditable` on your own widget /// is that you will embed a `GtkText` inside a complex widget, and want to /// delegate the editable functionality to that text widget. `GtkEditable` /// provides some utility functions to make this easy. -/// +/// /// In your class_init function, call [func@Gtk.Editable.install_properties], /// passing the first available property ID: -/// +/// /// ```c /// static void /// my_class_init (MyClass *class) @@ -58,31 +58,31 @@ import CGtk /// ... /// } /// ``` -/// +/// /// In your interface_init function for the `GtkEditable` interface, provide /// an implementation for the get_delegate vfunc that returns your text widget: -/// +/// /// ```c /// GtkEditable * /// get_editable_delegate (GtkEditable *editable) /// { /// return GTK_EDITABLE (MY_WIDGET (editable)->text_widget); /// } -/// +/// /// static void /// my_editable_init (GtkEditableInterface *iface) /// { /// iface->get_delegate = get_editable_delegate; /// } /// ``` -/// +/// /// You don't need to provide any other vfuncs. The default implementations /// work by forwarding to the delegate that the GtkEditableInterface.get_delegate() /// vfunc returns. -/// +/// /// In your instance_init function, create your text widget, and then call /// [method@Gtk.Editable.init_delegate]: -/// +/// /// ```c /// static void /// my_widget_init (MyWidget *self) @@ -93,10 +93,10 @@ import CGtk /// ... /// } /// ``` -/// +/// /// In your dispose function, call [method@Gtk.Editable.finish_delegate] before /// destroying your text widget: -/// +/// /// ```c /// static void /// my_widget_dispose (GObject *object) @@ -107,19 +107,19 @@ import CGtk /// ... /// } /// ``` -/// +/// /// Finally, use [func@Gtk.Editable.delegate_set_property] in your `set_property` /// function (and similar for `get_property`), to set the editable properties: -/// +/// /// ```c /// ... /// if (gtk_editable_delegate_set_property (object, prop_id, value, pspec)) /// return; -/// +/// /// switch (prop_id) /// ... /// ``` -/// +/// /// It is important to note that if you create a `GtkEditable` that uses /// a delegate, the low level [signal@Gtk.Editable::insert-text] and /// [signal@Gtk.Editable::delete-text] signals will be propagated from the @@ -130,54 +130,54 @@ import CGtk /// to them on the delegate obtained via [method@Gtk.Editable.get_delegate]. public protocol Editable: GObjectRepresentable { /// The current position of the insertion cursor in chars. -var cursorPosition: Int { get set } + var cursorPosition: Int { get set } -/// Whether the entry contents can be edited. -var editable: Bool { get set } + /// Whether the entry contents can be edited. + var editable: Bool { get set } -/// If undo/redo should be enabled for the editable. -var enableUndo: Bool { get set } + /// If undo/redo should be enabled for the editable. + var enableUndo: Bool { get set } -/// The desired maximum width of the entry, in characters. -var maxWidthChars: Int { get set } + /// The desired maximum width of the entry, in characters. + var maxWidthChars: Int { get set } -/// The contents of the entry. -var text: String { get set } + /// The contents of the entry. + var text: String { get set } -/// Number of characters to leave space for in the entry. -var widthChars: Int { get set } + /// Number of characters to leave space for in the entry. + var widthChars: Int { get set } -/// The horizontal alignment, from 0 (left) to 1 (right). -/// -/// Reversed for RTL layouts. -var xalign: Float { get set } + /// The horizontal alignment, from 0 (left) to 1 (right). + /// + /// Reversed for RTL layouts. + var xalign: Float { get set } /// Emitted at the end of a single user-visible operation on the -/// contents. -/// -/// E.g., a paste operation that replaces the contents of the -/// selection will cause only one signal emission (even though it -/// is implemented by first deleting the selection, then inserting -/// the new content, and may cause multiple ::notify::text signals -/// to be emitted). -var changed: ((Self) -> Void)? { get set } + /// contents. + /// + /// E.g., a paste operation that replaces the contents of the + /// selection will cause only one signal emission (even though it + /// is implemented by first deleting the selection, then inserting + /// the new content, and may cause multiple ::notify::text signals + /// to be emitted). + var changed: ((Self) -> Void)? { get set } -/// Emitted when text is deleted from the widget by the user. -/// -/// The default handler for this signal will normally be responsible for -/// deleting the text, so by connecting to this signal and then stopping -/// the signal with g_signal_stop_emission(), it is possible to modify the -/// range of deleted text, or prevent it from being deleted entirely. -/// -/// The @start_pos and @end_pos parameters are interpreted as for -/// [method@Gtk.Editable.delete_text]. -var deleteText: ((Self, Int, Int) -> Void)? { get set } + /// Emitted when text is deleted from the widget by the user. + /// + /// The default handler for this signal will normally be responsible for + /// deleting the text, so by connecting to this signal and then stopping + /// the signal with g_signal_stop_emission(), it is possible to modify the + /// range of deleted text, or prevent it from being deleted entirely. + /// + /// The @start_pos and @end_pos parameters are interpreted as for + /// [method@Gtk.Editable.delete_text]. + var deleteText: ((Self, Int, Int) -> Void)? { get set } -/// Emitted when text is inserted into the widget by the user. -/// -/// The default handler for this signal will normally be responsible -/// for inserting the text, so by connecting to this signal and then -/// stopping the signal with g_signal_stop_emission(), it is possible -/// to modify the inserted text, or prevent it from being inserted entirely. -var insertText: ((Self, UnsafePointer, Int, gpointer) -> Void)? { get set } -} \ No newline at end of file + /// Emitted when text is inserted into the widget by the user. + /// + /// The default handler for this signal will normally be responsible + /// for inserting the text, so by connecting to this signal and then + /// stopping the signal with g_signal_stop_emission(), it is possible + /// to modify the inserted text, or prevent it from being inserted entirely. + var insertText: ((Self, UnsafePointer, Int, gpointer) -> Void)? { get set } +} diff --git a/Sources/Gtk/Generated/EditableProperties.swift b/Sources/Gtk/Generated/EditableProperties.swift index ac550444ea..99c51d3239 100644 --- a/Sources/Gtk/Generated/EditableProperties.swift +++ b/Sources/Gtk/Generated/EditableProperties.swift @@ -1,55 +1,55 @@ import CGtk /// The identifiers for [iface@Gtk.Editable] properties. -/// +/// /// See [func@Gtk.Editable.install_properties] for details on how to /// implement the `GtkEditable` interface. public enum EditableProperties: GValueRepresentableEnum { public typealias GtkEnum = GtkEditableProperties /// The property id for [property@Gtk.Editable:text] -case propText -/// The property id for [property@Gtk.Editable:cursor-position] -case propCursorPosition -/// The property id for [property@Gtk.Editable:selection-bound] -case propSelectionBound -/// The property id for [property@Gtk.Editable:editable] -case propEditable -/// The property id for [property@Gtk.Editable:width-chars] -case propWidthChars -/// The property id for [property@Gtk.Editable:max-width-chars] -case propMaxWidthChars -/// The property id for [property@Gtk.Editable:xalign] -case propXalign -/// The property id for [property@Gtk.Editable:enable-undo] -case propEnableUndo -/// The number of properties -case numProperties + case propText + /// The property id for [property@Gtk.Editable:cursor-position] + case propCursorPosition + /// The property id for [property@Gtk.Editable:selection-bound] + case propSelectionBound + /// The property id for [property@Gtk.Editable:editable] + case propEditable + /// The property id for [property@Gtk.Editable:width-chars] + case propWidthChars + /// The property id for [property@Gtk.Editable:max-width-chars] + case propMaxWidthChars + /// The property id for [property@Gtk.Editable:xalign] + case propXalign + /// The property id for [property@Gtk.Editable:enable-undo] + case propEnableUndo + /// The number of properties + case numProperties public static var type: GType { - gtk_editable_properties_get_type() -} + gtk_editable_properties_get_type() + } public init(from gtkEnum: GtkEditableProperties) { switch gtkEnum { case GTK_EDITABLE_PROP_TEXT: - self = .propText -case GTK_EDITABLE_PROP_CURSOR_POSITION: - self = .propCursorPosition -case GTK_EDITABLE_PROP_SELECTION_BOUND: - self = .propSelectionBound -case GTK_EDITABLE_PROP_EDITABLE: - self = .propEditable -case GTK_EDITABLE_PROP_WIDTH_CHARS: - self = .propWidthChars -case GTK_EDITABLE_PROP_MAX_WIDTH_CHARS: - self = .propMaxWidthChars -case GTK_EDITABLE_PROP_XALIGN: - self = .propXalign -case GTK_EDITABLE_PROP_ENABLE_UNDO: - self = .propEnableUndo -case GTK_EDITABLE_NUM_PROPERTIES: - self = .numProperties + self = .propText + case GTK_EDITABLE_PROP_CURSOR_POSITION: + self = .propCursorPosition + case GTK_EDITABLE_PROP_SELECTION_BOUND: + self = .propSelectionBound + case GTK_EDITABLE_PROP_EDITABLE: + self = .propEditable + case GTK_EDITABLE_PROP_WIDTH_CHARS: + self = .propWidthChars + case GTK_EDITABLE_PROP_MAX_WIDTH_CHARS: + self = .propMaxWidthChars + case GTK_EDITABLE_PROP_XALIGN: + self = .propXalign + case GTK_EDITABLE_PROP_ENABLE_UNDO: + self = .propEnableUndo + case GTK_EDITABLE_NUM_PROPERTIES: + self = .numProperties default: fatalError("Unsupported GtkEditableProperties enum value: \(gtkEnum.rawValue)") } @@ -58,23 +58,23 @@ case GTK_EDITABLE_NUM_PROPERTIES: public func toGtk() -> GtkEditableProperties { switch self { case .propText: - return GTK_EDITABLE_PROP_TEXT -case .propCursorPosition: - return GTK_EDITABLE_PROP_CURSOR_POSITION -case .propSelectionBound: - return GTK_EDITABLE_PROP_SELECTION_BOUND -case .propEditable: - return GTK_EDITABLE_PROP_EDITABLE -case .propWidthChars: - return GTK_EDITABLE_PROP_WIDTH_CHARS -case .propMaxWidthChars: - return GTK_EDITABLE_PROP_MAX_WIDTH_CHARS -case .propXalign: - return GTK_EDITABLE_PROP_XALIGN -case .propEnableUndo: - return GTK_EDITABLE_PROP_ENABLE_UNDO -case .numProperties: - return GTK_EDITABLE_NUM_PROPERTIES + return GTK_EDITABLE_PROP_TEXT + case .propCursorPosition: + return GTK_EDITABLE_PROP_CURSOR_POSITION + case .propSelectionBound: + return GTK_EDITABLE_PROP_SELECTION_BOUND + case .propEditable: + return GTK_EDITABLE_PROP_EDITABLE + case .propWidthChars: + return GTK_EDITABLE_PROP_WIDTH_CHARS + case .propMaxWidthChars: + return GTK_EDITABLE_PROP_MAX_WIDTH_CHARS + case .propXalign: + return GTK_EDITABLE_PROP_XALIGN + case .propEnableUndo: + return GTK_EDITABLE_PROP_ENABLE_UNDO + case .numProperties: + return GTK_EDITABLE_NUM_PROPERTIES } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Entry.swift b/Sources/Gtk/Generated/Entry.swift index 8a3d9764b7..26b74f887b 100644 --- a/Sources/Gtk/Generated/Entry.swift +++ b/Sources/Gtk/Generated/Entry.swift @@ -1,25 +1,25 @@ import CGtk /// A single-line text entry widget. -/// +/// /// An example GtkEntry -/// +/// /// A fairly large set of key bindings are supported by default. If the /// entered text is longer than the allocation of the widget, the widget /// will scroll so that the cursor position is visible. -/// +/// /// When using an entry for passwords and other sensitive information, it /// can be put into “password mode” using [method@Gtk.Entry.set_visibility]. /// In this mode, entered text is displayed using a “invisible” character. /// By default, GTK picks the best invisible character that is available /// in the current font, but it can be changed with /// [method@Gtk.Entry.set_invisible_char]. -/// +/// /// `GtkEntry` has the ability to display progress or activity /// information behind the text. To make an entry display such information, /// use [method@Gtk.Entry.set_progress_fraction] or /// [method@Gtk.Entry.set_progress_pulse_step]. -/// +/// /// Additionally, `GtkEntry` can show icons at either side of the entry. /// These icons can be activatable by clicking, can be set up as drag source /// and can have tooltips. To add an icon, use @@ -30,15 +30,15 @@ import CGtk /// [method@Gtk.Entry.set_icon_drag_source]. To set a tooltip on an icon, use /// [method@Gtk.Entry.set_icon_tooltip_text] or the corresponding function /// for markup. -/// +/// /// Note that functionality or information that is only available by clicking /// on an icon in an entry may not be accessible at all to users which are not /// able to use a mouse or other pointing device. It is therefore recommended /// that any such functionality should also be available by other means, e.g. /// via the context menu of the entry. -/// +/// /// # CSS nodes -/// +/// /// ``` /// entry[.flat][.warning][.error] /// ├── text[.readonly] @@ -46,904 +46,968 @@ import CGtk /// ├── image.right /// ╰── [progress[.pulse]] /// ``` -/// +/// /// `GtkEntry` has a main node with the name entry. Depending on the properties /// of the entry, the style classes .read-only and .flat may appear. The style /// classes .warning and .error may also be used with entries. -/// +/// /// When the entry shows icons, it adds subnodes with the name image and the /// style class .left or .right, depending on where the icon appears. -/// +/// /// When the entry shows progress, it adds a subnode with the name progress. /// The node has the style class .pulse when the shown progress is pulsing. -/// +/// /// For all the subnodes added to the text node in various situations, /// see [class@Gtk.Text]. -/// +/// /// # GtkEntry as GtkBuildable -/// +/// /// The `GtkEntry` implementation of the `GtkBuildable` interface supports a /// custom `` element, which supports any number of `` /// elements. The `` element has attributes named “name“, “value“, /// “start“ and “end“ and allows you to specify `PangoAttribute` values for /// this label. -/// +/// /// An example of a UI definition fragment specifying Pango attributes: /// ```xml /// /// ``` -/// +/// /// The start and end attributes specify the range of characters to which the /// Pango attribute applies. If start and end are not specified, the attribute /// is applied to the whole text. Note that specifying ranges does not make much /// sense with translatable attributes. Use markup embedded in the translatable /// content instead. -/// +/// /// # Accessibility -/// +/// /// `GtkEntry` uses the [enum@Gtk.AccessibleRole.text_box] role. open class Entry: Widget, CellEditable, Editable { /// Creates a new entry. -public convenience init() { - self.init( - gtk_entry_new() - ) -} - -/// Creates a new entry with the specified text buffer. -public convenience init(buffer: UnsafeMutablePointer!) { - self.init( - gtk_entry_new_with_buffer(buffer) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "icon-press", handler: gCallback(handler1)) { [weak self] (param0: GtkEntryIconPosition) in - guard let self = self else { return } - self.iconPress?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "icon-release", handler: gCallback(handler2)) { [weak self] (param0: GtkEntryIconPosition) in - guard let self = self else { return } - self.iconRelease?(self, param0) -} - -addSignal(name: "editing-done") { [weak self] () in - guard let self = self else { return } - self.editingDone?(self) -} - -addSignal(name: "remove-widget") { [weak self] () in - guard let self = self else { return } - self.removeWidget?(self) -} - -addSignal(name: "changed") { [weak self] () in - guard let self = self else { return } - self.changed?(self) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - -addSignal(name: "delete-text", handler: gCallback(handler6)) { [weak self] (param0: Int, param1: Int) in - guard let self = self else { return } - self.deleteText?(self, param0, param1) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, UnsafePointer, Int, gpointer, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, value3, data in - SignalBox3, Int, gpointer>.run(data, value1, value2, value3) - } - -addSignal(name: "insert-text", handler: gCallback(handler7)) { [weak self] (param0: UnsafePointer, param1: Int, param2: gpointer) in - guard let self = self else { return } - self.insertText?(self, param0, param1, param2) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::activates-default", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActivatesDefault?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::attributes", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAttributes?(self, param0) -} - -let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::buffer", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyBuffer?(self, param0) -} - -let handler11: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::completion", handler: gCallback(handler11)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCompletion?(self, param0) -} - -let handler12: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::enable-emoji-completion", handler: gCallback(handler12)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEnableEmojiCompletion?(self, param0) -} - -let handler13: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::extra-menu", handler: gCallback(handler13)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExtraMenu?(self, param0) -} - -let handler14: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::has-frame", handler: gCallback(handler14)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasFrame?(self, param0) -} - -let handler15: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::im-module", handler: gCallback(handler15)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyImModule?(self, param0) -} - -let handler16: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::input-hints", handler: gCallback(handler16)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInputHints?(self, param0) -} - -let handler17: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::input-purpose", handler: gCallback(handler17)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInputPurpose?(self, param0) -} - -let handler18: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::invisible-char", handler: gCallback(handler18)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInvisibleCharacter?(self, param0) -} - -let handler19: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::invisible-char-set", handler: gCallback(handler19)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInvisibleCharacterSet?(self, param0) -} - -let handler20: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::max-length", handler: gCallback(handler20)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMaxLength?(self, param0) -} - -let handler21: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::menu-entry-icon-primary-text", handler: gCallback(handler21)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMenuEntryIconPrimaryText?(self, param0) -} - -let handler22: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::menu-entry-icon-secondary-text", handler: gCallback(handler22)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMenuEntryIconSecondaryText?(self, param0) -} - -let handler23: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_entry_new() + ) + } + + /// Creates a new entry with the specified text buffer. + public convenience init(buffer: UnsafeMutablePointer!) { + self.init( + gtk_entry_new_with_buffer(buffer) + ) + } + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, UnsafeMutableRawPointer) + -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "icon-press", handler: gCallback(handler1)) { + [weak self] (param0: GtkEntryIconPosition) in + guard let self = self else { return } + self.iconPress?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, UnsafeMutableRawPointer) + -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "icon-release", handler: gCallback(handler2)) { + [weak self] (param0: GtkEntryIconPosition) in + guard let self = self else { return } + self.iconRelease?(self, param0) + } + + addSignal(name: "editing-done") { [weak self] () in + guard let self = self else { return } + self.editingDone?(self) + } + + addSignal(name: "remove-widget") { [weak self] () in + guard let self = self else { return } + self.removeWidget?(self) + } + + addSignal(name: "changed") { [weak self] () in + guard let self = self else { return } + self.changed?(self) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "delete-text", handler: gCallback(handler6)) { + [weak self] (param0: Int, param1: Int) in + guard let self = self else { return } + self.deleteText?(self, param0, param1) + } + + let handler7: + @convention(c) ( + UnsafeMutableRawPointer, UnsafePointer, Int, gpointer, + UnsafeMutableRawPointer + ) -> Void = + { _, value1, value2, value3, data in + SignalBox3, Int, gpointer>.run( + data, value1, value2, value3) + } + + addSignal(name: "insert-text", handler: gCallback(handler7)) { + [weak self] (param0: UnsafePointer, param1: Int, param2: gpointer) in + guard let self = self else { return } + self.insertText?(self, param0, param1, param2) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::activates-default", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActivatesDefault?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::attributes", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAttributes?(self, param0) + } + + let handler10: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::buffer", handler: gCallback(handler10)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyBuffer?(self, param0) + } + + let handler11: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::completion", handler: gCallback(handler11)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCompletion?(self, param0) + } + + let handler12: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::enable-emoji-completion", handler: gCallback(handler12)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEnableEmojiCompletion?(self, param0) + } + + let handler13: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::extra-menu", handler: gCallback(handler13)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExtraMenu?(self, param0) + } + + let handler14: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::has-frame", handler: gCallback(handler14)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasFrame?(self, param0) + } + + let handler15: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::im-module", handler: gCallback(handler15)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyImModule?(self, param0) + } + + let handler16: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::input-hints", handler: gCallback(handler16)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInputHints?(self, param0) + } + + let handler17: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::input-purpose", handler: gCallback(handler17)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInputPurpose?(self, param0) + } + + let handler18: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::invisible-char", handler: gCallback(handler18)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInvisibleCharacter?(self, param0) + } + + let handler19: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::invisible-char-set", handler: gCallback(handler19)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInvisibleCharacterSet?(self, param0) + } + + let handler20: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::max-length", handler: gCallback(handler20)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMaxLength?(self, param0) + } + + let handler21: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::menu-entry-icon-primary-text", handler: gCallback(handler21)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMenuEntryIconPrimaryText?(self, param0) + } + + let handler22: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::menu-entry-icon-secondary-text", handler: gCallback(handler22)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMenuEntryIconSecondaryText?(self, param0) + } + + let handler23: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::overwrite-mode", handler: gCallback(handler23)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyOverwriteMode?(self, param0) + } + + let handler24: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::placeholder-text", handler: gCallback(handler24)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPlaceholderText?(self, param0) + } + + let handler25: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-activatable", handler: gCallback(handler25)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconActivatable?(self, param0) + } + + let handler26: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-gicon", handler: gCallback(handler26)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconGicon?(self, param0) + } + + let handler27: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-name", handler: gCallback(handler27)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconName?(self, param0) + } + + let handler28: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-paintable", handler: gCallback(handler28)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconPaintable?(self, param0) + } + + let handler29: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-sensitive", handler: gCallback(handler29)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconSensitive?(self, param0) + } + + let handler30: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-storage-type", handler: gCallback(handler30)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconStorageType?(self, param0) + } + + let handler31: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-tooltip-markup", handler: gCallback(handler31)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconTooltipMarkup?(self, param0) + } + + let handler32: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-tooltip-text", handler: gCallback(handler32)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconTooltipText?(self, param0) + } + + let handler33: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::progress-fraction", handler: gCallback(handler33)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyProgressFraction?(self, param0) + } + + let handler34: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::progress-pulse-step", handler: gCallback(handler34)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyProgressPulseStep?(self, param0) + } + + let handler35: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::scroll-offset", handler: gCallback(handler35)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyScrollOffset?(self, param0) + } + + let handler36: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-activatable", handler: gCallback(handler36)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconActivatable?(self, param0) + } + + let handler37: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-gicon", handler: gCallback(handler37)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconGicon?(self, param0) + } + + let handler38: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-name", handler: gCallback(handler38)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconName?(self, param0) + } + + let handler39: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-paintable", handler: gCallback(handler39)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconPaintable?(self, param0) + } + + let handler40: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-sensitive", handler: gCallback(handler40)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconSensitive?(self, param0) + } + + let handler41: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-storage-type", handler: gCallback(handler41)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconStorageType?(self, param0) + } + + let handler42: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-tooltip-markup", handler: gCallback(handler42)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconTooltipMarkup?(self, param0) + } + + let handler43: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-tooltip-text", handler: gCallback(handler43)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconTooltipText?(self, param0) + } + + let handler44: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::show-emoji-icon", handler: gCallback(handler44)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowEmojiIcon?(self, param0) + } + + let handler45: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::tabs", handler: gCallback(handler45)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTabs?(self, param0) + } + + let handler46: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::text-length", handler: gCallback(handler46)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTextLength?(self, param0) + } + + let handler47: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::truncate-multiline", handler: gCallback(handler47)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTruncateMultiline?(self, param0) + } + + let handler48: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::visibility", handler: gCallback(handler48)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyVisibility?(self, param0) + } + + let handler49: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::editing-canceled", handler: gCallback(handler49)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEditingCanceled?(self, param0) + } + + let handler50: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::cursor-position", handler: gCallback(handler50)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCursorPosition?(self, param0) + } + + let handler51: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::editable", handler: gCallback(handler51)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEditable?(self, param0) + } + + let handler52: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::enable-undo", handler: gCallback(handler52)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEnableUndo?(self, param0) + } + + let handler53: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::max-width-chars", handler: gCallback(handler53)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMaxWidthChars?(self, param0) + } + + let handler54: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::selection-bound", handler: gCallback(handler54)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectionBound?(self, param0) + } + + let handler55: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::text", handler: gCallback(handler55)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyText?(self, param0) + } + + let handler56: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::width-chars", handler: gCallback(handler56)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWidthChars?(self, param0) + } + + let handler57: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::xalign", handler: gCallback(handler57)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyXalign?(self, param0) + } } -addSignal(name: "notify::overwrite-mode", handler: gCallback(handler23)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyOverwriteMode?(self, param0) -} - -let handler24: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::placeholder-text", handler: gCallback(handler24)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPlaceholderText?(self, param0) -} - -let handler25: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-activatable", handler: gCallback(handler25)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconActivatable?(self, param0) -} - -let handler26: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-gicon", handler: gCallback(handler26)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconGicon?(self, param0) -} - -let handler27: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-name", handler: gCallback(handler27)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconName?(self, param0) -} - -let handler28: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-paintable", handler: gCallback(handler28)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconPaintable?(self, param0) -} - -let handler29: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-sensitive", handler: gCallback(handler29)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconSensitive?(self, param0) -} - -let handler30: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-storage-type", handler: gCallback(handler30)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconStorageType?(self, param0) -} - -let handler31: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-tooltip-markup", handler: gCallback(handler31)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconTooltipMarkup?(self, param0) -} - -let handler32: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-tooltip-text", handler: gCallback(handler32)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconTooltipText?(self, param0) -} - -let handler33: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::progress-fraction", handler: gCallback(handler33)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyProgressFraction?(self, param0) -} - -let handler34: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::progress-pulse-step", handler: gCallback(handler34)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyProgressPulseStep?(self, param0) -} - -let handler35: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::scroll-offset", handler: gCallback(handler35)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyScrollOffset?(self, param0) -} - -let handler36: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::secondary-icon-activatable", handler: gCallback(handler36)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconActivatable?(self, param0) -} - -let handler37: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::secondary-icon-gicon", handler: gCallback(handler37)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconGicon?(self, param0) -} - -let handler38: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::secondary-icon-name", handler: gCallback(handler38)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconName?(self, param0) -} - -let handler39: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::secondary-icon-paintable", handler: gCallback(handler39)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconPaintable?(self, param0) -} - -let handler40: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::secondary-icon-sensitive", handler: gCallback(handler40)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconSensitive?(self, param0) -} - -let handler41: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::secondary-icon-storage-type", handler: gCallback(handler41)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconStorageType?(self, param0) -} - -let handler42: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::secondary-icon-tooltip-markup", handler: gCallback(handler42)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconTooltipMarkup?(self, param0) -} - -let handler43: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::secondary-icon-tooltip-text", handler: gCallback(handler43)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconTooltipText?(self, param0) -} - -let handler44: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::show-emoji-icon", handler: gCallback(handler44)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowEmojiIcon?(self, param0) -} - -let handler45: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::tabs", handler: gCallback(handler45)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTabs?(self, param0) -} - -let handler46: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::text-length", handler: gCallback(handler46)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTextLength?(self, param0) -} - -let handler47: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::truncate-multiline", handler: gCallback(handler47)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTruncateMultiline?(self, param0) -} - -let handler48: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::visibility", handler: gCallback(handler48)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyVisibility?(self, param0) -} - -let handler49: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::editing-canceled", handler: gCallback(handler49)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEditingCanceled?(self, param0) -} - -let handler50: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::cursor-position", handler: gCallback(handler50)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCursorPosition?(self, param0) -} - -let handler51: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::editable", handler: gCallback(handler51)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEditable?(self, param0) -} - -let handler52: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::enable-undo", handler: gCallback(handler52)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEnableUndo?(self, param0) -} - -let handler53: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::max-width-chars", handler: gCallback(handler53)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMaxWidthChars?(self, param0) -} - -let handler54: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::selection-bound", handler: gCallback(handler54)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectionBound?(self, param0) -} - -let handler55: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::text", handler: gCallback(handler55)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyText?(self, param0) -} - -let handler56: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::width-chars", handler: gCallback(handler56)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWidthChars?(self, param0) -} - -let handler57: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::xalign", handler: gCallback(handler57)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyXalign?(self, param0) -} -} - /// Whether to activate the default widget when Enter is pressed. -@GObjectProperty(named: "activates-default") public var activatesDefault: Bool - -/// Whether the entry should draw a frame. -@GObjectProperty(named: "has-frame") public var hasFrame: Bool - -/// The purpose of this text field. -/// -/// This property can be used by on-screen keyboards and other input -/// methods to adjust their behaviour. -/// -/// Note that setting the purpose to %GTK_INPUT_PURPOSE_PASSWORD or -/// %GTK_INPUT_PURPOSE_PIN is independent from setting -/// [property@Gtk.Entry:visibility]. -@GObjectProperty(named: "input-purpose") public var inputPurpose: InputPurpose - -/// The character to use when masking entry contents (“password mode”). -@GObjectProperty(named: "invisible-char") public var invisibleCharacter: UInt - -/// Maximum number of characters for this entry. -@GObjectProperty(named: "max-length") public var maxLength: Int - -/// If text is overwritten when typing in the `GtkEntry`. -@GObjectProperty(named: "overwrite-mode") public var overwriteMode: Bool - -/// The text that will be displayed in the `GtkEntry` when it is empty -/// and unfocused. -@GObjectProperty(named: "placeholder-text") public var placeholderText: String? - -/// The current fraction of the task that's been completed. -@GObjectProperty(named: "progress-fraction") public var progressFraction: Double - -/// The fraction of total entry width to move the progress -/// bouncing block for each pulse. -/// -/// See [method@Gtk.Entry.progress_pulse]. -@GObjectProperty(named: "progress-pulse-step") public var progressPulseStep: Double - -/// The length of the text in the `GtkEntry`. -@GObjectProperty(named: "text-length") public var textLength: UInt - -/// Whether the entry should show the “invisible char” instead of the -/// actual text (“password mode”). -@GObjectProperty(named: "visibility") public var visibility: Bool - -/// The current position of the insertion cursor in chars. -@GObjectProperty(named: "cursor-position") public var cursorPosition: Int - -/// Whether the entry contents can be edited. -@GObjectProperty(named: "editable") public var editable: Bool - -/// If undo/redo should be enabled for the editable. -@GObjectProperty(named: "enable-undo") public var enableUndo: Bool - -/// The desired maximum width of the entry, in characters. -@GObjectProperty(named: "max-width-chars") public var maxWidthChars: Int - -/// The contents of the entry. -@GObjectProperty(named: "text") public var text: String - -/// Number of characters to leave space for in the entry. -@GObjectProperty(named: "width-chars") public var widthChars: Int - -/// The horizontal alignment, from 0 (left) to 1 (right). -/// -/// Reversed for RTL layouts. -@GObjectProperty(named: "xalign") public var xalign: Float - -/// Emitted when the entry is activated. -/// -/// The keybindings for this signal are all forms of the Enter key. -public var activate: ((Entry) -> Void)? - -/// Emitted when an activatable icon is clicked. -public var iconPress: ((Entry, GtkEntryIconPosition) -> Void)? - -/// Emitted on the button release from a mouse click -/// over an activatable icon. -public var iconRelease: ((Entry, GtkEntryIconPosition) -> Void)? - -/// This signal is a sign for the cell renderer to update its -/// value from the @cell_editable. -/// -/// Implementations of `GtkCellEditable` are responsible for -/// emitting this signal when they are done editing, e.g. -/// `GtkEntry` emits this signal when the user presses Enter. Typical things to -/// do in a handler for ::editing-done are to capture the edited value, -/// disconnect the @cell_editable from signals on the `GtkCellRenderer`, etc. -/// -/// gtk_cell_editable_editing_done() is a convenience method -/// for emitting `GtkCellEditable::editing-done`. -public var editingDone: ((Entry) -> Void)? - -/// This signal is meant to indicate that the cell is finished -/// editing, and the @cell_editable widget is being removed and may -/// subsequently be destroyed. -/// -/// Implementations of `GtkCellEditable` are responsible for -/// emitting this signal when they are done editing. It must -/// be emitted after the `GtkCellEditable::editing-done` signal, -/// to give the cell renderer a chance to update the cell's value -/// before the widget is removed. -/// -/// gtk_cell_editable_remove_widget() is a convenience method -/// for emitting `GtkCellEditable::remove-widget`. -public var removeWidget: ((Entry) -> Void)? - -/// Emitted at the end of a single user-visible operation on the -/// contents. -/// -/// E.g., a paste operation that replaces the contents of the -/// selection will cause only one signal emission (even though it -/// is implemented by first deleting the selection, then inserting -/// the new content, and may cause multiple ::notify::text signals -/// to be emitted). -public var changed: ((Entry) -> Void)? - -/// Emitted when text is deleted from the widget by the user. -/// -/// The default handler for this signal will normally be responsible for -/// deleting the text, so by connecting to this signal and then stopping -/// the signal with g_signal_stop_emission(), it is possible to modify the -/// range of deleted text, or prevent it from being deleted entirely. -/// -/// The @start_pos and @end_pos parameters are interpreted as for -/// [method@Gtk.Editable.delete_text]. -public var deleteText: ((Entry, Int, Int) -> Void)? - -/// Emitted when text is inserted into the widget by the user. -/// -/// The default handler for this signal will normally be responsible -/// for inserting the text, so by connecting to this signal and then -/// stopping the signal with g_signal_stop_emission(), it is possible -/// to modify the inserted text, or prevent it from being inserted entirely. -public var insertText: ((Entry, UnsafePointer, Int, gpointer) -> Void)? - - -public var notifyActivatesDefault: ((Entry, OpaquePointer) -> Void)? - - -public var notifyAttributes: ((Entry, OpaquePointer) -> Void)? - - -public var notifyBuffer: ((Entry, OpaquePointer) -> Void)? - - -public var notifyCompletion: ((Entry, OpaquePointer) -> Void)? + @GObjectProperty(named: "activates-default") public var activatesDefault: Bool + + /// Whether the entry should draw a frame. + @GObjectProperty(named: "has-frame") public var hasFrame: Bool + + /// The purpose of this text field. + /// + /// This property can be used by on-screen keyboards and other input + /// methods to adjust their behaviour. + /// + /// Note that setting the purpose to %GTK_INPUT_PURPOSE_PASSWORD or + /// %GTK_INPUT_PURPOSE_PIN is independent from setting + /// [property@Gtk.Entry:visibility]. + @GObjectProperty(named: "input-purpose") public var inputPurpose: InputPurpose + + /// The character to use when masking entry contents (“password mode”). + @GObjectProperty(named: "invisible-char") public var invisibleCharacter: UInt + + /// Maximum number of characters for this entry. + @GObjectProperty(named: "max-length") public var maxLength: Int + + /// If text is overwritten when typing in the `GtkEntry`. + @GObjectProperty(named: "overwrite-mode") public var overwriteMode: Bool + + /// The text that will be displayed in the `GtkEntry` when it is empty + /// and unfocused. + @GObjectProperty(named: "placeholder-text") public var placeholderText: String? + + /// The current fraction of the task that's been completed. + @GObjectProperty(named: "progress-fraction") public var progressFraction: Double + + /// The fraction of total entry width to move the progress + /// bouncing block for each pulse. + /// + /// See [method@Gtk.Entry.progress_pulse]. + @GObjectProperty(named: "progress-pulse-step") public var progressPulseStep: Double + + /// The length of the text in the `GtkEntry`. + @GObjectProperty(named: "text-length") public var textLength: UInt + + /// Whether the entry should show the “invisible char” instead of the + /// actual text (“password mode”). + @GObjectProperty(named: "visibility") public var visibility: Bool + + /// The current position of the insertion cursor in chars. + @GObjectProperty(named: "cursor-position") public var cursorPosition: Int + + /// Whether the entry contents can be edited. + @GObjectProperty(named: "editable") public var editable: Bool + + /// If undo/redo should be enabled for the editable. + @GObjectProperty(named: "enable-undo") public var enableUndo: Bool + + /// The desired maximum width of the entry, in characters. + @GObjectProperty(named: "max-width-chars") public var maxWidthChars: Int + + /// The contents of the entry. + @GObjectProperty(named: "text") public var text: String + + /// Number of characters to leave space for in the entry. + @GObjectProperty(named: "width-chars") public var widthChars: Int + + /// The horizontal alignment, from 0 (left) to 1 (right). + /// + /// Reversed for RTL layouts. + @GObjectProperty(named: "xalign") public var xalign: Float + /// Emitted when the entry is activated. + /// + /// The keybindings for this signal are all forms of the Enter key. + public var activate: ((Entry) -> Void)? -public var notifyEnableEmojiCompletion: ((Entry, OpaquePointer) -> Void)? + /// Emitted when an activatable icon is clicked. + public var iconPress: ((Entry, GtkEntryIconPosition) -> Void)? + /// Emitted on the button release from a mouse click + /// over an activatable icon. + public var iconRelease: ((Entry, GtkEntryIconPosition) -> Void)? -public var notifyExtraMenu: ((Entry, OpaquePointer) -> Void)? + /// This signal is a sign for the cell renderer to update its + /// value from the @cell_editable. + /// + /// Implementations of `GtkCellEditable` are responsible for + /// emitting this signal when they are done editing, e.g. + /// `GtkEntry` emits this signal when the user presses Enter. Typical things to + /// do in a handler for ::editing-done are to capture the edited value, + /// disconnect the @cell_editable from signals on the `GtkCellRenderer`, etc. + /// + /// gtk_cell_editable_editing_done() is a convenience method + /// for emitting `GtkCellEditable::editing-done`. + public var editingDone: ((Entry) -> Void)? + /// This signal is meant to indicate that the cell is finished + /// editing, and the @cell_editable widget is being removed and may + /// subsequently be destroyed. + /// + /// Implementations of `GtkCellEditable` are responsible for + /// emitting this signal when they are done editing. It must + /// be emitted after the `GtkCellEditable::editing-done` signal, + /// to give the cell renderer a chance to update the cell's value + /// before the widget is removed. + /// + /// gtk_cell_editable_remove_widget() is a convenience method + /// for emitting `GtkCellEditable::remove-widget`. + public var removeWidget: ((Entry) -> Void)? -public var notifyHasFrame: ((Entry, OpaquePointer) -> Void)? + /// Emitted at the end of a single user-visible operation on the + /// contents. + /// + /// E.g., a paste operation that replaces the contents of the + /// selection will cause only one signal emission (even though it + /// is implemented by first deleting the selection, then inserting + /// the new content, and may cause multiple ::notify::text signals + /// to be emitted). + public var changed: ((Entry) -> Void)? + /// Emitted when text is deleted from the widget by the user. + /// + /// The default handler for this signal will normally be responsible for + /// deleting the text, so by connecting to this signal and then stopping + /// the signal with g_signal_stop_emission(), it is possible to modify the + /// range of deleted text, or prevent it from being deleted entirely. + /// + /// The @start_pos and @end_pos parameters are interpreted as for + /// [method@Gtk.Editable.delete_text]. + public var deleteText: ((Entry, Int, Int) -> Void)? -public var notifyImModule: ((Entry, OpaquePointer) -> Void)? + /// Emitted when text is inserted into the widget by the user. + /// + /// The default handler for this signal will normally be responsible + /// for inserting the text, so by connecting to this signal and then + /// stopping the signal with g_signal_stop_emission(), it is possible + /// to modify the inserted text, or prevent it from being inserted entirely. + public var insertText: ((Entry, UnsafePointer, Int, gpointer) -> Void)? + public var notifyActivatesDefault: ((Entry, OpaquePointer) -> Void)? -public var notifyInputHints: ((Entry, OpaquePointer) -> Void)? + public var notifyAttributes: ((Entry, OpaquePointer) -> Void)? + public var notifyBuffer: ((Entry, OpaquePointer) -> Void)? -public var notifyInputPurpose: ((Entry, OpaquePointer) -> Void)? + public var notifyCompletion: ((Entry, OpaquePointer) -> Void)? + public var notifyEnableEmojiCompletion: ((Entry, OpaquePointer) -> Void)? -public var notifyInvisibleCharacter: ((Entry, OpaquePointer) -> Void)? + public var notifyExtraMenu: ((Entry, OpaquePointer) -> Void)? + public var notifyHasFrame: ((Entry, OpaquePointer) -> Void)? -public var notifyInvisibleCharacterSet: ((Entry, OpaquePointer) -> Void)? + public var notifyImModule: ((Entry, OpaquePointer) -> Void)? + public var notifyInputHints: ((Entry, OpaquePointer) -> Void)? -public var notifyMaxLength: ((Entry, OpaquePointer) -> Void)? + public var notifyInputPurpose: ((Entry, OpaquePointer) -> Void)? + public var notifyInvisibleCharacter: ((Entry, OpaquePointer) -> Void)? -public var notifyMenuEntryIconPrimaryText: ((Entry, OpaquePointer) -> Void)? + public var notifyInvisibleCharacterSet: ((Entry, OpaquePointer) -> Void)? + public var notifyMaxLength: ((Entry, OpaquePointer) -> Void)? -public var notifyMenuEntryIconSecondaryText: ((Entry, OpaquePointer) -> Void)? + public var notifyMenuEntryIconPrimaryText: ((Entry, OpaquePointer) -> Void)? + public var notifyMenuEntryIconSecondaryText: ((Entry, OpaquePointer) -> Void)? -public var notifyOverwriteMode: ((Entry, OpaquePointer) -> Void)? + public var notifyOverwriteMode: ((Entry, OpaquePointer) -> Void)? + public var notifyPlaceholderText: ((Entry, OpaquePointer) -> Void)? -public var notifyPlaceholderText: ((Entry, OpaquePointer) -> Void)? + public var notifyPrimaryIconActivatable: ((Entry, OpaquePointer) -> Void)? + public var notifyPrimaryIconGicon: ((Entry, OpaquePointer) -> Void)? -public var notifyPrimaryIconActivatable: ((Entry, OpaquePointer) -> Void)? + public var notifyPrimaryIconName: ((Entry, OpaquePointer) -> Void)? + public var notifyPrimaryIconPaintable: ((Entry, OpaquePointer) -> Void)? -public var notifyPrimaryIconGicon: ((Entry, OpaquePointer) -> Void)? + public var notifyPrimaryIconSensitive: ((Entry, OpaquePointer) -> Void)? + public var notifyPrimaryIconStorageType: ((Entry, OpaquePointer) -> Void)? -public var notifyPrimaryIconName: ((Entry, OpaquePointer) -> Void)? + public var notifyPrimaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? + public var notifyPrimaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? -public var notifyPrimaryIconPaintable: ((Entry, OpaquePointer) -> Void)? + public var notifyProgressFraction: ((Entry, OpaquePointer) -> Void)? + public var notifyProgressPulseStep: ((Entry, OpaquePointer) -> Void)? -public var notifyPrimaryIconSensitive: ((Entry, OpaquePointer) -> Void)? + public var notifyScrollOffset: ((Entry, OpaquePointer) -> Void)? + public var notifySecondaryIconActivatable: ((Entry, OpaquePointer) -> Void)? -public var notifyPrimaryIconStorageType: ((Entry, OpaquePointer) -> Void)? + public var notifySecondaryIconGicon: ((Entry, OpaquePointer) -> Void)? + public var notifySecondaryIconName: ((Entry, OpaquePointer) -> Void)? -public var notifyPrimaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? + public var notifySecondaryIconPaintable: ((Entry, OpaquePointer) -> Void)? + public var notifySecondaryIconSensitive: ((Entry, OpaquePointer) -> Void)? -public var notifyPrimaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? + public var notifySecondaryIconStorageType: ((Entry, OpaquePointer) -> Void)? + public var notifySecondaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? -public var notifyProgressFraction: ((Entry, OpaquePointer) -> Void)? + public var notifySecondaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? + public var notifyShowEmojiIcon: ((Entry, OpaquePointer) -> Void)? -public var notifyProgressPulseStep: ((Entry, OpaquePointer) -> Void)? + public var notifyTabs: ((Entry, OpaquePointer) -> Void)? + public var notifyTextLength: ((Entry, OpaquePointer) -> Void)? -public var notifyScrollOffset: ((Entry, OpaquePointer) -> Void)? + public var notifyTruncateMultiline: ((Entry, OpaquePointer) -> Void)? + public var notifyVisibility: ((Entry, OpaquePointer) -> Void)? -public var notifySecondaryIconActivatable: ((Entry, OpaquePointer) -> Void)? + public var notifyEditingCanceled: ((Entry, OpaquePointer) -> Void)? + public var notifyCursorPosition: ((Entry, OpaquePointer) -> Void)? -public var notifySecondaryIconGicon: ((Entry, OpaquePointer) -> Void)? + public var notifyEditable: ((Entry, OpaquePointer) -> Void)? + public var notifyEnableUndo: ((Entry, OpaquePointer) -> Void)? -public var notifySecondaryIconName: ((Entry, OpaquePointer) -> Void)? + public var notifyMaxWidthChars: ((Entry, OpaquePointer) -> Void)? + public var notifySelectionBound: ((Entry, OpaquePointer) -> Void)? -public var notifySecondaryIconPaintable: ((Entry, OpaquePointer) -> Void)? + public var notifyText: ((Entry, OpaquePointer) -> Void)? + public var notifyWidthChars: ((Entry, OpaquePointer) -> Void)? -public var notifySecondaryIconSensitive: ((Entry, OpaquePointer) -> Void)? - - -public var notifySecondaryIconStorageType: ((Entry, OpaquePointer) -> Void)? - - -public var notifySecondaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? - - -public var notifySecondaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? - - -public var notifyShowEmojiIcon: ((Entry, OpaquePointer) -> Void)? - - -public var notifyTabs: ((Entry, OpaquePointer) -> Void)? - - -public var notifyTextLength: ((Entry, OpaquePointer) -> Void)? - - -public var notifyTruncateMultiline: ((Entry, OpaquePointer) -> Void)? - - -public var notifyVisibility: ((Entry, OpaquePointer) -> Void)? - - -public var notifyEditingCanceled: ((Entry, OpaquePointer) -> Void)? - - -public var notifyCursorPosition: ((Entry, OpaquePointer) -> Void)? - - -public var notifyEditable: ((Entry, OpaquePointer) -> Void)? - - -public var notifyEnableUndo: ((Entry, OpaquePointer) -> Void)? - - -public var notifyMaxWidthChars: ((Entry, OpaquePointer) -> Void)? - - -public var notifySelectionBound: ((Entry, OpaquePointer) -> Void)? - - -public var notifyText: ((Entry, OpaquePointer) -> Void)? - - -public var notifyWidthChars: ((Entry, OpaquePointer) -> Void)? - - -public var notifyXalign: ((Entry, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyXalign: ((Entry, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/EntryIconPosition.swift b/Sources/Gtk/Generated/EntryIconPosition.swift index 9528a4e836..6ef056f05c 100644 --- a/Sources/Gtk/Generated/EntryIconPosition.swift +++ b/Sources/Gtk/Generated/EntryIconPosition.swift @@ -5,20 +5,20 @@ public enum EntryIconPosition: GValueRepresentableEnum { public typealias GtkEnum = GtkEntryIconPosition /// At the beginning of the entry (depending on the text direction). -case primary -/// At the end of the entry (depending on the text direction). -case secondary + case primary + /// At the end of the entry (depending on the text direction). + case secondary public static var type: GType { - gtk_entry_icon_position_get_type() -} + gtk_entry_icon_position_get_type() + } public init(from gtkEnum: GtkEntryIconPosition) { switch gtkEnum { case GTK_ENTRY_ICON_PRIMARY: - self = .primary -case GTK_ENTRY_ICON_SECONDARY: - self = .secondary + self = .primary + case GTK_ENTRY_ICON_SECONDARY: + self = .secondary default: fatalError("Unsupported GtkEntryIconPosition enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ case GTK_ENTRY_ICON_SECONDARY: public func toGtk() -> GtkEntryIconPosition { switch self { case .primary: - return GTK_ENTRY_ICON_PRIMARY -case .secondary: - return GTK_ENTRY_ICON_SECONDARY + return GTK_ENTRY_ICON_PRIMARY + case .secondary: + return GTK_ENTRY_ICON_SECONDARY } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/EventController.swift b/Sources/Gtk/Generated/EventController.swift index 6842e79b31..c29ce1254a 100644 --- a/Sources/Gtk/Generated/EventController.swift +++ b/Sources/Gtk/Generated/EventController.swift @@ -1,82 +1,85 @@ import CGtk /// The base class for event controllers. -/// +/// /// These are ancillary objects associated to widgets, which react /// to `GdkEvents`, and possibly trigger actions as a consequence. -/// +/// /// Event controllers are added to a widget with /// [method@Gtk.Widget.add_controller]. It is rarely necessary to /// explicitly remove a controller with [method@Gtk.Widget.remove_controller]. -/// +/// /// See the chapter on [input handling](input-handling.html) for /// an overview of the basic concepts, such as the capture and bubble /// phases of event propagation. open class EventController: GObject { - public override func registerSignals() { - super.registerSignals() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::name", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyName?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + super.registerSignals() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::name", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyName?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::propagation-limit", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPropagationLimit?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::propagation-phase", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPropagationPhase?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::widget", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWidget?(self, param0) + } } -addSignal(name: "notify::propagation-limit", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPropagationLimit?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::propagation-phase", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPropagationPhase?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::widget", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWidget?(self, param0) -} -} - /// The name for this controller, typically used for debugging purposes. -@GObjectProperty(named: "name") public var name: String? + @GObjectProperty(named: "name") public var name: String? -/// The limit for which events this controller will handle. -@GObjectProperty(named: "propagation-limit") public var propagationLimit: PropagationLimit + /// The limit for which events this controller will handle. + @GObjectProperty(named: "propagation-limit") public var propagationLimit: PropagationLimit -/// The propagation phase at which this controller will handle events. -@GObjectProperty(named: "propagation-phase") public var propagationPhase: PropagationPhase + /// The propagation phase at which this controller will handle events. + @GObjectProperty(named: "propagation-phase") public var propagationPhase: PropagationPhase + public var notifyName: ((EventController, OpaquePointer) -> Void)? -public var notifyName: ((EventController, OpaquePointer) -> Void)? + public var notifyPropagationLimit: ((EventController, OpaquePointer) -> Void)? + public var notifyPropagationPhase: ((EventController, OpaquePointer) -> Void)? -public var notifyPropagationLimit: ((EventController, OpaquePointer) -> Void)? - - -public var notifyPropagationPhase: ((EventController, OpaquePointer) -> Void)? - - -public var notifyWidget: ((EventController, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyWidget: ((EventController, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/EventControllerMotion.swift b/Sources/Gtk/Generated/EventControllerMotion.swift index 9310628743..152ca94e59 100644 --- a/Sources/Gtk/Generated/EventControllerMotion.swift +++ b/Sources/Gtk/Generated/EventControllerMotion.swift @@ -1,7 +1,7 @@ import CGtk /// Tracks the pointer position. -/// +/// /// The event controller offers [signal@Gtk.EventControllerMotion::enter] /// and [signal@Gtk.EventControllerMotion::leave] signals, as well as /// [property@Gtk.EventControllerMotion:is-pointer] and @@ -10,92 +10,100 @@ import CGtk /// moves over the widget. open class EventControllerMotion: EventController { /// Creates a new event controller that will handle motion events. -public convenience init() { - self.init( - gtk_event_controller_motion_new() - ) -} - - public override func registerSignals() { - super.registerSignals() - - let handler0: @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) + public convenience init() { + self.init( + gtk_event_controller_motion_new() + ) } -addSignal(name: "enter", handler: gCallback(handler0)) { [weak self] (param0: Double, param1: Double) in - guard let self = self else { return } - self.enter?(self, param0, param1) -} - -addSignal(name: "leave") { [weak self] () in - guard let self = self else { return } - self.leave?(self) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - -addSignal(name: "motion", handler: gCallback(handler2)) { [weak self] (param0: Double, param1: Double) in - guard let self = self else { return } - self.motion?(self, param0, param1) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::contains-pointer", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContainsPointer?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public override func registerSignals() { + super.registerSignals() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> + Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "enter", handler: gCallback(handler0)) { + [weak self] (param0: Double, param1: Double) in + guard let self = self else { return } + self.enter?(self, param0, param1) + } + + addSignal(name: "leave") { [weak self] () in + guard let self = self else { return } + self.leave?(self) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> + Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "motion", handler: gCallback(handler2)) { + [weak self] (param0: Double, param1: Double) in + guard let self = self else { return } + self.motion?(self, param0, param1) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::contains-pointer", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContainsPointer?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::is-pointer", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIsPointer?(self, param0) + } } -addSignal(name: "notify::is-pointer", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIsPointer?(self, param0) -} -} - /// Whether the pointer is in the controllers widget or a descendant. -/// -/// See also [property@Gtk.EventControllerMotion:is-pointer]. -/// -/// When handling crossing events, this property is updated -/// before [signal@Gtk.EventControllerMotion::enter], but after -/// [signal@Gtk.EventControllerMotion::leave] is emitted. -@GObjectProperty(named: "contains-pointer") public var containsPointer: Bool - -/// Whether the pointer is in the controllers widget itself, -/// as opposed to in a descendent widget. -/// -/// See also [property@Gtk.EventControllerMotion:contains-pointer]. -/// -/// When handling crossing events, this property is updated -/// before [signal@Gtk.EventControllerMotion::enter], but after -/// [signal@Gtk.EventControllerMotion::leave] is emitted. -@GObjectProperty(named: "is-pointer") public var isPointer: Bool - -/// Signals that the pointer has entered the widget. -public var enter: ((EventControllerMotion, Double, Double) -> Void)? - -/// Signals that the pointer has left the widget. -public var leave: ((EventControllerMotion) -> Void)? - -/// Emitted when the pointer moves inside the widget. -public var motion: ((EventControllerMotion, Double, Double) -> Void)? - - -public var notifyContainsPointer: ((EventControllerMotion, OpaquePointer) -> Void)? - - -public var notifyIsPointer: ((EventControllerMotion, OpaquePointer) -> Void)? -} \ No newline at end of file + /// + /// See also [property@Gtk.EventControllerMotion:is-pointer]. + /// + /// When handling crossing events, this property is updated + /// before [signal@Gtk.EventControllerMotion::enter], but after + /// [signal@Gtk.EventControllerMotion::leave] is emitted. + @GObjectProperty(named: "contains-pointer") public var containsPointer: Bool + + /// Whether the pointer is in the controllers widget itself, + /// as opposed to in a descendent widget. + /// + /// See also [property@Gtk.EventControllerMotion:contains-pointer]. + /// + /// When handling crossing events, this property is updated + /// before [signal@Gtk.EventControllerMotion::enter], but after + /// [signal@Gtk.EventControllerMotion::leave] is emitted. + @GObjectProperty(named: "is-pointer") public var isPointer: Bool + + /// Signals that the pointer has entered the widget. + public var enter: ((EventControllerMotion, Double, Double) -> Void)? + + /// Signals that the pointer has left the widget. + public var leave: ((EventControllerMotion) -> Void)? + + /// Emitted when the pointer moves inside the widget. + public var motion: ((EventControllerMotion, Double, Double) -> Void)? + + public var notifyContainsPointer: ((EventControllerMotion, OpaquePointer) -> Void)? + + public var notifyIsPointer: ((EventControllerMotion, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/EventSequenceState.swift b/Sources/Gtk/Generated/EventSequenceState.swift index ca6ae3e2d7..d64e046cab 100644 --- a/Sources/Gtk/Generated/EventSequenceState.swift +++ b/Sources/Gtk/Generated/EventSequenceState.swift @@ -5,24 +5,24 @@ public enum EventSequenceState: GValueRepresentableEnum { public typealias GtkEnum = GtkEventSequenceState /// The sequence is handled, but not grabbed. -case none -/// The sequence is handled and grabbed. -case claimed -/// The sequence is denied. -case denied + case none + /// The sequence is handled and grabbed. + case claimed + /// The sequence is denied. + case denied public static var type: GType { - gtk_event_sequence_state_get_type() -} + gtk_event_sequence_state_get_type() + } public init(from gtkEnum: GtkEventSequenceState) { switch gtkEnum { case GTK_EVENT_SEQUENCE_NONE: - self = .none -case GTK_EVENT_SEQUENCE_CLAIMED: - self = .claimed -case GTK_EVENT_SEQUENCE_DENIED: - self = .denied + self = .none + case GTK_EVENT_SEQUENCE_CLAIMED: + self = .claimed + case GTK_EVENT_SEQUENCE_DENIED: + self = .denied default: fatalError("Unsupported GtkEventSequenceState enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ case GTK_EVENT_SEQUENCE_DENIED: public func toGtk() -> GtkEventSequenceState { switch self { case .none: - return GTK_EVENT_SEQUENCE_NONE -case .claimed: - return GTK_EVENT_SEQUENCE_CLAIMED -case .denied: - return GTK_EVENT_SEQUENCE_DENIED + return GTK_EVENT_SEQUENCE_NONE + case .claimed: + return GTK_EVENT_SEQUENCE_CLAIMED + case .denied: + return GTK_EVENT_SEQUENCE_DENIED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/FileChooser.swift b/Sources/Gtk/Generated/FileChooser.swift index ca019aca97..057280132d 100644 --- a/Sources/Gtk/Generated/FileChooser.swift +++ b/Sources/Gtk/Generated/FileChooser.swift @@ -2,37 +2,37 @@ import CGtk /// `GtkFileChooser` is an interface that can be implemented by file /// selection widgets. -/// +/// /// In GTK, the main objects that implement this interface are /// [class@Gtk.FileChooserWidget] and [class@Gtk.FileChooserDialog]. -/// +/// /// You do not need to write an object that implements the `GtkFileChooser` /// interface unless you are trying to adapt an existing file selector to /// expose a standard programming interface. -/// +/// /// `GtkFileChooser` allows for shortcuts to various places in the filesystem. /// In the default implementation these are displayed in the left pane. It /// may be a bit confusing at first that these shortcuts come from various /// sources and in various flavours, so lets explain the terminology here: -/// +/// /// - Bookmarks: are created by the user, by dragging folders from the /// right pane to the left pane, or by using the “Add”. Bookmarks /// can be renamed and deleted by the user. -/// +/// /// - Shortcuts: can be provided by the application. For example, a Paint /// program may want to add a shortcut for a Clipart folder. Shortcuts /// cannot be modified by the user. -/// +/// /// - Volumes: are provided by the underlying filesystem abstraction. They are /// the “roots” of the filesystem. -/// +/// /// # File Names and Encodings -/// +/// /// When the user is finished selecting files in a `GtkFileChooser`, your /// program can get the selected filenames as `GFile`s. -/// +/// /// # Adding options -/// +/// /// You can add extra widgets to a file chooser to provide options /// that are not present in the default design, by using /// [method@Gtk.FileChooser.add_choice]. Each choice has an identifier and @@ -42,28 +42,27 @@ import CGtk /// be rendered as a combo box. public protocol FileChooser: GObjectRepresentable { /// The type of operation that the file chooser is performing. -var action: FileChooserAction { get set } + var action: FileChooserAction { get set } -/// Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode -/// will offer the user to create new folders. -var createFolders: Bool { get set } + /// Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode + /// will offer the user to create new folders. + var createFolders: Bool { get set } -/// A `GListModel` containing the filters that have been -/// added with gtk_file_chooser_add_filter(). -/// -/// The returned object should not be modified. It may -/// or may not be updated for later changes. -var filters: OpaquePointer { get set } + /// A `GListModel` containing the filters that have been + /// added with gtk_file_chooser_add_filter(). + /// + /// The returned object should not be modified. It may + /// or may not be updated for later changes. + var filters: OpaquePointer { get set } -/// Whether to allow multiple files to be selected. -var selectMultiple: Bool { get set } + /// Whether to allow multiple files to be selected. + var selectMultiple: Bool { get set } -/// A `GListModel` containing the shortcut folders that have been -/// added with gtk_file_chooser_add_shortcut_folder(). -/// -/// The returned object should not be modified. It may -/// or may not be updated for later changes. -var shortcutFolders: OpaquePointer { get set } + /// A `GListModel` containing the shortcut folders that have been + /// added with gtk_file_chooser_add_shortcut_folder(). + /// + /// The returned object should not be modified. It may + /// or may not be updated for later changes. + var shortcutFolders: OpaquePointer { get set } - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/FileChooserAction.swift b/Sources/Gtk/Generated/FileChooserAction.swift index dab1abc72c..fb1e889e94 100644 --- a/Sources/Gtk/Generated/FileChooserAction.swift +++ b/Sources/Gtk/Generated/FileChooserAction.swift @@ -6,29 +6,29 @@ public enum FileChooserAction: GValueRepresentableEnum { public typealias GtkEnum = GtkFileChooserAction /// Indicates open mode. The file chooser -/// will only let the user pick an existing file. -case open -/// Indicates save mode. The file chooser -/// will let the user pick an existing file, or type in a new -/// filename. -case save -/// Indicates an Open mode for -/// selecting folders. The file chooser will let the user pick an -/// existing folder. -case selectFolder + /// will only let the user pick an existing file. + case open + /// Indicates save mode. The file chooser + /// will let the user pick an existing file, or type in a new + /// filename. + case save + /// Indicates an Open mode for + /// selecting folders. The file chooser will let the user pick an + /// existing folder. + case selectFolder public static var type: GType { - gtk_file_chooser_action_get_type() -} + gtk_file_chooser_action_get_type() + } public init(from gtkEnum: GtkFileChooserAction) { switch gtkEnum { case GTK_FILE_CHOOSER_ACTION_OPEN: - self = .open -case GTK_FILE_CHOOSER_ACTION_SAVE: - self = .save -case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER: - self = .selectFolder + self = .open + case GTK_FILE_CHOOSER_ACTION_SAVE: + self = .save + case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER: + self = .selectFolder default: fatalError("Unsupported GtkFileChooserAction enum value: \(gtkEnum.rawValue)") } @@ -37,11 +37,11 @@ case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER: public func toGtk() -> GtkFileChooserAction { switch self { case .open: - return GTK_FILE_CHOOSER_ACTION_OPEN -case .save: - return GTK_FILE_CHOOSER_ACTION_SAVE -case .selectFolder: - return GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER + return GTK_FILE_CHOOSER_ACTION_OPEN + case .save: + return GTK_FILE_CHOOSER_ACTION_SAVE + case .selectFolder: + return GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/FileChooserError.swift b/Sources/Gtk/Generated/FileChooserError.swift index 4b5ae8e16a..78085a9ffa 100644 --- a/Sources/Gtk/Generated/FileChooserError.swift +++ b/Sources/Gtk/Generated/FileChooserError.swift @@ -6,30 +6,30 @@ public enum FileChooserError: GValueRepresentableEnum { public typealias GtkEnum = GtkFileChooserError /// Indicates that a file does not exist. -case nonexistent -/// Indicates a malformed filename. -case badFilename -/// Indicates a duplicate path (e.g. when -/// adding a bookmark). -case alreadyExists -/// Indicates an incomplete hostname -/// (e.g. "http://foo" without a slash after that). -case incompleteHostname + case nonexistent + /// Indicates a malformed filename. + case badFilename + /// Indicates a duplicate path (e.g. when + /// adding a bookmark). + case alreadyExists + /// Indicates an incomplete hostname + /// (e.g. "http://foo" without a slash after that). + case incompleteHostname public static var type: GType { - gtk_file_chooser_error_get_type() -} + gtk_file_chooser_error_get_type() + } public init(from gtkEnum: GtkFileChooserError) { switch gtkEnum { case GTK_FILE_CHOOSER_ERROR_NONEXISTENT: - self = .nonexistent -case GTK_FILE_CHOOSER_ERROR_BAD_FILENAME: - self = .badFilename -case GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS: - self = .alreadyExists -case GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME: - self = .incompleteHostname + self = .nonexistent + case GTK_FILE_CHOOSER_ERROR_BAD_FILENAME: + self = .badFilename + case GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS: + self = .alreadyExists + case GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME: + self = .incompleteHostname default: fatalError("Unsupported GtkFileChooserError enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ case GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME: public func toGtk() -> GtkFileChooserError { switch self { case .nonexistent: - return GTK_FILE_CHOOSER_ERROR_NONEXISTENT -case .badFilename: - return GTK_FILE_CHOOSER_ERROR_BAD_FILENAME -case .alreadyExists: - return GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS -case .incompleteHostname: - return GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME + return GTK_FILE_CHOOSER_ERROR_NONEXISTENT + case .badFilename: + return GTK_FILE_CHOOSER_ERROR_BAD_FILENAME + case .alreadyExists: + return GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS + case .incompleteHostname: + return GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/FileChooserNative.swift b/Sources/Gtk/Generated/FileChooserNative.swift index 970c5c4ead..ad788b8891 100644 --- a/Sources/Gtk/Generated/FileChooserNative.swift +++ b/Sources/Gtk/Generated/FileChooserNative.swift @@ -2,7 +2,7 @@ import CGtk /// `GtkFileChooserNative` is an abstraction of a dialog suitable /// for use with “File Open” or “File Save as” commands. -/// +/// /// By default, this just uses a `GtkFileChooserDialog` to implement /// the actual dialog. However, on some platforms, such as Windows and /// macOS, the native platform file chooser is used instead. When the @@ -10,25 +10,25 @@ import CGtk /// filesystem access (such as Flatpak), `GtkFileChooserNative` may call /// the proper APIs (portals) to let the user choose a file and make it /// available to the application. -/// +/// /// While the API of `GtkFileChooserNative` closely mirrors `GtkFileChooserDialog`, /// the main difference is that there is no access to any `GtkWindow` or `GtkWidget` /// for the dialog. This is required, as there may not be one in the case of a /// platform native dialog. -/// +/// /// Showing, hiding and running the dialog is handled by the /// [class@Gtk.NativeDialog] functions. -/// +/// /// Note that unlike `GtkFileChooserDialog`, `GtkFileChooserNative` objects /// are not toplevel widgets, and GTK does not keep them alive. It is your /// responsibility to keep a reference until you are done with the /// object. -/// +/// /// ## Typical usage -/// +/// /// In the simplest of cases, you can the following code to use /// `GtkFileChooserNative` to select a file for opening: -/// +/// /// ```c /// static void /// on_response (GtkNativeDialog *native, @@ -38,31 +38,31 @@ import CGtk /// { /// GtkFileChooser *chooser = GTK_FILE_CHOOSER (native); /// GFile *file = gtk_file_chooser_get_file (chooser); -/// +/// /// open_file (file); -/// +/// /// g_object_unref (file); /// } -/// +/// /// g_object_unref (native); /// } -/// +/// /// // ... /// GtkFileChooserNative *native; /// GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN; -/// +/// /// native = gtk_file_chooser_native_new ("Open File", /// parent_window, /// action, /// "_Open", /// "_Cancel"); -/// +/// /// g_signal_connect (native, "response", G_CALLBACK (on_response), NULL); /// gtk_native_dialog_show (GTK_NATIVE_DIALOG (native)); /// ``` -/// +/// /// To use a `GtkFileChooserNative` for saving, you can use this: -/// +/// /// ```c /// static void /// on_response (GtkNativeDialog *native, @@ -72,225 +72,236 @@ import CGtk /// { /// GtkFileChooser *chooser = GTK_FILE_CHOOSER (native); /// GFile *file = gtk_file_chooser_get_file (chooser); -/// +/// /// save_to_file (file); -/// +/// /// g_object_unref (file); /// } -/// +/// /// g_object_unref (native); /// } -/// +/// /// // ... /// GtkFileChooserNative *native; /// GtkFileChooser *chooser; /// GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SAVE; -/// +/// /// native = gtk_file_chooser_native_new ("Save File", /// parent_window, /// action, /// "_Save", /// "_Cancel"); /// chooser = GTK_FILE_CHOOSER (native); -/// +/// /// if (user_edited_a_new_document) /// gtk_file_chooser_set_current_name (chooser, _("Untitled document")); /// else /// gtk_file_chooser_set_file (chooser, existing_file, NULL); -/// +/// /// g_signal_connect (native, "response", G_CALLBACK (on_response), NULL); /// gtk_native_dialog_show (GTK_NATIVE_DIALOG (native)); /// ``` -/// +/// /// For more information on how to best set up a file dialog, /// see the [class@Gtk.FileChooserDialog] documentation. -/// +/// /// ## Response Codes -/// +/// /// `GtkFileChooserNative` inherits from [class@Gtk.NativeDialog], /// which means it will return %GTK_RESPONSE_ACCEPT if the user accepted, /// and %GTK_RESPONSE_CANCEL if he pressed cancel. It can also return /// %GTK_RESPONSE_DELETE_EVENT if the window was unexpectedly closed. -/// +/// /// ## Differences from `GtkFileChooserDialog` -/// +/// /// There are a few things in the [iface@Gtk.FileChooser] interface that /// are not possible to use with `GtkFileChooserNative`, as such use would /// prohibit the use of a native dialog. -/// +/// /// No operations that change the dialog work while the dialog is visible. /// Set all the properties that are required before showing the dialog. -/// +/// /// ## Win32 details -/// +/// /// On windows the `IFileDialog` implementation (added in Windows Vista) is /// used. It supports many of the features that `GtkFileChooser` has, but /// there are some things it does not handle: -/// +/// /// * Any [class@Gtk.FileFilter] added using a mimetype -/// +/// /// If any of these features are used the regular `GtkFileChooserDialog` /// will be used in place of the native one. -/// +/// /// ## Portal details -/// +/// /// When the `org.freedesktop.portal.FileChooser` portal is available on /// the session bus, it is used to bring up an out-of-process file chooser. /// Depending on the kind of session the application is running in, this may /// or may not be a GTK file chooser. -/// +/// /// ## macOS details -/// +/// /// On macOS the `NSSavePanel` and `NSOpenPanel` classes are used to provide /// native file chooser dialogs. Some features provided by `GtkFileChooser` /// are not supported: -/// +/// /// * Shortcut folders. open class FileChooserNative: NativeDialog, FileChooser { /// Creates a new `GtkFileChooserNative`. -public convenience init(title: String, parent: UnsafeMutablePointer!, action: GtkFileChooserAction, acceptLabel: String, cancelLabel: String) { - self.init( - gtk_file_chooser_native_new(title, parent, action, acceptLabel, cancelLabel) - ) -} - - public override func registerSignals() { - super.registerSignals() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::accept-label", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAcceptLabel?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::cancel-label", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCancelLabel?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::action", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAction?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init( + title: String, parent: UnsafeMutablePointer!, action: GtkFileChooserAction, + acceptLabel: String, cancelLabel: String + ) { + self.init( + gtk_file_chooser_native_new(title, parent, action, acceptLabel, cancelLabel) + ) } -addSignal(name: "notify::create-folders", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCreateFolders?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::filter", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFilter?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::filters", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFilters?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::select-multiple", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectMultiple?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public override func registerSignals() { + super.registerSignals() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::accept-label", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAcceptLabel?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::cancel-label", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCancelLabel?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::action", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAction?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::create-folders", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCreateFolders?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::filter", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFilter?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::filters", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFilters?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::select-multiple", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectMultiple?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::shortcut-folders", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShortcutFolders?(self, param0) + } } -addSignal(name: "notify::shortcut-folders", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShortcutFolders?(self, param0) -} -} - /// The text used for the label on the accept button in the dialog, or -/// %NULL to use the default text. -@GObjectProperty(named: "accept-label") public var acceptLabel: String? - -/// The text used for the label on the cancel button in the dialog, or -/// %NULL to use the default text. -@GObjectProperty(named: "cancel-label") public var cancelLabel: String? - -/// The type of operation that the file chooser is performing. -@GObjectProperty(named: "action") public var action: FileChooserAction - -/// Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode -/// will offer the user to create new folders. -@GObjectProperty(named: "create-folders") public var createFolders: Bool - -/// A `GListModel` containing the filters that have been -/// added with gtk_file_chooser_add_filter(). -/// -/// The returned object should not be modified. It may -/// or may not be updated for later changes. -@GObjectProperty(named: "filters") public var filters: OpaquePointer + /// %NULL to use the default text. + @GObjectProperty(named: "accept-label") public var acceptLabel: String? -/// Whether to allow multiple files to be selected. -@GObjectProperty(named: "select-multiple") public var selectMultiple: Bool + /// The text used for the label on the cancel button in the dialog, or + /// %NULL to use the default text. + @GObjectProperty(named: "cancel-label") public var cancelLabel: String? -/// A `GListModel` containing the shortcut folders that have been -/// added with gtk_file_chooser_add_shortcut_folder(). -/// -/// The returned object should not be modified. It may -/// or may not be updated for later changes. -@GObjectProperty(named: "shortcut-folders") public var shortcutFolders: OpaquePointer + /// The type of operation that the file chooser is performing. + @GObjectProperty(named: "action") public var action: FileChooserAction + /// Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode + /// will offer the user to create new folders. + @GObjectProperty(named: "create-folders") public var createFolders: Bool -public var notifyAcceptLabel: ((FileChooserNative, OpaquePointer) -> Void)? + /// A `GListModel` containing the filters that have been + /// added with gtk_file_chooser_add_filter(). + /// + /// The returned object should not be modified. It may + /// or may not be updated for later changes. + @GObjectProperty(named: "filters") public var filters: OpaquePointer + /// Whether to allow multiple files to be selected. + @GObjectProperty(named: "select-multiple") public var selectMultiple: Bool -public var notifyCancelLabel: ((FileChooserNative, OpaquePointer) -> Void)? + /// A `GListModel` containing the shortcut folders that have been + /// added with gtk_file_chooser_add_shortcut_folder(). + /// + /// The returned object should not be modified. It may + /// or may not be updated for later changes. + @GObjectProperty(named: "shortcut-folders") public var shortcutFolders: OpaquePointer + public var notifyAcceptLabel: ((FileChooserNative, OpaquePointer) -> Void)? -public var notifyAction: ((FileChooserNative, OpaquePointer) -> Void)? + public var notifyCancelLabel: ((FileChooserNative, OpaquePointer) -> Void)? + public var notifyAction: ((FileChooserNative, OpaquePointer) -> Void)? -public var notifyCreateFolders: ((FileChooserNative, OpaquePointer) -> Void)? + public var notifyCreateFolders: ((FileChooserNative, OpaquePointer) -> Void)? + public var notifyFilter: ((FileChooserNative, OpaquePointer) -> Void)? -public var notifyFilter: ((FileChooserNative, OpaquePointer) -> Void)? + public var notifyFilters: ((FileChooserNative, OpaquePointer) -> Void)? + public var notifySelectMultiple: ((FileChooserNative, OpaquePointer) -> Void)? -public var notifyFilters: ((FileChooserNative, OpaquePointer) -> Void)? - - -public var notifySelectMultiple: ((FileChooserNative, OpaquePointer) -> Void)? - - -public var notifyShortcutFolders: ((FileChooserNative, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyShortcutFolders: ((FileChooserNative, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/FilterChange.swift b/Sources/Gtk/Generated/FilterChange.swift index ff29ec0419..ef229a3148 100644 --- a/Sources/Gtk/Generated/FilterChange.swift +++ b/Sources/Gtk/Generated/FilterChange.swift @@ -2,39 +2,39 @@ import CGtk /// Describes changes in a filter in more detail and allows objects /// using the filter to optimize refiltering items. -/// +/// /// If you are writing an implementation and are not sure which /// value to pass, `GTK_FILTER_CHANGE_DIFFERENT` is always a correct /// choice. -/// +/// /// New values may be added in the future. public enum FilterChange: GValueRepresentableEnum { public typealias GtkEnum = GtkFilterChange /// The filter change cannot be -/// described with any of the other enumeration values -case different -/// The filter is less strict than -/// it was before: All items that it used to return true -/// still return true, others now may, too. -case lessStrict -/// The filter is more strict than -/// it was before: All items that it used to return false -/// still return false, others now may, too. -case moreStrict + /// described with any of the other enumeration values + case different + /// The filter is less strict than + /// it was before: All items that it used to return true + /// still return true, others now may, too. + case lessStrict + /// The filter is more strict than + /// it was before: All items that it used to return false + /// still return false, others now may, too. + case moreStrict public static var type: GType { - gtk_filter_change_get_type() -} + gtk_filter_change_get_type() + } public init(from gtkEnum: GtkFilterChange) { switch gtkEnum { case GTK_FILTER_CHANGE_DIFFERENT: - self = .different -case GTK_FILTER_CHANGE_LESS_STRICT: - self = .lessStrict -case GTK_FILTER_CHANGE_MORE_STRICT: - self = .moreStrict + self = .different + case GTK_FILTER_CHANGE_LESS_STRICT: + self = .lessStrict + case GTK_FILTER_CHANGE_MORE_STRICT: + self = .moreStrict default: fatalError("Unsupported GtkFilterChange enum value: \(gtkEnum.rawValue)") } @@ -43,11 +43,11 @@ case GTK_FILTER_CHANGE_MORE_STRICT: public func toGtk() -> GtkFilterChange { switch self { case .different: - return GTK_FILTER_CHANGE_DIFFERENT -case .lessStrict: - return GTK_FILTER_CHANGE_LESS_STRICT -case .moreStrict: - return GTK_FILTER_CHANGE_MORE_STRICT + return GTK_FILTER_CHANGE_DIFFERENT + case .lessStrict: + return GTK_FILTER_CHANGE_LESS_STRICT + case .moreStrict: + return GTK_FILTER_CHANGE_MORE_STRICT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/FilterMatch.swift b/Sources/Gtk/Generated/FilterMatch.swift index 6057e32d95..27def01204 100644 --- a/Sources/Gtk/Generated/FilterMatch.swift +++ b/Sources/Gtk/Generated/FilterMatch.swift @@ -1,7 +1,7 @@ import CGtk /// Describes the known strictness of a filter. -/// +/// /// Note that for filters where the strictness is not known, /// `GTK_FILTER_MATCH_SOME` is always an acceptable value, /// even if a filter does match all or no items. @@ -9,27 +9,27 @@ public enum FilterMatch: GValueRepresentableEnum { public typealias GtkEnum = GtkFilterMatch /// The filter matches some items, -/// [method@Gtk.Filter.match] may return true or false -case some -/// The filter does not match any item, -/// [method@Gtk.Filter.match] will always return false -case none -/// The filter matches all items, -/// [method@Gtk.Filter.match] will alays return true -case all + /// [method@Gtk.Filter.match] may return true or false + case some + /// The filter does not match any item, + /// [method@Gtk.Filter.match] will always return false + case none + /// The filter matches all items, + /// [method@Gtk.Filter.match] will alays return true + case all public static var type: GType { - gtk_filter_match_get_type() -} + gtk_filter_match_get_type() + } public init(from gtkEnum: GtkFilterMatch) { switch gtkEnum { case GTK_FILTER_MATCH_SOME: - self = .some -case GTK_FILTER_MATCH_NONE: - self = .none -case GTK_FILTER_MATCH_ALL: - self = .all + self = .some + case GTK_FILTER_MATCH_NONE: + self = .none + case GTK_FILTER_MATCH_ALL: + self = .all default: fatalError("Unsupported GtkFilterMatch enum value: \(gtkEnum.rawValue)") } @@ -38,11 +38,11 @@ case GTK_FILTER_MATCH_ALL: public func toGtk() -> GtkFilterMatch { switch self { case .some: - return GTK_FILTER_MATCH_SOME -case .none: - return GTK_FILTER_MATCH_NONE -case .all: - return GTK_FILTER_MATCH_ALL + return GTK_FILTER_MATCH_SOME + case .none: + return GTK_FILTER_MATCH_NONE + case .all: + return GTK_FILTER_MATCH_ALL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/FontChooser.swift b/Sources/Gtk/Generated/FontChooser.swift index 451dff6cdc..1739368b72 100644 --- a/Sources/Gtk/Generated/FontChooser.swift +++ b/Sources/Gtk/Generated/FontChooser.swift @@ -2,33 +2,33 @@ import CGtk /// `GtkFontChooser` is an interface that can be implemented by widgets /// for choosing fonts. -/// +/// /// In GTK, the main objects that implement this interface are /// [class@Gtk.FontChooserWidget], [class@Gtk.FontChooserDialog] and /// [class@Gtk.FontButton]. public protocol FontChooser: GObjectRepresentable { /// The font description as a string, e.g. "Sans Italic 12". -var font: String? { get set } + var font: String? { get set } -/// The selected font features. -/// -/// The format of the string is compatible with -/// CSS and with Pango attributes. -var fontFeatures: String { get set } + /// The selected font features. + /// + /// The format of the string is compatible with + /// CSS and with Pango attributes. + var fontFeatures: String { get set } -/// The language for which the font features were selected. -var language: String { get set } + /// The language for which the font features were selected. + var language: String { get set } -/// The string with which to preview the font. -var previewText: String { get set } + /// The string with which to preview the font. + var previewText: String { get set } -/// Whether to show an entry to change the preview text. -var showPreviewEntry: Bool { get set } + /// Whether to show an entry to change the preview text. + var showPreviewEntry: Bool { get set } /// Emitted when a font is activated. -/// -/// This usually happens when the user double clicks an item, -/// or an item is selected and the user presses one of the keys -/// Space, Shift+Space, Return or Enter. -var fontActivated: ((Self, UnsafePointer) -> Void)? { get set } -} \ No newline at end of file + /// + /// This usually happens when the user double clicks an item, + /// or an item is selected and the user presses one of the keys + /// Space, Shift+Space, Return or Enter. + var fontActivated: ((Self, UnsafePointer) -> Void)? { get set } +} diff --git a/Sources/Gtk/Generated/GLArea.swift b/Sources/Gtk/Generated/GLArea.swift index 11bec91792..5247e75482 100644 --- a/Sources/Gtk/Generated/GLArea.swift +++ b/Sources/Gtk/Generated/GLArea.swift @@ -1,33 +1,33 @@ import CGtk /// Allows drawing with OpenGL. -/// +/// /// An example GtkGLArea -/// +/// /// `GtkGLArea` sets up its own [class@Gdk.GLContext], and creates a custom /// GL framebuffer that the widget will do GL rendering onto. It also ensures /// that this framebuffer is the default GL rendering target when rendering. /// The completed rendering is integrated into the larger GTK scene graph as /// a texture. -/// +/// /// In order to draw, you have to connect to the [signal@Gtk.GLArea::render] /// signal, or subclass `GtkGLArea` and override the GtkGLAreaClass.render /// virtual function. -/// +/// /// The `GtkGLArea` widget ensures that the `GdkGLContext` is associated with /// the widget's drawing area, and it is kept updated when the size and /// position of the drawing area changes. -/// +/// /// ## Drawing with GtkGLArea -/// +/// /// The simplest way to draw using OpenGL commands in a `GtkGLArea` is to /// create a widget instance and connect to the [signal@Gtk.GLArea::render] signal: -/// +/// /// The `render()` function will be called when the `GtkGLArea` is ready /// for you to draw its content: -/// +/// /// The initial contents of the framebuffer are transparent. -/// +/// /// ```c /// static gboolean /// render (GtkGLArea *area, GdkGLContext *context) @@ -36,45 +36,45 @@ import CGtk /// // GdkGLContext has been made current to the drawable /// // surface used by the `GtkGLArea` and the viewport has /// // already been set to be the size of the allocation -/// +/// /// // we can start by clearing the buffer /// glClearColor (0, 0, 0, 0); /// glClear (GL_COLOR_BUFFER_BIT); -/// +/// /// // record the active framebuffer ID, so we can return to it /// // with `glBindFramebuffer (GL_FRAMEBUFFER, screen_fb)` should /// // we, for instance, intend on utilizing the results of an /// // intermediate render texture pass /// GLuint screen_fb = 0; /// glGetIntegerv (GL_FRAMEBUFFER_BINDING, &screen_fb); -/// +/// /// // draw your object /// // draw_an_object (); -/// +/// /// // we completed our drawing; the draw commands will be /// // flushed at the end of the signal emission chain, and /// // the buffers will be drawn on the window /// return TRUE; /// } -/// +/// /// void setup_glarea (void) /// { /// // create a GtkGLArea instance /// GtkWidget *gl_area = gtk_gl_area_new (); -/// +/// /// // connect to the "render" signal /// g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL); /// } /// ``` -/// +/// /// If you need to initialize OpenGL state, e.g. buffer objects or /// shaders, you should use the [signal@Gtk.Widget::realize] signal; /// you can use the [signal@Gtk.Widget::unrealize] signal to clean up. /// Since the `GdkGLContext` creation and initialization may fail, you /// will need to check for errors, using [method@Gtk.GLArea.get_error]. -/// +/// /// An example of how to safely initialize the GL state is: -/// +/// /// ```c /// static void /// on_realize (GtkGLArea *area) @@ -82,13 +82,13 @@ import CGtk /// // We need to make the context current if we want to /// // call GL API /// gtk_gl_area_make_current (area); -/// +/// /// // If there were errors during the initialization or /// // when trying to make the context current, this /// // function will return a GError for you to catch /// if (gtk_gl_area_get_error (area) != NULL) /// return; -/// +/// /// // You can also use gtk_gl_area_set_error() in order /// // to show eventual initialization errors on the /// // GtkGLArea widget itself @@ -100,7 +100,7 @@ import CGtk /// g_error_free (error); /// return; /// } -/// +/// /// init_shaders (&error); /// if (error != NULL) /// { @@ -110,199 +110,210 @@ import CGtk /// } /// } /// ``` -/// +/// /// If you need to change the options for creating the `GdkGLContext` /// you should use the [signal@Gtk.GLArea::create-context] signal. open class GLArea: Widget { /// Creates a new `GtkGLArea` widget. -public convenience init() { - self.init( - gtk_gl_area_new() - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "create-context") { [weak self] () in - guard let self = self else { return } - self.createContext?(self) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "render", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.render?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - -addSignal(name: "resize", handler: gCallback(handler2)) { [weak self] (param0: Int, param1: Int) in - guard let self = self else { return } - self.resize?(self, param0, param1) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::allowed-apis", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAllowedApis?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::api", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyApi?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::auto-render", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAutoRender?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::context", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContext?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::has-depth-buffer", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasDepthBuffer?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_gl_area_new() + ) } -addSignal(name: "notify::has-stencil-buffer", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasStencilBuffer?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "create-context") { [weak self] () in + guard let self = self else { return } + self.createContext?(self) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "render", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.render?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "resize", handler: gCallback(handler2)) { + [weak self] (param0: Int, param1: Int) in + guard let self = self else { return } + self.resize?(self, param0, param1) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::allowed-apis", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAllowedApis?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::api", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyApi?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::auto-render", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAutoRender?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::context", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContext?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::has-depth-buffer", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasDepthBuffer?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::has-stencil-buffer", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasStencilBuffer?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-es", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseEs?(self, param0) + } } -addSignal(name: "notify::use-es", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseEs?(self, param0) -} -} - /// If set to %TRUE the ::render signal will be emitted every time -/// the widget draws. -/// -/// This is the default and is useful if drawing the widget is faster. -/// -/// If set to %FALSE the data from previous rendering is kept around and will -/// be used for drawing the widget the next time, unless the window is resized. -/// In order to force a rendering [method@Gtk.GLArea.queue_render] must be called. -/// This mode is useful when the scene changes seldom, but takes a long time -/// to redraw. -@GObjectProperty(named: "auto-render") public var autoRender: Bool - -/// The `GdkGLContext` used by the `GtkGLArea` widget. -/// -/// The `GtkGLArea` widget is responsible for creating the `GdkGLContext` -/// instance. If you need to render with other kinds of buffers (stencil, -/// depth, etc), use render buffers. -@GObjectProperty(named: "context") public var context: OpaquePointer? - -/// If set to %TRUE the widget will allocate and enable a depth buffer for the -/// target framebuffer. -/// -/// Setting this property will enable GL's depth testing as a side effect. If -/// you don't need depth testing, you should call `glDisable(GL_DEPTH_TEST)` -/// in your `GtkGLArea::render` handler. -@GObjectProperty(named: "has-depth-buffer") public var hasDepthBuffer: Bool - -/// If set to %TRUE the widget will allocate and enable a stencil buffer for the -/// target framebuffer. -@GObjectProperty(named: "has-stencil-buffer") public var hasStencilBuffer: Bool - -/// If set to %TRUE the widget will try to create a `GdkGLContext` using -/// OpenGL ES instead of OpenGL. -@GObjectProperty(named: "use-es") public var useEs: Bool - -/// Emitted when the widget is being realized. -/// -/// This allows you to override how the GL context is created. -/// This is useful when you want to reuse an existing GL context, -/// or if you want to try creating different kinds of GL options. -/// -/// If context creation fails then the signal handler can use -/// [method@Gtk.GLArea.set_error] to register a more detailed error -/// of how the construction failed. -public var createContext: ((GLArea) -> Void)? - -/// Emitted every time the contents of the `GtkGLArea` should be redrawn. -/// -/// The @context is bound to the @area prior to emitting this function, -/// and the buffers are painted to the window once the emission terminates. -public var render: ((GLArea, OpaquePointer) -> Void)? - -/// Emitted once when the widget is realized, and then each time the widget -/// is changed while realized. -/// -/// This is useful in order to keep GL state up to date with the widget size, -/// like for instance camera properties which may depend on the width/height -/// ratio. -/// -/// The GL context for the area is guaranteed to be current when this signal -/// is emitted. -/// -/// The default handler sets up the GL viewport. -public var resize: ((GLArea, Int, Int) -> Void)? - - -public var notifyAllowedApis: ((GLArea, OpaquePointer) -> Void)? - - -public var notifyApi: ((GLArea, OpaquePointer) -> Void)? - - -public var notifyAutoRender: ((GLArea, OpaquePointer) -> Void)? - - -public var notifyContext: ((GLArea, OpaquePointer) -> Void)? - - -public var notifyHasDepthBuffer: ((GLArea, OpaquePointer) -> Void)? - - -public var notifyHasStencilBuffer: ((GLArea, OpaquePointer) -> Void)? - - -public var notifyUseEs: ((GLArea, OpaquePointer) -> Void)? -} \ No newline at end of file + /// the widget draws. + /// + /// This is the default and is useful if drawing the widget is faster. + /// + /// If set to %FALSE the data from previous rendering is kept around and will + /// be used for drawing the widget the next time, unless the window is resized. + /// In order to force a rendering [method@Gtk.GLArea.queue_render] must be called. + /// This mode is useful when the scene changes seldom, but takes a long time + /// to redraw. + @GObjectProperty(named: "auto-render") public var autoRender: Bool + + /// The `GdkGLContext` used by the `GtkGLArea` widget. + /// + /// The `GtkGLArea` widget is responsible for creating the `GdkGLContext` + /// instance. If you need to render with other kinds of buffers (stencil, + /// depth, etc), use render buffers. + @GObjectProperty(named: "context") public var context: OpaquePointer? + + /// If set to %TRUE the widget will allocate and enable a depth buffer for the + /// target framebuffer. + /// + /// Setting this property will enable GL's depth testing as a side effect. If + /// you don't need depth testing, you should call `glDisable(GL_DEPTH_TEST)` + /// in your `GtkGLArea::render` handler. + @GObjectProperty(named: "has-depth-buffer") public var hasDepthBuffer: Bool + + /// If set to %TRUE the widget will allocate and enable a stencil buffer for the + /// target framebuffer. + @GObjectProperty(named: "has-stencil-buffer") public var hasStencilBuffer: Bool + + /// If set to %TRUE the widget will try to create a `GdkGLContext` using + /// OpenGL ES instead of OpenGL. + @GObjectProperty(named: "use-es") public var useEs: Bool + + /// Emitted when the widget is being realized. + /// + /// This allows you to override how the GL context is created. + /// This is useful when you want to reuse an existing GL context, + /// or if you want to try creating different kinds of GL options. + /// + /// If context creation fails then the signal handler can use + /// [method@Gtk.GLArea.set_error] to register a more detailed error + /// of how the construction failed. + public var createContext: ((GLArea) -> Void)? + + /// Emitted every time the contents of the `GtkGLArea` should be redrawn. + /// + /// The @context is bound to the @area prior to emitting this function, + /// and the buffers are painted to the window once the emission terminates. + public var render: ((GLArea, OpaquePointer) -> Void)? + + /// Emitted once when the widget is realized, and then each time the widget + /// is changed while realized. + /// + /// This is useful in order to keep GL state up to date with the widget size, + /// like for instance camera properties which may depend on the width/height + /// ratio. + /// + /// The GL context for the area is guaranteed to be current when this signal + /// is emitted. + /// + /// The default handler sets up the GL viewport. + public var resize: ((GLArea, Int, Int) -> Void)? + + public var notifyAllowedApis: ((GLArea, OpaquePointer) -> Void)? + + public var notifyApi: ((GLArea, OpaquePointer) -> Void)? + + public var notifyAutoRender: ((GLArea, OpaquePointer) -> Void)? + + public var notifyContext: ((GLArea, OpaquePointer) -> Void)? + + public var notifyHasDepthBuffer: ((GLArea, OpaquePointer) -> Void)? + + public var notifyHasStencilBuffer: ((GLArea, OpaquePointer) -> Void)? + + public var notifyUseEs: ((GLArea, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/Gesture.swift b/Sources/Gtk/Generated/Gesture.swift index d98561da4d..9b9b702cbf 100644 --- a/Sources/Gtk/Generated/Gesture.swift +++ b/Sources/Gtk/Generated/Gesture.swift @@ -1,206 +1,219 @@ import CGtk /// The base class for gesture recognition. -/// +/// /// Although `GtkGesture` is quite generalized to serve as a base for /// multi-touch gestures, it is suitable to implement single-touch and /// pointer-based gestures (using the special %NULL `GdkEventSequence` /// value for these). -/// +/// /// The number of touches that a `GtkGesture` need to be recognized is /// controlled by the [property@Gtk.Gesture:n-points] property, if a /// gesture is keeping track of less or more than that number of sequences, /// it won't check whether the gesture is recognized. -/// +/// /// As soon as the gesture has the expected number of touches, it will check /// regularly if it is recognized, the criteria to consider a gesture as /// "recognized" is left to `GtkGesture` subclasses. -/// +/// /// A recognized gesture will then emit the following signals: -/// +/// /// - [signal@Gtk.Gesture::begin] when the gesture is recognized. /// - [signal@Gtk.Gesture::update], whenever an input event is processed. /// - [signal@Gtk.Gesture::end] when the gesture is no longer recognized. -/// +/// /// ## Event propagation -/// +/// /// In order to receive events, a gesture needs to set a propagation phase /// through [method@Gtk.EventController.set_propagation_phase]. -/// +/// /// In the capture phase, events are propagated from the toplevel down /// to the target widget, and gestures that are attached to containers /// above the widget get a chance to interact with the event before it /// reaches the target. -/// +/// /// In the bubble phase, events are propagated up from the target widget /// to the toplevel, and gestures that are attached to containers above /// the widget get a chance to interact with events that have not been /// handled yet. -/// +/// /// ## States of a sequence -/// +/// /// Whenever input interaction happens, a single event may trigger a cascade /// of `GtkGesture`s, both across the parents of the widget receiving the /// event and in parallel within an individual widget. It is a responsibility /// of the widgets using those gestures to set the state of touch sequences /// accordingly in order to enable cooperation of gestures around the /// `GdkEventSequence`s triggering those. -/// +/// /// Within a widget, gestures can be grouped through [method@Gtk.Gesture.group]. /// Grouped gestures synchronize the state of sequences, so calling /// [method@Gtk.Gesture.set_state] on one will effectively propagate /// the state throughout the group. -/// +/// /// By default, all sequences start out in the %GTK_EVENT_SEQUENCE_NONE state, /// sequences in this state trigger the gesture event handler, but event /// propagation will continue unstopped by gestures. -/// +/// /// If a sequence enters into the %GTK_EVENT_SEQUENCE_DENIED state, the gesture /// group will effectively ignore the sequence, letting events go unstopped /// through the gesture, but the "slot" will still remain occupied while /// the touch is active. -/// +/// /// If a sequence enters in the %GTK_EVENT_SEQUENCE_CLAIMED state, the gesture /// group will grab all interaction on the sequence, by: -/// +/// /// - Setting the same sequence to %GTK_EVENT_SEQUENCE_DENIED on every other /// gesture group within the widget, and every gesture on parent widgets /// in the propagation chain. /// - Emitting [signal@Gtk.Gesture::cancel] on every gesture in widgets /// underneath in the propagation chain. /// - Stopping event propagation after the gesture group handles the event. -/// +/// /// Note: if a sequence is set early to %GTK_EVENT_SEQUENCE_CLAIMED on /// %GDK_TOUCH_BEGIN/%GDK_BUTTON_PRESS (so those events are captured before /// reaching the event widget, this implies %GTK_PHASE_CAPTURE), one similar /// event will be emulated if the sequence changes to %GTK_EVENT_SEQUENCE_DENIED. /// This way event coherence is preserved before event propagation is unstopped /// again. -/// +/// /// Sequence states can't be changed freely. /// See [method@Gtk.Gesture.set_state] to know about the possible /// lifetimes of a `GdkEventSequence`. -/// +/// /// ## Touchpad gestures -/// +/// /// On the platforms that support it, `GtkGesture` will handle transparently /// touchpad gesture events. The only precautions users of `GtkGesture` should /// do to enable this support are: -/// +/// /// - If the gesture has %GTK_PHASE_NONE, ensuring events of type /// %GDK_TOUCHPAD_SWIPE and %GDK_TOUCHPAD_PINCH are handled by the `GtkGesture` open class Gesture: EventController { - public override func registerSignals() { - super.registerSignals() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "begin", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.begin?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "cancel", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.cancel?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "end", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.end?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, GtkEventSequenceState, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) + super.registerSignals() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "begin", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.begin?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "cancel", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.cancel?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "end", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.end?(self, param0) + } + + let handler3: + @convention(c) ( + UnsafeMutableRawPointer, OpaquePointer, GtkEventSequenceState, + UnsafeMutableRawPointer + ) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "sequence-state-changed", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer, param1: GtkEventSequenceState) in + guard let self = self else { return } + self.sequenceStateChanged?(self, param0, param1) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "update", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.update?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::n-points", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyNPoints?(self, param0) + } } -addSignal(name: "sequence-state-changed", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer, param1: GtkEventSequenceState) in - guard let self = self else { return } - self.sequenceStateChanged?(self, param0, param1) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "update", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.update?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::n-points", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyNPoints?(self, param0) -} -} - /// Emitted when the gesture is recognized. -/// -/// This means the number of touch sequences matches -/// [property@Gtk.Gesture:n-points]. -/// -/// Note: These conditions may also happen when an extra touch -/// (eg. a third touch on a 2-touches gesture) is lifted, in that -/// situation @sequence won't pertain to the current set of active -/// touches, so don't rely on this being true. -public var begin: ((Gesture, OpaquePointer) -> Void)? - -/// Emitted whenever a sequence is cancelled. -/// -/// This usually happens on active touches when -/// [method@Gtk.EventController.reset] is called on @gesture -/// (manually, due to grabs...), or the individual @sequence -/// was claimed by parent widgets' controllers (see -/// [method@Gtk.Gesture.set_sequence_state]). -/// -/// @gesture must forget everything about @sequence as in -/// response to this signal. -public var cancel: ((Gesture, OpaquePointer) -> Void)? - -/// Emitted when @gesture either stopped recognizing the event -/// sequences as something to be handled, or the number of touch -/// sequences became higher or lower than [property@Gtk.Gesture:n-points]. -/// -/// Note: @sequence might not pertain to the group of sequences that -/// were previously triggering recognition on @gesture (ie. a just -/// pressed touch sequence that exceeds [property@Gtk.Gesture:n-points]). -/// This situation may be detected by checking through -/// [method@Gtk.Gesture.handles_sequence]. -public var end: ((Gesture, OpaquePointer) -> Void)? - -/// Emitted whenever a sequence state changes. -/// -/// See [method@Gtk.Gesture.set_sequence_state] to know -/// more about the expectable sequence lifetimes. -public var sequenceStateChanged: ((Gesture, OpaquePointer, GtkEventSequenceState) -> Void)? - -/// Emitted whenever an event is handled while the gesture is recognized. -/// -/// @sequence is guaranteed to pertain to the set of active touches. -public var update: ((Gesture, OpaquePointer) -> Void)? - - -public var notifyNPoints: ((Gesture, OpaquePointer) -> Void)? -} \ No newline at end of file + /// + /// This means the number of touch sequences matches + /// [property@Gtk.Gesture:n-points]. + /// + /// Note: These conditions may also happen when an extra touch + /// (eg. a third touch on a 2-touches gesture) is lifted, in that + /// situation @sequence won't pertain to the current set of active + /// touches, so don't rely on this being true. + public var begin: ((Gesture, OpaquePointer) -> Void)? + + /// Emitted whenever a sequence is cancelled. + /// + /// This usually happens on active touches when + /// [method@Gtk.EventController.reset] is called on @gesture + /// (manually, due to grabs...), or the individual @sequence + /// was claimed by parent widgets' controllers (see + /// [method@Gtk.Gesture.set_sequence_state]). + /// + /// @gesture must forget everything about @sequence as in + /// response to this signal. + public var cancel: ((Gesture, OpaquePointer) -> Void)? + + /// Emitted when @gesture either stopped recognizing the event + /// sequences as something to be handled, or the number of touch + /// sequences became higher or lower than [property@Gtk.Gesture:n-points]. + /// + /// Note: @sequence might not pertain to the group of sequences that + /// were previously triggering recognition on @gesture (ie. a just + /// pressed touch sequence that exceeds [property@Gtk.Gesture:n-points]). + /// This situation may be detected by checking through + /// [method@Gtk.Gesture.handles_sequence]. + public var end: ((Gesture, OpaquePointer) -> Void)? + + /// Emitted whenever a sequence state changes. + /// + /// See [method@Gtk.Gesture.set_sequence_state] to know + /// more about the expectable sequence lifetimes. + public var sequenceStateChanged: ((Gesture, OpaquePointer, GtkEventSequenceState) -> Void)? + + /// Emitted whenever an event is handled while the gesture is recognized. + /// + /// @sequence is guaranteed to pertain to the set of active touches. + public var update: ((Gesture, OpaquePointer) -> Void)? + + public var notifyNPoints: ((Gesture, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/GestureClick.swift b/Sources/Gtk/Generated/GestureClick.swift index 54cdd661b2..f71c8f6c84 100644 --- a/Sources/Gtk/Generated/GestureClick.swift +++ b/Sources/Gtk/Generated/GestureClick.swift @@ -1,7 +1,7 @@ import CGtk /// Recognizes click gestures. -/// +/// /// It is able to recognize multiple clicks on a nearby zone, which /// can be listened for through the [signal@Gtk.GestureClick::pressed] /// signal. Whenever time or distance between clicks exceed the GTK @@ -9,71 +9,83 @@ import CGtk /// click counter is reset. open class GestureClick: GestureSingle { /// Returns a newly created `GtkGesture` that recognizes -/// single and multiple presses. -public convenience init() { - self.init( - gtk_gesture_click_new() - ) -} + /// single and multiple presses. + public convenience init() { + self.init( + gtk_gesture_click_new() + ) + } public override func registerSignals() { - super.registerSignals() + super.registerSignals() - let handler0: @convention(c) (UnsafeMutableRawPointer, Int, Double, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, value3, data in - SignalBox3.run(data, value1, value2, value3) - } + let handler0: + @convention(c) (UnsafeMutableRawPointer, Int, Double, Double, UnsafeMutableRawPointer) + -> Void = + { _, value1, value2, value3, data in + SignalBox3.run(data, value1, value2, value3) + } -addSignal(name: "pressed", handler: gCallback(handler0)) { [weak self] (param0: Int, param1: Double, param2: Double) in - guard let self = self else { return } - self.pressed?(self, param0, param1, param2) -} + addSignal(name: "pressed", handler: gCallback(handler0)) { + [weak self] (param0: Int, param1: Double, param2: Double) in + guard let self = self else { return } + self.pressed?(self, param0, param1, param2) + } -let handler1: @convention(c) (UnsafeMutableRawPointer, Int, Double, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, value3, data in - SignalBox3.run(data, value1, value2, value3) - } + let handler1: + @convention(c) (UnsafeMutableRawPointer, Int, Double, Double, UnsafeMutableRawPointer) + -> Void = + { _, value1, value2, value3, data in + SignalBox3.run(data, value1, value2, value3) + } -addSignal(name: "released", handler: gCallback(handler1)) { [weak self] (param0: Int, param1: Double, param2: Double) in - guard let self = self else { return } - self.released?(self, param0, param1, param2) -} + addSignal(name: "released", handler: gCallback(handler1)) { + [weak self] (param0: Int, param1: Double, param2: Double) in + guard let self = self else { return } + self.released?(self, param0, param1, param2) + } -addSignal(name: "stopped") { [weak self] () in - guard let self = self else { return } - self.stopped?(self) -} + addSignal(name: "stopped") { [weak self] () in + guard let self = self else { return } + self.stopped?(self) + } -let handler3: @convention(c) (UnsafeMutableRawPointer, Double, Double, UInt, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, value3, value4, data in - SignalBox4.run(data, value1, value2, value3, value4) - } + let handler3: + @convention(c) ( + UnsafeMutableRawPointer, Double, Double, UInt, OpaquePointer, + UnsafeMutableRawPointer + ) -> Void = + { _, value1, value2, value3, value4, data in + SignalBox4.run( + data, value1, value2, value3, value4) + } -addSignal(name: "unpaired-release", handler: gCallback(handler3)) { [weak self] (param0: Double, param1: Double, param2: UInt, param3: OpaquePointer) in - guard let self = self else { return } - self.unpairedRelease?(self, param0, param1, param2, param3) -} -} + addSignal(name: "unpaired-release", handler: gCallback(handler3)) { + [weak self] (param0: Double, param1: Double, param2: UInt, param3: OpaquePointer) in + guard let self = self else { return } + self.unpairedRelease?(self, param0, param1, param2, param3) + } + } /// Emitted whenever a button or touch press happens. -public var pressed: ((GestureClick, Int, Double, Double) -> Void)? + public var pressed: ((GestureClick, Int, Double, Double) -> Void)? -/// Emitted when a button or touch is released. -/// -/// @n_press will report the number of press that is paired to -/// this event, note that [signal@Gtk.GestureClick::stopped] may -/// have been emitted between the press and its release, @n_press -/// will only start over at the next press. -public var released: ((GestureClick, Int, Double, Double) -> Void)? + /// Emitted when a button or touch is released. + /// + /// @n_press will report the number of press that is paired to + /// this event, note that [signal@Gtk.GestureClick::stopped] may + /// have been emitted between the press and its release, @n_press + /// will only start over at the next press. + public var released: ((GestureClick, Int, Double, Double) -> Void)? -/// Emitted whenever any time/distance threshold has been exceeded. -public var stopped: ((GestureClick) -> Void)? + /// Emitted whenever any time/distance threshold has been exceeded. + public var stopped: ((GestureClick) -> Void)? -/// Emitted whenever the gesture receives a release -/// event that had no previous corresponding press. -/// -/// Due to implicit grabs, this can only happen on situations -/// where input is grabbed elsewhere mid-press or the pressed -/// widget voluntarily relinquishes its implicit grab. -public var unpairedRelease: ((GestureClick, Double, Double, UInt, OpaquePointer) -> Void)? -} \ No newline at end of file + /// Emitted whenever the gesture receives a release + /// event that had no previous corresponding press. + /// + /// Due to implicit grabs, this can only happen on situations + /// where input is grabbed elsewhere mid-press or the pressed + /// widget voluntarily relinquishes its implicit grab. + public var unpairedRelease: ((GestureClick, Double, Double, UInt, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/GestureLongPress.swift b/Sources/Gtk/Generated/GestureLongPress.swift index 5adcd3ef4d..ee0eaaa4df 100644 --- a/Sources/Gtk/Generated/GestureLongPress.swift +++ b/Sources/Gtk/Generated/GestureLongPress.swift @@ -1,68 +1,72 @@ import CGtk /// Recognizes long press gestures. -/// +/// /// This gesture is also known as “Press and Hold”. -/// +/// /// When the timeout is exceeded, the gesture is triggering the /// [signal@Gtk.GestureLongPress::pressed] signal. -/// +/// /// If the touchpoint is lifted before the timeout passes, or if /// it drifts too far of the initial press point, the /// [signal@Gtk.GestureLongPress::cancelled] signal will be emitted. -/// +/// /// How long the timeout is before the ::pressed signal gets emitted is /// determined by the [property@Gtk.Settings:gtk-long-press-time] setting. /// It can be modified by the [property@Gtk.GestureLongPress:delay-factor] /// property. open class GestureLongPress: GestureSingle { /// Returns a newly created `GtkGesture` that recognizes long presses. -public convenience init() { - self.init( - gtk_gesture_long_press_new() - ) -} + public convenience init() { + self.init( + gtk_gesture_long_press_new() + ) + } public override func registerSignals() { - super.registerSignals() + super.registerSignals() - addSignal(name: "cancelled") { [weak self] () in - guard let self = self else { return } - self.cancelled?(self) -} + addSignal(name: "cancelled") { [weak self] () in + guard let self = self else { return } + self.cancelled?(self) + } -let handler1: @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } + let handler1: + @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> + Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } -addSignal(name: "pressed", handler: gCallback(handler1)) { [weak self] (param0: Double, param1: Double) in - guard let self = self else { return } - self.pressed?(self, param0, param1) -} + addSignal(name: "pressed", handler: gCallback(handler1)) { + [weak self] (param0: Double, param1: Double) in + guard let self = self else { return } + self.pressed?(self, param0, param1) + } -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } -addSignal(name: "notify::delay-factor", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDelayFactor?(self, param0) -} -} + addSignal(name: "notify::delay-factor", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDelayFactor?(self, param0) + } + } /// Factor by which to modify the default timeout. -@GObjectProperty(named: "delay-factor") public var delayFactor: Double + @GObjectProperty(named: "delay-factor") public var delayFactor: Double -/// Emitted whenever a press moved too far, or was released -/// before [signal@Gtk.GestureLongPress::pressed] happened. -public var cancelled: ((GestureLongPress) -> Void)? + /// Emitted whenever a press moved too far, or was released + /// before [signal@Gtk.GestureLongPress::pressed] happened. + public var cancelled: ((GestureLongPress) -> Void)? -/// Emitted whenever a press goes unmoved/unreleased longer than -/// what the GTK defaults tell. -public var pressed: ((GestureLongPress, Double, Double) -> Void)? + /// Emitted whenever a press goes unmoved/unreleased longer than + /// what the GTK defaults tell. + public var pressed: ((GestureLongPress, Double, Double) -> Void)? - -public var notifyDelayFactor: ((GestureLongPress, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyDelayFactor: ((GestureLongPress, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/GestureSingle.swift b/Sources/Gtk/Generated/GestureSingle.swift index 8bb88f0de6..c131329c8a 100644 --- a/Sources/Gtk/Generated/GestureSingle.swift +++ b/Sources/Gtk/Generated/GestureSingle.swift @@ -1,11 +1,11 @@ import CGtk /// A `GtkGesture` subclass optimized for singe-touch and mouse gestures. -/// +/// /// Under interaction, these gestures stick to the first interacting sequence, /// which is accessible through [method@Gtk.GestureSingle.get_current_sequence] /// while the gesture is being interacted with. -/// +/// /// By default gestures react to both %GDK_BUTTON_PRIMARY and touch events. /// [method@Gtk.GestureSingle.set_touch_only] can be used to change the /// touch behavior. Callers may also specify a different mouse button number @@ -14,59 +14,61 @@ import CGtk /// button being currently pressed can be known through /// [method@Gtk.GestureSingle.get_current_button]. open class GestureSingle: Gesture { - public override func registerSignals() { - super.registerSignals() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::button", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyButton?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::exclusive", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExclusive?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + super.registerSignals() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::button", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyButton?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::exclusive", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExclusive?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::touch-only", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTouchOnly?(self, param0) + } } -addSignal(name: "notify::touch-only", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTouchOnly?(self, param0) -} -} - /// Mouse button number to listen to, or 0 to listen for any button. -@GObjectProperty(named: "button") public var button: UInt + @GObjectProperty(named: "button") public var button: UInt -/// Whether the gesture is exclusive. -/// -/// Exclusive gestures only listen to pointer and pointer emulated events. -@GObjectProperty(named: "exclusive") public var exclusive: Bool + /// Whether the gesture is exclusive. + /// + /// Exclusive gestures only listen to pointer and pointer emulated events. + @GObjectProperty(named: "exclusive") public var exclusive: Bool -/// Whether the gesture handles only touch events. -@GObjectProperty(named: "touch-only") public var touchOnly: Bool + /// Whether the gesture handles only touch events. + @GObjectProperty(named: "touch-only") public var touchOnly: Bool + public var notifyButton: ((GestureSingle, OpaquePointer) -> Void)? -public var notifyButton: ((GestureSingle, OpaquePointer) -> Void)? + public var notifyExclusive: ((GestureSingle, OpaquePointer) -> Void)? - -public var notifyExclusive: ((GestureSingle, OpaquePointer) -> Void)? - - -public var notifyTouchOnly: ((GestureSingle, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyTouchOnly: ((GestureSingle, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/IconSize.swift b/Sources/Gtk/Generated/IconSize.swift index d1fb16ba73..d16dd7398f 100644 --- a/Sources/Gtk/Generated/IconSize.swift +++ b/Sources/Gtk/Generated/IconSize.swift @@ -1,10 +1,10 @@ import CGtk /// Built-in icon sizes. -/// +/// /// Icon sizes default to being inherited. Where they cannot be /// inherited, text size is the default. -/// +/// /// All widgets which use `GtkIconSize` set the normal-icons or /// large-icons style classes correspondingly, and let themes /// determine the actual size to be used with the @@ -13,24 +13,24 @@ public enum IconSize: GValueRepresentableEnum { public typealias GtkEnum = GtkIconSize /// Keep the size of the parent element -case inherit -/// Size similar to text size -case normal -/// Large size, for example in an icon view -case large + case inherit + /// Size similar to text size + case normal + /// Large size, for example in an icon view + case large public static var type: GType { - gtk_icon_size_get_type() -} + gtk_icon_size_get_type() + } public init(from gtkEnum: GtkIconSize) { switch gtkEnum { case GTK_ICON_SIZE_INHERIT: - self = .inherit -case GTK_ICON_SIZE_NORMAL: - self = .normal -case GTK_ICON_SIZE_LARGE: - self = .large + self = .inherit + case GTK_ICON_SIZE_NORMAL: + self = .normal + case GTK_ICON_SIZE_LARGE: + self = .large default: fatalError("Unsupported GtkIconSize enum value: \(gtkEnum.rawValue)") } @@ -39,11 +39,11 @@ case GTK_ICON_SIZE_LARGE: public func toGtk() -> GtkIconSize { switch self { case .inherit: - return GTK_ICON_SIZE_INHERIT -case .normal: - return GTK_ICON_SIZE_NORMAL -case .large: - return GTK_ICON_SIZE_LARGE + return GTK_ICON_SIZE_INHERIT + case .normal: + return GTK_ICON_SIZE_NORMAL + case .large: + return GTK_ICON_SIZE_LARGE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/IconThemeError.swift b/Sources/Gtk/Generated/IconThemeError.swift index 5a152db246..537df0dc54 100644 --- a/Sources/Gtk/Generated/IconThemeError.swift +++ b/Sources/Gtk/Generated/IconThemeError.swift @@ -5,20 +5,20 @@ public enum IconThemeError: GValueRepresentableEnum { public typealias GtkEnum = GtkIconThemeError /// The icon specified does not exist in the theme -case notFound -/// An unspecified error occurred. -case failed + case notFound + /// An unspecified error occurred. + case failed public static var type: GType { - gtk_icon_theme_error_get_type() -} + gtk_icon_theme_error_get_type() + } public init(from gtkEnum: GtkIconThemeError) { switch gtkEnum { case GTK_ICON_THEME_NOT_FOUND: - self = .notFound -case GTK_ICON_THEME_FAILED: - self = .failed + self = .notFound + case GTK_ICON_THEME_FAILED: + self = .failed default: fatalError("Unsupported GtkIconThemeError enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ case GTK_ICON_THEME_FAILED: public func toGtk() -> GtkIconThemeError { switch self { case .notFound: - return GTK_ICON_THEME_NOT_FOUND -case .failed: - return GTK_ICON_THEME_FAILED + return GTK_ICON_THEME_NOT_FOUND + case .failed: + return GTK_ICON_THEME_FAILED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/IconViewDropPosition.swift b/Sources/Gtk/Generated/IconViewDropPosition.swift index 3f3b74fba7..b6c709f411 100644 --- a/Sources/Gtk/Generated/IconViewDropPosition.swift +++ b/Sources/Gtk/Generated/IconViewDropPosition.swift @@ -5,36 +5,36 @@ public enum IconViewDropPosition: GValueRepresentableEnum { public typealias GtkEnum = GtkIconViewDropPosition /// No drop possible -case noDrop -/// Dropped item replaces the item -case dropInto -/// Dropped item is inserted to the left -case dropLeft -/// Dropped item is inserted to the right -case dropRight -/// Dropped item is inserted above -case dropAbove -/// Dropped item is inserted below -case dropBelow + case noDrop + /// Dropped item replaces the item + case dropInto + /// Dropped item is inserted to the left + case dropLeft + /// Dropped item is inserted to the right + case dropRight + /// Dropped item is inserted above + case dropAbove + /// Dropped item is inserted below + case dropBelow public static var type: GType { - gtk_icon_view_drop_position_get_type() -} + gtk_icon_view_drop_position_get_type() + } public init(from gtkEnum: GtkIconViewDropPosition) { switch gtkEnum { case GTK_ICON_VIEW_NO_DROP: - self = .noDrop -case GTK_ICON_VIEW_DROP_INTO: - self = .dropInto -case GTK_ICON_VIEW_DROP_LEFT: - self = .dropLeft -case GTK_ICON_VIEW_DROP_RIGHT: - self = .dropRight -case GTK_ICON_VIEW_DROP_ABOVE: - self = .dropAbove -case GTK_ICON_VIEW_DROP_BELOW: - self = .dropBelow + self = .noDrop + case GTK_ICON_VIEW_DROP_INTO: + self = .dropInto + case GTK_ICON_VIEW_DROP_LEFT: + self = .dropLeft + case GTK_ICON_VIEW_DROP_RIGHT: + self = .dropRight + case GTK_ICON_VIEW_DROP_ABOVE: + self = .dropAbove + case GTK_ICON_VIEW_DROP_BELOW: + self = .dropBelow default: fatalError("Unsupported GtkIconViewDropPosition enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ case GTK_ICON_VIEW_DROP_BELOW: public func toGtk() -> GtkIconViewDropPosition { switch self { case .noDrop: - return GTK_ICON_VIEW_NO_DROP -case .dropInto: - return GTK_ICON_VIEW_DROP_INTO -case .dropLeft: - return GTK_ICON_VIEW_DROP_LEFT -case .dropRight: - return GTK_ICON_VIEW_DROP_RIGHT -case .dropAbove: - return GTK_ICON_VIEW_DROP_ABOVE -case .dropBelow: - return GTK_ICON_VIEW_DROP_BELOW + return GTK_ICON_VIEW_NO_DROP + case .dropInto: + return GTK_ICON_VIEW_DROP_INTO + case .dropLeft: + return GTK_ICON_VIEW_DROP_LEFT + case .dropRight: + return GTK_ICON_VIEW_DROP_RIGHT + case .dropAbove: + return GTK_ICON_VIEW_DROP_ABOVE + case .dropBelow: + return GTK_ICON_VIEW_DROP_BELOW } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Image.swift b/Sources/Gtk/Generated/Image.swift index c33bfbdeba..be138278de 100644 --- a/Sources/Gtk/Generated/Image.swift +++ b/Sources/Gtk/Generated/Image.swift @@ -1,272 +1,281 @@ import CGtk /// Displays an image. -/// +/// /// picture>An example GtkImage -/// +/// /// Various kinds of object can be displayed as an image; most typically, /// you would load a `GdkTexture` from a file, using the convenience function /// [ctor@Gtk.Image.new_from_file], for instance: -/// +/// /// ```c /// GtkWidget *image = gtk_image_new_from_file ("myfile.png"); /// ``` -/// +/// /// If the file isn’t loaded successfully, the image will contain a /// “broken image” icon similar to that used in many web browsers. -/// +/// /// If you want to handle errors in loading the file yourself, for example /// by displaying an error message, then load the image with an image /// loading framework such as libglycin, then create the `GtkImage` with /// [ctor@Gtk.Image.new_from_paintable]. -/// +/// /// Sometimes an application will want to avoid depending on external data /// files, such as image files. See the documentation of `GResource` inside /// GIO, for details. In this case, [property@Gtk.Image:resource], /// [ctor@Gtk.Image.new_from_resource], and [method@Gtk.Image.set_from_resource] /// should be used. -/// +/// /// `GtkImage` displays its image as an icon, with a size that is determined /// by the application. See [class@Gtk.Picture] if you want to show an image /// at is actual size. -/// +/// /// ## CSS nodes -/// +/// /// `GtkImage` has a single CSS node with the name `image`. The style classes /// `.normal-icons` or `.large-icons` may appear, depending on the /// [property@Gtk.Image:icon-size] property. -/// +/// /// ## Accessibility -/// +/// /// `GtkImage` uses the [enum@Gtk.AccessibleRole.img] role. open class Image: Widget { /// Creates a new empty `GtkImage` widget. -public convenience init() { - self.init( - gtk_image_new() - ) -} - -/// Creates a new `GtkImage` displaying the file @filename. -/// -/// If the file isn’t found or can’t be loaded, the resulting `GtkImage` -/// will display a “broken image” icon. This function never returns %NULL, -/// it always returns a valid `GtkImage` widget. -/// -/// If you need to detect failures to load the file, use an -/// image loading framework such as libglycin to load the file -/// yourself, then create the `GtkImage` from the texture. -/// -/// The storage type (see [method@Gtk.Image.get_storage_type]) -/// of the returned image is not defined, it will be whatever -/// is appropriate for displaying the file. -public convenience init(filename: String) { - self.init( - gtk_image_new_from_file(filename) - ) -} - -/// Creates a `GtkImage` displaying an icon from the current icon theme. -/// -/// If the icon name isn’t known, a “broken image” icon will be -/// displayed instead. If the current icon theme is changed, the icon -/// will be updated appropriately. -public convenience init(icon: OpaquePointer) { - self.init( - gtk_image_new_from_gicon(icon) - ) -} - -/// Creates a `GtkImage` displaying an icon from the current icon theme. -/// -/// If the icon name isn’t known, a “broken image” icon will be -/// displayed instead. If the current icon theme is changed, the icon -/// will be updated appropriately. -public convenience init(iconName: String) { - self.init( - gtk_image_new_from_icon_name(iconName) - ) -} - -/// Creates a new `GtkImage` displaying @paintable. -/// -/// The `GtkImage` does not assume a reference to the paintable; you still -/// need to unref it if you own references. `GtkImage` will add its own -/// reference rather than adopting yours. -/// -/// The `GtkImage` will track changes to the @paintable and update -/// its size and contents in response to it. -/// -/// Note that paintables are still subject to the icon size that is -/// set on the image. If you want to display a paintable at its intrinsic -/// size, use [class@Gtk.Picture] instead. -/// -/// If @paintable is a [iface@Gtk.SymbolicPaintable], then it will be -/// recolored with the symbolic palette from the theme. -public convenience init(paintable: OpaquePointer) { - self.init( - gtk_image_new_from_paintable(paintable) - ) -} - -/// Creates a new `GtkImage` displaying the resource file @resource_path. -/// -/// If the file isn’t found or can’t be loaded, the resulting `GtkImage` will -/// display a “broken image” icon. This function never returns %NULL, -/// it always returns a valid `GtkImage` widget. -/// -/// If you need to detect failures to load the file, use an -/// image loading framework such as libglycin to load the file -/// yourself, then create the `GtkImage` from the texture. -/// -/// The storage type (see [method@Gtk.Image.get_storage_type]) of -/// the returned image is not defined, it will be whatever is -/// appropriate for displaying the file. -public convenience init(resourcePath: String) { - self.init( - gtk_image_new_from_resource(resourcePath) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::file", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFile?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_image_new() + ) } -addSignal(name: "notify::gicon", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyGicon?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::icon-name", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIconName?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new `GtkImage` displaying the file @filename. + /// + /// If the file isn’t found or can’t be loaded, the resulting `GtkImage` + /// will display a “broken image” icon. This function never returns %NULL, + /// it always returns a valid `GtkImage` widget. + /// + /// If you need to detect failures to load the file, use an + /// image loading framework such as libglycin to load the file + /// yourself, then create the `GtkImage` from the texture. + /// + /// The storage type (see [method@Gtk.Image.get_storage_type]) + /// of the returned image is not defined, it will be whatever + /// is appropriate for displaying the file. + public convenience init(filename: String) { + self.init( + gtk_image_new_from_file(filename) + ) } -addSignal(name: "notify::icon-size", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIconSize?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a `GtkImage` displaying an icon from the current icon theme. + /// + /// If the icon name isn’t known, a “broken image” icon will be + /// displayed instead. If the current icon theme is changed, the icon + /// will be updated appropriately. + public convenience init(icon: OpaquePointer) { + self.init( + gtk_image_new_from_gicon(icon) + ) } -addSignal(name: "notify::paintable", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPaintable?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a `GtkImage` displaying an icon from the current icon theme. + /// + /// If the icon name isn’t known, a “broken image” icon will be + /// displayed instead. If the current icon theme is changed, the icon + /// will be updated appropriately. + public convenience init(iconName: String) { + self.init( + gtk_image_new_from_icon_name(iconName) + ) } -addSignal(name: "notify::pixel-size", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPixelSize?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new `GtkImage` displaying @paintable. + /// + /// The `GtkImage` does not assume a reference to the paintable; you still + /// need to unref it if you own references. `GtkImage` will add its own + /// reference rather than adopting yours. + /// + /// The `GtkImage` will track changes to the @paintable and update + /// its size and contents in response to it. + /// + /// Note that paintables are still subject to the icon size that is + /// set on the image. If you want to display a paintable at its intrinsic + /// size, use [class@Gtk.Picture] instead. + /// + /// If @paintable is a [iface@Gtk.SymbolicPaintable], then it will be + /// recolored with the symbolic palette from the theme. + public convenience init(paintable: OpaquePointer) { + self.init( + gtk_image_new_from_paintable(paintable) + ) } -addSignal(name: "notify::resource", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyResource?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new `GtkImage` displaying the resource file @resource_path. + /// + /// If the file isn’t found or can’t be loaded, the resulting `GtkImage` will + /// display a “broken image” icon. This function never returns %NULL, + /// it always returns a valid `GtkImage` widget. + /// + /// If you need to detect failures to load the file, use an + /// image loading framework such as libglycin to load the file + /// yourself, then create the `GtkImage` from the texture. + /// + /// The storage type (see [method@Gtk.Image.get_storage_type]) of + /// the returned image is not defined, it will be whatever is + /// appropriate for displaying the file. + public convenience init(resourcePath: String) { + self.init( + gtk_image_new_from_resource(resourcePath) + ) } -addSignal(name: "notify::storage-type", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyStorageType?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::file", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFile?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::gicon", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyGicon?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::icon-name", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIconName?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::icon-size", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIconSize?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::paintable", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPaintable?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::pixel-size", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPixelSize?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::resource", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyResource?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::storage-type", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyStorageType?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-fallback", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseFallback?(self, param0) + } } -addSignal(name: "notify::use-fallback", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseFallback?(self, param0) -} -} - /// The name of the icon in the icon theme. -/// -/// If the icon theme is changed, the image will be updated automatically. -@GObjectProperty(named: "icon-name") public var iconName: String? - -/// The symbolic size to display icons at. -@GObjectProperty(named: "icon-size") public var iconSize: IconSize - -/// The `GdkPaintable` to display. -@GObjectProperty(named: "paintable") public var paintable: OpaquePointer? - -/// The size in pixels to display icons at. -/// -/// If set to a value != -1, this property overrides the -/// [property@Gtk.Image:icon-size] property for images of type -/// `GTK_IMAGE_ICON_NAME`. -@GObjectProperty(named: "pixel-size") public var pixelSize: Int - -/// The representation being used for image data. -@GObjectProperty(named: "storage-type") public var storageType: ImageType - + /// + /// If the icon theme is changed, the image will be updated automatically. + @GObjectProperty(named: "icon-name") public var iconName: String? -public var notifyFile: ((Image, OpaquePointer) -> Void)? + /// The symbolic size to display icons at. + @GObjectProperty(named: "icon-size") public var iconSize: IconSize + /// The `GdkPaintable` to display. + @GObjectProperty(named: "paintable") public var paintable: OpaquePointer? -public var notifyGicon: ((Image, OpaquePointer) -> Void)? + /// The size in pixels to display icons at. + /// + /// If set to a value != -1, this property overrides the + /// [property@Gtk.Image:icon-size] property for images of type + /// `GTK_IMAGE_ICON_NAME`. + @GObjectProperty(named: "pixel-size") public var pixelSize: Int + /// The representation being used for image data. + @GObjectProperty(named: "storage-type") public var storageType: ImageType -public var notifyIconName: ((Image, OpaquePointer) -> Void)? + public var notifyFile: ((Image, OpaquePointer) -> Void)? + public var notifyGicon: ((Image, OpaquePointer) -> Void)? -public var notifyIconSize: ((Image, OpaquePointer) -> Void)? + public var notifyIconName: ((Image, OpaquePointer) -> Void)? + public var notifyIconSize: ((Image, OpaquePointer) -> Void)? -public var notifyPaintable: ((Image, OpaquePointer) -> Void)? + public var notifyPaintable: ((Image, OpaquePointer) -> Void)? + public var notifyPixelSize: ((Image, OpaquePointer) -> Void)? -public var notifyPixelSize: ((Image, OpaquePointer) -> Void)? + public var notifyResource: ((Image, OpaquePointer) -> Void)? + public var notifyStorageType: ((Image, OpaquePointer) -> Void)? -public var notifyResource: ((Image, OpaquePointer) -> Void)? - - -public var notifyStorageType: ((Image, OpaquePointer) -> Void)? - - -public var notifyUseFallback: ((Image, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyUseFallback: ((Image, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/ImageType.swift b/Sources/Gtk/Generated/ImageType.swift index f34b0ae104..1adff5b1de 100644 --- a/Sources/Gtk/Generated/ImageType.swift +++ b/Sources/Gtk/Generated/ImageType.swift @@ -1,39 +1,39 @@ import CGtk /// Describes the image data representation used by a [class@Gtk.Image]. -/// +/// /// If you want to get the image from the widget, you can only get the /// currently-stored representation; for instance, if the gtk_image_get_storage_type() /// returns %GTK_IMAGE_PAINTABLE, then you can call gtk_image_get_paintable(). -/// +/// /// For empty images, you can request any storage type (call any of the "get" /// functions), but they will all return %NULL values. public enum ImageType: GValueRepresentableEnum { public typealias GtkEnum = GtkImageType /// There is no image displayed by the widget -case empty -/// The widget contains a named icon -case iconName -/// The widget contains a `GIcon` -case gicon -/// The widget contains a `GdkPaintable` -case paintable + case empty + /// The widget contains a named icon + case iconName + /// The widget contains a `GIcon` + case gicon + /// The widget contains a `GdkPaintable` + case paintable public static var type: GType { - gtk_image_type_get_type() -} + gtk_image_type_get_type() + } public init(from gtkEnum: GtkImageType) { switch gtkEnum { case GTK_IMAGE_EMPTY: - self = .empty -case GTK_IMAGE_ICON_NAME: - self = .iconName -case GTK_IMAGE_GICON: - self = .gicon -case GTK_IMAGE_PAINTABLE: - self = .paintable + self = .empty + case GTK_IMAGE_ICON_NAME: + self = .iconName + case GTK_IMAGE_GICON: + self = .gicon + case GTK_IMAGE_PAINTABLE: + self = .paintable default: fatalError("Unsupported GtkImageType enum value: \(gtkEnum.rawValue)") } @@ -42,13 +42,13 @@ case GTK_IMAGE_PAINTABLE: public func toGtk() -> GtkImageType { switch self { case .empty: - return GTK_IMAGE_EMPTY -case .iconName: - return GTK_IMAGE_ICON_NAME -case .gicon: - return GTK_IMAGE_GICON -case .paintable: - return GTK_IMAGE_PAINTABLE + return GTK_IMAGE_EMPTY + case .iconName: + return GTK_IMAGE_ICON_NAME + case .gicon: + return GTK_IMAGE_GICON + case .paintable: + return GTK_IMAGE_PAINTABLE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/InputPurpose.swift b/Sources/Gtk/Generated/InputPurpose.swift index e4ac62b696..c18b9b1cad 100644 --- a/Sources/Gtk/Generated/InputPurpose.swift +++ b/Sources/Gtk/Generated/InputPurpose.swift @@ -1,78 +1,78 @@ import CGtk /// Describes primary purpose of the input widget. -/// +/// /// This information is useful for on-screen keyboards and similar input /// methods to decide which keys should be presented to the user. -/// +/// /// Note that the purpose is not meant to impose a totally strict rule /// about allowed characters, and does not replace input validation. /// It is fine for an on-screen keyboard to let the user override the /// character set restriction that is expressed by the purpose. The /// application is expected to validate the entry contents, even if /// it specified a purpose. -/// +/// /// The difference between %GTK_INPUT_PURPOSE_DIGITS and /// %GTK_INPUT_PURPOSE_NUMBER is that the former accepts only digits /// while the latter also some punctuation (like commas or points, plus, /// minus) and “e” or “E” as in 3.14E+000. -/// +/// /// This enumeration may be extended in the future; input methods should /// interpret unknown values as “free form”. public enum InputPurpose: GValueRepresentableEnum { public typealias GtkEnum = GtkInputPurpose /// Allow any character -case freeForm -/// Allow only alphabetic characters -case alpha -/// Allow only digits -case digits -/// Edited field expects numbers -case number -/// Edited field expects phone number -case phone -/// Edited field expects URL -case url -/// Edited field expects email address -case email -/// Edited field expects the name of a person -case name -/// Like %GTK_INPUT_PURPOSE_FREE_FORM, but characters are hidden -case password -/// Like %GTK_INPUT_PURPOSE_DIGITS, but characters are hidden -case pin -/// Allow any character, in addition to control codes -case terminal + case freeForm + /// Allow only alphabetic characters + case alpha + /// Allow only digits + case digits + /// Edited field expects numbers + case number + /// Edited field expects phone number + case phone + /// Edited field expects URL + case url + /// Edited field expects email address + case email + /// Edited field expects the name of a person + case name + /// Like %GTK_INPUT_PURPOSE_FREE_FORM, but characters are hidden + case password + /// Like %GTK_INPUT_PURPOSE_DIGITS, but characters are hidden + case pin + /// Allow any character, in addition to control codes + case terminal public static var type: GType { - gtk_input_purpose_get_type() -} + gtk_input_purpose_get_type() + } public init(from gtkEnum: GtkInputPurpose) { switch gtkEnum { case GTK_INPUT_PURPOSE_FREE_FORM: - self = .freeForm -case GTK_INPUT_PURPOSE_ALPHA: - self = .alpha -case GTK_INPUT_PURPOSE_DIGITS: - self = .digits -case GTK_INPUT_PURPOSE_NUMBER: - self = .number -case GTK_INPUT_PURPOSE_PHONE: - self = .phone -case GTK_INPUT_PURPOSE_URL: - self = .url -case GTK_INPUT_PURPOSE_EMAIL: - self = .email -case GTK_INPUT_PURPOSE_NAME: - self = .name -case GTK_INPUT_PURPOSE_PASSWORD: - self = .password -case GTK_INPUT_PURPOSE_PIN: - self = .pin -case GTK_INPUT_PURPOSE_TERMINAL: - self = .terminal + self = .freeForm + case GTK_INPUT_PURPOSE_ALPHA: + self = .alpha + case GTK_INPUT_PURPOSE_DIGITS: + self = .digits + case GTK_INPUT_PURPOSE_NUMBER: + self = .number + case GTK_INPUT_PURPOSE_PHONE: + self = .phone + case GTK_INPUT_PURPOSE_URL: + self = .url + case GTK_INPUT_PURPOSE_EMAIL: + self = .email + case GTK_INPUT_PURPOSE_NAME: + self = .name + case GTK_INPUT_PURPOSE_PASSWORD: + self = .password + case GTK_INPUT_PURPOSE_PIN: + self = .pin + case GTK_INPUT_PURPOSE_TERMINAL: + self = .terminal default: fatalError("Unsupported GtkInputPurpose enum value: \(gtkEnum.rawValue)") } @@ -81,27 +81,27 @@ case GTK_INPUT_PURPOSE_TERMINAL: public func toGtk() -> GtkInputPurpose { switch self { case .freeForm: - return GTK_INPUT_PURPOSE_FREE_FORM -case .alpha: - return GTK_INPUT_PURPOSE_ALPHA -case .digits: - return GTK_INPUT_PURPOSE_DIGITS -case .number: - return GTK_INPUT_PURPOSE_NUMBER -case .phone: - return GTK_INPUT_PURPOSE_PHONE -case .url: - return GTK_INPUT_PURPOSE_URL -case .email: - return GTK_INPUT_PURPOSE_EMAIL -case .name: - return GTK_INPUT_PURPOSE_NAME -case .password: - return GTK_INPUT_PURPOSE_PASSWORD -case .pin: - return GTK_INPUT_PURPOSE_PIN -case .terminal: - return GTK_INPUT_PURPOSE_TERMINAL + return GTK_INPUT_PURPOSE_FREE_FORM + case .alpha: + return GTK_INPUT_PURPOSE_ALPHA + case .digits: + return GTK_INPUT_PURPOSE_DIGITS + case .number: + return GTK_INPUT_PURPOSE_NUMBER + case .phone: + return GTK_INPUT_PURPOSE_PHONE + case .url: + return GTK_INPUT_PURPOSE_URL + case .email: + return GTK_INPUT_PURPOSE_EMAIL + case .name: + return GTK_INPUT_PURPOSE_NAME + case .password: + return GTK_INPUT_PURPOSE_PASSWORD + case .pin: + return GTK_INPUT_PURPOSE_PIN + case .terminal: + return GTK_INPUT_PURPOSE_TERMINAL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Justification.swift b/Sources/Gtk/Generated/Justification.swift index 334fad46ff..a8d21f5f87 100644 --- a/Sources/Gtk/Generated/Justification.swift +++ b/Sources/Gtk/Generated/Justification.swift @@ -5,28 +5,28 @@ public enum Justification: GValueRepresentableEnum { public typealias GtkEnum = GtkJustification /// The text is placed at the left edge of the label. -case left -/// The text is placed at the right edge of the label. -case right -/// The text is placed in the center of the label. -case center -/// The text is placed is distributed across the label. -case fill + case left + /// The text is placed at the right edge of the label. + case right + /// The text is placed in the center of the label. + case center + /// The text is placed is distributed across the label. + case fill public static var type: GType { - gtk_justification_get_type() -} + gtk_justification_get_type() + } public init(from gtkEnum: GtkJustification) { switch gtkEnum { case GTK_JUSTIFY_LEFT: - self = .left -case GTK_JUSTIFY_RIGHT: - self = .right -case GTK_JUSTIFY_CENTER: - self = .center -case GTK_JUSTIFY_FILL: - self = .fill + self = .left + case GTK_JUSTIFY_RIGHT: + self = .right + case GTK_JUSTIFY_CENTER: + self = .center + case GTK_JUSTIFY_FILL: + self = .fill default: fatalError("Unsupported GtkJustification enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_JUSTIFY_FILL: public func toGtk() -> GtkJustification { switch self { case .left: - return GTK_JUSTIFY_LEFT -case .right: - return GTK_JUSTIFY_RIGHT -case .center: - return GTK_JUSTIFY_CENTER -case .fill: - return GTK_JUSTIFY_FILL + return GTK_JUSTIFY_LEFT + case .right: + return GTK_JUSTIFY_RIGHT + case .center: + return GTK_JUSTIFY_CENTER + case .fill: + return GTK_JUSTIFY_FILL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Label.swift b/Sources/Gtk/Generated/Label.swift index 0cba1191aa..f1e759cca0 100644 --- a/Sources/Gtk/Generated/Label.swift +++ b/Sources/Gtk/Generated/Label.swift @@ -1,32 +1,32 @@ import CGtk /// Displays a small amount of text. -/// +/// /// Most labels are used to label another widget (such as an [class@Entry]). -/// +/// /// An example GtkLabel -/// +/// /// ## Shortcuts and Gestures -/// +/// /// `GtkLabel` supports the following keyboard shortcuts, when the cursor is /// visible: -/// +/// /// - Shift+F10 or Menu opens the context menu. /// - Ctrl+A or Ctrl+/ /// selects all. /// - Ctrl+Shift+A or /// Ctrl+\ unselects all. -/// +/// /// Additionally, the following signals have default keybindings: -/// +/// /// - [signal@Gtk.Label::activate-current-link] /// - [signal@Gtk.Label::copy-clipboard] /// - [signal@Gtk.Label::move-cursor] -/// +/// /// ## Actions -/// +/// /// `GtkLabel` defines a set of built-in actions: -/// +/// /// - `clipboard.copy` copies the text to the clipboard. /// - `clipboard.cut` doesn't do anything, since text in labels can't be deleted. /// - `clipboard.paste` doesn't do anything, since text in labels can't be @@ -39,9 +39,9 @@ import CGtk /// deleted. /// - `selection.select-all` selects all of the text, if the label allows /// selection. -/// +/// /// ## CSS nodes -/// +/// /// ``` /// label /// ├── [selection] @@ -49,103 +49,103 @@ import CGtk /// ┊ /// ╰── [link] /// ``` -/// +/// /// `GtkLabel` has a single CSS node with the name label. A wide variety /// of style classes may be applied to labels, such as .title, .subtitle, /// .dim-label, etc. In the `GtkShortcutsWindow`, labels are used with the /// .keycap style class. -/// +/// /// If the label has a selection, it gets a subnode with name selection. -/// +/// /// If the label has links, there is one subnode per link. These subnodes /// carry the link or visited state depending on whether they have been /// visited. In this case, label node also gets a .link style class. -/// +/// /// ## GtkLabel as GtkBuildable -/// +/// /// The GtkLabel implementation of the GtkBuildable interface supports a /// custom `` element, which supports any number of `` /// elements. The `` element has attributes named “name“, “value“, /// “start“ and “end“ and allows you to specify [struct@Pango.Attribute] /// values for this label. -/// +/// /// An example of a UI definition fragment specifying Pango attributes: -/// +/// /// ```xml /// /// ``` -/// +/// /// The start and end attributes specify the range of characters to which the /// Pango attribute applies. If start and end are not specified, the attribute is /// applied to the whole text. Note that specifying ranges does not make much /// sense with translatable attributes. Use markup embedded in the translatable /// content instead. -/// +/// /// ## Accessibility -/// +/// /// `GtkLabel` uses the [enum@Gtk.AccessibleRole.label] role. -/// +/// /// ## Mnemonics -/// +/// /// Labels may contain “mnemonics”. Mnemonics are underlined characters in the /// label, used for keyboard navigation. Mnemonics are created by providing a /// string with an underscore before the mnemonic character, such as `"_File"`, /// to the functions [ctor@Gtk.Label.new_with_mnemonic] or /// [method@Gtk.Label.set_text_with_mnemonic]. -/// +/// /// Mnemonics automatically activate any activatable widget the label is /// inside, such as a [class@Gtk.Button]; if the label is not inside the /// mnemonic’s target widget, you have to tell the label about the target /// using [method@Gtk.Label.set_mnemonic_widget]. -/// +/// /// Here’s a simple example where the label is inside a button: -/// +/// /// ```c /// // Pressing Alt+H will activate this button /// GtkWidget *button = gtk_button_new (); /// GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello"); /// gtk_button_set_child (GTK_BUTTON (button), label); /// ``` -/// +/// /// There’s a convenience function to create buttons with a mnemonic label /// already inside: -/// +/// /// ```c /// // Pressing Alt+H will activate this button /// GtkWidget *button = gtk_button_new_with_mnemonic ("_Hello"); /// ``` -/// +/// /// To create a mnemonic for a widget alongside the label, such as a /// [class@Gtk.Entry], you have to point the label at the entry with /// [method@Gtk.Label.set_mnemonic_widget]: -/// +/// /// ```c /// // Pressing Alt+H will focus the entry /// GtkWidget *entry = gtk_entry_new (); /// GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello"); /// gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry); /// ``` -/// +/// /// ## Markup (styled text) -/// +/// /// To make it easy to format text in a label (changing colors, fonts, etc.), /// label text can be provided in a simple markup format: -/// +/// /// Here’s how to create a label with a small font: /// ```c /// GtkWidget *label = gtk_label_new (NULL); /// gtk_label_set_markup (GTK_LABEL (label), "Small text"); /// ``` -/// +/// /// (See the Pango manual for complete documentation] of available /// tags, [func@Pango.parse_markup]) -/// +/// /// The markup passed to [method@Gtk.Label.set_markup] must be valid XML; for example, /// literal `<`, `>` and `&` characters must be escaped as `<`, `>`, and `&`. /// If you pass text obtained from the user, file, or a network to /// [method@Gtk.Label.set_markup], you’ll want to escape it with /// [func@GLib.markup_escape_text] or [func@GLib.markup_printf_escaped]. -/// +/// /// Markup strings are just a convenient way to set the [struct@Pango.AttrList] /// on a label; [method@Gtk.Label.set_attributes] may be a simpler way to set /// attributes in some cases. Be careful though; [struct@Pango.AttrList] tends @@ -154,28 +154,28 @@ import CGtk /// to [0, `G_MAXINT`)). The reason is that specifying the `start_index` and /// `end_index` for a [struct@Pango.Attribute] requires knowledge of the exact /// string being displayed, so translations will cause problems. -/// +/// /// ## Selectable labels -/// +/// /// Labels can be made selectable with [method@Gtk.Label.set_selectable]. /// Selectable labels allow the user to copy the label contents to the /// clipboard. Only labels that contain useful-to-copy information — such /// as error messages — should be made selectable. -/// +/// /// ## Text layout -/// +/// /// A label can contain any number of paragraphs, but will have /// performance problems if it contains more than a small number. /// Paragraphs are separated by newlines or other paragraph separators /// understood by Pango. -/// +/// /// Labels can automatically wrap text if you call [method@Gtk.Label.set_wrap]. -/// +/// /// [method@Gtk.Label.set_justify] sets how the lines in a label align /// with one another. If you want to set how the label as a whole aligns /// in its available space, see the [property@Gtk.Widget:halign] and /// [property@Gtk.Widget:valign] properties. -/// +/// /// The [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] /// properties can be used to control the size allocation of ellipsized or /// wrapped labels. For ellipsizing labels, if either is specified (and less @@ -184,18 +184,18 @@ import CGtk /// width-chars is used as the minimum width, if specified, and max-width-chars /// is used as the natural width. Even if max-width-chars specified, wrapping /// labels will be rewrapped to use all of the available width. -/// +/// /// ## Links -/// +/// /// GTK supports markup for clickable hyperlinks in addition to regular Pango /// markup. The markup for links is borrowed from HTML, using the `` tag /// with “href“, “title“ and “class“ attributes. GTK renders links similar to /// the way they appear in web browsers, with colored, underlined text. The /// “title“ attribute is displayed as a tooltip on the link. The “class“ /// attribute is used as style class on the CSS node for the link. -/// +/// /// An example of inline links looks like this: -/// +/// /// ```c /// const char *text = /// "Go to the " @@ -204,455 +204,481 @@ import CGtk /// GtkWidget *label = gtk_label_new (NULL); /// gtk_label_set_markup (GTK_LABEL (label), text); /// ``` -/// +/// /// It is possible to implement custom handling for links and their tooltips /// with the [signal@Gtk.Label::activate-link] signal and the /// [method@Gtk.Label.get_current_uri] function. open class Label: Widget { /// Creates a new label with the given text inside it. -/// -/// You can pass `NULL` to get an empty label widget. -public convenience init(string: String) { - self.init( - gtk_label_new(string) - ) -} - -/// Creates a new label with the given text inside it, and a mnemonic. -/// -/// If characters in @str are preceded by an underscore, they are -/// underlined. If you need a literal underscore character in a label, use -/// '__' (two underscores). The first underlined character represents a -/// keyboard accelerator called a mnemonic. The mnemonic key can be used -/// to activate another widget, chosen automatically, or explicitly using -/// [method@Gtk.Label.set_mnemonic_widget]. -/// -/// If [method@Gtk.Label.set_mnemonic_widget] is not called, then the first -/// activatable ancestor of the label will be chosen as the mnemonic -/// widget. For instance, if the label is inside a button or menu item, -/// the button or menu item will automatically become the mnemonic widget -/// and be activated by the mnemonic. -public convenience init(mnemonic string: String) { - self.init( - gtk_label_new_with_mnemonic(string) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate-current-link") { [weak self] () in - guard let self = self else { return } - self.activateCurrentLink?(self) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1>.run(data, value1) - } - -addSignal(name: "activate-link", handler: gCallback(handler1)) { [weak self] (param0: UnsafePointer) in - guard let self = self else { return } - self.activateLink?(self, param0) -} - -addSignal(name: "copy-clipboard") { [weak self] () in - guard let self = self else { return } - self.copyClipboard?(self) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, value3, data in - SignalBox3.run(data, value1, value2, value3) - } - -addSignal(name: "move-cursor", handler: gCallback(handler3)) { [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool) in - guard let self = self else { return } - self.moveCursor?(self, param0, param1, param2) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::attributes", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAttributes?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::ellipsize", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEllipsize?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::extra-menu", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExtraMenu?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::justify", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyJustify?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::label", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLabel?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::lines", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLines?(self, param0) -} - -let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// + /// You can pass `NULL` to get an empty label widget. + public convenience init(string: String) { + self.init( + gtk_label_new(string) + ) } -addSignal(name: "notify::max-width-chars", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMaxWidthChars?(self, param0) -} - -let handler11: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new label with the given text inside it, and a mnemonic. + /// + /// If characters in @str are preceded by an underscore, they are + /// underlined. If you need a literal underscore character in a label, use + /// '__' (two underscores). The first underlined character represents a + /// keyboard accelerator called a mnemonic. The mnemonic key can be used + /// to activate another widget, chosen automatically, or explicitly using + /// [method@Gtk.Label.set_mnemonic_widget]. + /// + /// If [method@Gtk.Label.set_mnemonic_widget] is not called, then the first + /// activatable ancestor of the label will be chosen as the mnemonic + /// widget. For instance, if the label is inside a button or menu item, + /// the button or menu item will automatically become the mnemonic widget + /// and be activated by the mnemonic. + public convenience init(mnemonic string: String) { + self.init( + gtk_label_new_with_mnemonic(string) + ) } -addSignal(name: "notify::mnemonic-keyval", handler: gCallback(handler11)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMnemonicKeyval?(self, param0) -} - -let handler12: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate-current-link") { [weak self] () in + guard let self = self else { return } + self.activateCurrentLink?(self) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) + -> Void = + { _, value1, data in + SignalBox1>.run(data, value1) + } + + addSignal(name: "activate-link", handler: gCallback(handler1)) { + [weak self] (param0: UnsafePointer) in + guard let self = self else { return } + self.activateLink?(self, param0) + } + + addSignal(name: "copy-clipboard") { [weak self] () in + guard let self = self else { return } + self.copyClipboard?(self) + } + + let handler3: + @convention(c) ( + UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, UnsafeMutableRawPointer + ) -> Void = + { _, value1, value2, value3, data in + SignalBox3.run(data, value1, value2, value3) + } + + addSignal(name: "move-cursor", handler: gCallback(handler3)) { + [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool) in + guard let self = self else { return } + self.moveCursor?(self, param0, param1, param2) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::attributes", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAttributes?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::ellipsize", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEllipsize?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::extra-menu", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExtraMenu?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::justify", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyJustify?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::label", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLabel?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::lines", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLines?(self, param0) + } + + let handler10: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::max-width-chars", handler: gCallback(handler10)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMaxWidthChars?(self, param0) + } + + let handler11: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::mnemonic-keyval", handler: gCallback(handler11)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMnemonicKeyval?(self, param0) + } + + let handler12: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::natural-wrap-mode", handler: gCallback(handler12)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyNaturalWrapMode?(self, param0) + } + + let handler13: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::selectable", handler: gCallback(handler13)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectable?(self, param0) + } + + let handler14: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::single-line-mode", handler: gCallback(handler14)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySingleLineMode?(self, param0) + } + + let handler15: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::tabs", handler: gCallback(handler15)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTabs?(self, param0) + } + + let handler16: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-markup", handler: gCallback(handler16)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseMarkup?(self, param0) + } + + let handler17: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-underline", handler: gCallback(handler17)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseUnderline?(self, param0) + } + + let handler18: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::width-chars", handler: gCallback(handler18)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWidthChars?(self, param0) + } + + let handler19: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::wrap", handler: gCallback(handler19)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWrap?(self, param0) + } + + let handler20: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::wrap-mode", handler: gCallback(handler20)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWrapMode?(self, param0) + } + + let handler21: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::xalign", handler: gCallback(handler21)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyXalign?(self, param0) + } + + let handler22: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::yalign", handler: gCallback(handler22)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyYalign?(self, param0) + } } -addSignal(name: "notify::natural-wrap-mode", handler: gCallback(handler12)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyNaturalWrapMode?(self, param0) -} - -let handler13: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::selectable", handler: gCallback(handler13)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectable?(self, param0) -} - -let handler14: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::single-line-mode", handler: gCallback(handler14)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySingleLineMode?(self, param0) -} - -let handler15: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::tabs", handler: gCallback(handler15)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTabs?(self, param0) -} - -let handler16: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::use-markup", handler: gCallback(handler16)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseMarkup?(self, param0) -} - -let handler17: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::use-underline", handler: gCallback(handler17)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseUnderline?(self, param0) -} - -let handler18: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::width-chars", handler: gCallback(handler18)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWidthChars?(self, param0) -} - -let handler19: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::wrap", handler: gCallback(handler19)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWrap?(self, param0) -} - -let handler20: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::wrap-mode", handler: gCallback(handler20)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWrapMode?(self, param0) -} - -let handler21: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::xalign", handler: gCallback(handler21)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyXalign?(self, param0) -} - -let handler22: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::yalign", handler: gCallback(handler22)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyYalign?(self, param0) -} -} - /// The alignment of the lines in the text of the label, relative to each other. -/// -/// This does *not* affect the alignment of the label within its allocation. -/// See [property@Gtk.Label:xalign] for that. -@GObjectProperty(named: "justify") public var justify: Justification - -/// The contents of the label. -/// -/// If the string contains Pango markup (see [func@Pango.parse_markup]), -/// you will have to set the [property@Gtk.Label:use-markup] property to -/// true in order for the label to display the markup attributes. See also -/// [method@Gtk.Label.set_markup] for a convenience function that sets both -/// this property and the [property@Gtk.Label:use-markup] property at the -/// same time. -/// -/// If the string contains underlines acting as mnemonics, you will have to -/// set the [property@Gtk.Label:use-underline] property to true in order -/// for the label to display them. -@GObjectProperty(named: "label") public var label: String - -/// The number of lines to which an ellipsized, wrapping label -/// should display before it gets ellipsized. This both prevents the label -/// from ellipsizing before this many lines are displayed, and limits the -/// height request of the label to this many lines. -/// -/// ::: warning -/// Setting this property has unintuitive and unfortunate consequences -/// for the minimum _width_ of the label. Specifically, if the height -/// of the label is such that it fits a smaller number of lines than -/// the value of this property, the label can not be ellipsized at all, -/// which means it must be wide enough to fit all the text fully. -/// -/// This property has no effect if the label is not wrapping or ellipsized. -/// -/// Set this property to -1 if you don't want to limit the number of lines. -@GObjectProperty(named: "lines") public var lines: Int - -/// The desired maximum width of the label, in characters. -/// -/// If this property is set to -1, the width will be calculated automatically. -/// -/// See the section on [text layout](class.Label.html#text-layout) for details -/// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] -/// determine the width of ellipsized and wrapped labels. -@GObjectProperty(named: "max-width-chars") public var maxWidthChars: Int - -/// The mnemonic accelerator key for the label. -@GObjectProperty(named: "mnemonic-keyval") public var mnemonicKeyval: UInt - -/// Whether the label text can be selected with the mouse. -@GObjectProperty(named: "selectable") public var selectable: Bool - -/// Whether the label is in single line mode. -/// -/// In single line mode, the height of the label does not depend on the -/// actual text, it is always set to ascent + descent of the font. This -/// can be an advantage in situations where resizing the label because -/// of text changes would be distracting, e.g. in a statusbar. -@GObjectProperty(named: "single-line-mode") public var singleLineMode: Bool - -/// True if the text of the label includes Pango markup. -/// -/// See [func@Pango.parse_markup]. -@GObjectProperty(named: "use-markup") public var useMarkup: Bool - -/// True if the text of the label indicates a mnemonic with an `_` -/// before the mnemonic character. -@GObjectProperty(named: "use-underline") public var useUnderline: Bool - -/// The desired width of the label, in characters. -/// -/// If this property is set to -1, the width will be calculated automatically. -/// -/// See the section on [text layout](class.Label.html#text-layout) for details -/// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] -/// determine the width of ellipsized and wrapped labels. -@GObjectProperty(named: "width-chars") public var widthChars: Int - -/// True if the label text will wrap if it gets too wide. -@GObjectProperty(named: "wrap") public var wrap: Bool - -/// The horizontal alignment of the label text inside its size allocation. -/// -/// Compare this to [property@Gtk.Widget:halign], which determines how the -/// labels size allocation is positioned in the space available for the label. -@GObjectProperty(named: "xalign") public var xalign: Float - -/// The vertical alignment of the label text inside its size allocation. -/// -/// Compare this to [property@Gtk.Widget:valign], which determines how the -/// labels size allocation is positioned in the space available for the label. -@GObjectProperty(named: "yalign") public var yalign: Float - -/// Gets emitted when the user activates a link in the label. -/// -/// The `::activate-current-link` is a [keybinding signal](class.SignalAction.html). -/// -/// Applications may also emit the signal with g_signal_emit_by_name() -/// if they need to control activation of URIs programmatically. -/// -/// The default bindings for this signal are all forms of the Enter key. -public var activateCurrentLink: ((Label) -> Void)? - -/// Gets emitted to activate a URI. -/// -/// Applications may connect to it to override the default behaviour, -/// which is to call [method@Gtk.FileLauncher.launch]. -public var activateLink: ((Label, UnsafePointer) -> Void)? + /// + /// This does *not* affect the alignment of the label within its allocation. + /// See [property@Gtk.Label:xalign] for that. + @GObjectProperty(named: "justify") public var justify: Justification + + /// The contents of the label. + /// + /// If the string contains Pango markup (see [func@Pango.parse_markup]), + /// you will have to set the [property@Gtk.Label:use-markup] property to + /// true in order for the label to display the markup attributes. See also + /// [method@Gtk.Label.set_markup] for a convenience function that sets both + /// this property and the [property@Gtk.Label:use-markup] property at the + /// same time. + /// + /// If the string contains underlines acting as mnemonics, you will have to + /// set the [property@Gtk.Label:use-underline] property to true in order + /// for the label to display them. + @GObjectProperty(named: "label") public var label: String + + /// The number of lines to which an ellipsized, wrapping label + /// should display before it gets ellipsized. This both prevents the label + /// from ellipsizing before this many lines are displayed, and limits the + /// height request of the label to this many lines. + /// + /// ::: warning + /// Setting this property has unintuitive and unfortunate consequences + /// for the minimum _width_ of the label. Specifically, if the height + /// of the label is such that it fits a smaller number of lines than + /// the value of this property, the label can not be ellipsized at all, + /// which means it must be wide enough to fit all the text fully. + /// + /// This property has no effect if the label is not wrapping or ellipsized. + /// + /// Set this property to -1 if you don't want to limit the number of lines. + @GObjectProperty(named: "lines") public var lines: Int + + /// The desired maximum width of the label, in characters. + /// + /// If this property is set to -1, the width will be calculated automatically. + /// + /// See the section on [text layout](class.Label.html#text-layout) for details + /// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] + /// determine the width of ellipsized and wrapped labels. + @GObjectProperty(named: "max-width-chars") public var maxWidthChars: Int + + /// The mnemonic accelerator key for the label. + @GObjectProperty(named: "mnemonic-keyval") public var mnemonicKeyval: UInt + + /// Whether the label text can be selected with the mouse. + @GObjectProperty(named: "selectable") public var selectable: Bool + + /// Whether the label is in single line mode. + /// + /// In single line mode, the height of the label does not depend on the + /// actual text, it is always set to ascent + descent of the font. This + /// can be an advantage in situations where resizing the label because + /// of text changes would be distracting, e.g. in a statusbar. + @GObjectProperty(named: "single-line-mode") public var singleLineMode: Bool + + /// True if the text of the label includes Pango markup. + /// + /// See [func@Pango.parse_markup]. + @GObjectProperty(named: "use-markup") public var useMarkup: Bool + + /// True if the text of the label indicates a mnemonic with an `_` + /// before the mnemonic character. + @GObjectProperty(named: "use-underline") public var useUnderline: Bool + + /// The desired width of the label, in characters. + /// + /// If this property is set to -1, the width will be calculated automatically. + /// + /// See the section on [text layout](class.Label.html#text-layout) for details + /// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] + /// determine the width of ellipsized and wrapped labels. + @GObjectProperty(named: "width-chars") public var widthChars: Int + + /// True if the label text will wrap if it gets too wide. + @GObjectProperty(named: "wrap") public var wrap: Bool + + /// The horizontal alignment of the label text inside its size allocation. + /// + /// Compare this to [property@Gtk.Widget:halign], which determines how the + /// labels size allocation is positioned in the space available for the label. + @GObjectProperty(named: "xalign") public var xalign: Float + + /// The vertical alignment of the label text inside its size allocation. + /// + /// Compare this to [property@Gtk.Widget:valign], which determines how the + /// labels size allocation is positioned in the space available for the label. + @GObjectProperty(named: "yalign") public var yalign: Float + + /// Gets emitted when the user activates a link in the label. + /// + /// The `::activate-current-link` is a [keybinding signal](class.SignalAction.html). + /// + /// Applications may also emit the signal with g_signal_emit_by_name() + /// if they need to control activation of URIs programmatically. + /// + /// The default bindings for this signal are all forms of the Enter key. + public var activateCurrentLink: ((Label) -> Void)? + + /// Gets emitted to activate a URI. + /// + /// Applications may connect to it to override the default behaviour, + /// which is to call [method@Gtk.FileLauncher.launch]. + public var activateLink: ((Label, UnsafePointer) -> Void)? + + /// Gets emitted to copy the selection to the clipboard. + /// + /// The `::copy-clipboard` signal is a [keybinding signal](class.SignalAction.html). + /// + /// The default binding for this signal is Ctrl+c. + public var copyClipboard: ((Label) -> Void)? + + /// Gets emitted when the user initiates a cursor movement. + /// + /// The `::move-cursor` signal is a [keybinding signal](class.SignalAction.html). + /// If the cursor is not visible in @entry, this signal causes the viewport to + /// be moved instead. + /// + /// Applications should not connect to it, but may emit it with + /// [func@GObject.signal_emit_by_name] if they need to control + /// the cursor programmatically. + /// + /// The default bindings for this signal come in two variants, the + /// variant with the Shift modifier extends the selection, + /// the variant without the Shift modifier does not. + /// There are too many key combinations to list them all here. + /// + /// - , , , + /// move by individual characters/lines + /// - Ctrl+, etc. move by words/paragraphs + /// - Home and End move to the ends of the buffer + public var moveCursor: ((Label, GtkMovementStep, Int, Bool) -> Void)? + + public var notifyAttributes: ((Label, OpaquePointer) -> Void)? + + public var notifyEllipsize: ((Label, OpaquePointer) -> Void)? + + public var notifyExtraMenu: ((Label, OpaquePointer) -> Void)? + + public var notifyJustify: ((Label, OpaquePointer) -> Void)? -/// Gets emitted to copy the selection to the clipboard. -/// -/// The `::copy-clipboard` signal is a [keybinding signal](class.SignalAction.html). -/// -/// The default binding for this signal is Ctrl+c. -public var copyClipboard: ((Label) -> Void)? + public var notifyLabel: ((Label, OpaquePointer) -> Void)? + + public var notifyLines: ((Label, OpaquePointer) -> Void)? -/// Gets emitted when the user initiates a cursor movement. -/// -/// The `::move-cursor` signal is a [keybinding signal](class.SignalAction.html). -/// If the cursor is not visible in @entry, this signal causes the viewport to -/// be moved instead. -/// -/// Applications should not connect to it, but may emit it with -/// [func@GObject.signal_emit_by_name] if they need to control -/// the cursor programmatically. -/// -/// The default bindings for this signal come in two variants, the -/// variant with the Shift modifier extends the selection, -/// the variant without the Shift modifier does not. -/// There are too many key combinations to list them all here. -/// -/// - , , , -/// move by individual characters/lines -/// - Ctrl+, etc. move by words/paragraphs -/// - Home and End move to the ends of the buffer -public var moveCursor: ((Label, GtkMovementStep, Int, Bool) -> Void)? + public var notifyMaxWidthChars: ((Label, OpaquePointer) -> Void)? + + public var notifyMnemonicKeyval: ((Label, OpaquePointer) -> Void)? + + public var notifyNaturalWrapMode: ((Label, OpaquePointer) -> Void)? + + public var notifySelectable: ((Label, OpaquePointer) -> Void)? + public var notifySingleLineMode: ((Label, OpaquePointer) -> Void)? -public var notifyAttributes: ((Label, OpaquePointer) -> Void)? + public var notifyTabs: ((Label, OpaquePointer) -> Void)? + public var notifyUseMarkup: ((Label, OpaquePointer) -> Void)? -public var notifyEllipsize: ((Label, OpaquePointer) -> Void)? + public var notifyUseUnderline: ((Label, OpaquePointer) -> Void)? + public var notifyWidthChars: ((Label, OpaquePointer) -> Void)? -public var notifyExtraMenu: ((Label, OpaquePointer) -> Void)? + public var notifyWrap: ((Label, OpaquePointer) -> Void)? + public var notifyWrapMode: ((Label, OpaquePointer) -> Void)? -public var notifyJustify: ((Label, OpaquePointer) -> Void)? + public var notifyXalign: ((Label, OpaquePointer) -> Void)? - -public var notifyLabel: ((Label, OpaquePointer) -> Void)? - - -public var notifyLines: ((Label, OpaquePointer) -> Void)? - - -public var notifyMaxWidthChars: ((Label, OpaquePointer) -> Void)? - - -public var notifyMnemonicKeyval: ((Label, OpaquePointer) -> Void)? - - -public var notifyNaturalWrapMode: ((Label, OpaquePointer) -> Void)? - - -public var notifySelectable: ((Label, OpaquePointer) -> Void)? - - -public var notifySingleLineMode: ((Label, OpaquePointer) -> Void)? - - -public var notifyTabs: ((Label, OpaquePointer) -> Void)? - - -public var notifyUseMarkup: ((Label, OpaquePointer) -> Void)? - - -public var notifyUseUnderline: ((Label, OpaquePointer) -> Void)? - - -public var notifyWidthChars: ((Label, OpaquePointer) -> Void)? - - -public var notifyWrap: ((Label, OpaquePointer) -> Void)? - - -public var notifyWrapMode: ((Label, OpaquePointer) -> Void)? - - -public var notifyXalign: ((Label, OpaquePointer) -> Void)? - - -public var notifyYalign: ((Label, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyYalign: ((Label, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/LevelBarMode.swift b/Sources/Gtk/Generated/LevelBarMode.swift index 508c23645a..999e280dea 100644 --- a/Sources/Gtk/Generated/LevelBarMode.swift +++ b/Sources/Gtk/Generated/LevelBarMode.swift @@ -1,27 +1,27 @@ import CGtk /// Describes how [class@LevelBar] contents should be rendered. -/// +/// /// Note that this enumeration could be extended with additional modes /// in the future. public enum LevelBarMode: GValueRepresentableEnum { public typealias GtkEnum = GtkLevelBarMode /// The bar has a continuous mode -case continuous -/// The bar has a discrete mode -case discrete + case continuous + /// The bar has a discrete mode + case discrete public static var type: GType { - gtk_level_bar_mode_get_type() -} + gtk_level_bar_mode_get_type() + } public init(from gtkEnum: GtkLevelBarMode) { switch gtkEnum { case GTK_LEVEL_BAR_MODE_CONTINUOUS: - self = .continuous -case GTK_LEVEL_BAR_MODE_DISCRETE: - self = .discrete + self = .continuous + case GTK_LEVEL_BAR_MODE_DISCRETE: + self = .discrete default: fatalError("Unsupported GtkLevelBarMode enum value: \(gtkEnum.rawValue)") } @@ -30,9 +30,9 @@ case GTK_LEVEL_BAR_MODE_DISCRETE: public func toGtk() -> GtkLevelBarMode { switch self { case .continuous: - return GTK_LEVEL_BAR_MODE_CONTINUOUS -case .discrete: - return GTK_LEVEL_BAR_MODE_DISCRETE + return GTK_LEVEL_BAR_MODE_CONTINUOUS + case .discrete: + return GTK_LEVEL_BAR_MODE_DISCRETE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ListBox.swift b/Sources/Gtk/Generated/ListBox.swift index f10b14d5fe..bc5762d6c7 100644 --- a/Sources/Gtk/Generated/ListBox.swift +++ b/Sources/Gtk/Generated/ListBox.swift @@ -1,233 +1,253 @@ import CGtk /// Shows a vertical list. -/// +/// /// An example GtkListBox -/// +/// /// A `GtkListBox` only contains `GtkListBoxRow` children. These rows can /// by dynamically sorted and filtered, and headers can be added dynamically /// depending on the row content. It also allows keyboard and mouse navigation /// and selection like a typical list. -/// +/// /// Using `GtkListBox` is often an alternative to `GtkTreeView`, especially /// when the list contents has a more complicated layout than what is allowed /// by a `GtkCellRenderer`, or when the contents is interactive (i.e. has a /// button in it). -/// +/// /// Although a `GtkListBox` must have only `GtkListBoxRow` children, you can /// add any kind of widget to it via [method@Gtk.ListBox.prepend], /// [method@Gtk.ListBox.append] and [method@Gtk.ListBox.insert] and a /// `GtkListBoxRow` widget will automatically be inserted between the list /// and the widget. -/// +/// /// `GtkListBoxRows` can be marked as activatable or selectable. If a row is /// activatable, [signal@Gtk.ListBox::row-activated] will be emitted for it when /// the user tries to activate it. If it is selectable, the row will be marked /// as selected when the user tries to select it. -/// +/// /// # GtkListBox as GtkBuildable -/// +/// /// The `GtkListBox` implementation of the `GtkBuildable` interface supports /// setting a child as the placeholder by specifying “placeholder” as the “type” /// attribute of a `` element. See [method@Gtk.ListBox.set_placeholder] /// for info. -/// +/// /// # Shortcuts and Gestures -/// +/// /// The following signals have default keybindings: -/// +/// /// - [signal@Gtk.ListBox::move-cursor] /// - [signal@Gtk.ListBox::select-all] /// - [signal@Gtk.ListBox::toggle-cursor-row] /// - [signal@Gtk.ListBox::unselect-all] -/// +/// /// # CSS nodes -/// +/// /// ``` /// list[.separators][.rich-list][.navigation-sidebar][.boxed-list] /// ╰── row[.activatable] /// ``` -/// +/// /// `GtkListBox` uses a single CSS node named list. It may carry the .separators /// style class, when the [property@Gtk.ListBox:show-separators] property is set. /// Each `GtkListBoxRow` uses a single CSS node named row. The row nodes get the /// .activatable style class added when appropriate. -/// +/// /// It may also carry the .boxed-list style class. In this case, the list will be /// automatically surrounded by a frame and have separators. -/// +/// /// The main list node may also carry style classes to select /// the style of [list presentation](section-list-widget.html#list-styles): /// .rich-list, .navigation-sidebar or .data-table. -/// +/// /// # Accessibility -/// +/// /// `GtkListBox` uses the [enum@Gtk.AccessibleRole.list] role and `GtkListBoxRow` uses /// the [enum@Gtk.AccessibleRole.list_item] role. open class ListBox: Widget { /// Creates a new `GtkListBox` container. -public convenience init() { - self.init( - gtk_list_box_new() - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate-cursor-row") { [weak self] () in - guard let self = self else { return } - self.activateCursorRow?(self) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, Bool, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, value3, value4, data in - SignalBox4.run(data, value1, value2, value3, value4) - } - -addSignal(name: "move-cursor", handler: gCallback(handler1)) { [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool, param3: Bool) in - guard let self = self else { return } - self.moveCursor?(self, param0, param1, param2, param3) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, UnsafeMutablePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1>.run(data, value1) - } - -addSignal(name: "row-activated", handler: gCallback(handler2)) { [weak self] (param0: UnsafeMutablePointer) in - guard let self = self else { return } - self.rowActivated?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, UnsafeMutablePointer?, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1?>.run(data, value1) - } - -addSignal(name: "row-selected", handler: gCallback(handler3)) { [weak self] (param0: UnsafeMutablePointer?) in - guard let self = self else { return } - self.rowSelected?(self, param0) -} - -addSignal(name: "selected-rows-changed") { [weak self] () in - guard let self = self else { return } - self.selectedRowsChanged?(self) -} - -addSignal(name: "toggle-cursor-row") { [weak self] () in - guard let self = self else { return } - self.toggleCursorRow?(self) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::accept-unpaired-release", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAcceptUnpairedRelease?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::activate-on-single-click", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActivateOnSingleClick?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::selection-mode", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectionMode?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_list_box_new() + ) } -addSignal(name: "notify::show-separators", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowSeparators?(self, param0) -} - -let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate-cursor-row") { [weak self] () in + guard let self = self else { return } + self.activateCursorRow?(self) + } + + let handler1: + @convention(c) ( + UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, Bool, UnsafeMutableRawPointer + ) -> Void = + { _, value1, value2, value3, value4, data in + SignalBox4.run( + data, value1, value2, value3, value4) + } + + addSignal(name: "move-cursor", handler: gCallback(handler1)) { + [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool, param3: Bool) in + guard let self = self else { return } + self.moveCursor?(self, param0, param1, param2, param3) + } + + let handler2: + @convention(c) ( + UnsafeMutableRawPointer, UnsafeMutablePointer, + UnsafeMutableRawPointer + ) -> Void = + { _, value1, data in + SignalBox1>.run(data, value1) + } + + addSignal(name: "row-activated", handler: gCallback(handler2)) { + [weak self] (param0: UnsafeMutablePointer) in + guard let self = self else { return } + self.rowActivated?(self, param0) + } + + let handler3: + @convention(c) ( + UnsafeMutableRawPointer, UnsafeMutablePointer?, + UnsafeMutableRawPointer + ) -> Void = + { _, value1, data in + SignalBox1?>.run(data, value1) + } + + addSignal(name: "row-selected", handler: gCallback(handler3)) { + [weak self] (param0: UnsafeMutablePointer?) in + guard let self = self else { return } + self.rowSelected?(self, param0) + } + + addSignal(name: "selected-rows-changed") { [weak self] () in + guard let self = self else { return } + self.selectedRowsChanged?(self) + } + + addSignal(name: "toggle-cursor-row") { [weak self] () in + guard let self = self else { return } + self.toggleCursorRow?(self) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::accept-unpaired-release", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAcceptUnpairedRelease?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::activate-on-single-click", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActivateOnSingleClick?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::selection-mode", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectionMode?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::show-separators", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowSeparators?(self, param0) + } + + let handler10: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::tab-behavior", handler: gCallback(handler10)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTabBehavior?(self, param0) + } } -addSignal(name: "notify::tab-behavior", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTabBehavior?(self, param0) -} -} - /// Determines whether children can be activated with a single -/// click, or require a double-click. -@GObjectProperty(named: "activate-on-single-click") public var activateOnSingleClick: Bool - -/// The selection mode used by the list box. -@GObjectProperty(named: "selection-mode") public var selectionMode: SelectionMode + /// click, or require a double-click. + @GObjectProperty(named: "activate-on-single-click") public var activateOnSingleClick: Bool -/// Whether to show separators between rows. -@GObjectProperty(named: "show-separators") public var showSeparators: Bool + /// The selection mode used by the list box. + @GObjectProperty(named: "selection-mode") public var selectionMode: SelectionMode -/// Emitted when the cursor row is activated. -public var activateCursorRow: ((ListBox) -> Void)? + /// Whether to show separators between rows. + @GObjectProperty(named: "show-separators") public var showSeparators: Bool -/// Emitted when the user initiates a cursor movement. -/// -/// The default bindings for this signal come in two variants, the variant with -/// the Shift modifier extends the selection, the variant without the Shift -/// modifier does not. There are too many key combinations to list them all -/// here. -/// -/// - , , , -/// move by individual children -/// - Home, End move to the ends of the box -/// - PgUp, PgDn move vertically by pages -public var moveCursor: ((ListBox, GtkMovementStep, Int, Bool, Bool) -> Void)? + /// Emitted when the cursor row is activated. + public var activateCursorRow: ((ListBox) -> Void)? -/// Emitted when a row has been activated by the user. -public var rowActivated: ((ListBox, UnsafeMutablePointer) -> Void)? + /// Emitted when the user initiates a cursor movement. + /// + /// The default bindings for this signal come in two variants, the variant with + /// the Shift modifier extends the selection, the variant without the Shift + /// modifier does not. There are too many key combinations to list them all + /// here. + /// + /// - , , , + /// move by individual children + /// - Home, End move to the ends of the box + /// - PgUp, PgDn move vertically by pages + public var moveCursor: ((ListBox, GtkMovementStep, Int, Bool, Bool) -> Void)? -/// Emitted when a new row is selected, or (with a %NULL @row) -/// when the selection is cleared. -/// -/// When the @box is using %GTK_SELECTION_MULTIPLE, this signal will not -/// give you the full picture of selection changes, and you should use -/// the [signal@Gtk.ListBox::selected-rows-changed] signal instead. -public var rowSelected: ((ListBox, UnsafeMutablePointer?) -> Void)? + /// Emitted when a row has been activated by the user. + public var rowActivated: ((ListBox, UnsafeMutablePointer) -> Void)? -/// Emitted when the set of selected rows changes. -public var selectedRowsChanged: ((ListBox) -> Void)? + /// Emitted when a new row is selected, or (with a %NULL @row) + /// when the selection is cleared. + /// + /// When the @box is using %GTK_SELECTION_MULTIPLE, this signal will not + /// give you the full picture of selection changes, and you should use + /// the [signal@Gtk.ListBox::selected-rows-changed] signal instead. + public var rowSelected: ((ListBox, UnsafeMutablePointer?) -> Void)? -/// Emitted when the cursor row is toggled. -/// -/// The default bindings for this signal is Ctrl+. -public var toggleCursorRow: ((ListBox) -> Void)? + /// Emitted when the set of selected rows changes. + public var selectedRowsChanged: ((ListBox) -> Void)? + /// Emitted when the cursor row is toggled. + /// + /// The default bindings for this signal is Ctrl+. + public var toggleCursorRow: ((ListBox) -> Void)? -public var notifyAcceptUnpairedRelease: ((ListBox, OpaquePointer) -> Void)? + public var notifyAcceptUnpairedRelease: ((ListBox, OpaquePointer) -> Void)? + public var notifyActivateOnSingleClick: ((ListBox, OpaquePointer) -> Void)? -public var notifyActivateOnSingleClick: ((ListBox, OpaquePointer) -> Void)? + public var notifySelectionMode: ((ListBox, OpaquePointer) -> Void)? + public var notifyShowSeparators: ((ListBox, OpaquePointer) -> Void)? -public var notifySelectionMode: ((ListBox, OpaquePointer) -> Void)? - - -public var notifyShowSeparators: ((ListBox, OpaquePointer) -> Void)? - - -public var notifyTabBehavior: ((ListBox, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyTabBehavior: ((ListBox, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/MessageType.swift b/Sources/Gtk/Generated/MessageType.swift index ec25435d64..f842063b16 100644 --- a/Sources/Gtk/Generated/MessageType.swift +++ b/Sources/Gtk/Generated/MessageType.swift @@ -5,32 +5,32 @@ public enum MessageType: GValueRepresentableEnum { public typealias GtkEnum = GtkMessageType /// Informational message -case info -/// Non-fatal warning message -case warning -/// Question requiring a choice -case question -/// Fatal error message -case error -/// None of the above -case other + case info + /// Non-fatal warning message + case warning + /// Question requiring a choice + case question + /// Fatal error message + case error + /// None of the above + case other public static var type: GType { - gtk_message_type_get_type() -} + gtk_message_type_get_type() + } public init(from gtkEnum: GtkMessageType) { switch gtkEnum { case GTK_MESSAGE_INFO: - self = .info -case GTK_MESSAGE_WARNING: - self = .warning -case GTK_MESSAGE_QUESTION: - self = .question -case GTK_MESSAGE_ERROR: - self = .error -case GTK_MESSAGE_OTHER: - self = .other + self = .info + case GTK_MESSAGE_WARNING: + self = .warning + case GTK_MESSAGE_QUESTION: + self = .question + case GTK_MESSAGE_ERROR: + self = .error + case GTK_MESSAGE_OTHER: + self = .other default: fatalError("Unsupported GtkMessageType enum value: \(gtkEnum.rawValue)") } @@ -39,15 +39,15 @@ case GTK_MESSAGE_OTHER: public func toGtk() -> GtkMessageType { switch self { case .info: - return GTK_MESSAGE_INFO -case .warning: - return GTK_MESSAGE_WARNING -case .question: - return GTK_MESSAGE_QUESTION -case .error: - return GTK_MESSAGE_ERROR -case .other: - return GTK_MESSAGE_OTHER + return GTK_MESSAGE_INFO + case .warning: + return GTK_MESSAGE_WARNING + case .question: + return GTK_MESSAGE_QUESTION + case .error: + return GTK_MESSAGE_ERROR + case .other: + return GTK_MESSAGE_OTHER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/MovementStep.swift b/Sources/Gtk/Generated/MovementStep.swift index f6652e1c43..60162d7795 100644 --- a/Sources/Gtk/Generated/MovementStep.swift +++ b/Sources/Gtk/Generated/MovementStep.swift @@ -6,52 +6,52 @@ public enum MovementStep: GValueRepresentableEnum { public typealias GtkEnum = GtkMovementStep /// Move forward or back by graphemes -case logicalPositions -/// Move left or right by graphemes -case visualPositions -/// Move forward or back by words -case words -/// Move up or down lines (wrapped lines) -case displayLines -/// Move to either end of a line -case displayLineEnds -/// Move up or down paragraphs (newline-ended lines) -case paragraphs -/// Move to either end of a paragraph -case paragraphEnds -/// Move by pages -case pages -/// Move to ends of the buffer -case bufferEnds -/// Move horizontally by pages -case horizontalPages + case logicalPositions + /// Move left or right by graphemes + case visualPositions + /// Move forward or back by words + case words + /// Move up or down lines (wrapped lines) + case displayLines + /// Move to either end of a line + case displayLineEnds + /// Move up or down paragraphs (newline-ended lines) + case paragraphs + /// Move to either end of a paragraph + case paragraphEnds + /// Move by pages + case pages + /// Move to ends of the buffer + case bufferEnds + /// Move horizontally by pages + case horizontalPages public static var type: GType { - gtk_movement_step_get_type() -} + gtk_movement_step_get_type() + } public init(from gtkEnum: GtkMovementStep) { switch gtkEnum { case GTK_MOVEMENT_LOGICAL_POSITIONS: - self = .logicalPositions -case GTK_MOVEMENT_VISUAL_POSITIONS: - self = .visualPositions -case GTK_MOVEMENT_WORDS: - self = .words -case GTK_MOVEMENT_DISPLAY_LINES: - self = .displayLines -case GTK_MOVEMENT_DISPLAY_LINE_ENDS: - self = .displayLineEnds -case GTK_MOVEMENT_PARAGRAPHS: - self = .paragraphs -case GTK_MOVEMENT_PARAGRAPH_ENDS: - self = .paragraphEnds -case GTK_MOVEMENT_PAGES: - self = .pages -case GTK_MOVEMENT_BUFFER_ENDS: - self = .bufferEnds -case GTK_MOVEMENT_HORIZONTAL_PAGES: - self = .horizontalPages + self = .logicalPositions + case GTK_MOVEMENT_VISUAL_POSITIONS: + self = .visualPositions + case GTK_MOVEMENT_WORDS: + self = .words + case GTK_MOVEMENT_DISPLAY_LINES: + self = .displayLines + case GTK_MOVEMENT_DISPLAY_LINE_ENDS: + self = .displayLineEnds + case GTK_MOVEMENT_PARAGRAPHS: + self = .paragraphs + case GTK_MOVEMENT_PARAGRAPH_ENDS: + self = .paragraphEnds + case GTK_MOVEMENT_PAGES: + self = .pages + case GTK_MOVEMENT_BUFFER_ENDS: + self = .bufferEnds + case GTK_MOVEMENT_HORIZONTAL_PAGES: + self = .horizontalPages default: fatalError("Unsupported GtkMovementStep enum value: \(gtkEnum.rawValue)") } @@ -60,25 +60,25 @@ case GTK_MOVEMENT_HORIZONTAL_PAGES: public func toGtk() -> GtkMovementStep { switch self { case .logicalPositions: - return GTK_MOVEMENT_LOGICAL_POSITIONS -case .visualPositions: - return GTK_MOVEMENT_VISUAL_POSITIONS -case .words: - return GTK_MOVEMENT_WORDS -case .displayLines: - return GTK_MOVEMENT_DISPLAY_LINES -case .displayLineEnds: - return GTK_MOVEMENT_DISPLAY_LINE_ENDS -case .paragraphs: - return GTK_MOVEMENT_PARAGRAPHS -case .paragraphEnds: - return GTK_MOVEMENT_PARAGRAPH_ENDS -case .pages: - return GTK_MOVEMENT_PAGES -case .bufferEnds: - return GTK_MOVEMENT_BUFFER_ENDS -case .horizontalPages: - return GTK_MOVEMENT_HORIZONTAL_PAGES + return GTK_MOVEMENT_LOGICAL_POSITIONS + case .visualPositions: + return GTK_MOVEMENT_VISUAL_POSITIONS + case .words: + return GTK_MOVEMENT_WORDS + case .displayLines: + return GTK_MOVEMENT_DISPLAY_LINES + case .displayLineEnds: + return GTK_MOVEMENT_DISPLAY_LINE_ENDS + case .paragraphs: + return GTK_MOVEMENT_PARAGRAPHS + case .paragraphEnds: + return GTK_MOVEMENT_PARAGRAPH_ENDS + case .pages: + return GTK_MOVEMENT_PAGES + case .bufferEnds: + return GTK_MOVEMENT_BUFFER_ENDS + case .horizontalPages: + return GTK_MOVEMENT_HORIZONTAL_PAGES } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Native.swift b/Sources/Gtk/Generated/Native.swift index 3decd0c521..df37f3f405 100644 --- a/Sources/Gtk/Generated/Native.swift +++ b/Sources/Gtk/Generated/Native.swift @@ -1,21 +1,19 @@ import CGtk /// An interface for widgets that have their own [class@Gdk.Surface]. -/// +/// /// The obvious example of a `GtkNative` is `GtkWindow`. -/// +/// /// Every widget that is not itself a `GtkNative` is contained in one, /// and you can get it with [method@Gtk.Widget.get_native]. -/// +/// /// To get the surface of a `GtkNative`, use [method@Gtk.Native.get_surface]. /// It is also possible to find the `GtkNative` to which a surface /// belongs, with [func@Gtk.Native.get_for_surface]. -/// +/// /// In addition to a [class@Gdk.Surface], a `GtkNative` also provides /// a [class@Gsk.Renderer] for rendering on that surface. To get the /// renderer, use [method@Gtk.Native.get_renderer]. public protocol Native: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/NativeDialog.swift b/Sources/Gtk/Generated/NativeDialog.swift index 052aa5d409..1f7e967650 100644 --- a/Sources/Gtk/Generated/NativeDialog.swift +++ b/Sources/Gtk/Generated/NativeDialog.swift @@ -1,105 +1,109 @@ import CGtk /// Base class for platform dialogs that don't use `GtkDialog`. -/// +/// /// Native dialogs are used in order to integrate better with a platform, /// by looking the same as other native applications and supporting /// platform specific features. -/// +/// /// The [class@Gtk.Dialog] functions cannot be used on such objects, /// but we need a similar API in order to drive them. The `GtkNativeDialog` /// object is an API that allows you to do this. It allows you to set /// various common properties on the dialog, as well as show and hide /// it and get a [signal@Gtk.NativeDialog::response] signal when the user /// finished with the dialog. -/// +/// /// Note that unlike `GtkDialog`, `GtkNativeDialog` objects are not /// toplevel widgets, and GTK does not keep them alive. It is your /// responsibility to keep a reference until you are done with the /// object. open class NativeDialog: GObject { - public override func registerSignals() { - super.registerSignals() - - let handler0: @convention(c) (UnsafeMutableRawPointer, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "response", handler: gCallback(handler0)) { [weak self] (param0: Int) in - guard let self = self else { return } - self.response?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::modal", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyModal?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::title", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTitle?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + super.registerSignals() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "response", handler: gCallback(handler0)) { [weak self] (param0: Int) in + guard let self = self else { return } + self.response?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::modal", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyModal?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::title", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTitle?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::transient-for", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTransientFor?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::visible", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyVisible?(self, param0) + } } -addSignal(name: "notify::transient-for", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTransientFor?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::visible", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyVisible?(self, param0) -} -} - /// Whether the window should be modal with respect to its transient parent. -@GObjectProperty(named: "modal") public var modal: Bool - -/// The title of the dialog window -@GObjectProperty(named: "title") public var title: String? - -/// Whether the window is currently visible. -@GObjectProperty(named: "visible") public var visible: Bool + @GObjectProperty(named: "modal") public var modal: Bool -/// Emitted when the user responds to the dialog. -/// -/// When this is called the dialog has been hidden. -/// -/// If you call [method@Gtk.NativeDialog.hide] before the user -/// responds to the dialog this signal will not be emitted. -public var response: ((NativeDialog, Int) -> Void)? + /// The title of the dialog window + @GObjectProperty(named: "title") public var title: String? + /// Whether the window is currently visible. + @GObjectProperty(named: "visible") public var visible: Bool -public var notifyModal: ((NativeDialog, OpaquePointer) -> Void)? + /// Emitted when the user responds to the dialog. + /// + /// When this is called the dialog has been hidden. + /// + /// If you call [method@Gtk.NativeDialog.hide] before the user + /// responds to the dialog this signal will not be emitted. + public var response: ((NativeDialog, Int) -> Void)? + public var notifyModal: ((NativeDialog, OpaquePointer) -> Void)? -public var notifyTitle: ((NativeDialog, OpaquePointer) -> Void)? + public var notifyTitle: ((NativeDialog, OpaquePointer) -> Void)? + public var notifyTransientFor: ((NativeDialog, OpaquePointer) -> Void)? -public var notifyTransientFor: ((NativeDialog, OpaquePointer) -> Void)? - - -public var notifyVisible: ((NativeDialog, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyVisible: ((NativeDialog, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/NotebookTab.swift b/Sources/Gtk/Generated/NotebookTab.swift index ad7ee8720b..3c521e29d5 100644 --- a/Sources/Gtk/Generated/NotebookTab.swift +++ b/Sources/Gtk/Generated/NotebookTab.swift @@ -5,20 +5,20 @@ public enum NotebookTab: GValueRepresentableEnum { public typealias GtkEnum = GtkNotebookTab /// The first tab in the notebook -case first -/// The last tab in the notebook -case last + case first + /// The last tab in the notebook + case last public static var type: GType { - gtk_notebook_tab_get_type() -} + gtk_notebook_tab_get_type() + } public init(from gtkEnum: GtkNotebookTab) { switch gtkEnum { case GTK_NOTEBOOK_TAB_FIRST: - self = .first -case GTK_NOTEBOOK_TAB_LAST: - self = .last + self = .first + case GTK_NOTEBOOK_TAB_LAST: + self = .last default: fatalError("Unsupported GtkNotebookTab enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ case GTK_NOTEBOOK_TAB_LAST: public func toGtk() -> GtkNotebookTab { switch self { case .first: - return GTK_NOTEBOOK_TAB_FIRST -case .last: - return GTK_NOTEBOOK_TAB_LAST + return GTK_NOTEBOOK_TAB_FIRST + case .last: + return GTK_NOTEBOOK_TAB_LAST } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/NumberUpLayout.swift b/Sources/Gtk/Generated/NumberUpLayout.swift index 4d8fdd0b28..5d81e7641e 100644 --- a/Sources/Gtk/Generated/NumberUpLayout.swift +++ b/Sources/Gtk/Generated/NumberUpLayout.swift @@ -6,44 +6,44 @@ public enum NumberUpLayout: GValueRepresentableEnum { public typealias GtkEnum = GtkNumberUpLayout /// ![](layout-lrtb.png) -case lrtb -/// ![](layout-lrbt.png) -case lrbt -/// ![](layout-rltb.png) -case rltb -/// ![](layout-rlbt.png) -case rlbt -/// ![](layout-tblr.png) -case tblr -/// ![](layout-tbrl.png) -case tbrl -/// ![](layout-btlr.png) -case btlr -/// ![](layout-btrl.png) -case btrl + case lrtb + /// ![](layout-lrbt.png) + case lrbt + /// ![](layout-rltb.png) + case rltb + /// ![](layout-rlbt.png) + case rlbt + /// ![](layout-tblr.png) + case tblr + /// ![](layout-tbrl.png) + case tbrl + /// ![](layout-btlr.png) + case btlr + /// ![](layout-btrl.png) + case btrl public static var type: GType { - gtk_number_up_layout_get_type() -} + gtk_number_up_layout_get_type() + } public init(from gtkEnum: GtkNumberUpLayout) { switch gtkEnum { case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM: - self = .lrtb -case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP: - self = .lrbt -case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM: - self = .rltb -case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP: - self = .rlbt -case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT: - self = .tblr -case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT: - self = .tbrl -case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT: - self = .btlr -case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT: - self = .btrl + self = .lrtb + case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP: + self = .lrbt + case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM: + self = .rltb + case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP: + self = .rlbt + case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT: + self = .tblr + case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT: + self = .tbrl + case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT: + self = .btlr + case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT: + self = .btrl default: fatalError("Unsupported GtkNumberUpLayout enum value: \(gtkEnum.rawValue)") } @@ -52,21 +52,21 @@ case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT: public func toGtk() -> GtkNumberUpLayout { switch self { case .lrtb: - return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM -case .lrbt: - return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP -case .rltb: - return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM -case .rlbt: - return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP -case .tblr: - return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT -case .tbrl: - return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT -case .btlr: - return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT -case .btrl: - return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT + return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM + case .lrbt: + return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP + case .rltb: + return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM + case .rlbt: + return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP + case .tblr: + return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT + case .tbrl: + return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT + case .btlr: + return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT + case .btrl: + return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Ordering.swift b/Sources/Gtk/Generated/Ordering.swift index 65bc101c37..ac58f25c48 100644 --- a/Sources/Gtk/Generated/Ordering.swift +++ b/Sources/Gtk/Generated/Ordering.swift @@ -1,7 +1,7 @@ import CGtk /// Describes the way two values can be compared. -/// +/// /// These values can be used with a [callback@GLib.CompareFunc]. However, /// a `GCompareFunc` is allowed to return any integer values. /// For converting such a value to a `GtkOrdering` value, use @@ -10,24 +10,24 @@ public enum Ordering: GValueRepresentableEnum { public typealias GtkEnum = GtkOrdering /// The first value is smaller than the second -case smaller -/// The two values are equal -case equal -/// The first value is larger than the second -case larger + case smaller + /// The two values are equal + case equal + /// The first value is larger than the second + case larger public static var type: GType { - gtk_ordering_get_type() -} + gtk_ordering_get_type() + } public init(from gtkEnum: GtkOrdering) { switch gtkEnum { case GTK_ORDERING_SMALLER: - self = .smaller -case GTK_ORDERING_EQUAL: - self = .equal -case GTK_ORDERING_LARGER: - self = .larger + self = .smaller + case GTK_ORDERING_EQUAL: + self = .equal + case GTK_ORDERING_LARGER: + self = .larger default: fatalError("Unsupported GtkOrdering enum value: \(gtkEnum.rawValue)") } @@ -36,11 +36,11 @@ case GTK_ORDERING_LARGER: public func toGtk() -> GtkOrdering { switch self { case .smaller: - return GTK_ORDERING_SMALLER -case .equal: - return GTK_ORDERING_EQUAL -case .larger: - return GTK_ORDERING_LARGER + return GTK_ORDERING_SMALLER + case .equal: + return GTK_ORDERING_EQUAL + case .larger: + return GTK_ORDERING_LARGER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Orientation.swift b/Sources/Gtk/Generated/Orientation.swift index e323c5d837..15d9fbac6f 100644 --- a/Sources/Gtk/Generated/Orientation.swift +++ b/Sources/Gtk/Generated/Orientation.swift @@ -1,26 +1,26 @@ import CGtk /// Represents the orientation of widgets and other objects. -/// +/// /// Typical examples are [class@Box] or [class@GesturePan]. public enum Orientation: GValueRepresentableEnum { public typealias GtkEnum = GtkOrientation /// The element is in horizontal orientation. -case horizontal -/// The element is in vertical orientation. -case vertical + case horizontal + /// The element is in vertical orientation. + case vertical public static var type: GType { - gtk_orientation_get_type() -} + gtk_orientation_get_type() + } public init(from gtkEnum: GtkOrientation) { switch gtkEnum { case GTK_ORIENTATION_HORIZONTAL: - self = .horizontal -case GTK_ORIENTATION_VERTICAL: - self = .vertical + self = .horizontal + case GTK_ORIENTATION_VERTICAL: + self = .vertical default: fatalError("Unsupported GtkOrientation enum value: \(gtkEnum.rawValue)") } @@ -29,9 +29,9 @@ case GTK_ORIENTATION_VERTICAL: public func toGtk() -> GtkOrientation { switch self { case .horizontal: - return GTK_ORIENTATION_HORIZONTAL -case .vertical: - return GTK_ORIENTATION_VERTICAL + return GTK_ORIENTATION_HORIZONTAL + case .vertical: + return GTK_ORIENTATION_VERTICAL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Overflow.swift b/Sources/Gtk/Generated/Overflow.swift index ef8e4379ec..d28097d9c1 100644 --- a/Sources/Gtk/Generated/Overflow.swift +++ b/Sources/Gtk/Generated/Overflow.swift @@ -1,7 +1,7 @@ import CGtk /// Defines how content overflowing a given area should be handled. -/// +/// /// This is used in [method@Gtk.Widget.set_overflow]. The /// [property@Gtk.Widget:overflow] property is modeled after the /// CSS overflow property, but implements it only partially. @@ -9,22 +9,22 @@ public enum Overflow: GValueRepresentableEnum { public typealias GtkEnum = GtkOverflow /// No change is applied. Content is drawn at the specified -/// position. -case visible -/// Content is clipped to the bounds of the area. Content -/// outside the area is not drawn and cannot be interacted with. -case hidden + /// position. + case visible + /// Content is clipped to the bounds of the area. Content + /// outside the area is not drawn and cannot be interacted with. + case hidden public static var type: GType { - gtk_overflow_get_type() -} + gtk_overflow_get_type() + } public init(from gtkEnum: GtkOverflow) { switch gtkEnum { case GTK_OVERFLOW_VISIBLE: - self = .visible -case GTK_OVERFLOW_HIDDEN: - self = .hidden + self = .visible + case GTK_OVERFLOW_HIDDEN: + self = .hidden default: fatalError("Unsupported GtkOverflow enum value: \(gtkEnum.rawValue)") } @@ -33,9 +33,9 @@ case GTK_OVERFLOW_HIDDEN: public func toGtk() -> GtkOverflow { switch self { case .visible: - return GTK_OVERFLOW_VISIBLE -case .hidden: - return GTK_OVERFLOW_HIDDEN + return GTK_OVERFLOW_VISIBLE + case .hidden: + return GTK_OVERFLOW_HIDDEN } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PackType.swift b/Sources/Gtk/Generated/PackType.swift index fd74570593..283619f764 100644 --- a/Sources/Gtk/Generated/PackType.swift +++ b/Sources/Gtk/Generated/PackType.swift @@ -1,26 +1,26 @@ import CGtk /// Represents the packing location of a children in its parent. -/// +/// /// See [class@WindowControls] for example. public enum PackType: GValueRepresentableEnum { public typealias GtkEnum = GtkPackType /// The child is packed into the start of the widget -case start -/// The child is packed into the end of the widget -case end + case start + /// The child is packed into the end of the widget + case end public static var type: GType { - gtk_pack_type_get_type() -} + gtk_pack_type_get_type() + } public init(from gtkEnum: GtkPackType) { switch gtkEnum { case GTK_PACK_START: - self = .start -case GTK_PACK_END: - self = .end + self = .start + case GTK_PACK_END: + self = .end default: fatalError("Unsupported GtkPackType enum value: \(gtkEnum.rawValue)") } @@ -29,9 +29,9 @@ case GTK_PACK_END: public func toGtk() -> GtkPackType { switch self { case .start: - return GTK_PACK_START -case .end: - return GTK_PACK_END + return GTK_PACK_START + case .end: + return GTK_PACK_END } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PadActionType.swift b/Sources/Gtk/Generated/PadActionType.swift index 8f1f53c1de..6a6471e167 100644 --- a/Sources/Gtk/Generated/PadActionType.swift +++ b/Sources/Gtk/Generated/PadActionType.swift @@ -5,28 +5,28 @@ public enum PadActionType: GValueRepresentableEnum { public typealias GtkEnum = GtkPadActionType /// Action is triggered by a pad button -case button -/// Action is triggered by a pad ring -case ring -/// Action is triggered by a pad strip -case strip -/// Action is triggered by a pad dial -case dial + case button + /// Action is triggered by a pad ring + case ring + /// Action is triggered by a pad strip + case strip + /// Action is triggered by a pad dial + case dial public static var type: GType { - gtk_pad_action_type_get_type() -} + gtk_pad_action_type_get_type() + } public init(from gtkEnum: GtkPadActionType) { switch gtkEnum { case GTK_PAD_ACTION_BUTTON: - self = .button -case GTK_PAD_ACTION_RING: - self = .ring -case GTK_PAD_ACTION_STRIP: - self = .strip -case GTK_PAD_ACTION_DIAL: - self = .dial + self = .button + case GTK_PAD_ACTION_RING: + self = .ring + case GTK_PAD_ACTION_STRIP: + self = .strip + case GTK_PAD_ACTION_DIAL: + self = .dial default: fatalError("Unsupported GtkPadActionType enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_PAD_ACTION_DIAL: public func toGtk() -> GtkPadActionType { switch self { case .button: - return GTK_PAD_ACTION_BUTTON -case .ring: - return GTK_PAD_ACTION_RING -case .strip: - return GTK_PAD_ACTION_STRIP -case .dial: - return GTK_PAD_ACTION_DIAL + return GTK_PAD_ACTION_BUTTON + case .ring: + return GTK_PAD_ACTION_RING + case .strip: + return GTK_PAD_ACTION_STRIP + case .dial: + return GTK_PAD_ACTION_DIAL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PageOrientation.swift b/Sources/Gtk/Generated/PageOrientation.swift index 11056e7960..c58cf50992 100644 --- a/Sources/Gtk/Generated/PageOrientation.swift +++ b/Sources/Gtk/Generated/PageOrientation.swift @@ -5,28 +5,28 @@ public enum PageOrientation: GValueRepresentableEnum { public typealias GtkEnum = GtkPageOrientation /// Portrait mode. -case portrait -/// Landscape mode. -case landscape -/// Reverse portrait mode. -case reversePortrait -/// Reverse landscape mode. -case reverseLandscape + case portrait + /// Landscape mode. + case landscape + /// Reverse portrait mode. + case reversePortrait + /// Reverse landscape mode. + case reverseLandscape public static var type: GType { - gtk_page_orientation_get_type() -} + gtk_page_orientation_get_type() + } public init(from gtkEnum: GtkPageOrientation) { switch gtkEnum { case GTK_PAGE_ORIENTATION_PORTRAIT: - self = .portrait -case GTK_PAGE_ORIENTATION_LANDSCAPE: - self = .landscape -case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT: - self = .reversePortrait -case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE: - self = .reverseLandscape + self = .portrait + case GTK_PAGE_ORIENTATION_LANDSCAPE: + self = .landscape + case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT: + self = .reversePortrait + case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE: + self = .reverseLandscape default: fatalError("Unsupported GtkPageOrientation enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE: public func toGtk() -> GtkPageOrientation { switch self { case .portrait: - return GTK_PAGE_ORIENTATION_PORTRAIT -case .landscape: - return GTK_PAGE_ORIENTATION_LANDSCAPE -case .reversePortrait: - return GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT -case .reverseLandscape: - return GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE + return GTK_PAGE_ORIENTATION_PORTRAIT + case .landscape: + return GTK_PAGE_ORIENTATION_LANDSCAPE + case .reversePortrait: + return GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT + case .reverseLandscape: + return GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PageSet.swift b/Sources/Gtk/Generated/PageSet.swift index 74cc516b41..be8ebed1e7 100644 --- a/Sources/Gtk/Generated/PageSet.swift +++ b/Sources/Gtk/Generated/PageSet.swift @@ -5,24 +5,24 @@ public enum PageSet: GValueRepresentableEnum { public typealias GtkEnum = GtkPageSet /// All pages. -case all -/// Even pages. -case even -/// Odd pages. -case odd + case all + /// Even pages. + case even + /// Odd pages. + case odd public static var type: GType { - gtk_page_set_get_type() -} + gtk_page_set_get_type() + } public init(from gtkEnum: GtkPageSet) { switch gtkEnum { case GTK_PAGE_SET_ALL: - self = .all -case GTK_PAGE_SET_EVEN: - self = .even -case GTK_PAGE_SET_ODD: - self = .odd + self = .all + case GTK_PAGE_SET_EVEN: + self = .even + case GTK_PAGE_SET_ODD: + self = .odd default: fatalError("Unsupported GtkPageSet enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ case GTK_PAGE_SET_ODD: public func toGtk() -> GtkPageSet { switch self { case .all: - return GTK_PAGE_SET_ALL -case .even: - return GTK_PAGE_SET_EVEN -case .odd: - return GTK_PAGE_SET_ODD + return GTK_PAGE_SET_ALL + case .even: + return GTK_PAGE_SET_EVEN + case .odd: + return GTK_PAGE_SET_ODD } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PanDirection.swift b/Sources/Gtk/Generated/PanDirection.swift index 6c0f476926..671e76d754 100644 --- a/Sources/Gtk/Generated/PanDirection.swift +++ b/Sources/Gtk/Generated/PanDirection.swift @@ -5,28 +5,28 @@ public enum PanDirection: GValueRepresentableEnum { public typealias GtkEnum = GtkPanDirection /// Panned towards the left -case left -/// Panned towards the right -case right -/// Panned upwards -case up -/// Panned downwards -case down + case left + /// Panned towards the right + case right + /// Panned upwards + case up + /// Panned downwards + case down public static var type: GType { - gtk_pan_direction_get_type() -} + gtk_pan_direction_get_type() + } public init(from gtkEnum: GtkPanDirection) { switch gtkEnum { case GTK_PAN_DIRECTION_LEFT: - self = .left -case GTK_PAN_DIRECTION_RIGHT: - self = .right -case GTK_PAN_DIRECTION_UP: - self = .up -case GTK_PAN_DIRECTION_DOWN: - self = .down + self = .left + case GTK_PAN_DIRECTION_RIGHT: + self = .right + case GTK_PAN_DIRECTION_UP: + self = .up + case GTK_PAN_DIRECTION_DOWN: + self = .down default: fatalError("Unsupported GtkPanDirection enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_PAN_DIRECTION_DOWN: public func toGtk() -> GtkPanDirection { switch self { case .left: - return GTK_PAN_DIRECTION_LEFT -case .right: - return GTK_PAN_DIRECTION_RIGHT -case .up: - return GTK_PAN_DIRECTION_UP -case .down: - return GTK_PAN_DIRECTION_DOWN + return GTK_PAN_DIRECTION_LEFT + case .right: + return GTK_PAN_DIRECTION_RIGHT + case .up: + return GTK_PAN_DIRECTION_UP + case .down: + return GTK_PAN_DIRECTION_DOWN } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Picture.swift b/Sources/Gtk/Generated/Picture.swift index b75884c0a8..641cd3ecf3 100644 --- a/Sources/Gtk/Generated/Picture.swift +++ b/Sources/Gtk/Generated/Picture.swift @@ -1,34 +1,34 @@ import CGtk /// Displays a `GdkPaintable`. -/// +/// /// picture>An example GtkPicture -/// +/// /// Many convenience functions are provided to make pictures simple to use. /// For example, if you want to load an image from a file, and then display /// it, there’s a convenience function to do this: -/// +/// /// ```c /// GtkWidget *widget = gtk_picture_new_for_filename ("myfile.png"); /// ``` -/// +/// /// If the file isn’t loaded successfully, the picture will contain a /// “broken image” icon similar to that used in many web browsers. /// If you want to handle errors in loading the file yourself, /// for example by displaying an error message, then load the image with /// and image loading framework such as libglycin, then create the `GtkPicture` /// with [ctor@Gtk.Picture.new_for_paintable]. -/// +/// /// Sometimes an application will want to avoid depending on external data /// files, such as image files. See the documentation of `GResource` for details. /// In this case, [ctor@Gtk.Picture.new_for_resource] and /// [method@Gtk.Picture.set_resource] should be used. -/// +/// /// `GtkPicture` displays an image at its natural size. See [class@Gtk.Image] /// if you want to display a fixed-size image, such as an icon. -/// +/// /// ## Sizing the paintable -/// +/// /// You can influence how the paintable is displayed inside the `GtkPicture` /// by changing [property@Gtk.Picture:content-fit]. See [enum@Gtk.ContentFit] /// for details. [property@Gtk.Picture:can-shrink] can be unset to make sure @@ -38,144 +38,150 @@ import CGtk /// grow larger than the screen. And [property@Gtk.Widget:halign] and /// [property@Gtk.Widget:valign] can be used to make sure the paintable doesn't /// fill all available space but is instead displayed at its original size. -/// +/// /// ## CSS nodes -/// +/// /// `GtkPicture` has a single CSS node with the name `picture`. -/// +/// /// ## Accessibility -/// +/// /// `GtkPicture` uses the [enum@Gtk.AccessibleRole.img] role. open class Picture: Widget { /// Creates a new empty `GtkPicture` widget. -public convenience init() { - self.init( - gtk_picture_new() - ) -} - -/// Creates a new `GtkPicture` displaying the file @filename. -/// -/// This is a utility function that calls [ctor@Gtk.Picture.new_for_file]. -/// See that function for details. -public convenience init(filename: String) { - self.init( - gtk_picture_new_for_filename(filename) - ) -} - -/// Creates a new `GtkPicture` displaying @paintable. -/// -/// The `GtkPicture` will track changes to the @paintable and update -/// its size and contents in response to it. -public convenience init(paintable: OpaquePointer) { - self.init( - gtk_picture_new_for_paintable(paintable) - ) -} - -/// Creates a new `GtkPicture` displaying the resource at @resource_path. -/// -/// This is a utility function that calls [ctor@Gtk.Picture.new_for_file]. -/// See that function for details. -public convenience init(resourcePath: String) { - self.init( - gtk_picture_new_for_resource(resourcePath) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_picture_new() + ) } -addSignal(name: "notify::alternative-text", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAlternativeText?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new `GtkPicture` displaying the file @filename. + /// + /// This is a utility function that calls [ctor@Gtk.Picture.new_for_file]. + /// See that function for details. + public convenience init(filename: String) { + self.init( + gtk_picture_new_for_filename(filename) + ) } -addSignal(name: "notify::can-shrink", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCanShrink?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new `GtkPicture` displaying @paintable. + /// + /// The `GtkPicture` will track changes to the @paintable and update + /// its size and contents in response to it. + public convenience init(paintable: OpaquePointer) { + self.init( + gtk_picture_new_for_paintable(paintable) + ) } -addSignal(name: "notify::content-fit", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContentFit?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new `GtkPicture` displaying the resource at @resource_path. + /// + /// This is a utility function that calls [ctor@Gtk.Picture.new_for_file]. + /// See that function for details. + public convenience init(resourcePath: String) { + self.init( + gtk_picture_new_for_resource(resourcePath) + ) } -addSignal(name: "notify::file", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFile?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::keep-aspect-ratio", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyKeepAspectRatio?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::alternative-text", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAlternativeText?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::can-shrink", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCanShrink?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::content-fit", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContentFit?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::file", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFile?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::keep-aspect-ratio", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyKeepAspectRatio?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::paintable", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPaintable?(self, param0) + } } -addSignal(name: "notify::paintable", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPaintable?(self, param0) -} -} - /// The alternative textual description for the picture. -@GObjectProperty(named: "alternative-text") public var alternativeText: String? + @GObjectProperty(named: "alternative-text") public var alternativeText: String? -/// If the `GtkPicture` can be made smaller than the natural size of its contents. -@GObjectProperty(named: "can-shrink") public var canShrink: Bool + /// If the `GtkPicture` can be made smaller than the natural size of its contents. + @GObjectProperty(named: "can-shrink") public var canShrink: Bool -/// Whether the GtkPicture will render its contents trying to preserve the aspect -/// ratio. -@GObjectProperty(named: "keep-aspect-ratio") public var keepAspectRatio: Bool + /// Whether the GtkPicture will render its contents trying to preserve the aspect + /// ratio. + @GObjectProperty(named: "keep-aspect-ratio") public var keepAspectRatio: Bool -/// The `GdkPaintable` to be displayed by this `GtkPicture`. -@GObjectProperty(named: "paintable") public var paintable: OpaquePointer? + /// The `GdkPaintable` to be displayed by this `GtkPicture`. + @GObjectProperty(named: "paintable") public var paintable: OpaquePointer? + public var notifyAlternativeText: ((Picture, OpaquePointer) -> Void)? -public var notifyAlternativeText: ((Picture, OpaquePointer) -> Void)? + public var notifyCanShrink: ((Picture, OpaquePointer) -> Void)? + public var notifyContentFit: ((Picture, OpaquePointer) -> Void)? -public var notifyCanShrink: ((Picture, OpaquePointer) -> Void)? + public var notifyFile: ((Picture, OpaquePointer) -> Void)? + public var notifyKeepAspectRatio: ((Picture, OpaquePointer) -> Void)? -public var notifyContentFit: ((Picture, OpaquePointer) -> Void)? - - -public var notifyFile: ((Picture, OpaquePointer) -> Void)? - - -public var notifyKeepAspectRatio: ((Picture, OpaquePointer) -> Void)? - - -public var notifyPaintable: ((Picture, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyPaintable: ((Picture, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/PolicyType.swift b/Sources/Gtk/Generated/PolicyType.swift index 723782bc54..6c8b2f3718 100644 --- a/Sources/Gtk/Generated/PolicyType.swift +++ b/Sources/Gtk/Generated/PolicyType.swift @@ -6,33 +6,33 @@ public enum PolicyType: GValueRepresentableEnum { public typealias GtkEnum = GtkPolicyType /// The scrollbar is always visible. The view size is -/// independent of the content. -case always -/// The scrollbar will appear and disappear as necessary. -/// For example, when all of a `GtkTreeView` can not be seen. -case automatic -/// The scrollbar should never appear. In this mode the -/// content determines the size. -case never -/// Don't show a scrollbar, but don't force the -/// size to follow the content. This can be used e.g. to make multiple -/// scrolled windows share a scrollbar. -case external + /// independent of the content. + case always + /// The scrollbar will appear and disappear as necessary. + /// For example, when all of a `GtkTreeView` can not be seen. + case automatic + /// The scrollbar should never appear. In this mode the + /// content determines the size. + case never + /// Don't show a scrollbar, but don't force the + /// size to follow the content. This can be used e.g. to make multiple + /// scrolled windows share a scrollbar. + case external public static var type: GType { - gtk_policy_type_get_type() -} + gtk_policy_type_get_type() + } public init(from gtkEnum: GtkPolicyType) { switch gtkEnum { case GTK_POLICY_ALWAYS: - self = .always -case GTK_POLICY_AUTOMATIC: - self = .automatic -case GTK_POLICY_NEVER: - self = .never -case GTK_POLICY_EXTERNAL: - self = .external + self = .always + case GTK_POLICY_AUTOMATIC: + self = .automatic + case GTK_POLICY_NEVER: + self = .never + case GTK_POLICY_EXTERNAL: + self = .external default: fatalError("Unsupported GtkPolicyType enum value: \(gtkEnum.rawValue)") } @@ -41,13 +41,13 @@ case GTK_POLICY_EXTERNAL: public func toGtk() -> GtkPolicyType { switch self { case .always: - return GTK_POLICY_ALWAYS -case .automatic: - return GTK_POLICY_AUTOMATIC -case .never: - return GTK_POLICY_NEVER -case .external: - return GTK_POLICY_EXTERNAL + return GTK_POLICY_ALWAYS + case .automatic: + return GTK_POLICY_AUTOMATIC + case .never: + return GTK_POLICY_NEVER + case .external: + return GTK_POLICY_EXTERNAL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Popover.swift b/Sources/Gtk/Generated/Popover.swift index 7095c5824c..0a68d9b281 100644 --- a/Sources/Gtk/Generated/Popover.swift +++ b/Sources/Gtk/Generated/Popover.swift @@ -1,9 +1,9 @@ import CGtk /// Presents a bubble-like popup. -/// +/// /// An example GtkPopover -/// +/// /// It is primarily meant to provide context-dependent information /// or options. Popovers are attached to a parent widget. The parent widget /// must support popover children, as [class@Gtk.MenuButton] and @@ -11,62 +11,62 @@ import CGtk /// has an attached popover, you need to call [method@Gtk.Popover.present] /// in your [vfunc@Gtk.Widget.size_allocate] vfunc, in order to update the /// positioning of the popover. -/// +/// /// The position of a popover relative to the widget it is attached to /// can also be changed with [method@Gtk.Popover.set_position]. By default, /// it points to the whole widget area, but it can be made to point to /// a specific area using [method@Gtk.Popover.set_pointing_to]. -/// +/// /// By default, `GtkPopover` performs a grab, in order to ensure input /// events get redirected to it while it is shown, and also so the popover /// is dismissed in the expected situations (clicks outside the popover, /// or the Escape key being pressed). If no such modal behavior is desired /// on a popover, [method@Gtk.Popover.set_autohide] may be called on it to /// tweak its behavior. -/// +/// /// ## GtkPopover as menu replacement -/// +/// /// `GtkPopover` is often used to replace menus. The best way to do this /// is to use the [class@Gtk.PopoverMenu] subclass which supports being /// populated from a `GMenuModel` with [ctor@Gtk.PopoverMenu.new_from_model]. -/// +/// /// ```xml ///
horizontal-buttonsCutapp.cutedit-cut-symbolicCopyapp.copyedit-copy-symbolicPasteapp.pasteedit-paste-symbolic
/// ``` -/// +/// /// # Shortcuts and Gestures -/// +/// /// `GtkPopover` supports the following keyboard shortcuts: -/// +/// /// - Escape closes the popover. /// - Alt makes the mnemonics visible. -/// +/// /// The following signals have default keybindings: -/// +/// /// - [signal@Gtk.Popover::activate-default] -/// +/// /// # CSS nodes -/// +/// /// ``` /// popover.background[.menu] /// ├── arrow /// ╰── contents /// ╰── /// ``` -/// +/// /// `GtkPopover` has a main node with name `popover`, an arrow with name `arrow`, /// and another node for the content named `contents`. The `popover` node always /// gets the `.background` style class. It also gets the `.menu` style class /// if the popover is menu-like, e.g. is a [class@Gtk.PopoverMenu]. -/// +/// /// Particular uses of `GtkPopover`, such as touch selection popups or /// magnifiers in `GtkEntry` or `GtkTextView` get style classes like /// `.touch-selection` or `.magnifier` to differentiate from plain popovers. -/// +/// /// When styling a popover directly, the `popover` node should usually /// not have any background. The visible part of the popover can have /// a shadow. To specify it in CSS, set the box-shadow of the `contents` node. -/// +/// /// Note that, in order to accomplish appropriate arrow visuals, `GtkPopover` /// uses custom drawing for the `arrow` node. This makes it possible for the /// arrow to change its shape dynamically, but it also limits the possibilities @@ -78,154 +78,162 @@ import CGtk /// used) and no box-shadow. open class Popover: Widget, Native, ShortcutManager { /// Creates a new `GtkPopover`. -public convenience init() { - self.init( - gtk_popover_new() - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate-default") { [weak self] () in - guard let self = self else { return } - self.activateDefault?(self) -} - -addSignal(name: "closed") { [weak self] () in - guard let self = self else { return } - self.closed?(self) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_popover_new() + ) } -addSignal(name: "notify::autohide", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAutohide?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate-default") { [weak self] () in + guard let self = self else { return } + self.activateDefault?(self) + } + + addSignal(name: "closed") { [weak self] () in + guard let self = self else { return } + self.closed?(self) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::autohide", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAutohide?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::cascade-popdown", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCascadePopdown?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::child", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyChild?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::default-widget", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDefaultWidget?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::has-arrow", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasArrow?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::mnemonics-visible", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMnemonicsVisible?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::pointing-to", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPointingTo?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::position", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPosition?(self, param0) + } } -addSignal(name: "notify::cascade-popdown", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCascadePopdown?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::child", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyChild?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::default-widget", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDefaultWidget?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::has-arrow", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasArrow?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::mnemonics-visible", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMnemonicsVisible?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::pointing-to", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPointingTo?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::position", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPosition?(self, param0) -} -} - /// Whether to dismiss the popover on outside clicks. -@GObjectProperty(named: "autohide") public var autohide: Bool - -/// Whether the popover pops down after a child popover. -/// -/// This is used to implement the expected behavior of submenus. -@GObjectProperty(named: "cascade-popdown") public var cascadePopdown: Bool - -/// Whether to draw an arrow. -@GObjectProperty(named: "has-arrow") public var hasArrow: Bool - -/// Whether mnemonics are currently visible in this popover. -@GObjectProperty(named: "mnemonics-visible") public var mnemonicsVisible: Bool - -/// How to place the popover, relative to its parent. -@GObjectProperty(named: "position") public var position: PositionType + @GObjectProperty(named: "autohide") public var autohide: Bool -/// Emitted whend the user activates the default widget. -/// -/// This is a [keybinding signal](class.SignalAction.html). -/// -/// The default binding for this signal is Enter. -public var activateDefault: ((Popover) -> Void)? + /// Whether the popover pops down after a child popover. + /// + /// This is used to implement the expected behavior of submenus. + @GObjectProperty(named: "cascade-popdown") public var cascadePopdown: Bool -/// Emitted when the popover is closed. -public var closed: ((Popover) -> Void)? + /// Whether to draw an arrow. + @GObjectProperty(named: "has-arrow") public var hasArrow: Bool + /// Whether mnemonics are currently visible in this popover. + @GObjectProperty(named: "mnemonics-visible") public var mnemonicsVisible: Bool -public var notifyAutohide: ((Popover, OpaquePointer) -> Void)? + /// How to place the popover, relative to its parent. + @GObjectProperty(named: "position") public var position: PositionType + /// Emitted whend the user activates the default widget. + /// + /// This is a [keybinding signal](class.SignalAction.html). + /// + /// The default binding for this signal is Enter. + public var activateDefault: ((Popover) -> Void)? -public var notifyCascadePopdown: ((Popover, OpaquePointer) -> Void)? + /// Emitted when the popover is closed. + public var closed: ((Popover) -> Void)? + public var notifyAutohide: ((Popover, OpaquePointer) -> Void)? -public var notifyChild: ((Popover, OpaquePointer) -> Void)? + public var notifyCascadePopdown: ((Popover, OpaquePointer) -> Void)? + public var notifyChild: ((Popover, OpaquePointer) -> Void)? -public var notifyDefaultWidget: ((Popover, OpaquePointer) -> Void)? + public var notifyDefaultWidget: ((Popover, OpaquePointer) -> Void)? + public var notifyHasArrow: ((Popover, OpaquePointer) -> Void)? -public var notifyHasArrow: ((Popover, OpaquePointer) -> Void)? + public var notifyMnemonicsVisible: ((Popover, OpaquePointer) -> Void)? + public var notifyPointingTo: ((Popover, OpaquePointer) -> Void)? -public var notifyMnemonicsVisible: ((Popover, OpaquePointer) -> Void)? - - -public var notifyPointingTo: ((Popover, OpaquePointer) -> Void)? - - -public var notifyPosition: ((Popover, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyPosition: ((Popover, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/PositionType.swift b/Sources/Gtk/Generated/PositionType.swift index 1ae80235e0..cd0c7bcd4e 100644 --- a/Sources/Gtk/Generated/PositionType.swift +++ b/Sources/Gtk/Generated/PositionType.swift @@ -1,35 +1,35 @@ import CGtk /// Describes which edge of a widget a certain feature is positioned at. -/// +/// /// For examples, see the tabs of a [class@Notebook], or the label /// of a [class@Scale]. public enum PositionType: GValueRepresentableEnum { public typealias GtkEnum = GtkPositionType /// The feature is at the left edge. -case left -/// The feature is at the right edge. -case right -/// The feature is at the top edge. -case top -/// The feature is at the bottom edge. -case bottom + case left + /// The feature is at the right edge. + case right + /// The feature is at the top edge. + case top + /// The feature is at the bottom edge. + case bottom public static var type: GType { - gtk_position_type_get_type() -} + gtk_position_type_get_type() + } public init(from gtkEnum: GtkPositionType) { switch gtkEnum { case GTK_POS_LEFT: - self = .left -case GTK_POS_RIGHT: - self = .right -case GTK_POS_TOP: - self = .top -case GTK_POS_BOTTOM: - self = .bottom + self = .left + case GTK_POS_RIGHT: + self = .right + case GTK_POS_TOP: + self = .top + case GTK_POS_BOTTOM: + self = .bottom default: fatalError("Unsupported GtkPositionType enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ case GTK_POS_BOTTOM: public func toGtk() -> GtkPositionType { switch self { case .left: - return GTK_POS_LEFT -case .right: - return GTK_POS_RIGHT -case .top: - return GTK_POS_TOP -case .bottom: - return GTK_POS_BOTTOM + return GTK_POS_LEFT + case .right: + return GTK_POS_RIGHT + case .top: + return GTK_POS_TOP + case .bottom: + return GTK_POS_BOTTOM } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PrintDuplex.swift b/Sources/Gtk/Generated/PrintDuplex.swift index 8d59014fc4..fdf4854f27 100644 --- a/Sources/Gtk/Generated/PrintDuplex.swift +++ b/Sources/Gtk/Generated/PrintDuplex.swift @@ -5,24 +5,24 @@ public enum PrintDuplex: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintDuplex /// No duplex. -case simplex -/// Horizontal duplex. -case horizontal -/// Vertical duplex. -case vertical + case simplex + /// Horizontal duplex. + case horizontal + /// Vertical duplex. + case vertical public static var type: GType { - gtk_print_duplex_get_type() -} + gtk_print_duplex_get_type() + } public init(from gtkEnum: GtkPrintDuplex) { switch gtkEnum { case GTK_PRINT_DUPLEX_SIMPLEX: - self = .simplex -case GTK_PRINT_DUPLEX_HORIZONTAL: - self = .horizontal -case GTK_PRINT_DUPLEX_VERTICAL: - self = .vertical + self = .simplex + case GTK_PRINT_DUPLEX_HORIZONTAL: + self = .horizontal + case GTK_PRINT_DUPLEX_VERTICAL: + self = .vertical default: fatalError("Unsupported GtkPrintDuplex enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ case GTK_PRINT_DUPLEX_VERTICAL: public func toGtk() -> GtkPrintDuplex { switch self { case .simplex: - return GTK_PRINT_DUPLEX_SIMPLEX -case .horizontal: - return GTK_PRINT_DUPLEX_HORIZONTAL -case .vertical: - return GTK_PRINT_DUPLEX_VERTICAL + return GTK_PRINT_DUPLEX_SIMPLEX + case .horizontal: + return GTK_PRINT_DUPLEX_HORIZONTAL + case .vertical: + return GTK_PRINT_DUPLEX_VERTICAL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PrintError.swift b/Sources/Gtk/Generated/PrintError.swift index b61a09f4ab..c4397c6f19 100644 --- a/Sources/Gtk/Generated/PrintError.swift +++ b/Sources/Gtk/Generated/PrintError.swift @@ -6,29 +6,29 @@ public enum PrintError: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintError /// An unspecified error occurred. -case general -/// An internal error occurred. -case internalError -/// A memory allocation failed. -case nomem -/// An error occurred while loading a page setup -/// or paper size from a key file. -case invalidFile + case general + /// An internal error occurred. + case internalError + /// A memory allocation failed. + case nomem + /// An error occurred while loading a page setup + /// or paper size from a key file. + case invalidFile public static var type: GType { - gtk_print_error_get_type() -} + gtk_print_error_get_type() + } public init(from gtkEnum: GtkPrintError) { switch gtkEnum { case GTK_PRINT_ERROR_GENERAL: - self = .general -case GTK_PRINT_ERROR_INTERNAL_ERROR: - self = .internalError -case GTK_PRINT_ERROR_NOMEM: - self = .nomem -case GTK_PRINT_ERROR_INVALID_FILE: - self = .invalidFile + self = .general + case GTK_PRINT_ERROR_INTERNAL_ERROR: + self = .internalError + case GTK_PRINT_ERROR_NOMEM: + self = .nomem + case GTK_PRINT_ERROR_INVALID_FILE: + self = .invalidFile default: fatalError("Unsupported GtkPrintError enum value: \(gtkEnum.rawValue)") } @@ -37,13 +37,13 @@ case GTK_PRINT_ERROR_INVALID_FILE: public func toGtk() -> GtkPrintError { switch self { case .general: - return GTK_PRINT_ERROR_GENERAL -case .internalError: - return GTK_PRINT_ERROR_INTERNAL_ERROR -case .nomem: - return GTK_PRINT_ERROR_NOMEM -case .invalidFile: - return GTK_PRINT_ERROR_INVALID_FILE + return GTK_PRINT_ERROR_GENERAL + case .internalError: + return GTK_PRINT_ERROR_INTERNAL_ERROR + case .nomem: + return GTK_PRINT_ERROR_NOMEM + case .invalidFile: + return GTK_PRINT_ERROR_INVALID_FILE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PrintOperationAction.swift b/Sources/Gtk/Generated/PrintOperationAction.swift index 3c4579d6cd..dc3be60a12 100644 --- a/Sources/Gtk/Generated/PrintOperationAction.swift +++ b/Sources/Gtk/Generated/PrintOperationAction.swift @@ -1,37 +1,37 @@ import CGtk /// Determines what action the print operation should perform. -/// +/// /// A parameter of this typs is passed to [method@Gtk.PrintOperation.run]. public enum PrintOperationAction: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintOperationAction /// Show the print dialog. -case printDialog -/// Start to print without showing -/// the print dialog, based on the current print settings, if possible. -/// Depending on the platform, a print dialog might appear anyway. -case print -/// Show the print preview. -case preview -/// Export to a file. This requires -/// the export-filename property to be set. -case export + case printDialog + /// Start to print without showing + /// the print dialog, based on the current print settings, if possible. + /// Depending on the platform, a print dialog might appear anyway. + case print + /// Show the print preview. + case preview + /// Export to a file. This requires + /// the export-filename property to be set. + case export public static var type: GType { - gtk_print_operation_action_get_type() -} + gtk_print_operation_action_get_type() + } public init(from gtkEnum: GtkPrintOperationAction) { switch gtkEnum { case GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG: - self = .printDialog -case GTK_PRINT_OPERATION_ACTION_PRINT: - self = .print -case GTK_PRINT_OPERATION_ACTION_PREVIEW: - self = .preview -case GTK_PRINT_OPERATION_ACTION_EXPORT: - self = .export + self = .printDialog + case GTK_PRINT_OPERATION_ACTION_PRINT: + self = .print + case GTK_PRINT_OPERATION_ACTION_PREVIEW: + self = .preview + case GTK_PRINT_OPERATION_ACTION_EXPORT: + self = .export default: fatalError("Unsupported GtkPrintOperationAction enum value: \(gtkEnum.rawValue)") } @@ -40,13 +40,13 @@ case GTK_PRINT_OPERATION_ACTION_EXPORT: public func toGtk() -> GtkPrintOperationAction { switch self { case .printDialog: - return GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG -case .print: - return GTK_PRINT_OPERATION_ACTION_PRINT -case .preview: - return GTK_PRINT_OPERATION_ACTION_PREVIEW -case .export: - return GTK_PRINT_OPERATION_ACTION_EXPORT + return GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG + case .print: + return GTK_PRINT_OPERATION_ACTION_PRINT + case .preview: + return GTK_PRINT_OPERATION_ACTION_PREVIEW + case .export: + return GTK_PRINT_OPERATION_ACTION_EXPORT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PrintOperationResult.swift b/Sources/Gtk/Generated/PrintOperationResult.swift index 46bf28eb4d..07a29bb38e 100644 --- a/Sources/Gtk/Generated/PrintOperationResult.swift +++ b/Sources/Gtk/Generated/PrintOperationResult.swift @@ -1,36 +1,36 @@ import CGtk /// The result of a print operation. -/// +/// /// A value of this type is returned by [method@Gtk.PrintOperation.run]. public enum PrintOperationResult: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintOperationResult /// An error has occurred. -case error -/// The print settings should be stored. -case apply -/// The print operation has been canceled, -/// the print settings should not be stored. -case cancel -/// The print operation is not complete -/// yet. This value will only be returned when running asynchronously. -case inProgress + case error + /// The print settings should be stored. + case apply + /// The print operation has been canceled, + /// the print settings should not be stored. + case cancel + /// The print operation is not complete + /// yet. This value will only be returned when running asynchronously. + case inProgress public static var type: GType { - gtk_print_operation_result_get_type() -} + gtk_print_operation_result_get_type() + } public init(from gtkEnum: GtkPrintOperationResult) { switch gtkEnum { case GTK_PRINT_OPERATION_RESULT_ERROR: - self = .error -case GTK_PRINT_OPERATION_RESULT_APPLY: - self = .apply -case GTK_PRINT_OPERATION_RESULT_CANCEL: - self = .cancel -case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS: - self = .inProgress + self = .error + case GTK_PRINT_OPERATION_RESULT_APPLY: + self = .apply + case GTK_PRINT_OPERATION_RESULT_CANCEL: + self = .cancel + case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS: + self = .inProgress default: fatalError("Unsupported GtkPrintOperationResult enum value: \(gtkEnum.rawValue)") } @@ -39,13 +39,13 @@ case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS: public func toGtk() -> GtkPrintOperationResult { switch self { case .error: - return GTK_PRINT_OPERATION_RESULT_ERROR -case .apply: - return GTK_PRINT_OPERATION_RESULT_APPLY -case .cancel: - return GTK_PRINT_OPERATION_RESULT_CANCEL -case .inProgress: - return GTK_PRINT_OPERATION_RESULT_IN_PROGRESS + return GTK_PRINT_OPERATION_RESULT_ERROR + case .apply: + return GTK_PRINT_OPERATION_RESULT_APPLY + case .cancel: + return GTK_PRINT_OPERATION_RESULT_CANCEL + case .inProgress: + return GTK_PRINT_OPERATION_RESULT_IN_PROGRESS } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PrintPages.swift b/Sources/Gtk/Generated/PrintPages.swift index 0daf9facdb..6806476cf3 100644 --- a/Sources/Gtk/Generated/PrintPages.swift +++ b/Sources/Gtk/Generated/PrintPages.swift @@ -5,28 +5,28 @@ public enum PrintPages: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintPages /// All pages. -case all -/// Current page. -case current -/// Range of pages. -case ranges -/// Selected pages. -case selection + case all + /// Current page. + case current + /// Range of pages. + case ranges + /// Selected pages. + case selection public static var type: GType { - gtk_print_pages_get_type() -} + gtk_print_pages_get_type() + } public init(from gtkEnum: GtkPrintPages) { switch gtkEnum { case GTK_PRINT_PAGES_ALL: - self = .all -case GTK_PRINT_PAGES_CURRENT: - self = .current -case GTK_PRINT_PAGES_RANGES: - self = .ranges -case GTK_PRINT_PAGES_SELECTION: - self = .selection + self = .all + case GTK_PRINT_PAGES_CURRENT: + self = .current + case GTK_PRINT_PAGES_RANGES: + self = .ranges + case GTK_PRINT_PAGES_SELECTION: + self = .selection default: fatalError("Unsupported GtkPrintPages enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_PRINT_PAGES_SELECTION: public func toGtk() -> GtkPrintPages { switch self { case .all: - return GTK_PRINT_PAGES_ALL -case .current: - return GTK_PRINT_PAGES_CURRENT -case .ranges: - return GTK_PRINT_PAGES_RANGES -case .selection: - return GTK_PRINT_PAGES_SELECTION + return GTK_PRINT_PAGES_ALL + case .current: + return GTK_PRINT_PAGES_CURRENT + case .ranges: + return GTK_PRINT_PAGES_RANGES + case .selection: + return GTK_PRINT_PAGES_SELECTION } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PrintQuality.swift b/Sources/Gtk/Generated/PrintQuality.swift index 66848c3d9c..08c785ae17 100644 --- a/Sources/Gtk/Generated/PrintQuality.swift +++ b/Sources/Gtk/Generated/PrintQuality.swift @@ -5,28 +5,28 @@ public enum PrintQuality: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintQuality /// Low quality. -case low -/// Normal quality. -case normal -/// High quality. -case high -/// Draft quality. -case draft + case low + /// Normal quality. + case normal + /// High quality. + case high + /// Draft quality. + case draft public static var type: GType { - gtk_print_quality_get_type() -} + gtk_print_quality_get_type() + } public init(from gtkEnum: GtkPrintQuality) { switch gtkEnum { case GTK_PRINT_QUALITY_LOW: - self = .low -case GTK_PRINT_QUALITY_NORMAL: - self = .normal -case GTK_PRINT_QUALITY_HIGH: - self = .high -case GTK_PRINT_QUALITY_DRAFT: - self = .draft + self = .low + case GTK_PRINT_QUALITY_NORMAL: + self = .normal + case GTK_PRINT_QUALITY_HIGH: + self = .high + case GTK_PRINT_QUALITY_DRAFT: + self = .draft default: fatalError("Unsupported GtkPrintQuality enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_PRINT_QUALITY_DRAFT: public func toGtk() -> GtkPrintQuality { switch self { case .low: - return GTK_PRINT_QUALITY_LOW -case .normal: - return GTK_PRINT_QUALITY_NORMAL -case .high: - return GTK_PRINT_QUALITY_HIGH -case .draft: - return GTK_PRINT_QUALITY_DRAFT + return GTK_PRINT_QUALITY_LOW + case .normal: + return GTK_PRINT_QUALITY_NORMAL + case .high: + return GTK_PRINT_QUALITY_HIGH + case .draft: + return GTK_PRINT_QUALITY_DRAFT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PrintStatus.swift b/Sources/Gtk/Generated/PrintStatus.swift index 9409b327c4..5078e9369f 100644 --- a/Sources/Gtk/Generated/PrintStatus.swift +++ b/Sources/Gtk/Generated/PrintStatus.swift @@ -6,54 +6,54 @@ public enum PrintStatus: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintStatus /// The printing has not started yet; this -/// status is set initially, and while the print dialog is shown. -case initial -/// This status is set while the begin-print -/// signal is emitted and during pagination. -case preparing -/// This status is set while the -/// pages are being rendered. -case generatingData -/// The print job is being sent off to the -/// printer. -case sendingData -/// The print job has been sent to the printer, -/// but is not printed for some reason, e.g. the printer may be stopped. -case pending -/// Some problem has occurred during -/// printing, e.g. a paper jam. -case pendingIssue -/// The printer is processing the print job. -case printing -/// The printing has been completed successfully. -case finished -/// The printing has been aborted. -case finishedAborted + /// status is set initially, and while the print dialog is shown. + case initial + /// This status is set while the begin-print + /// signal is emitted and during pagination. + case preparing + /// This status is set while the + /// pages are being rendered. + case generatingData + /// The print job is being sent off to the + /// printer. + case sendingData + /// The print job has been sent to the printer, + /// but is not printed for some reason, e.g. the printer may be stopped. + case pending + /// Some problem has occurred during + /// printing, e.g. a paper jam. + case pendingIssue + /// The printer is processing the print job. + case printing + /// The printing has been completed successfully. + case finished + /// The printing has been aborted. + case finishedAborted public static var type: GType { - gtk_print_status_get_type() -} + gtk_print_status_get_type() + } public init(from gtkEnum: GtkPrintStatus) { switch gtkEnum { case GTK_PRINT_STATUS_INITIAL: - self = .initial -case GTK_PRINT_STATUS_PREPARING: - self = .preparing -case GTK_PRINT_STATUS_GENERATING_DATA: - self = .generatingData -case GTK_PRINT_STATUS_SENDING_DATA: - self = .sendingData -case GTK_PRINT_STATUS_PENDING: - self = .pending -case GTK_PRINT_STATUS_PENDING_ISSUE: - self = .pendingIssue -case GTK_PRINT_STATUS_PRINTING: - self = .printing -case GTK_PRINT_STATUS_FINISHED: - self = .finished -case GTK_PRINT_STATUS_FINISHED_ABORTED: - self = .finishedAborted + self = .initial + case GTK_PRINT_STATUS_PREPARING: + self = .preparing + case GTK_PRINT_STATUS_GENERATING_DATA: + self = .generatingData + case GTK_PRINT_STATUS_SENDING_DATA: + self = .sendingData + case GTK_PRINT_STATUS_PENDING: + self = .pending + case GTK_PRINT_STATUS_PENDING_ISSUE: + self = .pendingIssue + case GTK_PRINT_STATUS_PRINTING: + self = .printing + case GTK_PRINT_STATUS_FINISHED: + self = .finished + case GTK_PRINT_STATUS_FINISHED_ABORTED: + self = .finishedAborted default: fatalError("Unsupported GtkPrintStatus enum value: \(gtkEnum.rawValue)") } @@ -62,23 +62,23 @@ case GTK_PRINT_STATUS_FINISHED_ABORTED: public func toGtk() -> GtkPrintStatus { switch self { case .initial: - return GTK_PRINT_STATUS_INITIAL -case .preparing: - return GTK_PRINT_STATUS_PREPARING -case .generatingData: - return GTK_PRINT_STATUS_GENERATING_DATA -case .sendingData: - return GTK_PRINT_STATUS_SENDING_DATA -case .pending: - return GTK_PRINT_STATUS_PENDING -case .pendingIssue: - return GTK_PRINT_STATUS_PENDING_ISSUE -case .printing: - return GTK_PRINT_STATUS_PRINTING -case .finished: - return GTK_PRINT_STATUS_FINISHED -case .finishedAborted: - return GTK_PRINT_STATUS_FINISHED_ABORTED + return GTK_PRINT_STATUS_INITIAL + case .preparing: + return GTK_PRINT_STATUS_PREPARING + case .generatingData: + return GTK_PRINT_STATUS_GENERATING_DATA + case .sendingData: + return GTK_PRINT_STATUS_SENDING_DATA + case .pending: + return GTK_PRINT_STATUS_PENDING + case .pendingIssue: + return GTK_PRINT_STATUS_PENDING_ISSUE + case .printing: + return GTK_PRINT_STATUS_PRINTING + case .finished: + return GTK_PRINT_STATUS_FINISHED + case .finishedAborted: + return GTK_PRINT_STATUS_FINISHED_ABORTED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ProgressBar.swift b/Sources/Gtk/Generated/ProgressBar.swift index 23d464f7d1..65796c4396 100644 --- a/Sources/Gtk/Generated/ProgressBar.swift +++ b/Sources/Gtk/Generated/ProgressBar.swift @@ -1,39 +1,39 @@ import CGtk /// Displays the progress of a long-running operation. -/// +/// /// `GtkProgressBar` provides a visual clue that processing is underway. /// It can be used in two different modes: percentage mode and activity mode. -/// +/// /// An example GtkProgressBar -/// +/// /// When an application can determine how much work needs to take place /// (e.g. read a fixed number of bytes from a file) and can monitor its /// progress, it can use the `GtkProgressBar` in percentage mode and the /// user sees a growing bar indicating the percentage of the work that /// has been completed. In this mode, the application is required to call /// [method@Gtk.ProgressBar.set_fraction] periodically to update the progress bar. -/// +/// /// When an application has no accurate way of knowing the amount of work /// to do, it can use the `GtkProgressBar` in activity mode, which shows /// activity by a block moving back and forth within the progress area. In /// this mode, the application is required to call [method@Gtk.ProgressBar.pulse] /// periodically to update the progress bar. -/// +/// /// There is quite a bit of flexibility provided to control the appearance /// of the `GtkProgressBar`. Functions are provided to control the orientation /// of the bar, optional text can be displayed along with the bar, and the /// step size used in activity mode can be set. -/// +/// /// # CSS nodes -/// +/// /// ``` /// progressbar[.osd] /// ├── [text] /// ╰── trough[.empty][.full] /// ╰── progress[.pulse] /// ``` -/// +/// /// `GtkProgressBar` has a main CSS node with name progressbar and subnodes with /// names text and trough, of which the latter has a subnode named progress. The /// text subnode is only present if text is shown. The progress subnode has the @@ -41,137 +41,144 @@ import CGtk /// .right, .top or .bottom added when the progress 'touches' the corresponding /// end of the GtkProgressBar. The .osd class on the progressbar node is for use /// in overlays like the one Epiphany has for page loading progress. -/// +/// /// # Accessibility -/// +/// /// `GtkProgressBar` uses the [enum@Gtk.AccessibleRole.progress_bar] role. open class ProgressBar: Widget, Orientable { /// Creates a new `GtkProgressBar`. -public convenience init() { - self.init( - gtk_progress_bar_new() - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::ellipsize", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEllipsize?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::fraction", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFraction?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::inverted", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInverted?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::pulse-step", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPulseStep?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_progress_bar_new() + ) } -addSignal(name: "notify::show-text", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowText?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::ellipsize", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEllipsize?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::fraction", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFraction?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::inverted", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInverted?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::pulse-step", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPulseStep?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::show-text", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowText?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::text", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyText?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::orientation", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyOrientation?(self, param0) + } } -addSignal(name: "notify::text", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyText?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::orientation", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyOrientation?(self, param0) -} -} - /// The fraction of total work that has been completed. -@GObjectProperty(named: "fraction") public var fraction: Double - -/// Invert the direction in which the progress bar grows. -@GObjectProperty(named: "inverted") public var inverted: Bool - -/// The fraction of total progress to move the bounding block when pulsed. -@GObjectProperty(named: "pulse-step") public var pulseStep: Double - -/// Sets whether the progress bar will show a text in addition -/// to the bar itself. -/// -/// The shown text is either the value of the [property@Gtk.ProgressBar:text] -/// property or, if that is %NULL, the [property@Gtk.ProgressBar:fraction] -/// value, as a percentage. -/// -/// To make a progress bar that is styled and sized suitably for showing text -/// (even if the actual text is blank), set [property@Gtk.ProgressBar:show-text] -/// to %TRUE and [property@Gtk.ProgressBar:text] to the empty string (not %NULL). -@GObjectProperty(named: "show-text") public var showText: Bool - -/// Text to be displayed in the progress bar. -@GObjectProperty(named: "text") public var text: String? + @GObjectProperty(named: "fraction") public var fraction: Double -/// The orientation of the orientable. -@GObjectProperty(named: "orientation") public var orientation: Orientation + /// Invert the direction in which the progress bar grows. + @GObjectProperty(named: "inverted") public var inverted: Bool + /// The fraction of total progress to move the bounding block when pulsed. + @GObjectProperty(named: "pulse-step") public var pulseStep: Double -public var notifyEllipsize: ((ProgressBar, OpaquePointer) -> Void)? + /// Sets whether the progress bar will show a text in addition + /// to the bar itself. + /// + /// The shown text is either the value of the [property@Gtk.ProgressBar:text] + /// property or, if that is %NULL, the [property@Gtk.ProgressBar:fraction] + /// value, as a percentage. + /// + /// To make a progress bar that is styled and sized suitably for showing text + /// (even if the actual text is blank), set [property@Gtk.ProgressBar:show-text] + /// to %TRUE and [property@Gtk.ProgressBar:text] to the empty string (not %NULL). + @GObjectProperty(named: "show-text") public var showText: Bool + /// Text to be displayed in the progress bar. + @GObjectProperty(named: "text") public var text: String? -public var notifyFraction: ((ProgressBar, OpaquePointer) -> Void)? + /// The orientation of the orientable. + @GObjectProperty(named: "orientation") public var orientation: Orientation + public var notifyEllipsize: ((ProgressBar, OpaquePointer) -> Void)? -public var notifyInverted: ((ProgressBar, OpaquePointer) -> Void)? + public var notifyFraction: ((ProgressBar, OpaquePointer) -> Void)? + public var notifyInverted: ((ProgressBar, OpaquePointer) -> Void)? -public var notifyPulseStep: ((ProgressBar, OpaquePointer) -> Void)? + public var notifyPulseStep: ((ProgressBar, OpaquePointer) -> Void)? + public var notifyShowText: ((ProgressBar, OpaquePointer) -> Void)? -public var notifyShowText: ((ProgressBar, OpaquePointer) -> Void)? + public var notifyText: ((ProgressBar, OpaquePointer) -> Void)? - -public var notifyText: ((ProgressBar, OpaquePointer) -> Void)? - - -public var notifyOrientation: ((ProgressBar, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyOrientation: ((ProgressBar, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/PropagationLimit.swift b/Sources/Gtk/Generated/PropagationLimit.swift index 9b818c7b7f..47544d5c1e 100644 --- a/Sources/Gtk/Generated/PropagationLimit.swift +++ b/Sources/Gtk/Generated/PropagationLimit.swift @@ -6,24 +6,24 @@ public enum PropagationLimit: GValueRepresentableEnum { public typealias GtkEnum = GtkPropagationLimit /// Events are handled regardless of what their -/// target is. -case none -/// Events are only handled if their target is in -/// the same [iface@Native] (or widget with [property@Gtk.Widget:limit-events] -/// set) as the event controllers widget. -/// Note that some event types have two targets (origin and destination). -case sameNative + /// target is. + case none + /// Events are only handled if their target is in + /// the same [iface@Native] (or widget with [property@Gtk.Widget:limit-events] + /// set) as the event controllers widget. + /// Note that some event types have two targets (origin and destination). + case sameNative public static var type: GType { - gtk_propagation_limit_get_type() -} + gtk_propagation_limit_get_type() + } public init(from gtkEnum: GtkPropagationLimit) { switch gtkEnum { case GTK_LIMIT_NONE: - self = .none -case GTK_LIMIT_SAME_NATIVE: - self = .sameNative + self = .none + case GTK_LIMIT_SAME_NATIVE: + self = .sameNative default: fatalError("Unsupported GtkPropagationLimit enum value: \(gtkEnum.rawValue)") } @@ -32,9 +32,9 @@ case GTK_LIMIT_SAME_NATIVE: public func toGtk() -> GtkPropagationLimit { switch self { case .none: - return GTK_LIMIT_NONE -case .sameNative: - return GTK_LIMIT_SAME_NATIVE + return GTK_LIMIT_NONE + case .sameNative: + return GTK_LIMIT_SAME_NATIVE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PropagationPhase.swift b/Sources/Gtk/Generated/PropagationPhase.swift index c863676051..fad15a5c44 100644 --- a/Sources/Gtk/Generated/PropagationPhase.swift +++ b/Sources/Gtk/Generated/PropagationPhase.swift @@ -5,35 +5,35 @@ public enum PropagationPhase: GValueRepresentableEnum { public typealias GtkEnum = GtkPropagationPhase /// Events are not delivered. -case none -/// Events are delivered in the capture phase. The -/// capture phase happens before the bubble phase, runs from the toplevel down -/// to the event widget. This option should only be used on containers that -/// might possibly handle events before their children do. -case capture -/// Events are delivered in the bubble phase. The bubble -/// phase happens after the capture phase, and before the default handlers -/// are run. This phase runs from the event widget, up to the toplevel. -case bubble -/// Events are delivered in the default widget event handlers, -/// note that widget implementations must chain up on button, motion, touch and -/// grab broken handlers for controllers in this phase to be run. -case target + case none + /// Events are delivered in the capture phase. The + /// capture phase happens before the bubble phase, runs from the toplevel down + /// to the event widget. This option should only be used on containers that + /// might possibly handle events before their children do. + case capture + /// Events are delivered in the bubble phase. The bubble + /// phase happens after the capture phase, and before the default handlers + /// are run. This phase runs from the event widget, up to the toplevel. + case bubble + /// Events are delivered in the default widget event handlers, + /// note that widget implementations must chain up on button, motion, touch and + /// grab broken handlers for controllers in this phase to be run. + case target public static var type: GType { - gtk_propagation_phase_get_type() -} + gtk_propagation_phase_get_type() + } public init(from gtkEnum: GtkPropagationPhase) { switch gtkEnum { case GTK_PHASE_NONE: - self = .none -case GTK_PHASE_CAPTURE: - self = .capture -case GTK_PHASE_BUBBLE: - self = .bubble -case GTK_PHASE_TARGET: - self = .target + self = .none + case GTK_PHASE_CAPTURE: + self = .capture + case GTK_PHASE_BUBBLE: + self = .bubble + case GTK_PHASE_TARGET: + self = .target default: fatalError("Unsupported GtkPropagationPhase enum value: \(gtkEnum.rawValue)") } @@ -42,13 +42,13 @@ case GTK_PHASE_TARGET: public func toGtk() -> GtkPropagationPhase { switch self { case .none: - return GTK_PHASE_NONE -case .capture: - return GTK_PHASE_CAPTURE -case .bubble: - return GTK_PHASE_BUBBLE -case .target: - return GTK_PHASE_TARGET + return GTK_PHASE_NONE + case .capture: + return GTK_PHASE_CAPTURE + case .bubble: + return GTK_PHASE_BUBBLE + case .target: + return GTK_PHASE_TARGET } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Range.swift b/Sources/Gtk/Generated/Range.swift index de54f2c7d4..8bb7e472c1 100644 --- a/Sources/Gtk/Generated/Range.swift +++ b/Sources/Gtk/Generated/Range.swift @@ -1,198 +1,211 @@ import CGtk /// Base class for widgets which visualize an adjustment. -/// +/// /// Widgets that are derived from `GtkRange` include /// [class@Gtk.Scale] and [class@Gtk.Scrollbar]. -/// +/// /// Apart from signals for monitoring the parameters of the adjustment, /// `GtkRange` provides properties and methods for setting a /// “fill level” on range widgets. See [method@Gtk.Range.set_fill_level]. -/// +/// /// # Shortcuts and Gestures -/// +/// /// The `GtkRange` slider is draggable. Holding the Shift key while /// dragging, or initiating the drag with a long-press will enable the /// fine-tuning mode. open class Range: Widget, Orientable { - - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: @convention(c) (UnsafeMutableRawPointer, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "adjust-bounds", handler: gCallback(handler0)) { [weak self] (param0: Double) in - guard let self = self else { return } - self.adjustBounds?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, GtkScrollType, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - -addSignal(name: "change-value", handler: gCallback(handler1)) { [weak self] (param0: GtkScrollType, param1: Double) in - guard let self = self else { return } - self.changeValue?(self, param0, param1) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, GtkScrollType, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "move-slider", handler: gCallback(handler2)) { [weak self] (param0: GtkScrollType) in - guard let self = self else { return } - self.moveSlider?(self, param0) -} - -addSignal(name: "value-changed") { [weak self] () in - guard let self = self else { return } - self.valueChanged?(self) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::adjustment", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAdjustment?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::fill-level", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFillLevel?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::inverted", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInverted?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "adjust-bounds", handler: gCallback(handler0)) { + [weak self] (param0: Double) in + guard let self = self else { return } + self.adjustBounds?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, GtkScrollType, Double, UnsafeMutableRawPointer) + -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "change-value", handler: gCallback(handler1)) { + [weak self] (param0: GtkScrollType, param1: Double) in + guard let self = self else { return } + self.changeValue?(self, param0, param1) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, GtkScrollType, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "move-slider", handler: gCallback(handler2)) { + [weak self] (param0: GtkScrollType) in + guard let self = self else { return } + self.moveSlider?(self, param0) + } + + addSignal(name: "value-changed") { [weak self] () in + guard let self = self else { return } + self.valueChanged?(self) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::adjustment", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAdjustment?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::fill-level", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFillLevel?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::inverted", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInverted?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::restrict-to-fill-level", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyRestrictToFillLevel?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::round-digits", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyRoundDigits?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::show-fill-level", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowFillLevel?(self, param0) + } + + let handler10: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::orientation", handler: gCallback(handler10)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyOrientation?(self, param0) + } } -addSignal(name: "notify::restrict-to-fill-level", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyRestrictToFillLevel?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::round-digits", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyRoundDigits?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::show-fill-level", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowFillLevel?(self, param0) -} - -let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::orientation", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyOrientation?(self, param0) -} -} - /// The fill level (e.g. prebuffering of a network stream). -@GObjectProperty(named: "fill-level") public var fillLevel: Double - -/// If %TRUE, the direction in which the slider moves is inverted. -@GObjectProperty(named: "inverted") public var inverted: Bool - -/// Controls whether slider movement is restricted to an -/// upper boundary set by the fill level. -@GObjectProperty(named: "restrict-to-fill-level") public var restrictToFillLevel: Bool + @GObjectProperty(named: "fill-level") public var fillLevel: Double -/// The number of digits to round the value to when -/// it changes. -/// -/// See [signal@Gtk.Range::change-value]. -@GObjectProperty(named: "round-digits") public var roundDigits: Int + /// If %TRUE, the direction in which the slider moves is inverted. + @GObjectProperty(named: "inverted") public var inverted: Bool -/// Controls whether fill level indicator graphics are displayed -/// on the trough. -@GObjectProperty(named: "show-fill-level") public var showFillLevel: Bool + /// Controls whether slider movement is restricted to an + /// upper boundary set by the fill level. + @GObjectProperty(named: "restrict-to-fill-level") public var restrictToFillLevel: Bool -/// The orientation of the orientable. -@GObjectProperty(named: "orientation") public var orientation: Orientation + /// The number of digits to round the value to when + /// it changes. + /// + /// See [signal@Gtk.Range::change-value]. + @GObjectProperty(named: "round-digits") public var roundDigits: Int -/// Emitted before clamping a value, to give the application a -/// chance to adjust the bounds. -public var adjustBounds: ((Range, Double) -> Void)? + /// Controls whether fill level indicator graphics are displayed + /// on the trough. + @GObjectProperty(named: "show-fill-level") public var showFillLevel: Bool -/// Emitted when a scroll action is performed on a range. -/// -/// It allows an application to determine the type of scroll event -/// that occurred and the resultant new value. The application can -/// handle the event itself and return %TRUE to prevent further -/// processing. Or, by returning %FALSE, it can pass the event to -/// other handlers until the default GTK handler is reached. -/// -/// The value parameter is unrounded. An application that overrides -/// the ::change-value signal is responsible for clamping the value -/// to the desired number of decimal digits; the default GTK -/// handler clamps the value based on [property@Gtk.Range:round-digits]. -public var changeValue: ((Range, GtkScrollType, Double) -> Void)? + /// The orientation of the orientable. + @GObjectProperty(named: "orientation") public var orientation: Orientation -/// Virtual function that moves the slider. -/// -/// Used for keybindings. -public var moveSlider: ((Range, GtkScrollType) -> Void)? + /// Emitted before clamping a value, to give the application a + /// chance to adjust the bounds. + public var adjustBounds: ((Range, Double) -> Void)? -/// Emitted when the range value changes. -public var valueChanged: ((Range) -> Void)? + /// Emitted when a scroll action is performed on a range. + /// + /// It allows an application to determine the type of scroll event + /// that occurred and the resultant new value. The application can + /// handle the event itself and return %TRUE to prevent further + /// processing. Or, by returning %FALSE, it can pass the event to + /// other handlers until the default GTK handler is reached. + /// + /// The value parameter is unrounded. An application that overrides + /// the ::change-value signal is responsible for clamping the value + /// to the desired number of decimal digits; the default GTK + /// handler clamps the value based on [property@Gtk.Range:round-digits]. + public var changeValue: ((Range, GtkScrollType, Double) -> Void)? + /// Virtual function that moves the slider. + /// + /// Used for keybindings. + public var moveSlider: ((Range, GtkScrollType) -> Void)? -public var notifyAdjustment: ((Range, OpaquePointer) -> Void)? + /// Emitted when the range value changes. + public var valueChanged: ((Range) -> Void)? + public var notifyAdjustment: ((Range, OpaquePointer) -> Void)? -public var notifyFillLevel: ((Range, OpaquePointer) -> Void)? + public var notifyFillLevel: ((Range, OpaquePointer) -> Void)? + public var notifyInverted: ((Range, OpaquePointer) -> Void)? -public var notifyInverted: ((Range, OpaquePointer) -> Void)? + public var notifyRestrictToFillLevel: ((Range, OpaquePointer) -> Void)? + public var notifyRoundDigits: ((Range, OpaquePointer) -> Void)? -public var notifyRestrictToFillLevel: ((Range, OpaquePointer) -> Void)? + public var notifyShowFillLevel: ((Range, OpaquePointer) -> Void)? - -public var notifyRoundDigits: ((Range, OpaquePointer) -> Void)? - - -public var notifyShowFillLevel: ((Range, OpaquePointer) -> Void)? - - -public var notifyOrientation: ((Range, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyOrientation: ((Range, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/RecentManagerError.swift b/Sources/Gtk/Generated/RecentManagerError.swift index 2770a426a1..f6dfdfa16f 100644 --- a/Sources/Gtk/Generated/RecentManagerError.swift +++ b/Sources/Gtk/Generated/RecentManagerError.swift @@ -5,45 +5,45 @@ public enum RecentManagerError: GValueRepresentableEnum { public typealias GtkEnum = GtkRecentManagerError /// The URI specified does not exists in -/// the recently used resources list. -case notFound -/// The URI specified is not valid. -case invalidUri -/// The supplied string is not -/// UTF-8 encoded. -case invalidEncoding -/// No application has registered -/// the specified item. -case notRegistered -/// Failure while reading the recently used -/// resources file. -case read -/// Failure while writing the recently used -/// resources file. -case write -/// Unspecified error. -case unknown + /// the recently used resources list. + case notFound + /// The URI specified is not valid. + case invalidUri + /// The supplied string is not + /// UTF-8 encoded. + case invalidEncoding + /// No application has registered + /// the specified item. + case notRegistered + /// Failure while reading the recently used + /// resources file. + case read + /// Failure while writing the recently used + /// resources file. + case write + /// Unspecified error. + case unknown public static var type: GType { - gtk_recent_manager_error_get_type() -} + gtk_recent_manager_error_get_type() + } public init(from gtkEnum: GtkRecentManagerError) { switch gtkEnum { case GTK_RECENT_MANAGER_ERROR_NOT_FOUND: - self = .notFound -case GTK_RECENT_MANAGER_ERROR_INVALID_URI: - self = .invalidUri -case GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING: - self = .invalidEncoding -case GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED: - self = .notRegistered -case GTK_RECENT_MANAGER_ERROR_READ: - self = .read -case GTK_RECENT_MANAGER_ERROR_WRITE: - self = .write -case GTK_RECENT_MANAGER_ERROR_UNKNOWN: - self = .unknown + self = .notFound + case GTK_RECENT_MANAGER_ERROR_INVALID_URI: + self = .invalidUri + case GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING: + self = .invalidEncoding + case GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED: + self = .notRegistered + case GTK_RECENT_MANAGER_ERROR_READ: + self = .read + case GTK_RECENT_MANAGER_ERROR_WRITE: + self = .write + case GTK_RECENT_MANAGER_ERROR_UNKNOWN: + self = .unknown default: fatalError("Unsupported GtkRecentManagerError enum value: \(gtkEnum.rawValue)") } @@ -52,19 +52,19 @@ case GTK_RECENT_MANAGER_ERROR_UNKNOWN: public func toGtk() -> GtkRecentManagerError { switch self { case .notFound: - return GTK_RECENT_MANAGER_ERROR_NOT_FOUND -case .invalidUri: - return GTK_RECENT_MANAGER_ERROR_INVALID_URI -case .invalidEncoding: - return GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING -case .notRegistered: - return GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED -case .read: - return GTK_RECENT_MANAGER_ERROR_READ -case .write: - return GTK_RECENT_MANAGER_ERROR_WRITE -case .unknown: - return GTK_RECENT_MANAGER_ERROR_UNKNOWN + return GTK_RECENT_MANAGER_ERROR_NOT_FOUND + case .invalidUri: + return GTK_RECENT_MANAGER_ERROR_INVALID_URI + case .invalidEncoding: + return GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING + case .notRegistered: + return GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED + case .read: + return GTK_RECENT_MANAGER_ERROR_READ + case .write: + return GTK_RECENT_MANAGER_ERROR_WRITE + case .unknown: + return GTK_RECENT_MANAGER_ERROR_UNKNOWN } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ResponseType.swift b/Sources/Gtk/Generated/ResponseType.swift index 3c68948d07..3fd9f7cffc 100644 --- a/Sources/Gtk/Generated/ResponseType.swift +++ b/Sources/Gtk/Generated/ResponseType.swift @@ -1,64 +1,64 @@ import CGtk /// Predefined values for use as response ids in gtk_dialog_add_button(). -/// +/// /// All predefined values are negative; GTK leaves values of 0 or greater for /// application-defined response ids. public enum ResponseType: GValueRepresentableEnum { public typealias GtkEnum = GtkResponseType /// Returned if an action widget has no response id, -/// or if the dialog gets programmatically hidden or destroyed -case none -/// Generic response id, not used by GTK dialogs -case reject -/// Generic response id, not used by GTK dialogs -case accept -/// Returned if the dialog is deleted -case deleteEvent -/// Returned by OK buttons in GTK dialogs -case ok -/// Returned by Cancel buttons in GTK dialogs -case cancel -/// Returned by Close buttons in GTK dialogs -case close -/// Returned by Yes buttons in GTK dialogs -case yes -/// Returned by No buttons in GTK dialogs -case no -/// Returned by Apply buttons in GTK dialogs -case apply -/// Returned by Help buttons in GTK dialogs -case help + /// or if the dialog gets programmatically hidden or destroyed + case none + /// Generic response id, not used by GTK dialogs + case reject + /// Generic response id, not used by GTK dialogs + case accept + /// Returned if the dialog is deleted + case deleteEvent + /// Returned by OK buttons in GTK dialogs + case ok + /// Returned by Cancel buttons in GTK dialogs + case cancel + /// Returned by Close buttons in GTK dialogs + case close + /// Returned by Yes buttons in GTK dialogs + case yes + /// Returned by No buttons in GTK dialogs + case no + /// Returned by Apply buttons in GTK dialogs + case apply + /// Returned by Help buttons in GTK dialogs + case help public static var type: GType { - gtk_response_type_get_type() -} + gtk_response_type_get_type() + } public init(from gtkEnum: GtkResponseType) { switch gtkEnum { case GTK_RESPONSE_NONE: - self = .none -case GTK_RESPONSE_REJECT: - self = .reject -case GTK_RESPONSE_ACCEPT: - self = .accept -case GTK_RESPONSE_DELETE_EVENT: - self = .deleteEvent -case GTK_RESPONSE_OK: - self = .ok -case GTK_RESPONSE_CANCEL: - self = .cancel -case GTK_RESPONSE_CLOSE: - self = .close -case GTK_RESPONSE_YES: - self = .yes -case GTK_RESPONSE_NO: - self = .no -case GTK_RESPONSE_APPLY: - self = .apply -case GTK_RESPONSE_HELP: - self = .help + self = .none + case GTK_RESPONSE_REJECT: + self = .reject + case GTK_RESPONSE_ACCEPT: + self = .accept + case GTK_RESPONSE_DELETE_EVENT: + self = .deleteEvent + case GTK_RESPONSE_OK: + self = .ok + case GTK_RESPONSE_CANCEL: + self = .cancel + case GTK_RESPONSE_CLOSE: + self = .close + case GTK_RESPONSE_YES: + self = .yes + case GTK_RESPONSE_NO: + self = .no + case GTK_RESPONSE_APPLY: + self = .apply + case GTK_RESPONSE_HELP: + self = .help default: fatalError("Unsupported GtkResponseType enum value: \(gtkEnum.rawValue)") } @@ -67,27 +67,27 @@ case GTK_RESPONSE_HELP: public func toGtk() -> GtkResponseType { switch self { case .none: - return GTK_RESPONSE_NONE -case .reject: - return GTK_RESPONSE_REJECT -case .accept: - return GTK_RESPONSE_ACCEPT -case .deleteEvent: - return GTK_RESPONSE_DELETE_EVENT -case .ok: - return GTK_RESPONSE_OK -case .cancel: - return GTK_RESPONSE_CANCEL -case .close: - return GTK_RESPONSE_CLOSE -case .yes: - return GTK_RESPONSE_YES -case .no: - return GTK_RESPONSE_NO -case .apply: - return GTK_RESPONSE_APPLY -case .help: - return GTK_RESPONSE_HELP + return GTK_RESPONSE_NONE + case .reject: + return GTK_RESPONSE_REJECT + case .accept: + return GTK_RESPONSE_ACCEPT + case .deleteEvent: + return GTK_RESPONSE_DELETE_EVENT + case .ok: + return GTK_RESPONSE_OK + case .cancel: + return GTK_RESPONSE_CANCEL + case .close: + return GTK_RESPONSE_CLOSE + case .yes: + return GTK_RESPONSE_YES + case .no: + return GTK_RESPONSE_NO + case .apply: + return GTK_RESPONSE_APPLY + case .help: + return GTK_RESPONSE_HELP } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/RevealerTransitionType.swift b/Sources/Gtk/Generated/RevealerTransitionType.swift index 3762a6d618..d7908fc3a2 100644 --- a/Sources/Gtk/Generated/RevealerTransitionType.swift +++ b/Sources/Gtk/Generated/RevealerTransitionType.swift @@ -6,52 +6,52 @@ public enum RevealerTransitionType: GValueRepresentableEnum { public typealias GtkEnum = GtkRevealerTransitionType /// No transition -case none -/// Fade in -case crossfade -/// Slide in from the left -case slideRight -/// Slide in from the right -case slideLeft -/// Slide in from the bottom -case slideUp -/// Slide in from the top -case slideDown -/// Floop in from the left -case swingRight -/// Floop in from the right -case swingLeft -/// Floop in from the bottom -case swingUp -/// Floop in from the top -case swingDown + case none + /// Fade in + case crossfade + /// Slide in from the left + case slideRight + /// Slide in from the right + case slideLeft + /// Slide in from the bottom + case slideUp + /// Slide in from the top + case slideDown + /// Floop in from the left + case swingRight + /// Floop in from the right + case swingLeft + /// Floop in from the bottom + case swingUp + /// Floop in from the top + case swingDown public static var type: GType { - gtk_revealer_transition_type_get_type() -} + gtk_revealer_transition_type_get_type() + } public init(from gtkEnum: GtkRevealerTransitionType) { switch gtkEnum { case GTK_REVEALER_TRANSITION_TYPE_NONE: - self = .none -case GTK_REVEALER_TRANSITION_TYPE_CROSSFADE: - self = .crossfade -case GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT: - self = .slideRight -case GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT: - self = .slideLeft -case GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP: - self = .slideUp -case GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN: - self = .slideDown -case GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT: - self = .swingRight -case GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT: - self = .swingLeft -case GTK_REVEALER_TRANSITION_TYPE_SWING_UP: - self = .swingUp -case GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN: - self = .swingDown + self = .none + case GTK_REVEALER_TRANSITION_TYPE_CROSSFADE: + self = .crossfade + case GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT: + self = .slideRight + case GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT: + self = .slideLeft + case GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP: + self = .slideUp + case GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN: + self = .slideDown + case GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT: + self = .swingRight + case GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT: + self = .swingLeft + case GTK_REVEALER_TRANSITION_TYPE_SWING_UP: + self = .swingUp + case GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN: + self = .swingDown default: fatalError("Unsupported GtkRevealerTransitionType enum value: \(gtkEnum.rawValue)") } @@ -60,25 +60,25 @@ case GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN: public func toGtk() -> GtkRevealerTransitionType { switch self { case .none: - return GTK_REVEALER_TRANSITION_TYPE_NONE -case .crossfade: - return GTK_REVEALER_TRANSITION_TYPE_CROSSFADE -case .slideRight: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT -case .slideLeft: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT -case .slideUp: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP -case .slideDown: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN -case .swingRight: - return GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT -case .swingLeft: - return GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT -case .swingUp: - return GTK_REVEALER_TRANSITION_TYPE_SWING_UP -case .swingDown: - return GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN + return GTK_REVEALER_TRANSITION_TYPE_NONE + case .crossfade: + return GTK_REVEALER_TRANSITION_TYPE_CROSSFADE + case .slideRight: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT + case .slideLeft: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT + case .slideUp: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP + case .slideDown: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN + case .swingRight: + return GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT + case .swingLeft: + return GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT + case .swingUp: + return GTK_REVEALER_TRANSITION_TYPE_SWING_UP + case .swingDown: + return GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Root.swift b/Sources/Gtk/Generated/Root.swift index b398cdbd3c..c2dd7d45e0 100644 --- a/Sources/Gtk/Generated/Root.swift +++ b/Sources/Gtk/Generated/Root.swift @@ -1,20 +1,18 @@ import CGtk /// An interface for widgets that can act as the root of a widget hierarchy. -/// +/// /// The root widget takes care of providing the connection to the windowing /// system and manages layout, drawing and event delivery for its widget /// hierarchy. -/// +/// /// The obvious example of a `GtkRoot` is `GtkWindow`. -/// +/// /// To get the display to which a `GtkRoot` belongs, use /// [method@Gtk.Root.get_display]. -/// +/// /// `GtkRoot` also maintains the location of keyboard focus inside its widget /// hierarchy, with [method@Gtk.Root.set_focus] and [method@Gtk.Root.get_focus]. public protocol Root: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Scale.swift b/Sources/Gtk/Generated/Scale.swift index c73941ef80..7d9d13b964 100644 --- a/Sources/Gtk/Generated/Scale.swift +++ b/Sources/Gtk/Generated/Scale.swift @@ -1,40 +1,40 @@ import CGtk /// Allows to select a numeric value with a slider control. -/// +/// /// An example GtkScale -/// +/// /// To use it, you’ll probably want to investigate the methods on its base /// class, [class@Gtk.Range], in addition to the methods for `GtkScale` itself. /// To set the value of a scale, you would normally use [method@Gtk.Range.set_value]. /// To detect changes to the value, you would normally use the /// [signal@Gtk.Range::value-changed] signal. -/// +/// /// Note that using the same upper and lower bounds for the `GtkScale` (through /// the `GtkRange` methods) will hide the slider itself. This is useful for /// applications that want to show an undeterminate value on the scale, without /// changing the layout of the application (such as movie or music players). -/// +/// /// # GtkScale as GtkBuildable -/// +/// /// `GtkScale` supports a custom `` element, which can contain multiple /// `` elements. The “value” and “position” attributes have the same /// meaning as [method@Gtk.Scale.add_mark] parameters of the same name. If /// the element is not empty, its content is taken as the markup to show at /// the mark. It can be translated with the usual ”translatable” and /// “context” attributes. -/// +/// /// # Shortcuts and Gestures -/// +/// /// `GtkPopoverMenu` supports the following keyboard shortcuts: -/// +/// /// - Arrow keys, + and - will increment or decrement /// by step, or by page when combined with Ctrl. /// - PgUp and PgDn will increment or decrement by page. /// - Home and End will set the minimum or maximum value. -/// +/// /// # CSS nodes -/// +/// /// ``` /// scale[.fine-tune][.marks-before][.marks-after] /// ├── [value][.top][.right][.bottom][.left] @@ -55,130 +55,138 @@ import CGtk /// ├── [highlight] /// ╰── slider /// ``` -/// +/// /// `GtkScale` has a main CSS node with name scale and a subnode for its contents, /// with subnodes named trough and slider. -/// +/// /// The main node gets the style class .fine-tune added when the scale is in /// 'fine-tuning' mode. -/// +/// /// If the scale has an origin (see [method@Gtk.Scale.set_has_origin]), there is /// a subnode with name highlight below the trough node that is used for rendering /// the highlighted part of the trough. -/// +/// /// If the scale is showing a fill level (see [method@Gtk.Range.set_show_fill_level]), /// there is a subnode with name fill below the trough node that is used for /// rendering the filled in part of the trough. -/// +/// /// If marks are present, there is a marks subnode before or after the trough /// node, below which each mark gets a node with name mark. The marks nodes get /// either the .top or .bottom style class. -/// +/// /// The mark node has a subnode named indicator. If the mark has text, it also /// has a subnode named label. When the mark is either above or left of the /// scale, the label subnode is the first when present. Otherwise, the indicator /// subnode is the first. -/// +/// /// The main CSS node gets the 'marks-before' and/or 'marks-after' style classes /// added depending on what marks are present. -/// +/// /// If the scale is displaying the value (see [property@Gtk.Scale:draw-value]), /// there is subnode with name value. This node will get the .top or .bottom style /// classes similar to the marks node. -/// +/// /// # Accessibility -/// +/// /// `GtkScale` uses the [enum@Gtk.AccessibleRole.slider] role. open class Scale: Range { /// Creates a new `GtkScale`. -public convenience init(orientation: GtkOrientation, adjustment: UnsafeMutablePointer!) { - self.init( - gtk_scale_new(orientation, adjustment) - ) -} - -/// Creates a new scale widget with a range from @min to @max. -/// -/// The returns scale will have the given orientation and will let the -/// user input a number between @min and @max (including @min and @max) -/// with the increment @step. @step must be nonzero; it’s the distance -/// the slider moves when using the arrow keys to adjust the scale -/// value. -/// -/// Note that the way in which the precision is derived works best if -/// @step is a power of ten. If the resulting precision is not suitable -/// for your needs, use [method@Gtk.Scale.set_digits] to correct it. -public convenience init(range orientation: GtkOrientation, min: Double, max: Double, step: Double) { - self.init( - gtk_scale_new_with_range(orientation, min, max, step) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init( + orientation: GtkOrientation, adjustment: UnsafeMutablePointer! + ) { + self.init( + gtk_scale_new(orientation, adjustment) + ) } -addSignal(name: "notify::digits", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDigits?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new scale widget with a range from @min to @max. + /// + /// The returns scale will have the given orientation and will let the + /// user input a number between @min and @max (including @min and @max) + /// with the increment @step. @step must be nonzero; it’s the distance + /// the slider moves when using the arrow keys to adjust the scale + /// value. + /// + /// Note that the way in which the precision is derived works best if + /// @step is a power of ten. If the resulting precision is not suitable + /// for your needs, use [method@Gtk.Scale.set_digits] to correct it. + public convenience init( + range orientation: GtkOrientation, min: Double, max: Double, step: Double + ) { + self.init( + gtk_scale_new_with_range(orientation, min, max, step) + ) } -addSignal(name: "notify::draw-value", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDrawValue?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::digits", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDigits?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::draw-value", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDrawValue?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::has-origin", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasOrigin?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::value-pos", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyValuePos?(self, param0) + } } -addSignal(name: "notify::has-origin", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasOrigin?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::value-pos", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyValuePos?(self, param0) -} -} - /// The number of decimal places that are displayed in the value. -@GObjectProperty(named: "digits") public var digits: Int + @GObjectProperty(named: "digits") public var digits: Int -/// Whether the current value is displayed as a string next to the slider. -@GObjectProperty(named: "draw-value") public var drawValue: Bool + /// Whether the current value is displayed as a string next to the slider. + @GObjectProperty(named: "draw-value") public var drawValue: Bool -/// Whether the scale has an origin. -@GObjectProperty(named: "has-origin") public var hasOrigin: Bool + /// Whether the scale has an origin. + @GObjectProperty(named: "has-origin") public var hasOrigin: Bool -/// The position in which the current value is displayed. -@GObjectProperty(named: "value-pos") public var valuePos: PositionType + /// The position in which the current value is displayed. + @GObjectProperty(named: "value-pos") public var valuePos: PositionType + public var notifyDigits: ((Scale, OpaquePointer) -> Void)? -public var notifyDigits: ((Scale, OpaquePointer) -> Void)? + public var notifyDrawValue: ((Scale, OpaquePointer) -> Void)? + public var notifyHasOrigin: ((Scale, OpaquePointer) -> Void)? -public var notifyDrawValue: ((Scale, OpaquePointer) -> Void)? - - -public var notifyHasOrigin: ((Scale, OpaquePointer) -> Void)? - - -public var notifyValuePos: ((Scale, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyValuePos: ((Scale, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/ScrollStep.swift b/Sources/Gtk/Generated/ScrollStep.swift index 4b408bad16..0432f12244 100644 --- a/Sources/Gtk/Generated/ScrollStep.swift +++ b/Sources/Gtk/Generated/ScrollStep.swift @@ -5,36 +5,36 @@ public enum ScrollStep: GValueRepresentableEnum { public typealias GtkEnum = GtkScrollStep /// Scroll in steps. -case steps -/// Scroll by pages. -case pages -/// Scroll to ends. -case ends -/// Scroll in horizontal steps. -case horizontalSteps -/// Scroll by horizontal pages. -case horizontalPages -/// Scroll to the horizontal ends. -case horizontalEnds + case steps + /// Scroll by pages. + case pages + /// Scroll to ends. + case ends + /// Scroll in horizontal steps. + case horizontalSteps + /// Scroll by horizontal pages. + case horizontalPages + /// Scroll to the horizontal ends. + case horizontalEnds public static var type: GType { - gtk_scroll_step_get_type() -} + gtk_scroll_step_get_type() + } public init(from gtkEnum: GtkScrollStep) { switch gtkEnum { case GTK_SCROLL_STEPS: - self = .steps -case GTK_SCROLL_PAGES: - self = .pages -case GTK_SCROLL_ENDS: - self = .ends -case GTK_SCROLL_HORIZONTAL_STEPS: - self = .horizontalSteps -case GTK_SCROLL_HORIZONTAL_PAGES: - self = .horizontalPages -case GTK_SCROLL_HORIZONTAL_ENDS: - self = .horizontalEnds + self = .steps + case GTK_SCROLL_PAGES: + self = .pages + case GTK_SCROLL_ENDS: + self = .ends + case GTK_SCROLL_HORIZONTAL_STEPS: + self = .horizontalSteps + case GTK_SCROLL_HORIZONTAL_PAGES: + self = .horizontalPages + case GTK_SCROLL_HORIZONTAL_ENDS: + self = .horizontalEnds default: fatalError("Unsupported GtkScrollStep enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ case GTK_SCROLL_HORIZONTAL_ENDS: public func toGtk() -> GtkScrollStep { switch self { case .steps: - return GTK_SCROLL_STEPS -case .pages: - return GTK_SCROLL_PAGES -case .ends: - return GTK_SCROLL_ENDS -case .horizontalSteps: - return GTK_SCROLL_HORIZONTAL_STEPS -case .horizontalPages: - return GTK_SCROLL_HORIZONTAL_PAGES -case .horizontalEnds: - return GTK_SCROLL_HORIZONTAL_ENDS + return GTK_SCROLL_STEPS + case .pages: + return GTK_SCROLL_PAGES + case .ends: + return GTK_SCROLL_ENDS + case .horizontalSteps: + return GTK_SCROLL_HORIZONTAL_STEPS + case .horizontalPages: + return GTK_SCROLL_HORIZONTAL_PAGES + case .horizontalEnds: + return GTK_SCROLL_HORIZONTAL_ENDS } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ScrollType.swift b/Sources/Gtk/Generated/ScrollType.swift index d952af8897..88054fa724 100644 --- a/Sources/Gtk/Generated/ScrollType.swift +++ b/Sources/Gtk/Generated/ScrollType.swift @@ -5,76 +5,76 @@ public enum ScrollType: GValueRepresentableEnum { public typealias GtkEnum = GtkScrollType /// No scrolling. -case none -/// Jump to new location. -case jump -/// Step backward. -case stepBackward -/// Step forward. -case stepForward -/// Page backward. -case pageBackward -/// Page forward. -case pageForward -/// Step up. -case stepUp -/// Step down. -case stepDown -/// Page up. -case pageUp -/// Page down. -case pageDown -/// Step to the left. -case stepLeft -/// Step to the right. -case stepRight -/// Page to the left. -case pageLeft -/// Page to the right. -case pageRight -/// Scroll to start. -case start -/// Scroll to end. -case end + case none + /// Jump to new location. + case jump + /// Step backward. + case stepBackward + /// Step forward. + case stepForward + /// Page backward. + case pageBackward + /// Page forward. + case pageForward + /// Step up. + case stepUp + /// Step down. + case stepDown + /// Page up. + case pageUp + /// Page down. + case pageDown + /// Step to the left. + case stepLeft + /// Step to the right. + case stepRight + /// Page to the left. + case pageLeft + /// Page to the right. + case pageRight + /// Scroll to start. + case start + /// Scroll to end. + case end public static var type: GType { - gtk_scroll_type_get_type() -} + gtk_scroll_type_get_type() + } public init(from gtkEnum: GtkScrollType) { switch gtkEnum { case GTK_SCROLL_NONE: - self = .none -case GTK_SCROLL_JUMP: - self = .jump -case GTK_SCROLL_STEP_BACKWARD: - self = .stepBackward -case GTK_SCROLL_STEP_FORWARD: - self = .stepForward -case GTK_SCROLL_PAGE_BACKWARD: - self = .pageBackward -case GTK_SCROLL_PAGE_FORWARD: - self = .pageForward -case GTK_SCROLL_STEP_UP: - self = .stepUp -case GTK_SCROLL_STEP_DOWN: - self = .stepDown -case GTK_SCROLL_PAGE_UP: - self = .pageUp -case GTK_SCROLL_PAGE_DOWN: - self = .pageDown -case GTK_SCROLL_STEP_LEFT: - self = .stepLeft -case GTK_SCROLL_STEP_RIGHT: - self = .stepRight -case GTK_SCROLL_PAGE_LEFT: - self = .pageLeft -case GTK_SCROLL_PAGE_RIGHT: - self = .pageRight -case GTK_SCROLL_START: - self = .start -case GTK_SCROLL_END: - self = .end + self = .none + case GTK_SCROLL_JUMP: + self = .jump + case GTK_SCROLL_STEP_BACKWARD: + self = .stepBackward + case GTK_SCROLL_STEP_FORWARD: + self = .stepForward + case GTK_SCROLL_PAGE_BACKWARD: + self = .pageBackward + case GTK_SCROLL_PAGE_FORWARD: + self = .pageForward + case GTK_SCROLL_STEP_UP: + self = .stepUp + case GTK_SCROLL_STEP_DOWN: + self = .stepDown + case GTK_SCROLL_PAGE_UP: + self = .pageUp + case GTK_SCROLL_PAGE_DOWN: + self = .pageDown + case GTK_SCROLL_STEP_LEFT: + self = .stepLeft + case GTK_SCROLL_STEP_RIGHT: + self = .stepRight + case GTK_SCROLL_PAGE_LEFT: + self = .pageLeft + case GTK_SCROLL_PAGE_RIGHT: + self = .pageRight + case GTK_SCROLL_START: + self = .start + case GTK_SCROLL_END: + self = .end default: fatalError("Unsupported GtkScrollType enum value: \(gtkEnum.rawValue)") } @@ -83,37 +83,37 @@ case GTK_SCROLL_END: public func toGtk() -> GtkScrollType { switch self { case .none: - return GTK_SCROLL_NONE -case .jump: - return GTK_SCROLL_JUMP -case .stepBackward: - return GTK_SCROLL_STEP_BACKWARD -case .stepForward: - return GTK_SCROLL_STEP_FORWARD -case .pageBackward: - return GTK_SCROLL_PAGE_BACKWARD -case .pageForward: - return GTK_SCROLL_PAGE_FORWARD -case .stepUp: - return GTK_SCROLL_STEP_UP -case .stepDown: - return GTK_SCROLL_STEP_DOWN -case .pageUp: - return GTK_SCROLL_PAGE_UP -case .pageDown: - return GTK_SCROLL_PAGE_DOWN -case .stepLeft: - return GTK_SCROLL_STEP_LEFT -case .stepRight: - return GTK_SCROLL_STEP_RIGHT -case .pageLeft: - return GTK_SCROLL_PAGE_LEFT -case .pageRight: - return GTK_SCROLL_PAGE_RIGHT -case .start: - return GTK_SCROLL_START -case .end: - return GTK_SCROLL_END + return GTK_SCROLL_NONE + case .jump: + return GTK_SCROLL_JUMP + case .stepBackward: + return GTK_SCROLL_STEP_BACKWARD + case .stepForward: + return GTK_SCROLL_STEP_FORWARD + case .pageBackward: + return GTK_SCROLL_PAGE_BACKWARD + case .pageForward: + return GTK_SCROLL_PAGE_FORWARD + case .stepUp: + return GTK_SCROLL_STEP_UP + case .stepDown: + return GTK_SCROLL_STEP_DOWN + case .pageUp: + return GTK_SCROLL_PAGE_UP + case .pageDown: + return GTK_SCROLL_PAGE_DOWN + case .stepLeft: + return GTK_SCROLL_STEP_LEFT + case .stepRight: + return GTK_SCROLL_STEP_RIGHT + case .pageLeft: + return GTK_SCROLL_PAGE_LEFT + case .pageRight: + return GTK_SCROLL_PAGE_RIGHT + case .start: + return GTK_SCROLL_START + case .end: + return GTK_SCROLL_END } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Scrollable.swift b/Sources/Gtk/Generated/Scrollable.swift index 9e9cf83579..10f42ccffd 100644 --- a/Sources/Gtk/Generated/Scrollable.swift +++ b/Sources/Gtk/Generated/Scrollable.swift @@ -1,39 +1,38 @@ import CGtk /// An interface for widgets with native scrolling ability. -/// +/// /// To implement this interface you should override the /// [property@Gtk.Scrollable:hadjustment] and /// [property@Gtk.Scrollable:vadjustment] properties. -/// +/// /// ## Creating a scrollable widget -/// +/// /// All scrollable widgets should do the following. -/// +/// /// - When a parent widget sets the scrollable child widget’s adjustments, /// the widget should connect to the [signal@Gtk.Adjustment::value-changed] /// signal. The child widget should then populate the adjustments’ properties /// as soon as possible, which usually means queueing an allocation right away /// and populating the properties in the [vfunc@Gtk.Widget.size_allocate] /// implementation. -/// +/// /// - Because its preferred size is the size for a fully expanded widget, /// the scrollable widget must be able to cope with underallocations. /// This means that it must accept any value passed to its /// [vfunc@Gtk.Widget.size_allocate] implementation. -/// +/// /// - When the parent allocates space to the scrollable child widget, /// the widget must ensure the adjustments’ property values are correct and up /// to date, for example using [method@Gtk.Adjustment.configure]. -/// +/// /// - When any of the adjustments emits the [signal@Gtk.Adjustment::value-changed] /// signal, the scrollable widget should scroll its contents. public protocol Scrollable: GObjectRepresentable { /// Determines when horizontal scrolling should start. -var hscrollPolicy: ScrollablePolicy { get set } + var hscrollPolicy: ScrollablePolicy { get set } -/// Determines when vertical scrolling should start. -var vscrollPolicy: ScrollablePolicy { get set } + /// Determines when vertical scrolling should start. + var vscrollPolicy: ScrollablePolicy { get set } - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ScrollablePolicy.swift b/Sources/Gtk/Generated/ScrollablePolicy.swift index 5b2f2cd335..1e47fa44d0 100644 --- a/Sources/Gtk/Generated/ScrollablePolicy.swift +++ b/Sources/Gtk/Generated/ScrollablePolicy.swift @@ -6,20 +6,20 @@ public enum ScrollablePolicy: GValueRepresentableEnum { public typealias GtkEnum = GtkScrollablePolicy /// Scrollable adjustments are based on the minimum size -case minimum -/// Scrollable adjustments are based on the natural size -case natural + case minimum + /// Scrollable adjustments are based on the natural size + case natural public static var type: GType { - gtk_scrollable_policy_get_type() -} + gtk_scrollable_policy_get_type() + } public init(from gtkEnum: GtkScrollablePolicy) { switch gtkEnum { case GTK_SCROLL_MINIMUM: - self = .minimum -case GTK_SCROLL_NATURAL: - self = .natural + self = .minimum + case GTK_SCROLL_NATURAL: + self = .natural default: fatalError("Unsupported GtkScrollablePolicy enum value: \(gtkEnum.rawValue)") } @@ -28,9 +28,9 @@ case GTK_SCROLL_NATURAL: public func toGtk() -> GtkScrollablePolicy { switch self { case .minimum: - return GTK_SCROLL_MINIMUM -case .natural: - return GTK_SCROLL_NATURAL + return GTK_SCROLL_MINIMUM + case .natural: + return GTK_SCROLL_NATURAL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/SelectionMode.swift b/Sources/Gtk/Generated/SelectionMode.swift index 594b4d82d9..c97d0a94b3 100644 --- a/Sources/Gtk/Generated/SelectionMode.swift +++ b/Sources/Gtk/Generated/SelectionMode.swift @@ -5,36 +5,36 @@ public enum SelectionMode: GValueRepresentableEnum { public typealias GtkEnum = GtkSelectionMode /// No selection is possible. -case none -/// Zero or one element may be selected. -case single -/// Exactly one element is selected. -/// In some circumstances, such as initially or during a search -/// operation, it’s possible for no element to be selected with -/// %GTK_SELECTION_BROWSE. What is really enforced is that the user -/// can’t deselect a currently selected element except by selecting -/// another element. -case browse -/// Any number of elements may be selected. -/// The Ctrl key may be used to enlarge the selection, and Shift -/// key to select between the focus and the child pointed to. -/// Some widgets may also allow Click-drag to select a range of elements. -case multiple + case none + /// Zero or one element may be selected. + case single + /// Exactly one element is selected. + /// In some circumstances, such as initially or during a search + /// operation, it’s possible for no element to be selected with + /// %GTK_SELECTION_BROWSE. What is really enforced is that the user + /// can’t deselect a currently selected element except by selecting + /// another element. + case browse + /// Any number of elements may be selected. + /// The Ctrl key may be used to enlarge the selection, and Shift + /// key to select between the focus and the child pointed to. + /// Some widgets may also allow Click-drag to select a range of elements. + case multiple public static var type: GType { - gtk_selection_mode_get_type() -} + gtk_selection_mode_get_type() + } public init(from gtkEnum: GtkSelectionMode) { switch gtkEnum { case GTK_SELECTION_NONE: - self = .none -case GTK_SELECTION_SINGLE: - self = .single -case GTK_SELECTION_BROWSE: - self = .browse -case GTK_SELECTION_MULTIPLE: - self = .multiple + self = .none + case GTK_SELECTION_SINGLE: + self = .single + case GTK_SELECTION_BROWSE: + self = .browse + case GTK_SELECTION_MULTIPLE: + self = .multiple default: fatalError("Unsupported GtkSelectionMode enum value: \(gtkEnum.rawValue)") } @@ -43,13 +43,13 @@ case GTK_SELECTION_MULTIPLE: public func toGtk() -> GtkSelectionMode { switch self { case .none: - return GTK_SELECTION_NONE -case .single: - return GTK_SELECTION_SINGLE -case .browse: - return GTK_SELECTION_BROWSE -case .multiple: - return GTK_SELECTION_MULTIPLE + return GTK_SELECTION_NONE + case .single: + return GTK_SELECTION_SINGLE + case .browse: + return GTK_SELECTION_BROWSE + case .multiple: + return GTK_SELECTION_MULTIPLE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/SelectionModel.swift b/Sources/Gtk/Generated/SelectionModel.swift index fd59aa71c9..4b401bb239 100644 --- a/Sources/Gtk/Generated/SelectionModel.swift +++ b/Sources/Gtk/Generated/SelectionModel.swift @@ -1,14 +1,14 @@ import CGtk /// An interface that adds support for selection to list models. -/// +/// /// This support is then used by widgets using list models to add the ability /// to select and unselect various items. -/// +/// /// GTK provides default implementations of the most common selection modes such /// as [class@Gtk.SingleSelection], so you will only need to implement this /// interface if you want detailed control about how selections should be handled. -/// +/// /// A `GtkSelectionModel` supports a single boolean per item indicating if an item is /// selected or not. This can be queried via [method@Gtk.SelectionModel.is_selected]. /// When the selected state of one or more items changes, the model will emit the @@ -18,33 +18,32 @@ import CGtk /// requirement. If new items added to the model via the /// [signal@Gio.ListModel::items-changed] signal are selected or not is up to the /// implementation. -/// +/// /// Note that items added via [signal@Gio.ListModel::items-changed] may already /// be selected and no [signal@Gtk.SelectionModel::selection-changed] will be /// emitted for them. So to track which items are selected, it is necessary to /// listen to both signals. -/// +/// /// Additionally, the interface can expose functionality to select and unselect /// items. If these functions are implemented, GTK's list widgets will allow users /// to select and unselect items. However, `GtkSelectionModel`s are free to only /// implement them partially or not at all. In that case the widgets will not /// support the unimplemented operations. -/// +/// /// When selecting or unselecting is supported by a model, the return values of /// the selection functions do *not* indicate if selection or unselection happened. /// They are only meant to indicate complete failure, like when this mode of /// selecting is not supported by the model. -/// +/// /// Selections may happen asynchronously, so the only reliable way to find out /// when an item was selected is to listen to the signals that indicate selection. public protocol SelectionModel: GObjectRepresentable { - /// Emitted when the selection state of some of the items in @model changes. -/// -/// Note that this signal does not specify the new selection state of the -/// items, they need to be queried manually. It is also not necessary for -/// a model to change the selection state of any of the items in the selection -/// model, though it would be rather useless to emit such a signal. -var selectionChanged: ((Self, UInt, UInt) -> Void)? { get set } -} \ No newline at end of file + /// + /// Note that this signal does not specify the new selection state of the + /// items, they need to be queried manually. It is also not necessary for + /// a model to change the selection state of any of the items in the selection + /// model, though it would be rather useless to emit such a signal. + var selectionChanged: ((Self, UInt, UInt) -> Void)? { get set } +} diff --git a/Sources/Gtk/Generated/SensitivityType.swift b/Sources/Gtk/Generated/SensitivityType.swift index edff95c786..df5c24ecb6 100644 --- a/Sources/Gtk/Generated/SensitivityType.swift +++ b/Sources/Gtk/Generated/SensitivityType.swift @@ -6,25 +6,25 @@ public enum SensitivityType: GValueRepresentableEnum { public typealias GtkEnum = GtkSensitivityType /// The control is made insensitive if no -/// action can be triggered -case auto -/// The control is always sensitive -case on -/// The control is always insensitive -case off + /// action can be triggered + case auto + /// The control is always sensitive + case on + /// The control is always insensitive + case off public static var type: GType { - gtk_sensitivity_type_get_type() -} + gtk_sensitivity_type_get_type() + } public init(from gtkEnum: GtkSensitivityType) { switch gtkEnum { case GTK_SENSITIVITY_AUTO: - self = .auto -case GTK_SENSITIVITY_ON: - self = .on -case GTK_SENSITIVITY_OFF: - self = .off + self = .auto + case GTK_SENSITIVITY_ON: + self = .on + case GTK_SENSITIVITY_OFF: + self = .off default: fatalError("Unsupported GtkSensitivityType enum value: \(gtkEnum.rawValue)") } @@ -33,11 +33,11 @@ case GTK_SENSITIVITY_OFF: public func toGtk() -> GtkSensitivityType { switch self { case .auto: - return GTK_SENSITIVITY_AUTO -case .on: - return GTK_SENSITIVITY_ON -case .off: - return GTK_SENSITIVITY_OFF + return GTK_SENSITIVITY_AUTO + case .on: + return GTK_SENSITIVITY_ON + case .off: + return GTK_SENSITIVITY_OFF } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ShortcutManager.swift b/Sources/Gtk/Generated/ShortcutManager.swift index 9faa713766..793602901d 100644 --- a/Sources/Gtk/Generated/ShortcutManager.swift +++ b/Sources/Gtk/Generated/ShortcutManager.swift @@ -1,18 +1,16 @@ import CGtk /// An interface that is used to implement shortcut scopes. -/// +/// /// This is important for [iface@Gtk.Native] widgets that have their /// own surface, since the event controllers that are used to implement /// managed and global scopes are limited to the same native. -/// +/// /// Examples for widgets implementing `GtkShortcutManager` are /// [class@Gtk.Window] and [class@Gtk.Popover]. -/// +/// /// Every widget that implements `GtkShortcutManager` will be used as a /// `GTK_SHORTCUT_SCOPE_MANAGED`. public protocol ShortcutManager: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ShortcutScope.swift b/Sources/Gtk/Generated/ShortcutScope.swift index 5f52020322..52c905c929 100644 --- a/Sources/Gtk/Generated/ShortcutScope.swift +++ b/Sources/Gtk/Generated/ShortcutScope.swift @@ -6,27 +6,27 @@ public enum ShortcutScope: GValueRepresentableEnum { public typealias GtkEnum = GtkShortcutScope /// Shortcuts are handled inside -/// the widget the controller belongs to. -case local -/// Shortcuts are handled by -/// the first ancestor that is a [iface@ShortcutManager] -case managed -/// Shortcuts are handled by -/// the root widget. -case global + /// the widget the controller belongs to. + case local + /// Shortcuts are handled by + /// the first ancestor that is a [iface@ShortcutManager] + case managed + /// Shortcuts are handled by + /// the root widget. + case global public static var type: GType { - gtk_shortcut_scope_get_type() -} + gtk_shortcut_scope_get_type() + } public init(from gtkEnum: GtkShortcutScope) { switch gtkEnum { case GTK_SHORTCUT_SCOPE_LOCAL: - self = .local -case GTK_SHORTCUT_SCOPE_MANAGED: - self = .managed -case GTK_SHORTCUT_SCOPE_GLOBAL: - self = .global + self = .local + case GTK_SHORTCUT_SCOPE_MANAGED: + self = .managed + case GTK_SHORTCUT_SCOPE_GLOBAL: + self = .global default: fatalError("Unsupported GtkShortcutScope enum value: \(gtkEnum.rawValue)") } @@ -35,11 +35,11 @@ case GTK_SHORTCUT_SCOPE_GLOBAL: public func toGtk() -> GtkShortcutScope { switch self { case .local: - return GTK_SHORTCUT_SCOPE_LOCAL -case .managed: - return GTK_SHORTCUT_SCOPE_MANAGED -case .global: - return GTK_SHORTCUT_SCOPE_GLOBAL + return GTK_SHORTCUT_SCOPE_LOCAL + case .managed: + return GTK_SHORTCUT_SCOPE_MANAGED + case .global: + return GTK_SHORTCUT_SCOPE_GLOBAL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ShortcutType.swift b/Sources/Gtk/Generated/ShortcutType.swift index a3d57b53c7..8461c30a95 100644 --- a/Sources/Gtk/Generated/ShortcutType.swift +++ b/Sources/Gtk/Generated/ShortcutType.swift @@ -1,60 +1,60 @@ import CGtk /// GtkShortcutType specifies the kind of shortcut that is being described. -/// +/// /// More values may be added to this enumeration over time. public enum ShortcutType: GValueRepresentableEnum { public typealias GtkEnum = GtkShortcutType /// The shortcut is a keyboard accelerator. The GtkShortcutsShortcut:accelerator -/// property will be used. -case accelerator -/// The shortcut is a pinch gesture. GTK provides an icon and subtitle. -case gesturePinch -/// The shortcut is a stretch gesture. GTK provides an icon and subtitle. -case gestureStretch -/// The shortcut is a clockwise rotation gesture. GTK provides an icon and subtitle. -case gestureRotateClockwise -/// The shortcut is a counterclockwise rotation gesture. GTK provides an icon and subtitle. -case gestureRotateCounterclockwise -/// The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle. -case gestureTwoFingerSwipeLeft -/// The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle. -case gestureTwoFingerSwipeRight -/// The shortcut is a gesture. The GtkShortcutsShortcut:icon property will be -/// used. -case gesture -/// The shortcut is a swipe gesture. GTK provides an icon and subtitle. -case gestureSwipeLeft -/// The shortcut is a swipe gesture. GTK provides an icon and subtitle. -case gestureSwipeRight + /// property will be used. + case accelerator + /// The shortcut is a pinch gesture. GTK provides an icon and subtitle. + case gesturePinch + /// The shortcut is a stretch gesture. GTK provides an icon and subtitle. + case gestureStretch + /// The shortcut is a clockwise rotation gesture. GTK provides an icon and subtitle. + case gestureRotateClockwise + /// The shortcut is a counterclockwise rotation gesture. GTK provides an icon and subtitle. + case gestureRotateCounterclockwise + /// The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle. + case gestureTwoFingerSwipeLeft + /// The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle. + case gestureTwoFingerSwipeRight + /// The shortcut is a gesture. The GtkShortcutsShortcut:icon property will be + /// used. + case gesture + /// The shortcut is a swipe gesture. GTK provides an icon and subtitle. + case gestureSwipeLeft + /// The shortcut is a swipe gesture. GTK provides an icon and subtitle. + case gestureSwipeRight public static var type: GType { - gtk_shortcut_type_get_type() -} + gtk_shortcut_type_get_type() + } public init(from gtkEnum: GtkShortcutType) { switch gtkEnum { case GTK_SHORTCUT_ACCELERATOR: - self = .accelerator -case GTK_SHORTCUT_GESTURE_PINCH: - self = .gesturePinch -case GTK_SHORTCUT_GESTURE_STRETCH: - self = .gestureStretch -case GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE: - self = .gestureRotateClockwise -case GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE: - self = .gestureRotateCounterclockwise -case GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT: - self = .gestureTwoFingerSwipeLeft -case GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT: - self = .gestureTwoFingerSwipeRight -case GTK_SHORTCUT_GESTURE: - self = .gesture -case GTK_SHORTCUT_GESTURE_SWIPE_LEFT: - self = .gestureSwipeLeft -case GTK_SHORTCUT_GESTURE_SWIPE_RIGHT: - self = .gestureSwipeRight + self = .accelerator + case GTK_SHORTCUT_GESTURE_PINCH: + self = .gesturePinch + case GTK_SHORTCUT_GESTURE_STRETCH: + self = .gestureStretch + case GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE: + self = .gestureRotateClockwise + case GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE: + self = .gestureRotateCounterclockwise + case GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT: + self = .gestureTwoFingerSwipeLeft + case GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT: + self = .gestureTwoFingerSwipeRight + case GTK_SHORTCUT_GESTURE: + self = .gesture + case GTK_SHORTCUT_GESTURE_SWIPE_LEFT: + self = .gestureSwipeLeft + case GTK_SHORTCUT_GESTURE_SWIPE_RIGHT: + self = .gestureSwipeRight default: fatalError("Unsupported GtkShortcutType enum value: \(gtkEnum.rawValue)") } @@ -63,25 +63,25 @@ case GTK_SHORTCUT_GESTURE_SWIPE_RIGHT: public func toGtk() -> GtkShortcutType { switch self { case .accelerator: - return GTK_SHORTCUT_ACCELERATOR -case .gesturePinch: - return GTK_SHORTCUT_GESTURE_PINCH -case .gestureStretch: - return GTK_SHORTCUT_GESTURE_STRETCH -case .gestureRotateClockwise: - return GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE -case .gestureRotateCounterclockwise: - return GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE -case .gestureTwoFingerSwipeLeft: - return GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT -case .gestureTwoFingerSwipeRight: - return GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT -case .gesture: - return GTK_SHORTCUT_GESTURE -case .gestureSwipeLeft: - return GTK_SHORTCUT_GESTURE_SWIPE_LEFT -case .gestureSwipeRight: - return GTK_SHORTCUT_GESTURE_SWIPE_RIGHT + return GTK_SHORTCUT_ACCELERATOR + case .gesturePinch: + return GTK_SHORTCUT_GESTURE_PINCH + case .gestureStretch: + return GTK_SHORTCUT_GESTURE_STRETCH + case .gestureRotateClockwise: + return GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE + case .gestureRotateCounterclockwise: + return GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE + case .gestureTwoFingerSwipeLeft: + return GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT + case .gestureTwoFingerSwipeRight: + return GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT + case .gesture: + return GTK_SHORTCUT_GESTURE + case .gestureSwipeLeft: + return GTK_SHORTCUT_GESTURE_SWIPE_LEFT + case .gestureSwipeRight: + return GTK_SHORTCUT_GESTURE_SWIPE_RIGHT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/SizeGroupMode.swift b/Sources/Gtk/Generated/SizeGroupMode.swift index bd98e748f7..5a4a684fbd 100644 --- a/Sources/Gtk/Generated/SizeGroupMode.swift +++ b/Sources/Gtk/Generated/SizeGroupMode.swift @@ -6,28 +6,28 @@ public enum SizeGroupMode: GValueRepresentableEnum { public typealias GtkEnum = GtkSizeGroupMode /// Group has no effect -case none -/// Group affects horizontal requisition -case horizontal -/// Group affects vertical requisition -case vertical -/// Group affects both horizontal and vertical requisition -case both + case none + /// Group affects horizontal requisition + case horizontal + /// Group affects vertical requisition + case vertical + /// Group affects both horizontal and vertical requisition + case both public static var type: GType { - gtk_size_group_mode_get_type() -} + gtk_size_group_mode_get_type() + } public init(from gtkEnum: GtkSizeGroupMode) { switch gtkEnum { case GTK_SIZE_GROUP_NONE: - self = .none -case GTK_SIZE_GROUP_HORIZONTAL: - self = .horizontal -case GTK_SIZE_GROUP_VERTICAL: - self = .vertical -case GTK_SIZE_GROUP_BOTH: - self = .both + self = .none + case GTK_SIZE_GROUP_HORIZONTAL: + self = .horizontal + case GTK_SIZE_GROUP_VERTICAL: + self = .vertical + case GTK_SIZE_GROUP_BOTH: + self = .both default: fatalError("Unsupported GtkSizeGroupMode enum value: \(gtkEnum.rawValue)") } @@ -36,13 +36,13 @@ case GTK_SIZE_GROUP_BOTH: public func toGtk() -> GtkSizeGroupMode { switch self { case .none: - return GTK_SIZE_GROUP_NONE -case .horizontal: - return GTK_SIZE_GROUP_HORIZONTAL -case .vertical: - return GTK_SIZE_GROUP_VERTICAL -case .both: - return GTK_SIZE_GROUP_BOTH + return GTK_SIZE_GROUP_NONE + case .horizontal: + return GTK_SIZE_GROUP_HORIZONTAL + case .vertical: + return GTK_SIZE_GROUP_VERTICAL + case .both: + return GTK_SIZE_GROUP_BOTH } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/SizeRequestMode.swift b/Sources/Gtk/Generated/SizeRequestMode.swift index 14b590f8e2..4ed9def07c 100644 --- a/Sources/Gtk/Generated/SizeRequestMode.swift +++ b/Sources/Gtk/Generated/SizeRequestMode.swift @@ -6,24 +6,24 @@ public enum SizeRequestMode: GValueRepresentableEnum { public typealias GtkEnum = GtkSizeRequestMode /// Prefer height-for-width geometry management -case heightForWidth -/// Prefer width-for-height geometry management -case widthForHeight -/// Don’t trade height-for-width or width-for-height -case constantSize + case heightForWidth + /// Prefer width-for-height geometry management + case widthForHeight + /// Don’t trade height-for-width or width-for-height + case constantSize public static var type: GType { - gtk_size_request_mode_get_type() -} + gtk_size_request_mode_get_type() + } public init(from gtkEnum: GtkSizeRequestMode) { switch gtkEnum { case GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH: - self = .heightForWidth -case GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT: - self = .widthForHeight -case GTK_SIZE_REQUEST_CONSTANT_SIZE: - self = .constantSize + self = .heightForWidth + case GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT: + self = .widthForHeight + case GTK_SIZE_REQUEST_CONSTANT_SIZE: + self = .constantSize default: fatalError("Unsupported GtkSizeRequestMode enum value: \(gtkEnum.rawValue)") } @@ -32,11 +32,11 @@ case GTK_SIZE_REQUEST_CONSTANT_SIZE: public func toGtk() -> GtkSizeRequestMode { switch self { case .heightForWidth: - return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH -case .widthForHeight: - return GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT -case .constantSize: - return GTK_SIZE_REQUEST_CONSTANT_SIZE + return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH + case .widthForHeight: + return GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT + case .constantSize: + return GTK_SIZE_REQUEST_CONSTANT_SIZE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/SortType.swift b/Sources/Gtk/Generated/SortType.swift index 78d4dab6ae..2a19d30b89 100644 --- a/Sources/Gtk/Generated/SortType.swift +++ b/Sources/Gtk/Generated/SortType.swift @@ -5,20 +5,20 @@ public enum SortType: GValueRepresentableEnum { public typealias GtkEnum = GtkSortType /// Sorting is in ascending order. -case ascending -/// Sorting is in descending order. -case descending + case ascending + /// Sorting is in descending order. + case descending public static var type: GType { - gtk_sort_type_get_type() -} + gtk_sort_type_get_type() + } public init(from gtkEnum: GtkSortType) { switch gtkEnum { case GTK_SORT_ASCENDING: - self = .ascending -case GTK_SORT_DESCENDING: - self = .descending + self = .ascending + case GTK_SORT_DESCENDING: + self = .descending default: fatalError("Unsupported GtkSortType enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ case GTK_SORT_DESCENDING: public func toGtk() -> GtkSortType { switch self { case .ascending: - return GTK_SORT_ASCENDING -case .descending: - return GTK_SORT_DESCENDING + return GTK_SORT_ASCENDING + case .descending: + return GTK_SORT_DESCENDING } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/SorterChange.swift b/Sources/Gtk/Generated/SorterChange.swift index 1624530ab0..a7cf38e399 100644 --- a/Sources/Gtk/Generated/SorterChange.swift +++ b/Sources/Gtk/Generated/SorterChange.swift @@ -6,33 +6,33 @@ public enum SorterChange: GValueRepresentableEnum { public typealias GtkEnum = GtkSorterChange /// The sorter change cannot be described -/// by any of the other enumeration values -case different -/// The sort order was inverted. Comparisons -/// that returned %GTK_ORDERING_SMALLER now return %GTK_ORDERING_LARGER -/// and vice versa. Other comparisons return the same values as before. -case inverted -/// The sorter is less strict: Comparisons -/// may now return %GTK_ORDERING_EQUAL that did not do so before. -case lessStrict -/// The sorter is more strict: Comparisons -/// that did return %GTK_ORDERING_EQUAL may not do so anymore. -case moreStrict + /// by any of the other enumeration values + case different + /// The sort order was inverted. Comparisons + /// that returned %GTK_ORDERING_SMALLER now return %GTK_ORDERING_LARGER + /// and vice versa. Other comparisons return the same values as before. + case inverted + /// The sorter is less strict: Comparisons + /// may now return %GTK_ORDERING_EQUAL that did not do so before. + case lessStrict + /// The sorter is more strict: Comparisons + /// that did return %GTK_ORDERING_EQUAL may not do so anymore. + case moreStrict public static var type: GType { - gtk_sorter_change_get_type() -} + gtk_sorter_change_get_type() + } public init(from gtkEnum: GtkSorterChange) { switch gtkEnum { case GTK_SORTER_CHANGE_DIFFERENT: - self = .different -case GTK_SORTER_CHANGE_INVERTED: - self = .inverted -case GTK_SORTER_CHANGE_LESS_STRICT: - self = .lessStrict -case GTK_SORTER_CHANGE_MORE_STRICT: - self = .moreStrict + self = .different + case GTK_SORTER_CHANGE_INVERTED: + self = .inverted + case GTK_SORTER_CHANGE_LESS_STRICT: + self = .lessStrict + case GTK_SORTER_CHANGE_MORE_STRICT: + self = .moreStrict default: fatalError("Unsupported GtkSorterChange enum value: \(gtkEnum.rawValue)") } @@ -41,13 +41,13 @@ case GTK_SORTER_CHANGE_MORE_STRICT: public func toGtk() -> GtkSorterChange { switch self { case .different: - return GTK_SORTER_CHANGE_DIFFERENT -case .inverted: - return GTK_SORTER_CHANGE_INVERTED -case .lessStrict: - return GTK_SORTER_CHANGE_LESS_STRICT -case .moreStrict: - return GTK_SORTER_CHANGE_MORE_STRICT + return GTK_SORTER_CHANGE_DIFFERENT + case .inverted: + return GTK_SORTER_CHANGE_INVERTED + case .lessStrict: + return GTK_SORTER_CHANGE_LESS_STRICT + case .moreStrict: + return GTK_SORTER_CHANGE_MORE_STRICT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/SorterOrder.swift b/Sources/Gtk/Generated/SorterOrder.swift index 4fb6394d40..193596801b 100644 --- a/Sources/Gtk/Generated/SorterOrder.swift +++ b/Sources/Gtk/Generated/SorterOrder.swift @@ -5,27 +5,27 @@ public enum SorterOrder: GValueRepresentableEnum { public typealias GtkEnum = GtkSorterOrder /// A partial order. Any `GtkOrdering` is possible. -case partial -/// No order, all elements are considered equal. -/// gtk_sorter_compare() will only return %GTK_ORDERING_EQUAL. -case none -/// A total order. gtk_sorter_compare() will only -/// return %GTK_ORDERING_EQUAL if an item is compared with itself. Two -/// different items will never cause this value to be returned. -case total + case partial + /// No order, all elements are considered equal. + /// gtk_sorter_compare() will only return %GTK_ORDERING_EQUAL. + case none + /// A total order. gtk_sorter_compare() will only + /// return %GTK_ORDERING_EQUAL if an item is compared with itself. Two + /// different items will never cause this value to be returned. + case total public static var type: GType { - gtk_sorter_order_get_type() -} + gtk_sorter_order_get_type() + } public init(from gtkEnum: GtkSorterOrder) { switch gtkEnum { case GTK_SORTER_ORDER_PARTIAL: - self = .partial -case GTK_SORTER_ORDER_NONE: - self = .none -case GTK_SORTER_ORDER_TOTAL: - self = .total + self = .partial + case GTK_SORTER_ORDER_NONE: + self = .none + case GTK_SORTER_ORDER_TOTAL: + self = .total default: fatalError("Unsupported GtkSorterOrder enum value: \(gtkEnum.rawValue)") } @@ -34,11 +34,11 @@ case GTK_SORTER_ORDER_TOTAL: public func toGtk() -> GtkSorterOrder { switch self { case .partial: - return GTK_SORTER_ORDER_PARTIAL -case .none: - return GTK_SORTER_ORDER_NONE -case .total: - return GTK_SORTER_ORDER_TOTAL + return GTK_SORTER_ORDER_PARTIAL + case .none: + return GTK_SORTER_ORDER_NONE + case .total: + return GTK_SORTER_ORDER_TOTAL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/SpinButtonUpdatePolicy.swift b/Sources/Gtk/Generated/SpinButtonUpdatePolicy.swift index 14e0410ba8..f2064ada87 100644 --- a/Sources/Gtk/Generated/SpinButtonUpdatePolicy.swift +++ b/Sources/Gtk/Generated/SpinButtonUpdatePolicy.swift @@ -2,29 +2,29 @@ import CGtk /// Determines whether the spin button displays values outside the adjustment /// bounds. -/// +/// /// See [method@Gtk.SpinButton.set_update_policy]. public enum SpinButtonUpdatePolicy: GValueRepresentableEnum { public typealias GtkEnum = GtkSpinButtonUpdatePolicy /// When refreshing your `GtkSpinButton`, the value is -/// always displayed -case always -/// When refreshing your `GtkSpinButton`, the value is -/// only displayed if it is valid within the bounds of the spin button's -/// adjustment -case ifValid + /// always displayed + case always + /// When refreshing your `GtkSpinButton`, the value is + /// only displayed if it is valid within the bounds of the spin button's + /// adjustment + case ifValid public static var type: GType { - gtk_spin_button_update_policy_get_type() -} + gtk_spin_button_update_policy_get_type() + } public init(from gtkEnum: GtkSpinButtonUpdatePolicy) { switch gtkEnum { case GTK_UPDATE_ALWAYS: - self = .always -case GTK_UPDATE_IF_VALID: - self = .ifValid + self = .always + case GTK_UPDATE_IF_VALID: + self = .ifValid default: fatalError("Unsupported GtkSpinButtonUpdatePolicy enum value: \(gtkEnum.rawValue)") } @@ -33,9 +33,9 @@ case GTK_UPDATE_IF_VALID: public func toGtk() -> GtkSpinButtonUpdatePolicy { switch self { case .always: - return GTK_UPDATE_ALWAYS -case .ifValid: - return GTK_UPDATE_IF_VALID + return GTK_UPDATE_ALWAYS + case .ifValid: + return GTK_UPDATE_IF_VALID } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/SpinType.swift b/Sources/Gtk/Generated/SpinType.swift index da575388ec..495515dffa 100644 --- a/Sources/Gtk/Generated/SpinType.swift +++ b/Sources/Gtk/Generated/SpinType.swift @@ -6,40 +6,40 @@ public enum SpinType: GValueRepresentableEnum { public typealias GtkEnum = GtkSpinType /// Increment by the adjustments step increment. -case stepForward -/// Decrement by the adjustments step increment. -case stepBackward -/// Increment by the adjustments page increment. -case pageForward -/// Decrement by the adjustments page increment. -case pageBackward -/// Go to the adjustments lower bound. -case home -/// Go to the adjustments upper bound. -case end -/// Change by a specified amount. -case userDefined + case stepForward + /// Decrement by the adjustments step increment. + case stepBackward + /// Increment by the adjustments page increment. + case pageForward + /// Decrement by the adjustments page increment. + case pageBackward + /// Go to the adjustments lower bound. + case home + /// Go to the adjustments upper bound. + case end + /// Change by a specified amount. + case userDefined public static var type: GType { - gtk_spin_type_get_type() -} + gtk_spin_type_get_type() + } public init(from gtkEnum: GtkSpinType) { switch gtkEnum { case GTK_SPIN_STEP_FORWARD: - self = .stepForward -case GTK_SPIN_STEP_BACKWARD: - self = .stepBackward -case GTK_SPIN_PAGE_FORWARD: - self = .pageForward -case GTK_SPIN_PAGE_BACKWARD: - self = .pageBackward -case GTK_SPIN_HOME: - self = .home -case GTK_SPIN_END: - self = .end -case GTK_SPIN_USER_DEFINED: - self = .userDefined + self = .stepForward + case GTK_SPIN_STEP_BACKWARD: + self = .stepBackward + case GTK_SPIN_PAGE_FORWARD: + self = .pageForward + case GTK_SPIN_PAGE_BACKWARD: + self = .pageBackward + case GTK_SPIN_HOME: + self = .home + case GTK_SPIN_END: + self = .end + case GTK_SPIN_USER_DEFINED: + self = .userDefined default: fatalError("Unsupported GtkSpinType enum value: \(gtkEnum.rawValue)") } @@ -48,19 +48,19 @@ case GTK_SPIN_USER_DEFINED: public func toGtk() -> GtkSpinType { switch self { case .stepForward: - return GTK_SPIN_STEP_FORWARD -case .stepBackward: - return GTK_SPIN_STEP_BACKWARD -case .pageForward: - return GTK_SPIN_PAGE_FORWARD -case .pageBackward: - return GTK_SPIN_PAGE_BACKWARD -case .home: - return GTK_SPIN_HOME -case .end: - return GTK_SPIN_END -case .userDefined: - return GTK_SPIN_USER_DEFINED + return GTK_SPIN_STEP_FORWARD + case .stepBackward: + return GTK_SPIN_STEP_BACKWARD + case .pageForward: + return GTK_SPIN_PAGE_FORWARD + case .pageBackward: + return GTK_SPIN_PAGE_BACKWARD + case .home: + return GTK_SPIN_HOME + case .end: + return GTK_SPIN_END + case .userDefined: + return GTK_SPIN_USER_DEFINED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Spinner.swift b/Sources/Gtk/Generated/Spinner.swift index b3394a0ac2..3ba1db393c 100644 --- a/Sources/Gtk/Generated/Spinner.swift +++ b/Sources/Gtk/Generated/Spinner.swift @@ -1,45 +1,46 @@ import CGtk /// Displays an icon-size spinning animation. -/// +/// /// It is often used as an alternative to a [class@Gtk.ProgressBar] /// for displaying indefinite activity, instead of actual progress. -/// +/// /// An example GtkSpinner -/// +/// /// To start the animation, use [method@Gtk.Spinner.start], to stop it /// use [method@Gtk.Spinner.stop]. -/// +/// /// # CSS nodes -/// +/// /// `GtkSpinner` has a single CSS node with the name spinner. /// When the animation is active, the :checked pseudoclass is /// added to this node. open class Spinner: Widget { /// Returns a new spinner widget. Not yet started. -public convenience init() { - self.init( - gtk_spinner_new() - ) -} + public convenience init() { + self.init( + gtk_spinner_new() + ) + } - override func didMoveToParent() { - super.didMoveToParent() + override func didMoveToParent() { + super.didMoveToParent() - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } -addSignal(name: "notify::spinning", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySpinning?(self, param0) -} -} + addSignal(name: "notify::spinning", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySpinning?(self, param0) + } + } /// Whether the spinner is spinning -@GObjectProperty(named: "spinning") public var spinning: Bool + @GObjectProperty(named: "spinning") public var spinning: Bool - -public var notifySpinning: ((Spinner, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifySpinning: ((Spinner, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/StackTransitionType.swift b/Sources/Gtk/Generated/StackTransitionType.swift index 6c06a23b37..670e993e87 100644 --- a/Sources/Gtk/Generated/StackTransitionType.swift +++ b/Sources/Gtk/Generated/StackTransitionType.swift @@ -1,110 +1,110 @@ import CGtk /// Possible transitions between pages in a `GtkStack` widget. -/// +/// /// New values may be added to this enumeration over time. public enum StackTransitionType: GValueRepresentableEnum { public typealias GtkEnum = GtkStackTransitionType /// No transition -case none -/// A cross-fade -case crossfade -/// Slide from left to right -case slideRight -/// Slide from right to left -case slideLeft -/// Slide from bottom up -case slideUp -/// Slide from top down -case slideDown -/// Slide from left or right according to the children order -case slideLeftRight -/// Slide from top down or bottom up according to the order -case slideUpDown -/// Cover the old page by sliding up -case overUp -/// Cover the old page by sliding down -case overDown -/// Cover the old page by sliding to the left -case overLeft -/// Cover the old page by sliding to the right -case overRight -/// Uncover the new page by sliding up -case underUp -/// Uncover the new page by sliding down -case underDown -/// Uncover the new page by sliding to the left -case underLeft -/// Uncover the new page by sliding to the right -case underRight -/// Cover the old page sliding up or uncover the new page sliding down, according to order -case overUpDown -/// Cover the old page sliding down or uncover the new page sliding up, according to order -case overDownUp -/// Cover the old page sliding left or uncover the new page sliding right, according to order -case overLeftRight -/// Cover the old page sliding right or uncover the new page sliding left, according to order -case overRightLeft -/// Pretend the pages are sides of a cube and rotate that cube to the left -case rotateLeft -/// Pretend the pages are sides of a cube and rotate that cube to the right -case rotateRight -/// Pretend the pages are sides of a cube and rotate that cube to the left or right according to the children order -case rotateLeftRight + case none + /// A cross-fade + case crossfade + /// Slide from left to right + case slideRight + /// Slide from right to left + case slideLeft + /// Slide from bottom up + case slideUp + /// Slide from top down + case slideDown + /// Slide from left or right according to the children order + case slideLeftRight + /// Slide from top down or bottom up according to the order + case slideUpDown + /// Cover the old page by sliding up + case overUp + /// Cover the old page by sliding down + case overDown + /// Cover the old page by sliding to the left + case overLeft + /// Cover the old page by sliding to the right + case overRight + /// Uncover the new page by sliding up + case underUp + /// Uncover the new page by sliding down + case underDown + /// Uncover the new page by sliding to the left + case underLeft + /// Uncover the new page by sliding to the right + case underRight + /// Cover the old page sliding up or uncover the new page sliding down, according to order + case overUpDown + /// Cover the old page sliding down or uncover the new page sliding up, according to order + case overDownUp + /// Cover the old page sliding left or uncover the new page sliding right, according to order + case overLeftRight + /// Cover the old page sliding right or uncover the new page sliding left, according to order + case overRightLeft + /// Pretend the pages are sides of a cube and rotate that cube to the left + case rotateLeft + /// Pretend the pages are sides of a cube and rotate that cube to the right + case rotateRight + /// Pretend the pages are sides of a cube and rotate that cube to the left or right according to the children order + case rotateLeftRight public static var type: GType { - gtk_stack_transition_type_get_type() -} + gtk_stack_transition_type_get_type() + } public init(from gtkEnum: GtkStackTransitionType) { switch gtkEnum { case GTK_STACK_TRANSITION_TYPE_NONE: - self = .none -case GTK_STACK_TRANSITION_TYPE_CROSSFADE: - self = .crossfade -case GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT: - self = .slideRight -case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT: - self = .slideLeft -case GTK_STACK_TRANSITION_TYPE_SLIDE_UP: - self = .slideUp -case GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN: - self = .slideDown -case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT: - self = .slideLeftRight -case GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN: - self = .slideUpDown -case GTK_STACK_TRANSITION_TYPE_OVER_UP: - self = .overUp -case GTK_STACK_TRANSITION_TYPE_OVER_DOWN: - self = .overDown -case GTK_STACK_TRANSITION_TYPE_OVER_LEFT: - self = .overLeft -case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT: - self = .overRight -case GTK_STACK_TRANSITION_TYPE_UNDER_UP: - self = .underUp -case GTK_STACK_TRANSITION_TYPE_UNDER_DOWN: - self = .underDown -case GTK_STACK_TRANSITION_TYPE_UNDER_LEFT: - self = .underLeft -case GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT: - self = .underRight -case GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN: - self = .overUpDown -case GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP: - self = .overDownUp -case GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT: - self = .overLeftRight -case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT: - self = .overRightLeft -case GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT: - self = .rotateLeft -case GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT: - self = .rotateRight -case GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT: - self = .rotateLeftRight + self = .none + case GTK_STACK_TRANSITION_TYPE_CROSSFADE: + self = .crossfade + case GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT: + self = .slideRight + case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT: + self = .slideLeft + case GTK_STACK_TRANSITION_TYPE_SLIDE_UP: + self = .slideUp + case GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN: + self = .slideDown + case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT: + self = .slideLeftRight + case GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN: + self = .slideUpDown + case GTK_STACK_TRANSITION_TYPE_OVER_UP: + self = .overUp + case GTK_STACK_TRANSITION_TYPE_OVER_DOWN: + self = .overDown + case GTK_STACK_TRANSITION_TYPE_OVER_LEFT: + self = .overLeft + case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT: + self = .overRight + case GTK_STACK_TRANSITION_TYPE_UNDER_UP: + self = .underUp + case GTK_STACK_TRANSITION_TYPE_UNDER_DOWN: + self = .underDown + case GTK_STACK_TRANSITION_TYPE_UNDER_LEFT: + self = .underLeft + case GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT: + self = .underRight + case GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN: + self = .overUpDown + case GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP: + self = .overDownUp + case GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT: + self = .overLeftRight + case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT: + self = .overRightLeft + case GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT: + self = .rotateLeft + case GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT: + self = .rotateRight + case GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT: + self = .rotateLeftRight default: fatalError("Unsupported GtkStackTransitionType enum value: \(gtkEnum.rawValue)") } @@ -113,51 +113,51 @@ case GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT: public func toGtk() -> GtkStackTransitionType { switch self { case .none: - return GTK_STACK_TRANSITION_TYPE_NONE -case .crossfade: - return GTK_STACK_TRANSITION_TYPE_CROSSFADE -case .slideRight: - return GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT -case .slideLeft: - return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT -case .slideUp: - return GTK_STACK_TRANSITION_TYPE_SLIDE_UP -case .slideDown: - return GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN -case .slideLeftRight: - return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT -case .slideUpDown: - return GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN -case .overUp: - return GTK_STACK_TRANSITION_TYPE_OVER_UP -case .overDown: - return GTK_STACK_TRANSITION_TYPE_OVER_DOWN -case .overLeft: - return GTK_STACK_TRANSITION_TYPE_OVER_LEFT -case .overRight: - return GTK_STACK_TRANSITION_TYPE_OVER_RIGHT -case .underUp: - return GTK_STACK_TRANSITION_TYPE_UNDER_UP -case .underDown: - return GTK_STACK_TRANSITION_TYPE_UNDER_DOWN -case .underLeft: - return GTK_STACK_TRANSITION_TYPE_UNDER_LEFT -case .underRight: - return GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT -case .overUpDown: - return GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN -case .overDownUp: - return GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP -case .overLeftRight: - return GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT -case .overRightLeft: - return GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT -case .rotateLeft: - return GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT -case .rotateRight: - return GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT -case .rotateLeftRight: - return GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT + return GTK_STACK_TRANSITION_TYPE_NONE + case .crossfade: + return GTK_STACK_TRANSITION_TYPE_CROSSFADE + case .slideRight: + return GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT + case .slideLeft: + return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT + case .slideUp: + return GTK_STACK_TRANSITION_TYPE_SLIDE_UP + case .slideDown: + return GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN + case .slideLeftRight: + return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT + case .slideUpDown: + return GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN + case .overUp: + return GTK_STACK_TRANSITION_TYPE_OVER_UP + case .overDown: + return GTK_STACK_TRANSITION_TYPE_OVER_DOWN + case .overLeft: + return GTK_STACK_TRANSITION_TYPE_OVER_LEFT + case .overRight: + return GTK_STACK_TRANSITION_TYPE_OVER_RIGHT + case .underUp: + return GTK_STACK_TRANSITION_TYPE_UNDER_UP + case .underDown: + return GTK_STACK_TRANSITION_TYPE_UNDER_DOWN + case .underLeft: + return GTK_STACK_TRANSITION_TYPE_UNDER_LEFT + case .underRight: + return GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT + case .overUpDown: + return GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN + case .overDownUp: + return GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP + case .overLeftRight: + return GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT + case .overRightLeft: + return GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT + case .rotateLeft: + return GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT + case .rotateRight: + return GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT + case .rotateLeftRight: + return GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/StringFilterMatchMode.swift b/Sources/Gtk/Generated/StringFilterMatchMode.swift index 97dcadcf51..c0b77f93d6 100644 --- a/Sources/Gtk/Generated/StringFilterMatchMode.swift +++ b/Sources/Gtk/Generated/StringFilterMatchMode.swift @@ -5,27 +5,27 @@ public enum StringFilterMatchMode: GValueRepresentableEnum { public typealias GtkEnum = GtkStringFilterMatchMode /// The search string and -/// text must match exactly -case exact -/// The search string -/// must be contained as a substring inside the text -case substring -/// The text must begin -/// with the search string -case prefix + /// text must match exactly + case exact + /// The search string + /// must be contained as a substring inside the text + case substring + /// The text must begin + /// with the search string + case prefix public static var type: GType { - gtk_string_filter_match_mode_get_type() -} + gtk_string_filter_match_mode_get_type() + } public init(from gtkEnum: GtkStringFilterMatchMode) { switch gtkEnum { case GTK_STRING_FILTER_MATCH_MODE_EXACT: - self = .exact -case GTK_STRING_FILTER_MATCH_MODE_SUBSTRING: - self = .substring -case GTK_STRING_FILTER_MATCH_MODE_PREFIX: - self = .prefix + self = .exact + case GTK_STRING_FILTER_MATCH_MODE_SUBSTRING: + self = .substring + case GTK_STRING_FILTER_MATCH_MODE_PREFIX: + self = .prefix default: fatalError("Unsupported GtkStringFilterMatchMode enum value: \(gtkEnum.rawValue)") } @@ -34,11 +34,11 @@ case GTK_STRING_FILTER_MATCH_MODE_PREFIX: public func toGtk() -> GtkStringFilterMatchMode { switch self { case .exact: - return GTK_STRING_FILTER_MATCH_MODE_EXACT -case .substring: - return GTK_STRING_FILTER_MATCH_MODE_SUBSTRING -case .prefix: - return GTK_STRING_FILTER_MATCH_MODE_PREFIX + return GTK_STRING_FILTER_MATCH_MODE_EXACT + case .substring: + return GTK_STRING_FILTER_MATCH_MODE_SUBSTRING + case .prefix: + return GTK_STRING_FILTER_MATCH_MODE_PREFIX } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/StyleProvider.swift b/Sources/Gtk/Generated/StyleProvider.swift index 9318cb5a4b..d5587188a7 100644 --- a/Sources/Gtk/Generated/StyleProvider.swift +++ b/Sources/Gtk/Generated/StyleProvider.swift @@ -1,16 +1,14 @@ import CGtk /// An interface for style information used by [class@Gtk.StyleContext]. -/// +/// /// See [method@Gtk.StyleContext.add_provider] and /// [func@Gtk.StyleContext.add_provider_for_display] for /// adding `GtkStyleProviders`. -/// +/// /// GTK uses the `GtkStyleProvider` implementation for CSS in /// [class@Gtk.CssProvider]. public protocol StyleProvider: GObjectRepresentable { - - -var gtkPrivateChanged: ((Self) -> Void)? { get set } -} \ No newline at end of file + var gtkPrivateChanged: ((Self) -> Void)? { get set } +} diff --git a/Sources/Gtk/Generated/Switch.swift b/Sources/Gtk/Generated/Switch.swift index 00b294198a..e4145d8e1e 100644 --- a/Sources/Gtk/Generated/Switch.swift +++ b/Sources/Gtk/Generated/Switch.swift @@ -1,152 +1,157 @@ import CGtk /// Shows a "light switch" that has two states: on or off. -/// +/// /// An example GtkSwitch -/// +/// /// The user can control which state should be active by clicking the /// empty area, or by dragging the slider. -/// +/// /// `GtkSwitch` can also express situations where the underlying state changes /// with a delay. In this case, the slider position indicates the user's recent /// change (represented by the [property@Gtk.Switch:active] property), while the /// trough color indicates the present underlying state (represented by the /// [property@Gtk.Switch:state] property). -/// +/// /// GtkSwitch with delayed state change -/// +/// /// See [signal@Gtk.Switch::state-set] for details. -/// +/// /// # Shortcuts and Gestures -/// +/// /// `GtkSwitch` supports pan and drag gestures to move the slider. -/// +/// /// # CSS nodes -/// +/// /// ``` /// switch /// ├── image /// ├── image /// ╰── slider /// ``` -/// +/// /// `GtkSwitch` has four css nodes, the main node with the name switch and /// subnodes for the slider and the on and off images. Neither of them is /// using any style classes. -/// +/// /// # Accessibility -/// +/// /// `GtkSwitch` uses the [enum@Gtk.AccessibleRole.switch] role. open class Switch: Widget, Actionable { /// Creates a new `GtkSwitch` widget. -public convenience init() { - self.init( - gtk_switch_new() - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, Bool, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "state-set", handler: gCallback(handler1)) { [weak self] (param0: Bool) in - guard let self = self else { return } - self.stateSet?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_switch_new() + ) } -addSignal(name: "notify::active", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActive?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, Bool, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "state-set", handler: gCallback(handler1)) { [weak self] (param0: Bool) in + guard let self = self else { return } + self.stateSet?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::active", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActive?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::state", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyState?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::action-name", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionName?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::action-target", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionTarget?(self, param0) + } } -addSignal(name: "notify::state", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyState?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::action-name", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionName?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::action-target", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionTarget?(self, param0) -} -} - /// Whether the `GtkSwitch` widget is in its on or off state. -@GObjectProperty(named: "active") public var active: Bool - -/// The backend state that is controlled by the switch. -/// -/// Applications should usually set the [property@Gtk.Switch:active] property, -/// except when indicating a change to the backend state which occurs -/// separately from the user's interaction. -/// -/// See [signal@Gtk.Switch::state-set] for details. -@GObjectProperty(named: "state") public var state: Bool - -/// The name of the action with which this widget should be associated. -@GObjectProperty(named: "action-name") public var actionName: String? - -/// Emitted to animate the switch. -/// -/// Applications should never connect to this signal, -/// but use the [property@Gtk.Switch:active] property. -public var activate: ((Switch) -> Void)? - -/// Emitted to change the underlying state. -/// -/// The ::state-set signal is emitted when the user changes the switch -/// position. The default handler calls [method@Gtk.Switch.set_state] with the -/// value of @state. -/// -/// To implement delayed state change, applications can connect to this -/// signal, initiate the change of the underlying state, and call -/// [method@Gtk.Switch.set_state] when the underlying state change is -/// complete. The signal handler should return %TRUE to prevent the -/// default handler from running. -public var stateSet: ((Switch, Bool) -> Void)? - - -public var notifyActive: ((Switch, OpaquePointer) -> Void)? - - -public var notifyState: ((Switch, OpaquePointer) -> Void)? - - -public var notifyActionName: ((Switch, OpaquePointer) -> Void)? - - -public var notifyActionTarget: ((Switch, OpaquePointer) -> Void)? -} \ No newline at end of file + @GObjectProperty(named: "active") public var active: Bool + + /// The backend state that is controlled by the switch. + /// + /// Applications should usually set the [property@Gtk.Switch:active] property, + /// except when indicating a change to the backend state which occurs + /// separately from the user's interaction. + /// + /// See [signal@Gtk.Switch::state-set] for details. + @GObjectProperty(named: "state") public var state: Bool + + /// The name of the action with which this widget should be associated. + @GObjectProperty(named: "action-name") public var actionName: String? + + /// Emitted to animate the switch. + /// + /// Applications should never connect to this signal, + /// but use the [property@Gtk.Switch:active] property. + public var activate: ((Switch) -> Void)? + + /// Emitted to change the underlying state. + /// + /// The ::state-set signal is emitted when the user changes the switch + /// position. The default handler calls [method@Gtk.Switch.set_state] with the + /// value of @state. + /// + /// To implement delayed state change, applications can connect to this + /// signal, initiate the change of the underlying state, and call + /// [method@Gtk.Switch.set_state] when the underlying state change is + /// complete. The signal handler should return %TRUE to prevent the + /// default handler from running. + public var stateSet: ((Switch, Bool) -> Void)? + + public var notifyActive: ((Switch, OpaquePointer) -> Void)? + + public var notifyState: ((Switch, OpaquePointer) -> Void)? + + public var notifyActionName: ((Switch, OpaquePointer) -> Void)? + + public var notifyActionTarget: ((Switch, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/SystemSetting.swift b/Sources/Gtk/Generated/SystemSetting.swift index 69a3b88a13..ca7b9b4d36 100644 --- a/Sources/Gtk/Generated/SystemSetting.swift +++ b/Sources/Gtk/Generated/SystemSetting.swift @@ -2,50 +2,50 @@ import CGtk /// Values that can be passed to the [vfunc@Gtk.Widget.system_setting_changed] /// vfunc. -/// +/// /// The values indicate which system setting has changed. /// Widgets may need to drop caches, or react otherwise. -/// +/// /// Most of the values correspond to [class@Settings] properties. -/// +/// /// More values may be added over time. public enum SystemSetting: GValueRepresentableEnum { public typealias GtkEnum = GtkSystemSetting /// The [property@Gtk.Settings:gtk-xft-dpi] setting has changed -case dpi -/// The [property@Gtk.Settings:gtk-font-name] setting has changed -case fontName -/// The font configuration has changed in a way that -/// requires text to be redrawn. This can be any of the -/// [property@Gtk.Settings:gtk-xft-antialias], -/// [property@Gtk.Settings:gtk-xft-hinting], -/// [property@Gtk.Settings:gtk-xft-hintstyle], -/// [property@Gtk.Settings:gtk-xft-rgba] or -/// [property@Gtk.Settings:gtk-fontconfig-timestamp] settings -case fontConfig -/// The display has changed -case display -/// The icon theme has changed in a way that requires -/// icons to be looked up again -case iconTheme + case dpi + /// The [property@Gtk.Settings:gtk-font-name] setting has changed + case fontName + /// The font configuration has changed in a way that + /// requires text to be redrawn. This can be any of the + /// [property@Gtk.Settings:gtk-xft-antialias], + /// [property@Gtk.Settings:gtk-xft-hinting], + /// [property@Gtk.Settings:gtk-xft-hintstyle], + /// [property@Gtk.Settings:gtk-xft-rgba] or + /// [property@Gtk.Settings:gtk-fontconfig-timestamp] settings + case fontConfig + /// The display has changed + case display + /// The icon theme has changed in a way that requires + /// icons to be looked up again + case iconTheme public static var type: GType { - gtk_system_setting_get_type() -} + gtk_system_setting_get_type() + } public init(from gtkEnum: GtkSystemSetting) { switch gtkEnum { case GTK_SYSTEM_SETTING_DPI: - self = .dpi -case GTK_SYSTEM_SETTING_FONT_NAME: - self = .fontName -case GTK_SYSTEM_SETTING_FONT_CONFIG: - self = .fontConfig -case GTK_SYSTEM_SETTING_DISPLAY: - self = .display -case GTK_SYSTEM_SETTING_ICON_THEME: - self = .iconTheme + self = .dpi + case GTK_SYSTEM_SETTING_FONT_NAME: + self = .fontName + case GTK_SYSTEM_SETTING_FONT_CONFIG: + self = .fontConfig + case GTK_SYSTEM_SETTING_DISPLAY: + self = .display + case GTK_SYSTEM_SETTING_ICON_THEME: + self = .iconTheme default: fatalError("Unsupported GtkSystemSetting enum value: \(gtkEnum.rawValue)") } @@ -54,15 +54,15 @@ case GTK_SYSTEM_SETTING_ICON_THEME: public func toGtk() -> GtkSystemSetting { switch self { case .dpi: - return GTK_SYSTEM_SETTING_DPI -case .fontName: - return GTK_SYSTEM_SETTING_FONT_NAME -case .fontConfig: - return GTK_SYSTEM_SETTING_FONT_CONFIG -case .display: - return GTK_SYSTEM_SETTING_DISPLAY -case .iconTheme: - return GTK_SYSTEM_SETTING_ICON_THEME + return GTK_SYSTEM_SETTING_DPI + case .fontName: + return GTK_SYSTEM_SETTING_FONT_NAME + case .fontConfig: + return GTK_SYSTEM_SETTING_FONT_CONFIG + case .display: + return GTK_SYSTEM_SETTING_DISPLAY + case .iconTheme: + return GTK_SYSTEM_SETTING_ICON_THEME } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/TextDirection.swift b/Sources/Gtk/Generated/TextDirection.swift index 8c3b951114..1ab684b607 100644 --- a/Sources/Gtk/Generated/TextDirection.swift +++ b/Sources/Gtk/Generated/TextDirection.swift @@ -5,24 +5,24 @@ public enum TextDirection: GValueRepresentableEnum { public typealias GtkEnum = GtkTextDirection /// No direction. -case none -/// Left to right text direction. -case ltr -/// Right to left text direction. -case rtl + case none + /// Left to right text direction. + case ltr + /// Right to left text direction. + case rtl public static var type: GType { - gtk_text_direction_get_type() -} + gtk_text_direction_get_type() + } public init(from gtkEnum: GtkTextDirection) { switch gtkEnum { case GTK_TEXT_DIR_NONE: - self = .none -case GTK_TEXT_DIR_LTR: - self = .ltr -case GTK_TEXT_DIR_RTL: - self = .rtl + self = .none + case GTK_TEXT_DIR_LTR: + self = .ltr + case GTK_TEXT_DIR_RTL: + self = .rtl default: fatalError("Unsupported GtkTextDirection enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ case GTK_TEXT_DIR_RTL: public func toGtk() -> GtkTextDirection { switch self { case .none: - return GTK_TEXT_DIR_NONE -case .ltr: - return GTK_TEXT_DIR_LTR -case .rtl: - return GTK_TEXT_DIR_RTL + return GTK_TEXT_DIR_NONE + case .ltr: + return GTK_TEXT_DIR_LTR + case .rtl: + return GTK_TEXT_DIR_RTL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/TextExtendSelection.swift b/Sources/Gtk/Generated/TextExtendSelection.swift index 9883a0b27e..c83f57ecec 100644 --- a/Sources/Gtk/Generated/TextExtendSelection.swift +++ b/Sources/Gtk/Generated/TextExtendSelection.swift @@ -6,22 +6,22 @@ public enum TextExtendSelection: GValueRepresentableEnum { public typealias GtkEnum = GtkTextExtendSelection /// Selects the current word. It is triggered by -/// a double-click for example. -case word -/// Selects the current line. It is triggered by -/// a triple-click for example. -case line + /// a double-click for example. + case word + /// Selects the current line. It is triggered by + /// a triple-click for example. + case line public static var type: GType { - gtk_text_extend_selection_get_type() -} + gtk_text_extend_selection_get_type() + } public init(from gtkEnum: GtkTextExtendSelection) { switch gtkEnum { case GTK_TEXT_EXTEND_SELECTION_WORD: - self = .word -case GTK_TEXT_EXTEND_SELECTION_LINE: - self = .line + self = .word + case GTK_TEXT_EXTEND_SELECTION_LINE: + self = .line default: fatalError("Unsupported GtkTextExtendSelection enum value: \(gtkEnum.rawValue)") } @@ -30,9 +30,9 @@ case GTK_TEXT_EXTEND_SELECTION_LINE: public func toGtk() -> GtkTextExtendSelection { switch self { case .word: - return GTK_TEXT_EXTEND_SELECTION_WORD -case .line: - return GTK_TEXT_EXTEND_SELECTION_LINE + return GTK_TEXT_EXTEND_SELECTION_WORD + case .line: + return GTK_TEXT_EXTEND_SELECTION_LINE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/TextViewLayer.swift b/Sources/Gtk/Generated/TextViewLayer.swift index ee137729f9..bd391ea8bd 100644 --- a/Sources/Gtk/Generated/TextViewLayer.swift +++ b/Sources/Gtk/Generated/TextViewLayer.swift @@ -6,20 +6,20 @@ public enum TextViewLayer: GValueRepresentableEnum { public typealias GtkEnum = GtkTextViewLayer /// The layer rendered below the text (but above the background). -case belowText -/// The layer rendered above the text. -case aboveText + case belowText + /// The layer rendered above the text. + case aboveText public static var type: GType { - gtk_text_view_layer_get_type() -} + gtk_text_view_layer_get_type() + } public init(from gtkEnum: GtkTextViewLayer) { switch gtkEnum { case GTK_TEXT_VIEW_LAYER_BELOW_TEXT: - self = .belowText -case GTK_TEXT_VIEW_LAYER_ABOVE_TEXT: - self = .aboveText + self = .belowText + case GTK_TEXT_VIEW_LAYER_ABOVE_TEXT: + self = .aboveText default: fatalError("Unsupported GtkTextViewLayer enum value: \(gtkEnum.rawValue)") } @@ -28,9 +28,9 @@ case GTK_TEXT_VIEW_LAYER_ABOVE_TEXT: public func toGtk() -> GtkTextViewLayer { switch self { case .belowText: - return GTK_TEXT_VIEW_LAYER_BELOW_TEXT -case .aboveText: - return GTK_TEXT_VIEW_LAYER_ABOVE_TEXT + return GTK_TEXT_VIEW_LAYER_BELOW_TEXT + case .aboveText: + return GTK_TEXT_VIEW_LAYER_ABOVE_TEXT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/TextWindowType.swift b/Sources/Gtk/Generated/TextWindowType.swift index 96fbb93dfa..2457d73e97 100644 --- a/Sources/Gtk/Generated/TextWindowType.swift +++ b/Sources/Gtk/Generated/TextWindowType.swift @@ -5,36 +5,36 @@ public enum TextWindowType: GValueRepresentableEnum { public typealias GtkEnum = GtkTextWindowType /// Window that floats over scrolling areas. -case widget -/// Scrollable text window. -case text -/// Left side border window. -case left -/// Right side border window. -case right -/// Top border window. -case top -/// Bottom border window. -case bottom + case widget + /// Scrollable text window. + case text + /// Left side border window. + case left + /// Right side border window. + case right + /// Top border window. + case top + /// Bottom border window. + case bottom public static var type: GType { - gtk_text_window_type_get_type() -} + gtk_text_window_type_get_type() + } public init(from gtkEnum: GtkTextWindowType) { switch gtkEnum { case GTK_TEXT_WINDOW_WIDGET: - self = .widget -case GTK_TEXT_WINDOW_TEXT: - self = .text -case GTK_TEXT_WINDOW_LEFT: - self = .left -case GTK_TEXT_WINDOW_RIGHT: - self = .right -case GTK_TEXT_WINDOW_TOP: - self = .top -case GTK_TEXT_WINDOW_BOTTOM: - self = .bottom + self = .widget + case GTK_TEXT_WINDOW_TEXT: + self = .text + case GTK_TEXT_WINDOW_LEFT: + self = .left + case GTK_TEXT_WINDOW_RIGHT: + self = .right + case GTK_TEXT_WINDOW_TOP: + self = .top + case GTK_TEXT_WINDOW_BOTTOM: + self = .bottom default: fatalError("Unsupported GtkTextWindowType enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ case GTK_TEXT_WINDOW_BOTTOM: public func toGtk() -> GtkTextWindowType { switch self { case .widget: - return GTK_TEXT_WINDOW_WIDGET -case .text: - return GTK_TEXT_WINDOW_TEXT -case .left: - return GTK_TEXT_WINDOW_LEFT -case .right: - return GTK_TEXT_WINDOW_RIGHT -case .top: - return GTK_TEXT_WINDOW_TOP -case .bottom: - return GTK_TEXT_WINDOW_BOTTOM + return GTK_TEXT_WINDOW_WIDGET + case .text: + return GTK_TEXT_WINDOW_TEXT + case .left: + return GTK_TEXT_WINDOW_LEFT + case .right: + return GTK_TEXT_WINDOW_RIGHT + case .top: + return GTK_TEXT_WINDOW_TOP + case .bottom: + return GTK_TEXT_WINDOW_BOTTOM } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/TreeDragDest.swift b/Sources/Gtk/Generated/TreeDragDest.swift index f7da7eae8f..c10b696543 100644 --- a/Sources/Gtk/Generated/TreeDragDest.swift +++ b/Sources/Gtk/Generated/TreeDragDest.swift @@ -2,7 +2,5 @@ import CGtk /// Interface for Drag-and-Drop destinations in `GtkTreeView`. public protocol TreeDragDest: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/TreeDragSource.swift b/Sources/Gtk/Generated/TreeDragSource.swift index 4176d40441..6541757be8 100644 --- a/Sources/Gtk/Generated/TreeDragSource.swift +++ b/Sources/Gtk/Generated/TreeDragSource.swift @@ -2,7 +2,5 @@ import CGtk /// Interface for Drag-and-Drop destinations in `GtkTreeView`. public protocol TreeDragSource: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/TreeSortable.swift b/Sources/Gtk/Generated/TreeSortable.swift index 3f202bafd4..289b07112c 100644 --- a/Sources/Gtk/Generated/TreeSortable.swift +++ b/Sources/Gtk/Generated/TreeSortable.swift @@ -1,15 +1,14 @@ import CGtk /// The interface for sortable models used by GtkTreeView -/// +/// /// `GtkTreeSortable` is an interface to be implemented by tree models which /// support sorting. The `GtkTreeView` uses the methods provided by this interface /// to sort the model. public protocol TreeSortable: GObjectRepresentable { - /// The ::sort-column-changed signal is emitted when the sort column -/// or sort order of @sortable is changed. The signal is emitted before -/// the contents of @sortable are resorted. -var sortColumnChanged: ((Self) -> Void)? { get set } -} \ No newline at end of file + /// or sort order of @sortable is changed. The signal is emitted before + /// the contents of @sortable are resorted. + var sortColumnChanged: ((Self) -> Void)? { get set } +} diff --git a/Sources/Gtk/Generated/TreeViewColumnSizing.swift b/Sources/Gtk/Generated/TreeViewColumnSizing.swift index 325e951105..05b581761f 100644 --- a/Sources/Gtk/Generated/TreeViewColumnSizing.swift +++ b/Sources/Gtk/Generated/TreeViewColumnSizing.swift @@ -7,24 +7,24 @@ public enum TreeViewColumnSizing: GValueRepresentableEnum { public typealias GtkEnum = GtkTreeViewColumnSizing /// Columns only get bigger in reaction to changes in the model -case growOnly -/// Columns resize to be the optimal size every time the model changes. -case autosize -/// Columns are a fixed numbers of pixels wide. -case fixed + case growOnly + /// Columns resize to be the optimal size every time the model changes. + case autosize + /// Columns are a fixed numbers of pixels wide. + case fixed public static var type: GType { - gtk_tree_view_column_sizing_get_type() -} + gtk_tree_view_column_sizing_get_type() + } public init(from gtkEnum: GtkTreeViewColumnSizing) { switch gtkEnum { case GTK_TREE_VIEW_COLUMN_GROW_ONLY: - self = .growOnly -case GTK_TREE_VIEW_COLUMN_AUTOSIZE: - self = .autosize -case GTK_TREE_VIEW_COLUMN_FIXED: - self = .fixed + self = .growOnly + case GTK_TREE_VIEW_COLUMN_AUTOSIZE: + self = .autosize + case GTK_TREE_VIEW_COLUMN_FIXED: + self = .fixed default: fatalError("Unsupported GtkTreeViewColumnSizing enum value: \(gtkEnum.rawValue)") } @@ -33,11 +33,11 @@ case GTK_TREE_VIEW_COLUMN_FIXED: public func toGtk() -> GtkTreeViewColumnSizing { switch self { case .growOnly: - return GTK_TREE_VIEW_COLUMN_GROW_ONLY -case .autosize: - return GTK_TREE_VIEW_COLUMN_AUTOSIZE -case .fixed: - return GTK_TREE_VIEW_COLUMN_FIXED + return GTK_TREE_VIEW_COLUMN_GROW_ONLY + case .autosize: + return GTK_TREE_VIEW_COLUMN_AUTOSIZE + case .fixed: + return GTK_TREE_VIEW_COLUMN_FIXED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/TreeViewDropPosition.swift b/Sources/Gtk/Generated/TreeViewDropPosition.swift index 24b116d9ae..d86aa2ce20 100644 --- a/Sources/Gtk/Generated/TreeViewDropPosition.swift +++ b/Sources/Gtk/Generated/TreeViewDropPosition.swift @@ -5,28 +5,28 @@ public enum TreeViewDropPosition: GValueRepresentableEnum { public typealias GtkEnum = GtkTreeViewDropPosition /// Dropped row is inserted before -case before -/// Dropped row is inserted after -case after -/// Dropped row becomes a child or is inserted before -case intoOrBefore -/// Dropped row becomes a child or is inserted after -case intoOrAfter + case before + /// Dropped row is inserted after + case after + /// Dropped row becomes a child or is inserted before + case intoOrBefore + /// Dropped row becomes a child or is inserted after + case intoOrAfter public static var type: GType { - gtk_tree_view_drop_position_get_type() -} + gtk_tree_view_drop_position_get_type() + } public init(from gtkEnum: GtkTreeViewDropPosition) { switch gtkEnum { case GTK_TREE_VIEW_DROP_BEFORE: - self = .before -case GTK_TREE_VIEW_DROP_AFTER: - self = .after -case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: - self = .intoOrBefore -case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: - self = .intoOrAfter + self = .before + case GTK_TREE_VIEW_DROP_AFTER: + self = .after + case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: + self = .intoOrBefore + case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: + self = .intoOrAfter default: fatalError("Unsupported GtkTreeViewDropPosition enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: public func toGtk() -> GtkTreeViewDropPosition { switch self { case .before: - return GTK_TREE_VIEW_DROP_BEFORE -case .after: - return GTK_TREE_VIEW_DROP_AFTER -case .intoOrBefore: - return GTK_TREE_VIEW_DROP_INTO_OR_BEFORE -case .intoOrAfter: - return GTK_TREE_VIEW_DROP_INTO_OR_AFTER + return GTK_TREE_VIEW_DROP_BEFORE + case .after: + return GTK_TREE_VIEW_DROP_AFTER + case .intoOrBefore: + return GTK_TREE_VIEW_DROP_INTO_OR_BEFORE + case .intoOrAfter: + return GTK_TREE_VIEW_DROP_INTO_OR_AFTER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/TreeViewGridLines.swift b/Sources/Gtk/Generated/TreeViewGridLines.swift index e6a64dee59..7c03e8ce3e 100644 --- a/Sources/Gtk/Generated/TreeViewGridLines.swift +++ b/Sources/Gtk/Generated/TreeViewGridLines.swift @@ -5,28 +5,28 @@ public enum TreeViewGridLines: GValueRepresentableEnum { public typealias GtkEnum = GtkTreeViewGridLines /// No grid lines. -case none -/// Horizontal grid lines. -case horizontal -/// Vertical grid lines. -case vertical -/// Horizontal and vertical grid lines. -case both + case none + /// Horizontal grid lines. + case horizontal + /// Vertical grid lines. + case vertical + /// Horizontal and vertical grid lines. + case both public static var type: GType { - gtk_tree_view_grid_lines_get_type() -} + gtk_tree_view_grid_lines_get_type() + } public init(from gtkEnum: GtkTreeViewGridLines) { switch gtkEnum { case GTK_TREE_VIEW_GRID_LINES_NONE: - self = .none -case GTK_TREE_VIEW_GRID_LINES_HORIZONTAL: - self = .horizontal -case GTK_TREE_VIEW_GRID_LINES_VERTICAL: - self = .vertical -case GTK_TREE_VIEW_GRID_LINES_BOTH: - self = .both + self = .none + case GTK_TREE_VIEW_GRID_LINES_HORIZONTAL: + self = .horizontal + case GTK_TREE_VIEW_GRID_LINES_VERTICAL: + self = .vertical + case GTK_TREE_VIEW_GRID_LINES_BOTH: + self = .both default: fatalError("Unsupported GtkTreeViewGridLines enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_TREE_VIEW_GRID_LINES_BOTH: public func toGtk() -> GtkTreeViewGridLines { switch self { case .none: - return GTK_TREE_VIEW_GRID_LINES_NONE -case .horizontal: - return GTK_TREE_VIEW_GRID_LINES_HORIZONTAL -case .vertical: - return GTK_TREE_VIEW_GRID_LINES_VERTICAL -case .both: - return GTK_TREE_VIEW_GRID_LINES_BOTH + return GTK_TREE_VIEW_GRID_LINES_NONE + case .horizontal: + return GTK_TREE_VIEW_GRID_LINES_HORIZONTAL + case .vertical: + return GTK_TREE_VIEW_GRID_LINES_VERTICAL + case .both: + return GTK_TREE_VIEW_GRID_LINES_BOTH } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Unit.swift b/Sources/Gtk/Generated/Unit.swift index 4d301c3f0f..f67046e8f4 100644 --- a/Sources/Gtk/Generated/Unit.swift +++ b/Sources/Gtk/Generated/Unit.swift @@ -5,28 +5,28 @@ public enum Unit: GValueRepresentableEnum { public typealias GtkEnum = GtkUnit /// No units. -case none -/// Dimensions in points. -case points -/// Dimensions in inches. -case inch -/// Dimensions in millimeters -case mm + case none + /// Dimensions in points. + case points + /// Dimensions in inches. + case inch + /// Dimensions in millimeters + case mm public static var type: GType { - gtk_unit_get_type() -} + gtk_unit_get_type() + } public init(from gtkEnum: GtkUnit) { switch gtkEnum { case GTK_UNIT_NONE: - self = .none -case GTK_UNIT_POINTS: - self = .points -case GTK_UNIT_INCH: - self = .inch -case GTK_UNIT_MM: - self = .mm + self = .none + case GTK_UNIT_POINTS: + self = .points + case GTK_UNIT_INCH: + self = .inch + case GTK_UNIT_MM: + self = .mm default: fatalError("Unsupported GtkUnit enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_UNIT_MM: public func toGtk() -> GtkUnit { switch self { case .none: - return GTK_UNIT_NONE -case .points: - return GTK_UNIT_POINTS -case .inch: - return GTK_UNIT_INCH -case .mm: - return GTK_UNIT_MM + return GTK_UNIT_NONE + case .points: + return GTK_UNIT_POINTS + case .inch: + return GTK_UNIT_INCH + case .mm: + return GTK_UNIT_MM } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/WrapMode.swift b/Sources/Gtk/Generated/WrapMode.swift index 130400c5f3..2c48a3a945 100644 --- a/Sources/Gtk/Generated/WrapMode.swift +++ b/Sources/Gtk/Generated/WrapMode.swift @@ -5,31 +5,31 @@ public enum WrapMode: GValueRepresentableEnum { public typealias GtkEnum = GtkWrapMode /// Do not wrap lines; just make the text area wider -case none -/// Wrap text, breaking lines anywhere the cursor can -/// appear (between characters, usually - if you want to be technical, -/// between graphemes, see pango_get_log_attrs()) -case character -/// Wrap text, breaking lines in between words -case word -/// Wrap text, breaking lines in between words, or if -/// that is not enough, also between graphemes -case wordCharacter + case none + /// Wrap text, breaking lines anywhere the cursor can + /// appear (between characters, usually - if you want to be technical, + /// between graphemes, see pango_get_log_attrs()) + case character + /// Wrap text, breaking lines in between words + case word + /// Wrap text, breaking lines in between words, or if + /// that is not enough, also between graphemes + case wordCharacter public static var type: GType { - gtk_wrap_mode_get_type() -} + gtk_wrap_mode_get_type() + } public init(from gtkEnum: GtkWrapMode) { switch gtkEnum { case GTK_WRAP_NONE: - self = .none -case GTK_WRAP_CHAR: - self = .character -case GTK_WRAP_WORD: - self = .word -case GTK_WRAP_WORD_CHAR: - self = .wordCharacter + self = .none + case GTK_WRAP_CHAR: + self = .character + case GTK_WRAP_WORD: + self = .word + case GTK_WRAP_WORD_CHAR: + self = .wordCharacter default: fatalError("Unsupported GtkWrapMode enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ case GTK_WRAP_WORD_CHAR: public func toGtk() -> GtkWrapMode { switch self { case .none: - return GTK_WRAP_NONE -case .character: - return GTK_WRAP_CHAR -case .word: - return GTK_WRAP_WORD -case .wordCharacter: - return GTK_WRAP_WORD_CHAR + return GTK_WRAP_NONE + case .character: + return GTK_WRAP_CHAR + case .word: + return GTK_WRAP_WORD + case .wordCharacter: + return GTK_WRAP_WORD_CHAR } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Widgets/DrawingArea+ManualAdditions.swift b/Sources/Gtk/Widgets/DrawingArea+ManualAdditions.swift index 154b33366f..88a0d78563 100644 --- a/Sources/Gtk/Widgets/DrawingArea+ManualAdditions.swift +++ b/Sources/Gtk/Widgets/DrawingArea+ManualAdditions.swift @@ -2,11 +2,12 @@ import CGtk extension DrawingArea { public func setDrawFunc( - _ drawFunc: @escaping ( - _ cairo: OpaquePointer, - _ width: Int, - _ height: Int - ) -> Void + _ drawFunc: + @escaping ( + _ cairo: OpaquePointer, + _ width: Int, + _ height: Int + ) -> Void ) { let box = SignalBox3 { cairo, width, height in drawFunc(cairo, width, height) diff --git a/Sources/GtkBackend/GtkBackend.swift b/Sources/GtkBackend/GtkBackend.swift index 6d3498318b..5bc07226c1 100644 --- a/Sources/GtkBackend/GtkBackend.swift +++ b/Sources/GtkBackend/GtkBackend.swift @@ -1284,16 +1284,20 @@ public final class GtkBackend: AppBackend { } } } - + public func createHoverTarget(wrapping child: Widget) -> Widget { child.addEventController(EventControllerMotion()) return child } - - public func updateHoverTarget(_ hoverTarget: Widget, - environment: EnvironmentValues, - action: @escaping (Bool) -> Void) { - let gesture = hoverTarget.eventControllers.first { $0 is EventControllerMotion } as! EventControllerMotion + + public func updateHoverTarget( + _ hoverTarget: Widget, + environment: EnvironmentValues, + action: @escaping (Bool) -> Void + ) { + let gesture = + hoverTarget.eventControllers.first { $0 is EventControllerMotion } + as! EventControllerMotion gesture.enter = { _, _, _ in guard environment.isEnabled else { return } action(true) diff --git a/Sources/GtkCodeGen/GtkCodeGen.swift b/Sources/GtkCodeGen/GtkCodeGen.swift index a2b96888fb..13db5e4fc2 100644 --- a/Sources/GtkCodeGen/GtkCodeGen.swift +++ b/Sources/GtkCodeGen/GtkCodeGen.swift @@ -113,7 +113,9 @@ struct GtkCodeGen { "CheckButton", ] let gtk3AllowListedClasses = ["MenuShell", "EventBox"] - let gtk4AllowListedClasses = ["Picture", "DropDown", "Popover", "ListBox", "EventControllerMotion"] + let gtk4AllowListedClasses = [ + "Picture", "DropDown", "Popover", "ListBox", "EventControllerMotion", + ] for class_ in gir.namespace.classes { guard allowListedClasses.contains(class_.name) diff --git a/Sources/SwiftCrossUI/Backend/AppBackend.swift b/Sources/SwiftCrossUI/Backend/AppBackend.swift index 3c6a8f8161..31a412cf2f 100644 --- a/Sources/SwiftCrossUI/Backend/AppBackend.swift +++ b/Sources/SwiftCrossUI/Backend/AppBackend.swift @@ -639,7 +639,7 @@ public protocol AppBackend: Sendable { environment: EnvironmentValues, action: @escaping () -> Void ) - + /// Wraps a view in a container that can receive mouse hover events. Some /// backends may not have to wrap the child, in which case they may /// just return the child as is. @@ -726,49 +726,49 @@ extension AppBackend { print("\(type(of: self)): \(function) not implemented") Foundation.exit(1) } - + // MARK: System - + public func openExternalURL(_ url: URL) throws { todo() } - + public func revealFile(_ url: URL) throws { todo() } - + // MARK: Application - + public func setApplicationMenu(_ submenus: [ResolvedMenu.Submenu]) { todo() } - + public func setIncomingURLHandler(to action: @escaping (URL) -> Void) { todo() } - + // MARK: Containers - + public func createColorableRectangle() -> Widget { todo() } - + public func setColor(ofColorableRectangle widget: Widget, to color: Color) { todo() } - + public func setCornerRadius(of widget: Widget, to radius: Int) { todo() } - + public func createScrollContainer(for child: Widget) -> Widget { todo() } - + public func updateScrollContainer(_ scrollView: Widget, environment: EnvironmentValues) { todo() } - + public func setScrollBarPresence( ofScrollContainer scrollView: Widget, hasVerticalScrollBar: Bool, @@ -776,19 +776,19 @@ extension AppBackend { ) { todo() } - + public func createSelectableListView() -> Widget { todo() } - + public func baseItemPadding(ofSelectableListView listView: Widget) -> EdgeInsets { todo() } - + public func minimumRowSize(ofSelectableListView listView: Widget) -> SIMD2 { todo() } - + public func setItems( ofSelectableListView listView: Widget, to items: [Widget], @@ -796,33 +796,33 @@ extension AppBackend { ) { todo() } - + public func setSelectionHandler( forSelectableListView listView: Widget, to action: @escaping (_ selectedIndex: Int) -> Void ) { todo() } - + public func setSelectedItem(ofSelectableListView listView: Widget, toItemAt index: Int?) { todo() } - + public func createSplitView(leadingChild: Widget, trailingChild: Widget) -> Widget { todo() } - + public func setResizeHandler( ofSplitView splitView: Widget, to action: @escaping () -> Void ) { todo() } - + public func sidebarWidth(ofSplitView splitView: Widget) -> Int { todo() } - + public func setSidebarWidthBounds( ofSplitView splitView: Widget, minimum minimumWidth: Int, @@ -830,9 +830,9 @@ extension AppBackend { ) { todo() } - + // MARK: Passive views - + public func size( of text: String, whenDisplayedIn widget: Widget, @@ -841,7 +841,7 @@ extension AppBackend { ) -> SIMD2 { todo() } - + public func createTextView(content: String, shouldWrap: Bool) -> Widget { todo() } @@ -852,11 +852,11 @@ extension AppBackend { ) { todo() } - + public func createImageView() -> Widget { todo() } - + public func updateImageView( _ imageView: Widget, rgbaData: [UInt8], @@ -869,7 +869,7 @@ extension AppBackend { ) { todo() } - + public func createTable() -> Widget { todo() } @@ -890,9 +890,9 @@ extension AppBackend { ) { todo() } - + // MARK: Controls - + public func createButton() -> Widget { todo() } @@ -912,7 +912,7 @@ extension AppBackend { ) { todo() } - + public func createToggle() -> Widget { todo() } @@ -927,7 +927,7 @@ extension AppBackend { public func setState(ofToggle toggle: Widget, to state: Bool) { todo() } - + public func createSwitch() -> Widget { todo() } @@ -941,7 +941,7 @@ extension AppBackend { public func setState(ofSwitch switchWidget: Widget, to state: Bool) { todo() } - + public func createCheckbox() -> Widget { todo() } @@ -955,7 +955,7 @@ extension AppBackend { public func setState(ofCheckbox checkboxWidget: Widget, to state: Bool) { todo() } - + public func createSlider() -> Widget { todo() } @@ -972,7 +972,7 @@ extension AppBackend { public func setValue(ofSlider slider: Widget, to value: Double) { todo() } - + public func createTextField() -> Widget { todo() } @@ -991,7 +991,7 @@ extension AppBackend { public func getContent(ofTextField textField: Widget) -> String { todo() } - + public func createTextEditor() -> Widget { todo() } @@ -1008,7 +1008,7 @@ extension AppBackend { public func getContent(ofTextEditor textEditor: Widget) -> String { todo() } - + public func createPicker() -> Widget { todo() } @@ -1023,11 +1023,11 @@ extension AppBackend { public func setSelectedOption(ofPicker picker: Widget, to selectedOption: Int?) { todo() } - + public func createProgressSpinner() -> Widget { todo() } - + public func createProgressBar() -> Widget { todo() } @@ -1038,7 +1038,7 @@ extension AppBackend { ) { todo() } - + public func createPopoverMenu() -> Menu { todo() } @@ -1057,7 +1057,7 @@ extension AppBackend { ) { todo() } - + public func createAlert() -> Alert { todo() } @@ -1079,7 +1079,7 @@ extension AppBackend { public func dismissAlert(_ alert: Alert, window: Window?) { todo() } - + public func showOpenDialog( fileDialogOptions: FileDialogOptions, openDialogOptions: OpenDialogOptions, @@ -1096,7 +1096,7 @@ extension AppBackend { ) { todo() } - + public func createTapGestureTarget(wrapping child: Widget, gesture: TapGesture) -> Widget { todo() } @@ -1108,7 +1108,7 @@ extension AppBackend { ) { todo() } - + // MARK: Paths public func createPathWidget() -> Widget { todo() @@ -1134,7 +1134,7 @@ extension AppBackend { ) { todo() } - + public func createWebView() -> Widget { todo() } @@ -1151,8 +1151,7 @@ extension AppBackend { ) { todo() } - - + public func createHoverTarget(wrapping child: Widget) -> Widget { todo() } diff --git a/Sources/SwiftCrossUI/Views/EitherView.swift b/Sources/SwiftCrossUI/Views/EitherView.swift index 9b809f8341..fac32056ff 100644 --- a/Sources/SwiftCrossUI/Views/EitherView.swift +++ b/Sources/SwiftCrossUI/Views/EitherView.swift @@ -60,7 +60,7 @@ extension EitherView: TypeSafeView { switch storage { case .a(let a): switch children.node { - case let .a(nodeA): + case .a(let nodeA): result = nodeA.update( with: a, proposedSize: proposedSize, @@ -85,7 +85,7 @@ extension EitherView: TypeSafeView { } case .b(let b): switch children.node { - case let .b(nodeB): + case .b(let nodeB): result = nodeB.update( with: b, proposedSize: proposedSize, @@ -137,18 +137,18 @@ class EitherViewChildren: ViewGraphNodeChildren { /// The widget corresponding to the currently displayed child view. var widget: AnyWidget { switch self { - case let .a(node): + case .a(let node): return node.widget - case let .b(node): + case .b(let node): return node.widget } } var erasedNode: ErasedViewGraphNode { switch self { - case let .a(node): + case .a(let node): return ErasedViewGraphNode(wrapping: node) - case let .b(node): + case .b(let node): return ErasedViewGraphNode(wrapping: node) } } diff --git a/Sources/UIKitBackend/UIKitBackend+Control.swift b/Sources/UIKitBackend/UIKitBackend+Control.swift index 4ed1d7a272..57cca0a90c 100644 --- a/Sources/UIKitBackend/UIKitBackend+Control.swift +++ b/Sources/UIKitBackend/UIKitBackend+Control.swift @@ -170,7 +170,6 @@ final class TappableWidget: ContainerWidget { } } - @available(tvOS, unavailable) final class HoverableWidget: ContainerWidget { private var hoverGestureRecognizer: UIHoverGestureRecognizer? @@ -178,8 +177,9 @@ final class HoverableWidget: ContainerWidget { var hoverChangesHandler: ((Bool) -> Void)? { didSet { if hoverChangesHandler != nil && hoverGestureRecognizer == nil { - let gestureRecognizer = UIHoverGestureRecognizer(target: self, - action: #selector(hoveringChanged(_:))) + let gestureRecognizer = UIHoverGestureRecognizer( + target: self, + action: #selector(hoveringChanged(_:))) child.view.addGestureRecognizer(gestureRecognizer) self.hoverGestureRecognizer = gestureRecognizer } else if hoverChangesHandler == nil, let hoverGestureRecognizer { @@ -194,9 +194,9 @@ final class HoverableWidget: ContainerWidget { @objc func hoveringChanged(_ recognizer: UIHoverGestureRecognizer) { switch recognizer.state { - case .began: hoverChangesHandler?(true) - case .ended: hoverChangesHandler?(false) - default: break + case .began: hoverChangesHandler?(true) + case .ended: hoverChangesHandler?(false) + default: break } } } @@ -449,14 +449,16 @@ extension UIKitBackend { wrapper.onLongPress = environment.isEnabled ? action : {} } } - + public func createHoverTarget(wrapping child: Widget) -> Widget { HoverableWidget(child: child) } - - public func updateHoverTarget(_ hoverTarget: any WidgetProtocol, - environment: EnvironmentValues, - action: @escaping (Bool) -> Void) { + + public func updateHoverTarget( + _ hoverTarget: any WidgetProtocol, + environment: EnvironmentValues, + action: @escaping (Bool) -> Void + ) { let wrapper = hoverTarget as! HoverableWidget wrapper.hoverChangesHandler = action } diff --git a/Sources/UIKitBackend/UIKitBackend+Menu.swift b/Sources/UIKitBackend/UIKitBackend+Menu.swift index 4e0fa6a771..efe33affa9 100644 --- a/Sources/UIKitBackend/UIKitBackend+Menu.swift +++ b/Sources/UIKitBackend/UIKitBackend+Menu.swift @@ -18,13 +18,13 @@ extension UIKitBackend { ) -> UIMenu { let children = content.items.map { (item) -> UIMenuElement in switch item { - case let .button(label, action): + case .button(let label, let action): if let action { UIAction(title: label) { _ in action() } } else { UIAction(title: label, attributes: .disabled) { _ in } } - case let .submenu(submenu): + case .submenu(let submenu): buildMenu(content: submenu.content, label: submenu.label) } } diff --git a/Sources/WinUIBackend/HWNDInterop.swift b/Sources/WinUIBackend/HWNDInterop.swift index 86d00ec483..13f5b36b76 100644 --- a/Sources/WinUIBackend/HWNDInterop.swift +++ b/Sources/WinUIBackend/HWNDInterop.swift @@ -35,12 +35,14 @@ extension WinUI.Window { } private struct HWNDInterop { - private typealias pfnGetWindowIdFromWindow = @convention(c) ( - HWND?, UnsafeMutablePointer<__x_ABI_CMicrosoft_CUI_CWindowId>? - ) -> HRESULT - private typealias pfnGetWindowFromWindowId = @convention(c) ( - __x_ABI_CMicrosoft_CUI_CWindowId, UnsafeMutablePointer? - ) -> HRESULT + private typealias pfnGetWindowIdFromWindow = + @convention(c) ( + HWND?, UnsafeMutablePointer<__x_ABI_CMicrosoft_CUI_CWindowId>? + ) -> HRESULT + private typealias pfnGetWindowFromWindowId = + @convention(c) ( + __x_ABI_CMicrosoft_CUI_CWindowId, UnsafeMutablePointer? + ) -> HRESULT private var hModule: HMODULE! private var getWindowIDFromWindow_impl: pfnGetWindowIdFromWindow! private var getWindowFromWindowID_impl: pfnGetWindowFromWindowId! diff --git a/Sources/WinUIBackend/WinUIBackend.swift b/Sources/WinUIBackend/WinUIBackend.swift index 3f00ae8373..fdd05d51f5 100644 --- a/Sources/WinUIBackend/WinUIBackend.swift +++ b/Sources/WinUIBackend/WinUIBackend.swift @@ -1408,7 +1408,7 @@ public final class WinUIBackend: AppBackend { let hoverTarget = hoverTarget as! HoverGestureTarget hoverTarget.enterHandler = environment.isEnabled ? { action(true) } : {} hoverTarget.exitHandler = environment.isEnabled ? { action(false) } : {} - + hoverTarget.width = hoverTarget.child!.width hoverTarget.height = hoverTarget.child!.height } From e086878fa113e3483d776e0943bc52b820deaff6 Mon Sep 17 00:00:00 2001 From: Mia Koring Date: Sun, 14 Sep 2025 17:27:55 +0200 Subject: [PATCH 08/15] slight quality improvement in HoverExample --- Examples/Sources/HoverExample/HoverApp.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Examples/Sources/HoverExample/HoverApp.swift b/Examples/Sources/HoverExample/HoverApp.swift index d6170d966a..c7864f2f77 100644 --- a/Examples/Sources/HoverExample/HoverApp.swift +++ b/Examples/Sources/HoverExample/HoverApp.swift @@ -20,9 +20,6 @@ struct HoverExample: App { } } .background(Color.black) - .onAppear { - print(type(of: backend)) - } } .defaultSize(width: 900, height: 540) } @@ -30,7 +27,6 @@ struct HoverExample: App { struct CellView: View { @State var timer: Timer? - @Environment(\.colorScheme) var colorScheme @State var opacity: Float = 0.0 var body: some View { @@ -50,6 +46,7 @@ struct CellView: View { } } else { opacity = 1.0 + timer?.invalidate() timer = nil } } From 14b8123a56db91fd905ce7329bc89aa1ca6e9e9d Mon Sep 17 00:00:00 2001 From: Mia Koring Date: Mon, 15 Sep 2025 16:25:50 +0200 Subject: [PATCH 09/15] implemented requested changes --- Examples/Sources/HoverExample/HoverApp.swift | 15 +- Sources/AppKitBackend/AppKitBackend.swift | 43 +- Sources/Gtk/Generated/Accessible.swift | 23 +- .../Generated/AccessibleAutocomplete.swift | 64 +- .../Generated/AccessibleInvalidState.swift | 50 +- .../Gtk/Generated/AccessibleProperty.swift | 288 +-- .../Gtk/Generated/AccessibleRelation.swift | 268 +-- Sources/Gtk/Generated/AccessibleRole.swift | 986 ++++---- Sources/Gtk/Generated/AccessibleSort.swift | 50 +- Sources/Gtk/Generated/AccessibleState.swift | 122 +- .../Gtk/Generated/AccessibleTristate.swift | 38 +- Sources/Gtk/Generated/Actionable.swift | 9 +- Sources/Gtk/Generated/Align.swift | 56 +- Sources/Gtk/Generated/AppChooser.swift | 15 +- Sources/Gtk/Generated/ArrowType.swift | 60 +- Sources/Gtk/Generated/AssistantPageType.swift | 96 +- Sources/Gtk/Generated/BaselinePosition.swift | 38 +- Sources/Gtk/Generated/BorderStyle.swift | 120 +- Sources/Gtk/Generated/Buildable.swift | 10 +- Sources/Gtk/Generated/BuilderError.swift | 202 +- Sources/Gtk/Generated/BuilderScope.swift | 14 +- Sources/Gtk/Generated/Button.swift | 350 ++- Sources/Gtk/Generated/ButtonsType.swift | 76 +- Sources/Gtk/Generated/CellEditable.swift | 53 +- Sources/Gtk/Generated/CellLayout.swift | 40 +- .../Gtk/Generated/CellRendererAccelMode.swift | 24 +- Sources/Gtk/Generated/CellRendererMode.swift | 42 +- Sources/Gtk/Generated/CheckButton.swift | 354 ++- .../Gtk/Generated/ConstraintAttribute.swift | 162 +- .../Gtk/Generated/ConstraintRelation.swift | 36 +- .../Gtk/Generated/ConstraintStrength.swift | 50 +- Sources/Gtk/Generated/ConstraintTarget.swift | 6 +- .../Generated/ConstraintVflParserError.swift | 75 +- Sources/Gtk/Generated/CornerType.swift | 58 +- Sources/Gtk/Generated/CssParserError.swift | 62 +- Sources/Gtk/Generated/CssParserWarning.swift | 42 +- Sources/Gtk/Generated/DeleteType.swift | 108 +- Sources/Gtk/Generated/DirectionType.swift | 72 +- Sources/Gtk/Generated/DrawingArea.swift | 130 +- Sources/Gtk/Generated/DropDown.swift | 343 ++- Sources/Gtk/Generated/Editable.swift | 130 +- .../Gtk/Generated/EditableProperties.swift | 110 +- Sources/Gtk/Generated/Entry.swift | 1704 +++++++------- Sources/Gtk/Generated/EntryIconPosition.swift | 24 +- Sources/Gtk/Generated/EventController.swift | 121 +- .../Gtk/Generated/EventControllerMotion.swift | 178 +- .../Gtk/Generated/EventSequenceState.swift | 36 +- Sources/Gtk/Generated/FileChooser.swift | 59 +- Sources/Gtk/Generated/FileChooserAction.swift | 46 +- Sources/Gtk/Generated/FileChooserError.swift | 52 +- Sources/Gtk/Generated/FileChooserNative.swift | 339 ++- Sources/Gtk/Generated/FilterChange.swift | 50 +- Sources/Gtk/Generated/FilterMatch.swift | 44 +- Sources/Gtk/Generated/FontChooser.swift | 38 +- Sources/Gtk/Generated/GLArea.swift | 427 ++-- Sources/Gtk/Generated/Gesture.swift | 273 ++- Sources/Gtk/Generated/GestureClick.swift | 122 +- Sources/Gtk/Generated/GestureLongPress.swift | 86 +- Sources/Gtk/Generated/GestureSingle.swift | 98 +- Sources/Gtk/Generated/IconSize.swift | 40 +- Sources/Gtk/Generated/IconThemeError.swift | 24 +- .../Gtk/Generated/IconViewDropPosition.swift | 72 +- Sources/Gtk/Generated/Image.swift | 433 ++-- Sources/Gtk/Generated/ImageType.swift | 52 +- Sources/Gtk/Generated/InputPurpose.swift | 140 +- Sources/Gtk/Generated/Justification.swift | 48 +- Sources/Gtk/Generated/Label.swift | 980 ++++---- Sources/Gtk/Generated/LevelBarMode.swift | 26 +- Sources/Gtk/Generated/ListBox.swift | 348 ++- Sources/Gtk/Generated/MessageType.swift | 60 +- Sources/Gtk/Generated/MovementStep.swift | 120 +- Sources/Gtk/Generated/Native.swift | 12 +- Sources/Gtk/Generated/NativeDialog.swift | 156 +- Sources/Gtk/Generated/NotebookTab.swift | 24 +- Sources/Gtk/Generated/NumberUpLayout.swift | 96 +- Sources/Gtk/Generated/Ordering.swift | 38 +- Sources/Gtk/Generated/Orientation.swift | 26 +- Sources/Gtk/Generated/Overflow.swift | 30 +- Sources/Gtk/Generated/PackType.swift | 26 +- Sources/Gtk/Generated/PadActionType.swift | 42 +- Sources/Gtk/Generated/PageOrientation.swift | 48 +- Sources/Gtk/Generated/PageSet.swift | 36 +- Sources/Gtk/Generated/PanDirection.swift | 48 +- Sources/Gtk/Generated/Picture.swift | 252 +-- Sources/Gtk/Generated/PolicyType.swift | 58 +- Sources/Gtk/Generated/Popover.swift | 308 ++- Sources/Gtk/Generated/PositionType.swift | 50 +- Sources/Gtk/Generated/PrintDuplex.swift | 36 +- Sources/Gtk/Generated/PrintError.swift | 50 +- .../Gtk/Generated/PrintOperationAction.swift | 56 +- .../Gtk/Generated/PrintOperationResult.swift | 54 +- Sources/Gtk/Generated/PrintPages.swift | 48 +- Sources/Gtk/Generated/PrintQuality.swift | 48 +- Sources/Gtk/Generated/PrintStatus.swift | 120 +- Sources/Gtk/Generated/ProgressBar.swift | 249 +- Sources/Gtk/Generated/PropagationLimit.swift | 32 +- Sources/Gtk/Generated/PropagationPhase.swift | 62 +- Sources/Gtk/Generated/Range.swift | 343 ++- .../Gtk/Generated/RecentManagerError.swift | 94 +- Sources/Gtk/Generated/ResponseType.swift | 136 +- .../Generated/RevealerTransitionType.swift | 120 +- Sources/Gtk/Generated/Root.swift | 12 +- Sources/Gtk/Generated/Scale.swift | 202 +- Sources/Gtk/Generated/ScrollStep.swift | 72 +- Sources/Gtk/Generated/ScrollType.swift | 192 +- Sources/Gtk/Generated/Scrollable.swift | 23 +- Sources/Gtk/Generated/ScrollablePolicy.swift | 24 +- Sources/Gtk/Generated/SelectionMode.swift | 64 +- Sources/Gtk/Generated/SelectionModel.swift | 29 +- Sources/Gtk/Generated/SensitivityType.swift | 38 +- Sources/Gtk/Generated/ShortcutManager.swift | 10 +- Sources/Gtk/Generated/ShortcutScope.swift | 42 +- Sources/Gtk/Generated/ShortcutType.swift | 126 +- Sources/Gtk/Generated/SizeGroupMode.swift | 48 +- Sources/Gtk/Generated/SizeRequestMode.swift | 36 +- Sources/Gtk/Generated/SortType.swift | 24 +- Sources/Gtk/Generated/SorterChange.swift | 58 +- Sources/Gtk/Generated/SorterOrder.swift | 42 +- .../Generated/SpinButtonUpdatePolicy.swift | 32 +- Sources/Gtk/Generated/SpinType.swift | 84 +- Sources/Gtk/Generated/Spinner.swift | 51 +- .../Gtk/Generated/StackTransitionType.swift | 278 +-- .../Gtk/Generated/StringFilterMatchMode.swift | 42 +- Sources/Gtk/Generated/StyleProvider.swift | 10 +- Sources/Gtk/Generated/Switch.swift | 241 +- Sources/Gtk/Generated/SystemSetting.swift | 80 +- Sources/Gtk/Generated/TextDirection.swift | 36 +- .../Gtk/Generated/TextExtendSelection.swift | 28 +- Sources/Gtk/Generated/TextViewLayer.swift | 24 +- Sources/Gtk/Generated/TextWindowType.swift | 72 +- Sources/Gtk/Generated/TreeDragDest.swift | 4 +- Sources/Gtk/Generated/TreeDragSource.swift | 4 +- Sources/Gtk/Generated/TreeSortable.swift | 11 +- .../Gtk/Generated/TreeViewColumnSizing.swift | 36 +- .../Gtk/Generated/TreeViewDropPosition.swift | 48 +- Sources/Gtk/Generated/TreeViewGridLines.swift | 48 +- Sources/Gtk/Generated/Unit.swift | 48 +- Sources/Gtk/Generated/WrapMode.swift | 54 +- Sources/Gtk3/Generated/Activatable.swift | 110 +- Sources/Gtk3/Generated/Align.swift | 62 +- Sources/Gtk3/Generated/AppChooser.swift | 15 +- Sources/Gtk3/Generated/ArrowPlacement.swift | 36 +- Sources/Gtk3/Generated/ArrowType.swift | 48 +- .../Gtk3/Generated/AssistantPageType.swift | 94 +- Sources/Gtk3/Generated/BorderStyle.swift | 120 +- Sources/Gtk3/Generated/Buildable.swift | 8 +- Sources/Gtk3/Generated/BuilderError.swift | 186 +- Sources/Gtk3/Generated/Button.swift | 459 ++-- Sources/Gtk3/Generated/ButtonBoxStyle.swift | 52 +- Sources/Gtk3/Generated/ButtonRole.swift | 36 +- Sources/Gtk3/Generated/ButtonsType.swift | 74 +- .../Gtk3/Generated/CellAccessibleParent.swift | 5 +- Sources/Gtk3/Generated/CellEditable.swift | 51 +- Sources/Gtk3/Generated/CellLayout.swift | 36 +- .../Generated/CellRendererAccelMode.swift | 24 +- Sources/Gtk3/Generated/CellRendererMode.swift | 42 +- Sources/Gtk3/Generated/CheckButton.swift | 55 +- Sources/Gtk3/Generated/CornerType.swift | 56 +- Sources/Gtk3/Generated/CssProviderError.swift | 72 +- Sources/Gtk3/Generated/DeleteType.swift | 108 +- Sources/Gtk3/Generated/DirectionType.swift | 72 +- Sources/Gtk3/Generated/DragResult.swift | 76 +- Sources/Gtk3/Generated/DrawingArea.swift | 51 +- Sources/Gtk3/Generated/Editable.swift | 69 +- Sources/Gtk3/Generated/Entry.swift | 2013 ++++++++--------- Sources/Gtk3/Generated/EventBox.swift | 70 +- Sources/Gtk3/Generated/EventController.swift | 53 +- Sources/Gtk3/Generated/ExpanderStyle.swift | 48 +- Sources/Gtk3/Generated/FileChooser.swift | 315 +-- .../Gtk3/Generated/FileChooserAction.swift | 62 +- Sources/Gtk3/Generated/FileChooserError.swift | 50 +- .../Gtk3/Generated/FileChooserNative.swift | 798 ++++--- Sources/Gtk3/Generated/FontChooser.swift | 20 +- Sources/Gtk3/Generated/GLArea.swift | 320 ++- Sources/Gtk3/Generated/Gesture.swift | 278 ++- Sources/Gtk3/Generated/GestureLongPress.swift | 84 +- Sources/Gtk3/Generated/GestureSingle.swift | 80 +- Sources/Gtk3/Generated/IMPreeditStyle.swift | 36 +- Sources/Gtk3/Generated/IMStatusStyle.swift | 36 +- Sources/Gtk3/Generated/IconSize.swift | 84 +- Sources/Gtk3/Generated/IconThemeError.swift | 24 +- .../Gtk3/Generated/IconViewDropPosition.swift | 72 +- Sources/Gtk3/Generated/Image.swift | 487 ++-- Sources/Gtk3/Generated/ImageType.swift | 102 +- Sources/Gtk3/Generated/Justification.swift | 48 +- Sources/Gtk3/Generated/Label.swift | 827 ++++--- .../Gtk3/Generated/MenuDirectionType.swift | 48 +- Sources/Gtk3/Generated/MenuShell.swift | 237 +- Sources/Gtk3/Generated/MessageType.swift | 60 +- Sources/Gtk3/Generated/MovementStep.swift | 121 +- Sources/Gtk3/Generated/NativeDialog.swift | 142 +- Sources/Gtk3/Generated/NotebookTab.swift | 24 +- Sources/Gtk3/Generated/NumberUpLayout.swift | 96 +- Sources/Gtk3/Generated/Orientation.swift | 24 +- Sources/Gtk3/Generated/PackDirection.swift | 48 +- Sources/Gtk3/Generated/PackType.swift | 24 +- Sources/Gtk3/Generated/PadActionType.swift | 36 +- Sources/Gtk3/Generated/PageOrientation.swift | 48 +- Sources/Gtk3/Generated/PageSet.swift | 36 +- Sources/Gtk3/Generated/PathPriorityType.swift | 72 +- Sources/Gtk3/Generated/PathType.swift | 36 +- Sources/Gtk3/Generated/PolicyType.swift | 42 +- Sources/Gtk3/Generated/PositionType.swift | 48 +- Sources/Gtk3/Generated/PrintDuplex.swift | 36 +- Sources/Gtk3/Generated/PrintError.swift | 50 +- .../Gtk3/Generated/PrintOperationAction.swift | 52 +- .../Gtk3/Generated/PrintOperationResult.swift | 52 +- Sources/Gtk3/Generated/PrintPages.swift | 48 +- Sources/Gtk3/Generated/PrintQuality.swift | 48 +- Sources/Gtk3/Generated/PrintStatus.swift | 120 +- Sources/Gtk3/Generated/ProgressBar.swift | 211 +- Sources/Gtk3/Generated/Range.swift | 360 ++- Sources/Gtk3/Generated/RcTokenType.swift | 480 ++-- Sources/Gtk3/Generated/RecentChooser.swift | 26 +- Sources/Gtk3/Generated/ReliefStyle.swift | 36 +- Sources/Gtk3/Generated/ResizeMode.swift | 37 +- Sources/Gtk3/Generated/ResponseType.swift | 134 +- .../Generated/RevealerTransitionType.swift | 72 +- Sources/Gtk3/Generated/Scale.swift | 182 +- Sources/Gtk3/Generated/ScrollStep.swift | 73 +- Sources/Gtk3/Generated/ScrollType.swift | 192 +- Sources/Gtk3/Generated/Scrollable.swift | 18 +- Sources/Gtk3/Generated/ScrollablePolicy.swift | 24 +- Sources/Gtk3/Generated/SelectionMode.swift | 64 +- Sources/Gtk3/Generated/SensitivityType.swift | 38 +- Sources/Gtk3/Generated/ShadowType.swift | 62 +- Sources/Gtk3/Generated/SizeGroupMode.swift | 48 +- Sources/Gtk3/Generated/SizeRequestMode.swift | 36 +- Sources/Gtk3/Generated/SortType.swift | 24 +- .../Generated/SpinButtonUpdatePolicy.swift | 30 +- Sources/Gtk3/Generated/SpinType.swift | 84 +- Sources/Gtk3/Generated/Spinner.swift | 43 +- .../Gtk3/Generated/StackTransitionType.swift | 98 +- Sources/Gtk3/Generated/StateType.swift | 92 +- Sources/Gtk3/Generated/StyleProvider.swift | 4 +- Sources/Gtk3/Generated/Switch.swift | 205 +- .../Gtk3/Generated/TextBufferTargetInfo.swift | 38 +- Sources/Gtk3/Generated/TextDirection.swift | 36 +- Sources/Gtk3/Generated/TextViewLayer.swift | 24 +- Sources/Gtk3/Generated/TextWindowType.swift | 84 +- Sources/Gtk3/Generated/ToolShell.swift | 4 +- .../Gtk3/Generated/ToolbarSpaceStyle.swift | 24 +- Sources/Gtk3/Generated/ToolbarStyle.swift | 50 +- Sources/Gtk3/Generated/TreeDragDest.swift | 5 +- Sources/Gtk3/Generated/TreeDragSource.swift | 5 +- Sources/Gtk3/Generated/TreeSortable.swift | 9 +- .../Gtk3/Generated/TreeViewColumnSizing.swift | 36 +- .../Gtk3/Generated/TreeViewDropPosition.swift | 48 +- .../Gtk3/Generated/TreeViewGridLines.swift | 48 +- Sources/Gtk3/Generated/Unit.swift | 48 +- Sources/Gtk3/Generated/WidgetHelpType.swift | 24 +- Sources/Gtk3/Generated/WindowPosition.swift | 62 +- Sources/Gtk3/Generated/WindowType.swift | 24 +- Sources/Gtk3/Generated/WrapMode.swift | 54 +- Sources/GtkCodeGen/GtkCodeGen.swift | 7 + .../UIKitBackend/UIKitBackend+Control.swift | 2 - Sources/WinUIBackend/WinUIBackend.swift | 5 - 257 files changed, 14140 insertions(+), 14543 deletions(-) diff --git a/Examples/Sources/HoverExample/HoverApp.swift b/Examples/Sources/HoverExample/HoverApp.swift index c7864f2f77..9f5c2d0af3 100644 --- a/Examples/Sources/HoverExample/HoverApp.swift +++ b/Examples/Sources/HoverExample/HoverApp.swift @@ -7,19 +7,22 @@ import SwiftCrossUI #endif @main +@HotReloadable struct HoverExample: App { var body: some Scene { WindowGroup("Hover Example") { - VStack(spacing: 0) { - ForEach([Bool](repeating: false, count: 18)) { _ in - HStack(spacing: 0) { - ForEach([Bool](repeating: false, count: 30)) { _ in - CellView() + #hotReloadable { + VStack(spacing: 0) { + ForEach([Bool](repeating: false, count: 18)) { _ in + HStack(spacing: 0) { + ForEach([Bool](repeating: false, count: 30)) { _ in + CellView() + } } } + .background(Color.black) } } - .background(Color.black) } .defaultSize(width: 900, height: 540) } diff --git a/Sources/AppKitBackend/AppKitBackend.swift b/Sources/AppKitBackend/AppKitBackend.swift index 02e62f8282..99b13caa08 100644 --- a/Sources/AppKitBackend/AppKitBackend.swift +++ b/Sources/AppKitBackend/AppKitBackend.swift @@ -1762,20 +1762,8 @@ final class NSCustomHoverTarget: NSView { var hoverChangesHandler: ((Bool) -> Void)? { didSet { if hoverChangesHandler != nil && trackingArea == nil { - let options: NSTrackingArea.Options = [ - .mouseEnteredAndExited, - .activeInKeyWindow, - ] - let area = NSTrackingArea( - rect: self.bounds, - options: options, - owner: self, - userInfo: nil) - addTrackingArea(area) - trackingArea = area + setNewTrackingArea() } else if hoverChangesHandler == nil, let trackingArea { - // should be impossible at the moment of implementation - // keeping it to be save in case of later changes removeTrackingArea(trackingArea) self.trackingArea = nil } @@ -1786,20 +1774,10 @@ final class NSCustomHoverTarget: NSView { override func updateTrackingAreas() { super.updateTrackingAreas() - if let trackingArea = trackingArea { + if let trackingArea { self.removeTrackingArea(trackingArea) } - let options: NSTrackingArea.Options = [ - .mouseEnteredAndExited, - .activeInKeyWindow, - ] - - trackingArea = NSTrackingArea( - rect: self.bounds, - options: options, - owner: self, - userInfo: nil) - self.addTrackingArea(trackingArea!) + setNewTrackingArea() } override func mouseEntered(with event: NSEvent) { @@ -1807,9 +1785,22 @@ final class NSCustomHoverTarget: NSView { } override func mouseExited(with event: NSEvent) { - // Mouse exited the view's bounds hoverChangesHandler?(false) } + + private func setNewTrackingArea() { + let options: NSTrackingArea.Options = [ + .mouseEnteredAndExited, + .activeInKeyWindow, + ] + let area = NSTrackingArea( + rect: self.bounds, + options: options, + owner: self, + userInfo: nil) + addTrackingArea(area) + trackingArea = area + } } final class NSCustomMenuItem: NSMenuItem { diff --git a/Sources/Gtk/Generated/Accessible.swift b/Sources/Gtk/Generated/Accessible.swift index 4659bc8e0f..4a356e0d18 100644 --- a/Sources/Gtk/Generated/Accessible.swift +++ b/Sources/Gtk/Generated/Accessible.swift @@ -1,30 +1,30 @@ import CGtk /// An interface for describing UI elements for Assistive Technologies. -/// +/// /// Every accessible implementation has: -/// +/// /// - a “role”, represented by a value of the [enum@Gtk.AccessibleRole] enumeration /// - “attributes”, represented by a set of [enum@Gtk.AccessibleState], /// [enum@Gtk.AccessibleProperty] and [enum@Gtk.AccessibleRelation] values -/// +/// /// The role cannot be changed after instantiating a `GtkAccessible` /// implementation. -/// +/// /// The attributes are updated every time a UI element's state changes in /// a way that should be reflected by assistive technologies. For instance, /// if a `GtkWidget` visibility changes, the %GTK_ACCESSIBLE_STATE_HIDDEN /// state will also change to reflect the [property@Gtk.Widget:visible] property. -/// +/// /// Every accessible implementation is part of a tree of accessible objects. /// Normally, this tree corresponds to the widget tree, but can be customized /// by reimplementing the [vfunc@Gtk.Accessible.get_accessible_parent], /// [vfunc@Gtk.Accessible.get_first_accessible_child] and /// [vfunc@Gtk.Accessible.get_next_accessible_sibling] virtual functions. -/// +/// /// Note that you can not create a top-level accessible object as of now, /// which means that you must always have a parent accessible object. -/// +/// /// Also note that when an accessible object does not correspond to a widget, /// and it has children, whose implementation you don't control, /// it is necessary to ensure the correct shape of the a11y tree @@ -32,8 +32,9 @@ import CGtk /// updating the sibling by [method@Gtk.Accessible.update_next_accessible_sibling]. public protocol Accessible: GObjectRepresentable { /// The accessible role of the given `GtkAccessible` implementation. - /// - /// The accessible role cannot be changed once set. - var accessibleRole: AccessibleRole { get set } +/// +/// The accessible role cannot be changed once set. +var accessibleRole: AccessibleRole { get set } -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AccessibleAutocomplete.swift b/Sources/Gtk/Generated/AccessibleAutocomplete.swift index 1af0f8d331..f877f61ae8 100644 --- a/Sources/Gtk/Generated/AccessibleAutocomplete.swift +++ b/Sources/Gtk/Generated/AccessibleAutocomplete.swift @@ -6,36 +6,36 @@ public enum AccessibleAutocomplete: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleAutocomplete /// Automatic suggestions are not displayed. - case none - /// When a user is providing input, text - /// suggesting one way to complete the provided input may be dynamically - /// inserted after the caret. - case inline - /// When a user is providing input, an element - /// containing a collection of values that could complete the provided input - /// may be displayed. - case list - /// When a user is providing input, an element - /// containing a collection of values that could complete the provided input - /// may be displayed. If displayed, one value in the collection is automatically - /// selected, and the text needed to complete the automatically selected value - /// appears after the caret in the input. - case both +case none +/// When a user is providing input, text +/// suggesting one way to complete the provided input may be dynamically +/// inserted after the caret. +case inline +/// When a user is providing input, an element +/// containing a collection of values that could complete the provided input +/// may be displayed. +case list +/// When a user is providing input, an element +/// containing a collection of values that could complete the provided input +/// may be displayed. If displayed, one value in the collection is automatically +/// selected, and the text needed to complete the automatically selected value +/// appears after the caret in the input. +case both public static var type: GType { - gtk_accessible_autocomplete_get_type() - } + gtk_accessible_autocomplete_get_type() +} public init(from gtkEnum: GtkAccessibleAutocomplete) { switch gtkEnum { case GTK_ACCESSIBLE_AUTOCOMPLETE_NONE: - self = .none - case GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE: - self = .inline - case GTK_ACCESSIBLE_AUTOCOMPLETE_LIST: - self = .list - case GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH: - self = .both + self = .none +case GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE: + self = .inline +case GTK_ACCESSIBLE_AUTOCOMPLETE_LIST: + self = .list +case GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH: + self = .both default: fatalError("Unsupported GtkAccessibleAutocomplete enum value: \(gtkEnum.rawValue)") } @@ -44,13 +44,13 @@ public enum AccessibleAutocomplete: GValueRepresentableEnum { public func toGtk() -> GtkAccessibleAutocomplete { switch self { case .none: - return GTK_ACCESSIBLE_AUTOCOMPLETE_NONE - case .inline: - return GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE - case .list: - return GTK_ACCESSIBLE_AUTOCOMPLETE_LIST - case .both: - return GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH + return GTK_ACCESSIBLE_AUTOCOMPLETE_NONE +case .inline: + return GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE +case .list: + return GTK_ACCESSIBLE_AUTOCOMPLETE_LIST +case .both: + return GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AccessibleInvalidState.swift b/Sources/Gtk/Generated/AccessibleInvalidState.swift index be5eff22c3..76c2055efe 100644 --- a/Sources/Gtk/Generated/AccessibleInvalidState.swift +++ b/Sources/Gtk/Generated/AccessibleInvalidState.swift @@ -2,7 +2,7 @@ import CGtk /// The possible values for the %GTK_ACCESSIBLE_STATE_INVALID /// accessible state. -/// +/// /// Note that the %GTK_ACCESSIBLE_INVALID_FALSE and /// %GTK_ACCESSIBLE_INVALID_TRUE have the same values /// as %FALSE and %TRUE. @@ -10,28 +10,28 @@ public enum AccessibleInvalidState: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleInvalidState /// There are no detected errors in the value - case false_ - /// The value entered by the user has failed validation - case true_ - /// A grammatical error was detected - case grammar - /// A spelling error was detected - case spelling +case false_ +/// The value entered by the user has failed validation +case true_ +/// A grammatical error was detected +case grammar +/// A spelling error was detected +case spelling public static var type: GType { - gtk_accessible_invalid_state_get_type() - } + gtk_accessible_invalid_state_get_type() +} public init(from gtkEnum: GtkAccessibleInvalidState) { switch gtkEnum { case GTK_ACCESSIBLE_INVALID_FALSE: - self = .false_ - case GTK_ACCESSIBLE_INVALID_TRUE: - self = .true_ - case GTK_ACCESSIBLE_INVALID_GRAMMAR: - self = .grammar - case GTK_ACCESSIBLE_INVALID_SPELLING: - self = .spelling + self = .false_ +case GTK_ACCESSIBLE_INVALID_TRUE: + self = .true_ +case GTK_ACCESSIBLE_INVALID_GRAMMAR: + self = .grammar +case GTK_ACCESSIBLE_INVALID_SPELLING: + self = .spelling default: fatalError("Unsupported GtkAccessibleInvalidState enum value: \(gtkEnum.rawValue)") } @@ -40,13 +40,13 @@ public enum AccessibleInvalidState: GValueRepresentableEnum { public func toGtk() -> GtkAccessibleInvalidState { switch self { case .false_: - return GTK_ACCESSIBLE_INVALID_FALSE - case .true_: - return GTK_ACCESSIBLE_INVALID_TRUE - case .grammar: - return GTK_ACCESSIBLE_INVALID_GRAMMAR - case .spelling: - return GTK_ACCESSIBLE_INVALID_SPELLING + return GTK_ACCESSIBLE_INVALID_FALSE +case .true_: + return GTK_ACCESSIBLE_INVALID_TRUE +case .grammar: + return GTK_ACCESSIBLE_INVALID_GRAMMAR +case .spelling: + return GTK_ACCESSIBLE_INVALID_SPELLING } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AccessibleProperty.swift b/Sources/Gtk/Generated/AccessibleProperty.swift index a30c276c15..a98b3b4e67 100644 --- a/Sources/Gtk/Generated/AccessibleProperty.swift +++ b/Sources/Gtk/Generated/AccessibleProperty.swift @@ -5,118 +5,118 @@ public enum AccessibleProperty: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleProperty /// Indicates whether inputting text - /// could trigger display of one or more predictions of the user's intended - /// value for a combobox, searchbox, or textbox and specifies how predictions - /// would be presented if they were made. Value type: [enum@AccessibleAutocomplete] - case autocomplete - /// Defines a string value that describes - /// or annotates the current element. Value type: string - case description - /// Indicates the availability and type of - /// interactive popup element, such as menu or dialog, that can be triggered - /// by an element. - case hasPopup - /// Indicates keyboard shortcuts that an - /// author has implemented to activate or give focus to an element. Value type: - /// string. The format of the value is a space-separated list of shortcuts, with - /// each shortcut consisting of one or more modifiers (`Control`, `Alt` or `Shift`), - /// followed by a non-modifier key, all separated by `+`. - /// Examples: `F2`, `Alt-F`, `Control+Shift+N` - case keyShortcuts - /// Defines a string value that labels the current - /// element. Value type: string - case label - /// Defines the hierarchical level of an element - /// within a structure. Value type: integer - case level - /// Indicates whether an element is modal when - /// displayed. Value type: boolean - case modal - /// Indicates whether a text box accepts - /// multiple lines of input or only a single line. Value type: boolean - case multiLine - /// Indicates that the user may select - /// more than one item from the current selectable descendants. Value type: - /// boolean - case multiSelectable - /// Indicates whether the element's - /// orientation is horizontal, vertical, or unknown/ambiguous. Value type: - /// [enum@Orientation] - case orientation - /// Defines a short hint (a word or short - /// phrase) intended to aid the user with data entry when the control has no - /// value. A hint could be a sample value or a brief description of the expected - /// format. Value type: string - case placeholder - /// Indicates that the element is not editable, - /// but is otherwise operable. Value type: boolean - case readOnly - /// Indicates that user input is required on - /// the element before a form may be submitted. Value type: boolean - case required - /// Defines a human-readable, - /// author-localized description for the role of an element. Value type: string - case roleDescription - /// Indicates if items in a table or grid are - /// sorted in ascending or descending order. Value type: [enum@AccessibleSort] - case sort - /// Defines the maximum allowed value for a - /// range widget. Value type: double - case valueMax - /// Defines the minimum allowed value for a - /// range widget. Value type: double - case valueMin - /// Defines the current value for a range widget. - /// Value type: double - case valueNow - /// Defines the human readable text alternative - /// of aria-valuenow for a range widget. Value type: string - case valueText +/// could trigger display of one or more predictions of the user's intended +/// value for a combobox, searchbox, or textbox and specifies how predictions +/// would be presented if they were made. Value type: [enum@AccessibleAutocomplete] +case autocomplete +/// Defines a string value that describes +/// or annotates the current element. Value type: string +case description +/// Indicates the availability and type of +/// interactive popup element, such as menu or dialog, that can be triggered +/// by an element. +case hasPopup +/// Indicates keyboard shortcuts that an +/// author has implemented to activate or give focus to an element. Value type: +/// string. The format of the value is a space-separated list of shortcuts, with +/// each shortcut consisting of one or more modifiers (`Control`, `Alt` or `Shift`), +/// followed by a non-modifier key, all separated by `+`. +/// Examples: `F2`, `Alt-F`, `Control+Shift+N` +case keyShortcuts +/// Defines a string value that labels the current +/// element. Value type: string +case label +/// Defines the hierarchical level of an element +/// within a structure. Value type: integer +case level +/// Indicates whether an element is modal when +/// displayed. Value type: boolean +case modal +/// Indicates whether a text box accepts +/// multiple lines of input or only a single line. Value type: boolean +case multiLine +/// Indicates that the user may select +/// more than one item from the current selectable descendants. Value type: +/// boolean +case multiSelectable +/// Indicates whether the element's +/// orientation is horizontal, vertical, or unknown/ambiguous. Value type: +/// [enum@Orientation] +case orientation +/// Defines a short hint (a word or short +/// phrase) intended to aid the user with data entry when the control has no +/// value. A hint could be a sample value or a brief description of the expected +/// format. Value type: string +case placeholder +/// Indicates that the element is not editable, +/// but is otherwise operable. Value type: boolean +case readOnly +/// Indicates that user input is required on +/// the element before a form may be submitted. Value type: boolean +case required +/// Defines a human-readable, +/// author-localized description for the role of an element. Value type: string +case roleDescription +/// Indicates if items in a table or grid are +/// sorted in ascending or descending order. Value type: [enum@AccessibleSort] +case sort +/// Defines the maximum allowed value for a +/// range widget. Value type: double +case valueMax +/// Defines the minimum allowed value for a +/// range widget. Value type: double +case valueMin +/// Defines the current value for a range widget. +/// Value type: double +case valueNow +/// Defines the human readable text alternative +/// of aria-valuenow for a range widget. Value type: string +case valueText public static var type: GType { - gtk_accessible_property_get_type() - } + gtk_accessible_property_get_type() +} public init(from gtkEnum: GtkAccessibleProperty) { switch gtkEnum { case GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE: - self = .autocomplete - case GTK_ACCESSIBLE_PROPERTY_DESCRIPTION: - self = .description - case GTK_ACCESSIBLE_PROPERTY_HAS_POPUP: - self = .hasPopup - case GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS: - self = .keyShortcuts - case GTK_ACCESSIBLE_PROPERTY_LABEL: - self = .label - case GTK_ACCESSIBLE_PROPERTY_LEVEL: - self = .level - case GTK_ACCESSIBLE_PROPERTY_MODAL: - self = .modal - case GTK_ACCESSIBLE_PROPERTY_MULTI_LINE: - self = .multiLine - case GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE: - self = .multiSelectable - case GTK_ACCESSIBLE_PROPERTY_ORIENTATION: - self = .orientation - case GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER: - self = .placeholder - case GTK_ACCESSIBLE_PROPERTY_READ_ONLY: - self = .readOnly - case GTK_ACCESSIBLE_PROPERTY_REQUIRED: - self = .required - case GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION: - self = .roleDescription - case GTK_ACCESSIBLE_PROPERTY_SORT: - self = .sort - case GTK_ACCESSIBLE_PROPERTY_VALUE_MAX: - self = .valueMax - case GTK_ACCESSIBLE_PROPERTY_VALUE_MIN: - self = .valueMin - case GTK_ACCESSIBLE_PROPERTY_VALUE_NOW: - self = .valueNow - case GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT: - self = .valueText + self = .autocomplete +case GTK_ACCESSIBLE_PROPERTY_DESCRIPTION: + self = .description +case GTK_ACCESSIBLE_PROPERTY_HAS_POPUP: + self = .hasPopup +case GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS: + self = .keyShortcuts +case GTK_ACCESSIBLE_PROPERTY_LABEL: + self = .label +case GTK_ACCESSIBLE_PROPERTY_LEVEL: + self = .level +case GTK_ACCESSIBLE_PROPERTY_MODAL: + self = .modal +case GTK_ACCESSIBLE_PROPERTY_MULTI_LINE: + self = .multiLine +case GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE: + self = .multiSelectable +case GTK_ACCESSIBLE_PROPERTY_ORIENTATION: + self = .orientation +case GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER: + self = .placeholder +case GTK_ACCESSIBLE_PROPERTY_READ_ONLY: + self = .readOnly +case GTK_ACCESSIBLE_PROPERTY_REQUIRED: + self = .required +case GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION: + self = .roleDescription +case GTK_ACCESSIBLE_PROPERTY_SORT: + self = .sort +case GTK_ACCESSIBLE_PROPERTY_VALUE_MAX: + self = .valueMax +case GTK_ACCESSIBLE_PROPERTY_VALUE_MIN: + self = .valueMin +case GTK_ACCESSIBLE_PROPERTY_VALUE_NOW: + self = .valueNow +case GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT: + self = .valueText default: fatalError("Unsupported GtkAccessibleProperty enum value: \(gtkEnum.rawValue)") } @@ -125,43 +125,43 @@ public enum AccessibleProperty: GValueRepresentableEnum { public func toGtk() -> GtkAccessibleProperty { switch self { case .autocomplete: - return GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE - case .description: - return GTK_ACCESSIBLE_PROPERTY_DESCRIPTION - case .hasPopup: - return GTK_ACCESSIBLE_PROPERTY_HAS_POPUP - case .keyShortcuts: - return GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS - case .label: - return GTK_ACCESSIBLE_PROPERTY_LABEL - case .level: - return GTK_ACCESSIBLE_PROPERTY_LEVEL - case .modal: - return GTK_ACCESSIBLE_PROPERTY_MODAL - case .multiLine: - return GTK_ACCESSIBLE_PROPERTY_MULTI_LINE - case .multiSelectable: - return GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE - case .orientation: - return GTK_ACCESSIBLE_PROPERTY_ORIENTATION - case .placeholder: - return GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER - case .readOnly: - return GTK_ACCESSIBLE_PROPERTY_READ_ONLY - case .required: - return GTK_ACCESSIBLE_PROPERTY_REQUIRED - case .roleDescription: - return GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION - case .sort: - return GTK_ACCESSIBLE_PROPERTY_SORT - case .valueMax: - return GTK_ACCESSIBLE_PROPERTY_VALUE_MAX - case .valueMin: - return GTK_ACCESSIBLE_PROPERTY_VALUE_MIN - case .valueNow: - return GTK_ACCESSIBLE_PROPERTY_VALUE_NOW - case .valueText: - return GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT + return GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE +case .description: + return GTK_ACCESSIBLE_PROPERTY_DESCRIPTION +case .hasPopup: + return GTK_ACCESSIBLE_PROPERTY_HAS_POPUP +case .keyShortcuts: + return GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS +case .label: + return GTK_ACCESSIBLE_PROPERTY_LABEL +case .level: + return GTK_ACCESSIBLE_PROPERTY_LEVEL +case .modal: + return GTK_ACCESSIBLE_PROPERTY_MODAL +case .multiLine: + return GTK_ACCESSIBLE_PROPERTY_MULTI_LINE +case .multiSelectable: + return GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE +case .orientation: + return GTK_ACCESSIBLE_PROPERTY_ORIENTATION +case .placeholder: + return GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER +case .readOnly: + return GTK_ACCESSIBLE_PROPERTY_READ_ONLY +case .required: + return GTK_ACCESSIBLE_PROPERTY_REQUIRED +case .roleDescription: + return GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION +case .sort: + return GTK_ACCESSIBLE_PROPERTY_SORT +case .valueMax: + return GTK_ACCESSIBLE_PROPERTY_VALUE_MAX +case .valueMin: + return GTK_ACCESSIBLE_PROPERTY_VALUE_MIN +case .valueNow: + return GTK_ACCESSIBLE_PROPERTY_VALUE_NOW +case .valueText: + return GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AccessibleRelation.swift b/Sources/Gtk/Generated/AccessibleRelation.swift index 8e6cba4ed1..a88676ffc6 100644 --- a/Sources/Gtk/Generated/AccessibleRelation.swift +++ b/Sources/Gtk/Generated/AccessibleRelation.swift @@ -1,116 +1,116 @@ import CGtk /// The possible accessible relations of a [iface@Accessible]. -/// +/// /// Accessible relations can be references to other widgets, /// integers or strings. public enum AccessibleRelation: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleRelation /// Identifies the currently active - /// element when focus is on a composite widget, combobox, textbox, group, - /// or application. Value type: reference - case activeDescendant - /// Defines the total number of columns - /// in a table, grid, or treegrid. Value type: integer - case colCount - /// Defines an element's column index or - /// position with respect to the total number of columns within a table, - /// grid, or treegrid. Value type: integer - case colIndex - /// Defines a human readable text - /// alternative of %GTK_ACCESSIBLE_RELATION_COL_INDEX. Value type: string - case colIndexText - /// Defines the number of columns spanned - /// by a cell or gridcell within a table, grid, or treegrid. Value type: integer - case colSpan - /// Identifies the element (or elements) whose - /// contents or presence are controlled by the current element. Value type: reference - case controls - /// Identifies the element (or elements) - /// that describes the object. Value type: reference - case describedBy - /// Identifies the element (or elements) that - /// provide additional information related to the object. Value type: reference - case details - /// Identifies the element (or elements) that - /// provide an error message for an object. Value type: reference - case errorMessage - /// Identifies the next element (or elements) - /// in an alternate reading order of content which, at the user's discretion, - /// allows assistive technology to override the general default of reading in - /// document source order. Value type: reference - case flowTo - /// Identifies the element (or elements) - /// that labels the current element. Value type: reference - case labelledBy - /// Identifies an element (or elements) in order - /// to define a visual, functional, or contextual parent/child relationship - /// between elements where the widget hierarchy cannot be used to represent - /// the relationship. Value type: reference - case owns - /// Defines an element's number or position - /// in the current set of listitems or treeitems. Value type: integer - case posInSet - /// Defines the total number of rows in a table, - /// grid, or treegrid. Value type: integer - case rowCount - /// Defines an element's row index or position - /// with respect to the total number of rows within a table, grid, or treegrid. - /// Value type: integer - case rowIndex - /// Defines a human readable text - /// alternative of aria-rowindex. Value type: string - case rowIndexText - /// Defines the number of rows spanned by a - /// cell or gridcell within a table, grid, or treegrid. Value type: integer - case rowSpan - /// Defines the number of items in the current - /// set of listitems or treeitems. Value type: integer - case setSize +/// element when focus is on a composite widget, combobox, textbox, group, +/// or application. Value type: reference +case activeDescendant +/// Defines the total number of columns +/// in a table, grid, or treegrid. Value type: integer +case colCount +/// Defines an element's column index or +/// position with respect to the total number of columns within a table, +/// grid, or treegrid. Value type: integer +case colIndex +/// Defines a human readable text +/// alternative of %GTK_ACCESSIBLE_RELATION_COL_INDEX. Value type: string +case colIndexText +/// Defines the number of columns spanned +/// by a cell or gridcell within a table, grid, or treegrid. Value type: integer +case colSpan +/// Identifies the element (or elements) whose +/// contents or presence are controlled by the current element. Value type: reference +case controls +/// Identifies the element (or elements) +/// that describes the object. Value type: reference +case describedBy +/// Identifies the element (or elements) that +/// provide additional information related to the object. Value type: reference +case details +/// Identifies the element (or elements) that +/// provide an error message for an object. Value type: reference +case errorMessage +/// Identifies the next element (or elements) +/// in an alternate reading order of content which, at the user's discretion, +/// allows assistive technology to override the general default of reading in +/// document source order. Value type: reference +case flowTo +/// Identifies the element (or elements) +/// that labels the current element. Value type: reference +case labelledBy +/// Identifies an element (or elements) in order +/// to define a visual, functional, or contextual parent/child relationship +/// between elements where the widget hierarchy cannot be used to represent +/// the relationship. Value type: reference +case owns +/// Defines an element's number or position +/// in the current set of listitems or treeitems. Value type: integer +case posInSet +/// Defines the total number of rows in a table, +/// grid, or treegrid. Value type: integer +case rowCount +/// Defines an element's row index or position +/// with respect to the total number of rows within a table, grid, or treegrid. +/// Value type: integer +case rowIndex +/// Defines a human readable text +/// alternative of aria-rowindex. Value type: string +case rowIndexText +/// Defines the number of rows spanned by a +/// cell or gridcell within a table, grid, or treegrid. Value type: integer +case rowSpan +/// Defines the number of items in the current +/// set of listitems or treeitems. Value type: integer +case setSize public static var type: GType { - gtk_accessible_relation_get_type() - } + gtk_accessible_relation_get_type() +} public init(from gtkEnum: GtkAccessibleRelation) { switch gtkEnum { case GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT: - self = .activeDescendant - case GTK_ACCESSIBLE_RELATION_COL_COUNT: - self = .colCount - case GTK_ACCESSIBLE_RELATION_COL_INDEX: - self = .colIndex - case GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT: - self = .colIndexText - case GTK_ACCESSIBLE_RELATION_COL_SPAN: - self = .colSpan - case GTK_ACCESSIBLE_RELATION_CONTROLS: - self = .controls - case GTK_ACCESSIBLE_RELATION_DESCRIBED_BY: - self = .describedBy - case GTK_ACCESSIBLE_RELATION_DETAILS: - self = .details - case GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE: - self = .errorMessage - case GTK_ACCESSIBLE_RELATION_FLOW_TO: - self = .flowTo - case GTK_ACCESSIBLE_RELATION_LABELLED_BY: - self = .labelledBy - case GTK_ACCESSIBLE_RELATION_OWNS: - self = .owns - case GTK_ACCESSIBLE_RELATION_POS_IN_SET: - self = .posInSet - case GTK_ACCESSIBLE_RELATION_ROW_COUNT: - self = .rowCount - case GTK_ACCESSIBLE_RELATION_ROW_INDEX: - self = .rowIndex - case GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT: - self = .rowIndexText - case GTK_ACCESSIBLE_RELATION_ROW_SPAN: - self = .rowSpan - case GTK_ACCESSIBLE_RELATION_SET_SIZE: - self = .setSize + self = .activeDescendant +case GTK_ACCESSIBLE_RELATION_COL_COUNT: + self = .colCount +case GTK_ACCESSIBLE_RELATION_COL_INDEX: + self = .colIndex +case GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT: + self = .colIndexText +case GTK_ACCESSIBLE_RELATION_COL_SPAN: + self = .colSpan +case GTK_ACCESSIBLE_RELATION_CONTROLS: + self = .controls +case GTK_ACCESSIBLE_RELATION_DESCRIBED_BY: + self = .describedBy +case GTK_ACCESSIBLE_RELATION_DETAILS: + self = .details +case GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE: + self = .errorMessage +case GTK_ACCESSIBLE_RELATION_FLOW_TO: + self = .flowTo +case GTK_ACCESSIBLE_RELATION_LABELLED_BY: + self = .labelledBy +case GTK_ACCESSIBLE_RELATION_OWNS: + self = .owns +case GTK_ACCESSIBLE_RELATION_POS_IN_SET: + self = .posInSet +case GTK_ACCESSIBLE_RELATION_ROW_COUNT: + self = .rowCount +case GTK_ACCESSIBLE_RELATION_ROW_INDEX: + self = .rowIndex +case GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT: + self = .rowIndexText +case GTK_ACCESSIBLE_RELATION_ROW_SPAN: + self = .rowSpan +case GTK_ACCESSIBLE_RELATION_SET_SIZE: + self = .setSize default: fatalError("Unsupported GtkAccessibleRelation enum value: \(gtkEnum.rawValue)") } @@ -119,41 +119,41 @@ public enum AccessibleRelation: GValueRepresentableEnum { public func toGtk() -> GtkAccessibleRelation { switch self { case .activeDescendant: - return GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT - case .colCount: - return GTK_ACCESSIBLE_RELATION_COL_COUNT - case .colIndex: - return GTK_ACCESSIBLE_RELATION_COL_INDEX - case .colIndexText: - return GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT - case .colSpan: - return GTK_ACCESSIBLE_RELATION_COL_SPAN - case .controls: - return GTK_ACCESSIBLE_RELATION_CONTROLS - case .describedBy: - return GTK_ACCESSIBLE_RELATION_DESCRIBED_BY - case .details: - return GTK_ACCESSIBLE_RELATION_DETAILS - case .errorMessage: - return GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE - case .flowTo: - return GTK_ACCESSIBLE_RELATION_FLOW_TO - case .labelledBy: - return GTK_ACCESSIBLE_RELATION_LABELLED_BY - case .owns: - return GTK_ACCESSIBLE_RELATION_OWNS - case .posInSet: - return GTK_ACCESSIBLE_RELATION_POS_IN_SET - case .rowCount: - return GTK_ACCESSIBLE_RELATION_ROW_COUNT - case .rowIndex: - return GTK_ACCESSIBLE_RELATION_ROW_INDEX - case .rowIndexText: - return GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT - case .rowSpan: - return GTK_ACCESSIBLE_RELATION_ROW_SPAN - case .setSize: - return GTK_ACCESSIBLE_RELATION_SET_SIZE + return GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT +case .colCount: + return GTK_ACCESSIBLE_RELATION_COL_COUNT +case .colIndex: + return GTK_ACCESSIBLE_RELATION_COL_INDEX +case .colIndexText: + return GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT +case .colSpan: + return GTK_ACCESSIBLE_RELATION_COL_SPAN +case .controls: + return GTK_ACCESSIBLE_RELATION_CONTROLS +case .describedBy: + return GTK_ACCESSIBLE_RELATION_DESCRIBED_BY +case .details: + return GTK_ACCESSIBLE_RELATION_DETAILS +case .errorMessage: + return GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE +case .flowTo: + return GTK_ACCESSIBLE_RELATION_FLOW_TO +case .labelledBy: + return GTK_ACCESSIBLE_RELATION_LABELLED_BY +case .owns: + return GTK_ACCESSIBLE_RELATION_OWNS +case .posInSet: + return GTK_ACCESSIBLE_RELATION_POS_IN_SET +case .rowCount: + return GTK_ACCESSIBLE_RELATION_ROW_COUNT +case .rowIndex: + return GTK_ACCESSIBLE_RELATION_ROW_INDEX +case .rowIndexText: + return GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT +case .rowSpan: + return GTK_ACCESSIBLE_RELATION_ROW_SPAN +case .setSize: + return GTK_ACCESSIBLE_RELATION_SET_SIZE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AccessibleRole.swift b/Sources/Gtk/Generated/AccessibleRole.swift index b2e0c1d12d..c9e2ceb871 100644 --- a/Sources/Gtk/Generated/AccessibleRole.swift +++ b/Sources/Gtk/Generated/AccessibleRole.swift @@ -1,355 +1,355 @@ import CGtk /// The accessible role for a [iface@Accessible] implementation. -/// +/// /// Abstract roles are only used as part of the ontology; application /// developers must not use abstract roles in their code. public enum AccessibleRole: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleRole /// An element with important, and usually - /// time-sensitive, information - case alert - /// A type of dialog that contains an - /// alert message - case alertDialog - /// Unused - case banner - /// An input element that allows for - /// user-triggered actions when clicked or pressed - case button - /// Unused - case caption - /// Unused - case cell - /// A checkable input element that has - /// three possible values: `true`, `false`, or `mixed` - case checkbox - /// A header in a columned list. - case columnHeader - /// An input that controls another element, - /// such as a list or a grid, that can dynamically pop up to help the user - /// set the value of the input - case comboBox - /// Abstract role. - case command - /// Abstract role. - case composite - /// A dialog is a window that is designed to interrupt - /// the current processing of an application in order to prompt the user to enter - /// information or require a response. - case dialog - /// Content that assistive technology users may want to - /// browse in a reading mode. - case document - /// Unused - case feed - /// Unused - case form - /// A nameless container that has no semantic meaning - /// of its own. This is the role that GTK uses by default for widgets. - case generic - /// A grid of items. - case grid - /// An item in a grid or tree grid. - case gridCell - /// An element that groups multiple related widgets. GTK uses - /// this role for various containers, like [class@Gtk.HeaderBar] or [class@Gtk.Notebook]. - case group - /// Unused - case heading - /// An image. - case img - /// Abstract role. - case input - /// A visible name or caption for a user interface component. - case label - /// Abstract role. - case landmark - /// Unused - case legend - /// A clickable link. - case link - /// A list of items. - case list - /// Unused. - case listBox - /// An item in a list. - case listItem - /// Unused - case log - /// Unused - case main - /// Unused - case marquee - /// Unused - case math - /// An element that represents a value within a known range. - case meter - /// A menu. - case menu - /// A menubar. - case menuBar - /// An item in a menu. - case menuItem - /// A check item in a menu. - case menuItemCheckbox - /// A radio item in a menu. - case menuItemRadio - /// Unused - case navigation - /// An element that is not represented to accessibility technologies. - /// This role is synonymous to @GTK_ACCESSIBLE_ROLE_PRESENTATION. - case none - /// Unused - case note - /// Unused - case option - /// An element that is not represented to accessibility technologies. - /// This role is synonymous to @GTK_ACCESSIBLE_ROLE_NONE. - case presentation - /// An element that displays the progress - /// status for tasks that take a long time. - case progressBar - /// A checkable input in a group of radio roles, - /// only one of which can be checked at a time. - case radio - /// Unused - case radioGroup - /// Abstract role. - case range - /// Unused - case region - /// A row in a columned list. - case row - /// Unused - case rowGroup - /// Unused - case rowHeader - /// A graphical object that controls the scrolling - /// of content within a viewing area, regardless of whether the content is fully - /// displayed within the viewing area. - case scrollbar - /// Unused - case search - /// A type of textbox intended for specifying - /// search criteria. - case searchBox - /// Abstract role. - case section - /// Abstract role. - case sectionHead - /// Abstract role. - case select - /// A divider that separates and distinguishes - /// sections of content or groups of menuitems. - case separator - /// A user input where the user selects a value - /// from within a given range. - case slider - /// A form of range that expects the user to - /// select from among discrete choices. - case spinButton - /// Unused - case status - /// Abstract role. - case structure - /// A type of checkbox that represents on/off values, - /// as opposed to checked/unchecked values. - case switch_ - /// An item in a list of tab used for switching pages. - case tab - /// Unused - case table - /// A list of tabs for switching pages. - case tabList - /// A page in a notebook or stack. - case tabPanel - /// A type of input that allows free-form text - /// as its value. - case textBox - /// Unused - case time - /// Unused - case timer - /// Unused - case toolbar - /// Unused - case tooltip - /// Unused - case tree - /// A treeview-like, columned list. - case treeGrid - /// Unused - case treeItem - /// Abstract role for interactive components of a - /// graphical user interface - case widget - /// Abstract role for windows. - case window +/// time-sensitive, information +case alert +/// A type of dialog that contains an +/// alert message +case alertDialog +/// Unused +case banner +/// An input element that allows for +/// user-triggered actions when clicked or pressed +case button +/// Unused +case caption +/// Unused +case cell +/// A checkable input element that has +/// three possible values: `true`, `false`, or `mixed` +case checkbox +/// A header in a columned list. +case columnHeader +/// An input that controls another element, +/// such as a list or a grid, that can dynamically pop up to help the user +/// set the value of the input +case comboBox +/// Abstract role. +case command +/// Abstract role. +case composite +/// A dialog is a window that is designed to interrupt +/// the current processing of an application in order to prompt the user to enter +/// information or require a response. +case dialog +/// Content that assistive technology users may want to +/// browse in a reading mode. +case document +/// Unused +case feed +/// Unused +case form +/// A nameless container that has no semantic meaning +/// of its own. This is the role that GTK uses by default for widgets. +case generic +/// A grid of items. +case grid +/// An item in a grid or tree grid. +case gridCell +/// An element that groups multiple related widgets. GTK uses +/// this role for various containers, like [class@Gtk.HeaderBar] or [class@Gtk.Notebook]. +case group +/// Unused +case heading +/// An image. +case img +/// Abstract role. +case input +/// A visible name or caption for a user interface component. +case label +/// Abstract role. +case landmark +/// Unused +case legend +/// A clickable link. +case link +/// A list of items. +case list +/// Unused. +case listBox +/// An item in a list. +case listItem +/// Unused +case log +/// Unused +case main +/// Unused +case marquee +/// Unused +case math +/// An element that represents a value within a known range. +case meter +/// A menu. +case menu +/// A menubar. +case menuBar +/// An item in a menu. +case menuItem +/// A check item in a menu. +case menuItemCheckbox +/// A radio item in a menu. +case menuItemRadio +/// Unused +case navigation +/// An element that is not represented to accessibility technologies. +/// This role is synonymous to @GTK_ACCESSIBLE_ROLE_PRESENTATION. +case none +/// Unused +case note +/// Unused +case option +/// An element that is not represented to accessibility technologies. +/// This role is synonymous to @GTK_ACCESSIBLE_ROLE_NONE. +case presentation +/// An element that displays the progress +/// status for tasks that take a long time. +case progressBar +/// A checkable input in a group of radio roles, +/// only one of which can be checked at a time. +case radio +/// Unused +case radioGroup +/// Abstract role. +case range +/// Unused +case region +/// A row in a columned list. +case row +/// Unused +case rowGroup +/// Unused +case rowHeader +/// A graphical object that controls the scrolling +/// of content within a viewing area, regardless of whether the content is fully +/// displayed within the viewing area. +case scrollbar +/// Unused +case search +/// A type of textbox intended for specifying +/// search criteria. +case searchBox +/// Abstract role. +case section +/// Abstract role. +case sectionHead +/// Abstract role. +case select +/// A divider that separates and distinguishes +/// sections of content or groups of menuitems. +case separator +/// A user input where the user selects a value +/// from within a given range. +case slider +/// A form of range that expects the user to +/// select from among discrete choices. +case spinButton +/// Unused +case status +/// Abstract role. +case structure +/// A type of checkbox that represents on/off values, +/// as opposed to checked/unchecked values. +case switch_ +/// An item in a list of tab used for switching pages. +case tab +/// Unused +case table +/// A list of tabs for switching pages. +case tabList +/// A page in a notebook or stack. +case tabPanel +/// A type of input that allows free-form text +/// as its value. +case textBox +/// Unused +case time +/// Unused +case timer +/// Unused +case toolbar +/// Unused +case tooltip +/// Unused +case tree +/// A treeview-like, columned list. +case treeGrid +/// Unused +case treeItem +/// Abstract role for interactive components of a +/// graphical user interface +case widget +/// Abstract role for windows. +case window public static var type: GType { - gtk_accessible_role_get_type() - } + gtk_accessible_role_get_type() +} public init(from gtkEnum: GtkAccessibleRole) { switch gtkEnum { case GTK_ACCESSIBLE_ROLE_ALERT: - self = .alert - case GTK_ACCESSIBLE_ROLE_ALERT_DIALOG: - self = .alertDialog - case GTK_ACCESSIBLE_ROLE_BANNER: - self = .banner - case GTK_ACCESSIBLE_ROLE_BUTTON: - self = .button - case GTK_ACCESSIBLE_ROLE_CAPTION: - self = .caption - case GTK_ACCESSIBLE_ROLE_CELL: - self = .cell - case GTK_ACCESSIBLE_ROLE_CHECKBOX: - self = .checkbox - case GTK_ACCESSIBLE_ROLE_COLUMN_HEADER: - self = .columnHeader - case GTK_ACCESSIBLE_ROLE_COMBO_BOX: - self = .comboBox - case GTK_ACCESSIBLE_ROLE_COMMAND: - self = .command - case GTK_ACCESSIBLE_ROLE_COMPOSITE: - self = .composite - case GTK_ACCESSIBLE_ROLE_DIALOG: - self = .dialog - case GTK_ACCESSIBLE_ROLE_DOCUMENT: - self = .document - case GTK_ACCESSIBLE_ROLE_FEED: - self = .feed - case GTK_ACCESSIBLE_ROLE_FORM: - self = .form - case GTK_ACCESSIBLE_ROLE_GENERIC: - self = .generic - case GTK_ACCESSIBLE_ROLE_GRID: - self = .grid - case GTK_ACCESSIBLE_ROLE_GRID_CELL: - self = .gridCell - case GTK_ACCESSIBLE_ROLE_GROUP: - self = .group - case GTK_ACCESSIBLE_ROLE_HEADING: - self = .heading - case GTK_ACCESSIBLE_ROLE_IMG: - self = .img - case GTK_ACCESSIBLE_ROLE_INPUT: - self = .input - case GTK_ACCESSIBLE_ROLE_LABEL: - self = .label - case GTK_ACCESSIBLE_ROLE_LANDMARK: - self = .landmark - case GTK_ACCESSIBLE_ROLE_LEGEND: - self = .legend - case GTK_ACCESSIBLE_ROLE_LINK: - self = .link - case GTK_ACCESSIBLE_ROLE_LIST: - self = .list - case GTK_ACCESSIBLE_ROLE_LIST_BOX: - self = .listBox - case GTK_ACCESSIBLE_ROLE_LIST_ITEM: - self = .listItem - case GTK_ACCESSIBLE_ROLE_LOG: - self = .log - case GTK_ACCESSIBLE_ROLE_MAIN: - self = .main - case GTK_ACCESSIBLE_ROLE_MARQUEE: - self = .marquee - case GTK_ACCESSIBLE_ROLE_MATH: - self = .math - case GTK_ACCESSIBLE_ROLE_METER: - self = .meter - case GTK_ACCESSIBLE_ROLE_MENU: - self = .menu - case GTK_ACCESSIBLE_ROLE_MENU_BAR: - self = .menuBar - case GTK_ACCESSIBLE_ROLE_MENU_ITEM: - self = .menuItem - case GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX: - self = .menuItemCheckbox - case GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO: - self = .menuItemRadio - case GTK_ACCESSIBLE_ROLE_NAVIGATION: - self = .navigation - case GTK_ACCESSIBLE_ROLE_NONE: - self = .none - case GTK_ACCESSIBLE_ROLE_NOTE: - self = .note - case GTK_ACCESSIBLE_ROLE_OPTION: - self = .option - case GTK_ACCESSIBLE_ROLE_PRESENTATION: - self = .presentation - case GTK_ACCESSIBLE_ROLE_PROGRESS_BAR: - self = .progressBar - case GTK_ACCESSIBLE_ROLE_RADIO: - self = .radio - case GTK_ACCESSIBLE_ROLE_RADIO_GROUP: - self = .radioGroup - case GTK_ACCESSIBLE_ROLE_RANGE: - self = .range - case GTK_ACCESSIBLE_ROLE_REGION: - self = .region - case GTK_ACCESSIBLE_ROLE_ROW: - self = .row - case GTK_ACCESSIBLE_ROLE_ROW_GROUP: - self = .rowGroup - case GTK_ACCESSIBLE_ROLE_ROW_HEADER: - self = .rowHeader - case GTK_ACCESSIBLE_ROLE_SCROLLBAR: - self = .scrollbar - case GTK_ACCESSIBLE_ROLE_SEARCH: - self = .search - case GTK_ACCESSIBLE_ROLE_SEARCH_BOX: - self = .searchBox - case GTK_ACCESSIBLE_ROLE_SECTION: - self = .section - case GTK_ACCESSIBLE_ROLE_SECTION_HEAD: - self = .sectionHead - case GTK_ACCESSIBLE_ROLE_SELECT: - self = .select - case GTK_ACCESSIBLE_ROLE_SEPARATOR: - self = .separator - case GTK_ACCESSIBLE_ROLE_SLIDER: - self = .slider - case GTK_ACCESSIBLE_ROLE_SPIN_BUTTON: - self = .spinButton - case GTK_ACCESSIBLE_ROLE_STATUS: - self = .status - case GTK_ACCESSIBLE_ROLE_STRUCTURE: - self = .structure - case GTK_ACCESSIBLE_ROLE_SWITCH: - self = .switch_ - case GTK_ACCESSIBLE_ROLE_TAB: - self = .tab - case GTK_ACCESSIBLE_ROLE_TABLE: - self = .table - case GTK_ACCESSIBLE_ROLE_TAB_LIST: - self = .tabList - case GTK_ACCESSIBLE_ROLE_TAB_PANEL: - self = .tabPanel - case GTK_ACCESSIBLE_ROLE_TEXT_BOX: - self = .textBox - case GTK_ACCESSIBLE_ROLE_TIME: - self = .time - case GTK_ACCESSIBLE_ROLE_TIMER: - self = .timer - case GTK_ACCESSIBLE_ROLE_TOOLBAR: - self = .toolbar - case GTK_ACCESSIBLE_ROLE_TOOLTIP: - self = .tooltip - case GTK_ACCESSIBLE_ROLE_TREE: - self = .tree - case GTK_ACCESSIBLE_ROLE_TREE_GRID: - self = .treeGrid - case GTK_ACCESSIBLE_ROLE_TREE_ITEM: - self = .treeItem - case GTK_ACCESSIBLE_ROLE_WIDGET: - self = .widget - case GTK_ACCESSIBLE_ROLE_WINDOW: - self = .window + self = .alert +case GTK_ACCESSIBLE_ROLE_ALERT_DIALOG: + self = .alertDialog +case GTK_ACCESSIBLE_ROLE_BANNER: + self = .banner +case GTK_ACCESSIBLE_ROLE_BUTTON: + self = .button +case GTK_ACCESSIBLE_ROLE_CAPTION: + self = .caption +case GTK_ACCESSIBLE_ROLE_CELL: + self = .cell +case GTK_ACCESSIBLE_ROLE_CHECKBOX: + self = .checkbox +case GTK_ACCESSIBLE_ROLE_COLUMN_HEADER: + self = .columnHeader +case GTK_ACCESSIBLE_ROLE_COMBO_BOX: + self = .comboBox +case GTK_ACCESSIBLE_ROLE_COMMAND: + self = .command +case GTK_ACCESSIBLE_ROLE_COMPOSITE: + self = .composite +case GTK_ACCESSIBLE_ROLE_DIALOG: + self = .dialog +case GTK_ACCESSIBLE_ROLE_DOCUMENT: + self = .document +case GTK_ACCESSIBLE_ROLE_FEED: + self = .feed +case GTK_ACCESSIBLE_ROLE_FORM: + self = .form +case GTK_ACCESSIBLE_ROLE_GENERIC: + self = .generic +case GTK_ACCESSIBLE_ROLE_GRID: + self = .grid +case GTK_ACCESSIBLE_ROLE_GRID_CELL: + self = .gridCell +case GTK_ACCESSIBLE_ROLE_GROUP: + self = .group +case GTK_ACCESSIBLE_ROLE_HEADING: + self = .heading +case GTK_ACCESSIBLE_ROLE_IMG: + self = .img +case GTK_ACCESSIBLE_ROLE_INPUT: + self = .input +case GTK_ACCESSIBLE_ROLE_LABEL: + self = .label +case GTK_ACCESSIBLE_ROLE_LANDMARK: + self = .landmark +case GTK_ACCESSIBLE_ROLE_LEGEND: + self = .legend +case GTK_ACCESSIBLE_ROLE_LINK: + self = .link +case GTK_ACCESSIBLE_ROLE_LIST: + self = .list +case GTK_ACCESSIBLE_ROLE_LIST_BOX: + self = .listBox +case GTK_ACCESSIBLE_ROLE_LIST_ITEM: + self = .listItem +case GTK_ACCESSIBLE_ROLE_LOG: + self = .log +case GTK_ACCESSIBLE_ROLE_MAIN: + self = .main +case GTK_ACCESSIBLE_ROLE_MARQUEE: + self = .marquee +case GTK_ACCESSIBLE_ROLE_MATH: + self = .math +case GTK_ACCESSIBLE_ROLE_METER: + self = .meter +case GTK_ACCESSIBLE_ROLE_MENU: + self = .menu +case GTK_ACCESSIBLE_ROLE_MENU_BAR: + self = .menuBar +case GTK_ACCESSIBLE_ROLE_MENU_ITEM: + self = .menuItem +case GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX: + self = .menuItemCheckbox +case GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO: + self = .menuItemRadio +case GTK_ACCESSIBLE_ROLE_NAVIGATION: + self = .navigation +case GTK_ACCESSIBLE_ROLE_NONE: + self = .none +case GTK_ACCESSIBLE_ROLE_NOTE: + self = .note +case GTK_ACCESSIBLE_ROLE_OPTION: + self = .option +case GTK_ACCESSIBLE_ROLE_PRESENTATION: + self = .presentation +case GTK_ACCESSIBLE_ROLE_PROGRESS_BAR: + self = .progressBar +case GTK_ACCESSIBLE_ROLE_RADIO: + self = .radio +case GTK_ACCESSIBLE_ROLE_RADIO_GROUP: + self = .radioGroup +case GTK_ACCESSIBLE_ROLE_RANGE: + self = .range +case GTK_ACCESSIBLE_ROLE_REGION: + self = .region +case GTK_ACCESSIBLE_ROLE_ROW: + self = .row +case GTK_ACCESSIBLE_ROLE_ROW_GROUP: + self = .rowGroup +case GTK_ACCESSIBLE_ROLE_ROW_HEADER: + self = .rowHeader +case GTK_ACCESSIBLE_ROLE_SCROLLBAR: + self = .scrollbar +case GTK_ACCESSIBLE_ROLE_SEARCH: + self = .search +case GTK_ACCESSIBLE_ROLE_SEARCH_BOX: + self = .searchBox +case GTK_ACCESSIBLE_ROLE_SECTION: + self = .section +case GTK_ACCESSIBLE_ROLE_SECTION_HEAD: + self = .sectionHead +case GTK_ACCESSIBLE_ROLE_SELECT: + self = .select +case GTK_ACCESSIBLE_ROLE_SEPARATOR: + self = .separator +case GTK_ACCESSIBLE_ROLE_SLIDER: + self = .slider +case GTK_ACCESSIBLE_ROLE_SPIN_BUTTON: + self = .spinButton +case GTK_ACCESSIBLE_ROLE_STATUS: + self = .status +case GTK_ACCESSIBLE_ROLE_STRUCTURE: + self = .structure +case GTK_ACCESSIBLE_ROLE_SWITCH: + self = .switch_ +case GTK_ACCESSIBLE_ROLE_TAB: + self = .tab +case GTK_ACCESSIBLE_ROLE_TABLE: + self = .table +case GTK_ACCESSIBLE_ROLE_TAB_LIST: + self = .tabList +case GTK_ACCESSIBLE_ROLE_TAB_PANEL: + self = .tabPanel +case GTK_ACCESSIBLE_ROLE_TEXT_BOX: + self = .textBox +case GTK_ACCESSIBLE_ROLE_TIME: + self = .time +case GTK_ACCESSIBLE_ROLE_TIMER: + self = .timer +case GTK_ACCESSIBLE_ROLE_TOOLBAR: + self = .toolbar +case GTK_ACCESSIBLE_ROLE_TOOLTIP: + self = .tooltip +case GTK_ACCESSIBLE_ROLE_TREE: + self = .tree +case GTK_ACCESSIBLE_ROLE_TREE_GRID: + self = .treeGrid +case GTK_ACCESSIBLE_ROLE_TREE_ITEM: + self = .treeItem +case GTK_ACCESSIBLE_ROLE_WIDGET: + self = .widget +case GTK_ACCESSIBLE_ROLE_WINDOW: + self = .window default: fatalError("Unsupported GtkAccessibleRole enum value: \(gtkEnum.rawValue)") } @@ -358,161 +358,161 @@ public enum AccessibleRole: GValueRepresentableEnum { public func toGtk() -> GtkAccessibleRole { switch self { case .alert: - return GTK_ACCESSIBLE_ROLE_ALERT - case .alertDialog: - return GTK_ACCESSIBLE_ROLE_ALERT_DIALOG - case .banner: - return GTK_ACCESSIBLE_ROLE_BANNER - case .button: - return GTK_ACCESSIBLE_ROLE_BUTTON - case .caption: - return GTK_ACCESSIBLE_ROLE_CAPTION - case .cell: - return GTK_ACCESSIBLE_ROLE_CELL - case .checkbox: - return GTK_ACCESSIBLE_ROLE_CHECKBOX - case .columnHeader: - return GTK_ACCESSIBLE_ROLE_COLUMN_HEADER - case .comboBox: - return GTK_ACCESSIBLE_ROLE_COMBO_BOX - case .command: - return GTK_ACCESSIBLE_ROLE_COMMAND - case .composite: - return GTK_ACCESSIBLE_ROLE_COMPOSITE - case .dialog: - return GTK_ACCESSIBLE_ROLE_DIALOG - case .document: - return GTK_ACCESSIBLE_ROLE_DOCUMENT - case .feed: - return GTK_ACCESSIBLE_ROLE_FEED - case .form: - return GTK_ACCESSIBLE_ROLE_FORM - case .generic: - return GTK_ACCESSIBLE_ROLE_GENERIC - case .grid: - return GTK_ACCESSIBLE_ROLE_GRID - case .gridCell: - return GTK_ACCESSIBLE_ROLE_GRID_CELL - case .group: - return GTK_ACCESSIBLE_ROLE_GROUP - case .heading: - return GTK_ACCESSIBLE_ROLE_HEADING - case .img: - return GTK_ACCESSIBLE_ROLE_IMG - case .input: - return GTK_ACCESSIBLE_ROLE_INPUT - case .label: - return GTK_ACCESSIBLE_ROLE_LABEL - case .landmark: - return GTK_ACCESSIBLE_ROLE_LANDMARK - case .legend: - return GTK_ACCESSIBLE_ROLE_LEGEND - case .link: - return GTK_ACCESSIBLE_ROLE_LINK - case .list: - return GTK_ACCESSIBLE_ROLE_LIST - case .listBox: - return GTK_ACCESSIBLE_ROLE_LIST_BOX - case .listItem: - return GTK_ACCESSIBLE_ROLE_LIST_ITEM - case .log: - return GTK_ACCESSIBLE_ROLE_LOG - case .main: - return GTK_ACCESSIBLE_ROLE_MAIN - case .marquee: - return GTK_ACCESSIBLE_ROLE_MARQUEE - case .math: - return GTK_ACCESSIBLE_ROLE_MATH - case .meter: - return GTK_ACCESSIBLE_ROLE_METER - case .menu: - return GTK_ACCESSIBLE_ROLE_MENU - case .menuBar: - return GTK_ACCESSIBLE_ROLE_MENU_BAR - case .menuItem: - return GTK_ACCESSIBLE_ROLE_MENU_ITEM - case .menuItemCheckbox: - return GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX - case .menuItemRadio: - return GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO - case .navigation: - return GTK_ACCESSIBLE_ROLE_NAVIGATION - case .none: - return GTK_ACCESSIBLE_ROLE_NONE - case .note: - return GTK_ACCESSIBLE_ROLE_NOTE - case .option: - return GTK_ACCESSIBLE_ROLE_OPTION - case .presentation: - return GTK_ACCESSIBLE_ROLE_PRESENTATION - case .progressBar: - return GTK_ACCESSIBLE_ROLE_PROGRESS_BAR - case .radio: - return GTK_ACCESSIBLE_ROLE_RADIO - case .radioGroup: - return GTK_ACCESSIBLE_ROLE_RADIO_GROUP - case .range: - return GTK_ACCESSIBLE_ROLE_RANGE - case .region: - return GTK_ACCESSIBLE_ROLE_REGION - case .row: - return GTK_ACCESSIBLE_ROLE_ROW - case .rowGroup: - return GTK_ACCESSIBLE_ROLE_ROW_GROUP - case .rowHeader: - return GTK_ACCESSIBLE_ROLE_ROW_HEADER - case .scrollbar: - return GTK_ACCESSIBLE_ROLE_SCROLLBAR - case .search: - return GTK_ACCESSIBLE_ROLE_SEARCH - case .searchBox: - return GTK_ACCESSIBLE_ROLE_SEARCH_BOX - case .section: - return GTK_ACCESSIBLE_ROLE_SECTION - case .sectionHead: - return GTK_ACCESSIBLE_ROLE_SECTION_HEAD - case .select: - return GTK_ACCESSIBLE_ROLE_SELECT - case .separator: - return GTK_ACCESSIBLE_ROLE_SEPARATOR - case .slider: - return GTK_ACCESSIBLE_ROLE_SLIDER - case .spinButton: - return GTK_ACCESSIBLE_ROLE_SPIN_BUTTON - case .status: - return GTK_ACCESSIBLE_ROLE_STATUS - case .structure: - return GTK_ACCESSIBLE_ROLE_STRUCTURE - case .switch_: - return GTK_ACCESSIBLE_ROLE_SWITCH - case .tab: - return GTK_ACCESSIBLE_ROLE_TAB - case .table: - return GTK_ACCESSIBLE_ROLE_TABLE - case .tabList: - return GTK_ACCESSIBLE_ROLE_TAB_LIST - case .tabPanel: - return GTK_ACCESSIBLE_ROLE_TAB_PANEL - case .textBox: - return GTK_ACCESSIBLE_ROLE_TEXT_BOX - case .time: - return GTK_ACCESSIBLE_ROLE_TIME - case .timer: - return GTK_ACCESSIBLE_ROLE_TIMER - case .toolbar: - return GTK_ACCESSIBLE_ROLE_TOOLBAR - case .tooltip: - return GTK_ACCESSIBLE_ROLE_TOOLTIP - case .tree: - return GTK_ACCESSIBLE_ROLE_TREE - case .treeGrid: - return GTK_ACCESSIBLE_ROLE_TREE_GRID - case .treeItem: - return GTK_ACCESSIBLE_ROLE_TREE_ITEM - case .widget: - return GTK_ACCESSIBLE_ROLE_WIDGET - case .window: - return GTK_ACCESSIBLE_ROLE_WINDOW + return GTK_ACCESSIBLE_ROLE_ALERT +case .alertDialog: + return GTK_ACCESSIBLE_ROLE_ALERT_DIALOG +case .banner: + return GTK_ACCESSIBLE_ROLE_BANNER +case .button: + return GTK_ACCESSIBLE_ROLE_BUTTON +case .caption: + return GTK_ACCESSIBLE_ROLE_CAPTION +case .cell: + return GTK_ACCESSIBLE_ROLE_CELL +case .checkbox: + return GTK_ACCESSIBLE_ROLE_CHECKBOX +case .columnHeader: + return GTK_ACCESSIBLE_ROLE_COLUMN_HEADER +case .comboBox: + return GTK_ACCESSIBLE_ROLE_COMBO_BOX +case .command: + return GTK_ACCESSIBLE_ROLE_COMMAND +case .composite: + return GTK_ACCESSIBLE_ROLE_COMPOSITE +case .dialog: + return GTK_ACCESSIBLE_ROLE_DIALOG +case .document: + return GTK_ACCESSIBLE_ROLE_DOCUMENT +case .feed: + return GTK_ACCESSIBLE_ROLE_FEED +case .form: + return GTK_ACCESSIBLE_ROLE_FORM +case .generic: + return GTK_ACCESSIBLE_ROLE_GENERIC +case .grid: + return GTK_ACCESSIBLE_ROLE_GRID +case .gridCell: + return GTK_ACCESSIBLE_ROLE_GRID_CELL +case .group: + return GTK_ACCESSIBLE_ROLE_GROUP +case .heading: + return GTK_ACCESSIBLE_ROLE_HEADING +case .img: + return GTK_ACCESSIBLE_ROLE_IMG +case .input: + return GTK_ACCESSIBLE_ROLE_INPUT +case .label: + return GTK_ACCESSIBLE_ROLE_LABEL +case .landmark: + return GTK_ACCESSIBLE_ROLE_LANDMARK +case .legend: + return GTK_ACCESSIBLE_ROLE_LEGEND +case .link: + return GTK_ACCESSIBLE_ROLE_LINK +case .list: + return GTK_ACCESSIBLE_ROLE_LIST +case .listBox: + return GTK_ACCESSIBLE_ROLE_LIST_BOX +case .listItem: + return GTK_ACCESSIBLE_ROLE_LIST_ITEM +case .log: + return GTK_ACCESSIBLE_ROLE_LOG +case .main: + return GTK_ACCESSIBLE_ROLE_MAIN +case .marquee: + return GTK_ACCESSIBLE_ROLE_MARQUEE +case .math: + return GTK_ACCESSIBLE_ROLE_MATH +case .meter: + return GTK_ACCESSIBLE_ROLE_METER +case .menu: + return GTK_ACCESSIBLE_ROLE_MENU +case .menuBar: + return GTK_ACCESSIBLE_ROLE_MENU_BAR +case .menuItem: + return GTK_ACCESSIBLE_ROLE_MENU_ITEM +case .menuItemCheckbox: + return GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX +case .menuItemRadio: + return GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO +case .navigation: + return GTK_ACCESSIBLE_ROLE_NAVIGATION +case .none: + return GTK_ACCESSIBLE_ROLE_NONE +case .note: + return GTK_ACCESSIBLE_ROLE_NOTE +case .option: + return GTK_ACCESSIBLE_ROLE_OPTION +case .presentation: + return GTK_ACCESSIBLE_ROLE_PRESENTATION +case .progressBar: + return GTK_ACCESSIBLE_ROLE_PROGRESS_BAR +case .radio: + return GTK_ACCESSIBLE_ROLE_RADIO +case .radioGroup: + return GTK_ACCESSIBLE_ROLE_RADIO_GROUP +case .range: + return GTK_ACCESSIBLE_ROLE_RANGE +case .region: + return GTK_ACCESSIBLE_ROLE_REGION +case .row: + return GTK_ACCESSIBLE_ROLE_ROW +case .rowGroup: + return GTK_ACCESSIBLE_ROLE_ROW_GROUP +case .rowHeader: + return GTK_ACCESSIBLE_ROLE_ROW_HEADER +case .scrollbar: + return GTK_ACCESSIBLE_ROLE_SCROLLBAR +case .search: + return GTK_ACCESSIBLE_ROLE_SEARCH +case .searchBox: + return GTK_ACCESSIBLE_ROLE_SEARCH_BOX +case .section: + return GTK_ACCESSIBLE_ROLE_SECTION +case .sectionHead: + return GTK_ACCESSIBLE_ROLE_SECTION_HEAD +case .select: + return GTK_ACCESSIBLE_ROLE_SELECT +case .separator: + return GTK_ACCESSIBLE_ROLE_SEPARATOR +case .slider: + return GTK_ACCESSIBLE_ROLE_SLIDER +case .spinButton: + return GTK_ACCESSIBLE_ROLE_SPIN_BUTTON +case .status: + return GTK_ACCESSIBLE_ROLE_STATUS +case .structure: + return GTK_ACCESSIBLE_ROLE_STRUCTURE +case .switch_: + return GTK_ACCESSIBLE_ROLE_SWITCH +case .tab: + return GTK_ACCESSIBLE_ROLE_TAB +case .table: + return GTK_ACCESSIBLE_ROLE_TABLE +case .tabList: + return GTK_ACCESSIBLE_ROLE_TAB_LIST +case .tabPanel: + return GTK_ACCESSIBLE_ROLE_TAB_PANEL +case .textBox: + return GTK_ACCESSIBLE_ROLE_TEXT_BOX +case .time: + return GTK_ACCESSIBLE_ROLE_TIME +case .timer: + return GTK_ACCESSIBLE_ROLE_TIMER +case .toolbar: + return GTK_ACCESSIBLE_ROLE_TOOLBAR +case .tooltip: + return GTK_ACCESSIBLE_ROLE_TOOLTIP +case .tree: + return GTK_ACCESSIBLE_ROLE_TREE +case .treeGrid: + return GTK_ACCESSIBLE_ROLE_TREE_GRID +case .treeItem: + return GTK_ACCESSIBLE_ROLE_TREE_ITEM +case .widget: + return GTK_ACCESSIBLE_ROLE_WIDGET +case .window: + return GTK_ACCESSIBLE_ROLE_WINDOW } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AccessibleSort.swift b/Sources/Gtk/Generated/AccessibleSort.swift index 35f91845e7..393573ab31 100644 --- a/Sources/Gtk/Generated/AccessibleSort.swift +++ b/Sources/Gtk/Generated/AccessibleSort.swift @@ -6,29 +6,29 @@ public enum AccessibleSort: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleSort /// There is no defined sort applied to the column. - case none - /// Items are sorted in ascending order by this column. - case ascending - /// Items are sorted in descending order by this column. - case descending - /// A sort algorithm other than ascending or - /// descending has been applied. - case other +case none +/// Items are sorted in ascending order by this column. +case ascending +/// Items are sorted in descending order by this column. +case descending +/// A sort algorithm other than ascending or +/// descending has been applied. +case other public static var type: GType { - gtk_accessible_sort_get_type() - } + gtk_accessible_sort_get_type() +} public init(from gtkEnum: GtkAccessibleSort) { switch gtkEnum { case GTK_ACCESSIBLE_SORT_NONE: - self = .none - case GTK_ACCESSIBLE_SORT_ASCENDING: - self = .ascending - case GTK_ACCESSIBLE_SORT_DESCENDING: - self = .descending - case GTK_ACCESSIBLE_SORT_OTHER: - self = .other + self = .none +case GTK_ACCESSIBLE_SORT_ASCENDING: + self = .ascending +case GTK_ACCESSIBLE_SORT_DESCENDING: + self = .descending +case GTK_ACCESSIBLE_SORT_OTHER: + self = .other default: fatalError("Unsupported GtkAccessibleSort enum value: \(gtkEnum.rawValue)") } @@ -37,13 +37,13 @@ public enum AccessibleSort: GValueRepresentableEnum { public func toGtk() -> GtkAccessibleSort { switch self { case .none: - return GTK_ACCESSIBLE_SORT_NONE - case .ascending: - return GTK_ACCESSIBLE_SORT_ASCENDING - case .descending: - return GTK_ACCESSIBLE_SORT_DESCENDING - case .other: - return GTK_ACCESSIBLE_SORT_OTHER + return GTK_ACCESSIBLE_SORT_NONE +case .ascending: + return GTK_ACCESSIBLE_SORT_ASCENDING +case .descending: + return GTK_ACCESSIBLE_SORT_DESCENDING +case .other: + return GTK_ACCESSIBLE_SORT_OTHER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AccessibleState.swift b/Sources/Gtk/Generated/AccessibleState.swift index 7cfbf36ba3..3ddaa60b89 100644 --- a/Sources/Gtk/Generated/AccessibleState.swift +++ b/Sources/Gtk/Generated/AccessibleState.swift @@ -5,57 +5,57 @@ public enum AccessibleState: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleState /// A “busy” state. This state has boolean values - case busy - /// A “checked” state; indicates the current - /// state of a [class@CheckButton]. Value type: [enum@AccessibleTristate] - case checked - /// A “disabled” state; corresponds to the - /// [property@Widget:sensitive] property. It indicates a UI element - /// that is perceivable, but not editable or operable. Value type: boolean - case disabled - /// An “expanded” state; corresponds to the - /// [property@Expander:expanded] property. Value type: boolean - /// or undefined - case expanded - /// A “hidden” state; corresponds to the - /// [property@Widget:visible] property. You can use this state - /// explicitly on UI elements that should not be exposed to an assistive - /// technology. Value type: boolean - /// See also: %GTK_ACCESSIBLE_STATE_DISABLED - case hidden - /// An “invalid” state; set when a widget - /// is showing an error. Value type: [enum@AccessibleInvalidState] - case invalid - /// A “pressed” state; indicates the current - /// state of a [class@ToggleButton]. Value type: [enum@AccessibleTristate] - /// enumeration - case pressed - /// A “selected” state; set when a widget - /// is selected. Value type: boolean or undefined - case selected +case busy +/// A “checked” state; indicates the current +/// state of a [class@CheckButton]. Value type: [enum@AccessibleTristate] +case checked +/// A “disabled” state; corresponds to the +/// [property@Widget:sensitive] property. It indicates a UI element +/// that is perceivable, but not editable or operable. Value type: boolean +case disabled +/// An “expanded” state; corresponds to the +/// [property@Expander:expanded] property. Value type: boolean +/// or undefined +case expanded +/// A “hidden” state; corresponds to the +/// [property@Widget:visible] property. You can use this state +/// explicitly on UI elements that should not be exposed to an assistive +/// technology. Value type: boolean +/// See also: %GTK_ACCESSIBLE_STATE_DISABLED +case hidden +/// An “invalid” state; set when a widget +/// is showing an error. Value type: [enum@AccessibleInvalidState] +case invalid +/// A “pressed” state; indicates the current +/// state of a [class@ToggleButton]. Value type: [enum@AccessibleTristate] +/// enumeration +case pressed +/// A “selected” state; set when a widget +/// is selected. Value type: boolean or undefined +case selected public static var type: GType { - gtk_accessible_state_get_type() - } + gtk_accessible_state_get_type() +} public init(from gtkEnum: GtkAccessibleState) { switch gtkEnum { case GTK_ACCESSIBLE_STATE_BUSY: - self = .busy - case GTK_ACCESSIBLE_STATE_CHECKED: - self = .checked - case GTK_ACCESSIBLE_STATE_DISABLED: - self = .disabled - case GTK_ACCESSIBLE_STATE_EXPANDED: - self = .expanded - case GTK_ACCESSIBLE_STATE_HIDDEN: - self = .hidden - case GTK_ACCESSIBLE_STATE_INVALID: - self = .invalid - case GTK_ACCESSIBLE_STATE_PRESSED: - self = .pressed - case GTK_ACCESSIBLE_STATE_SELECTED: - self = .selected + self = .busy +case GTK_ACCESSIBLE_STATE_CHECKED: + self = .checked +case GTK_ACCESSIBLE_STATE_DISABLED: + self = .disabled +case GTK_ACCESSIBLE_STATE_EXPANDED: + self = .expanded +case GTK_ACCESSIBLE_STATE_HIDDEN: + self = .hidden +case GTK_ACCESSIBLE_STATE_INVALID: + self = .invalid +case GTK_ACCESSIBLE_STATE_PRESSED: + self = .pressed +case GTK_ACCESSIBLE_STATE_SELECTED: + self = .selected default: fatalError("Unsupported GtkAccessibleState enum value: \(gtkEnum.rawValue)") } @@ -64,21 +64,21 @@ public enum AccessibleState: GValueRepresentableEnum { public func toGtk() -> GtkAccessibleState { switch self { case .busy: - return GTK_ACCESSIBLE_STATE_BUSY - case .checked: - return GTK_ACCESSIBLE_STATE_CHECKED - case .disabled: - return GTK_ACCESSIBLE_STATE_DISABLED - case .expanded: - return GTK_ACCESSIBLE_STATE_EXPANDED - case .hidden: - return GTK_ACCESSIBLE_STATE_HIDDEN - case .invalid: - return GTK_ACCESSIBLE_STATE_INVALID - case .pressed: - return GTK_ACCESSIBLE_STATE_PRESSED - case .selected: - return GTK_ACCESSIBLE_STATE_SELECTED + return GTK_ACCESSIBLE_STATE_BUSY +case .checked: + return GTK_ACCESSIBLE_STATE_CHECKED +case .disabled: + return GTK_ACCESSIBLE_STATE_DISABLED +case .expanded: + return GTK_ACCESSIBLE_STATE_EXPANDED +case .hidden: + return GTK_ACCESSIBLE_STATE_HIDDEN +case .invalid: + return GTK_ACCESSIBLE_STATE_INVALID +case .pressed: + return GTK_ACCESSIBLE_STATE_PRESSED +case .selected: + return GTK_ACCESSIBLE_STATE_SELECTED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AccessibleTristate.swift b/Sources/Gtk/Generated/AccessibleTristate.swift index ea5f6b8b5b..56d1a4ac1f 100644 --- a/Sources/Gtk/Generated/AccessibleTristate.swift +++ b/Sources/Gtk/Generated/AccessibleTristate.swift @@ -2,7 +2,7 @@ import CGtk /// The possible values for the %GTK_ACCESSIBLE_STATE_PRESSED /// accessible state. -/// +/// /// Note that the %GTK_ACCESSIBLE_TRISTATE_FALSE and /// %GTK_ACCESSIBLE_TRISTATE_TRUE have the same values /// as %FALSE and %TRUE. @@ -10,24 +10,24 @@ public enum AccessibleTristate: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleTristate /// The state is `false` - case false_ - /// The state is `true` - case true_ - /// The state is `mixed` - case mixed +case false_ +/// The state is `true` +case true_ +/// The state is `mixed` +case mixed public static var type: GType { - gtk_accessible_tristate_get_type() - } + gtk_accessible_tristate_get_type() +} public init(from gtkEnum: GtkAccessibleTristate) { switch gtkEnum { case GTK_ACCESSIBLE_TRISTATE_FALSE: - self = .false_ - case GTK_ACCESSIBLE_TRISTATE_TRUE: - self = .true_ - case GTK_ACCESSIBLE_TRISTATE_MIXED: - self = .mixed + self = .false_ +case GTK_ACCESSIBLE_TRISTATE_TRUE: + self = .true_ +case GTK_ACCESSIBLE_TRISTATE_MIXED: + self = .mixed default: fatalError("Unsupported GtkAccessibleTristate enum value: \(gtkEnum.rawValue)") } @@ -36,11 +36,11 @@ public enum AccessibleTristate: GValueRepresentableEnum { public func toGtk() -> GtkAccessibleTristate { switch self { case .false_: - return GTK_ACCESSIBLE_TRISTATE_FALSE - case .true_: - return GTK_ACCESSIBLE_TRISTATE_TRUE - case .mixed: - return GTK_ACCESSIBLE_TRISTATE_MIXED + return GTK_ACCESSIBLE_TRISTATE_FALSE +case .true_: + return GTK_ACCESSIBLE_TRISTATE_TRUE +case .mixed: + return GTK_ACCESSIBLE_TRISTATE_MIXED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Actionable.swift b/Sources/Gtk/Generated/Actionable.swift index 5a4713d18d..129d7093a6 100644 --- a/Sources/Gtk/Generated/Actionable.swift +++ b/Sources/Gtk/Generated/Actionable.swift @@ -1,11 +1,11 @@ import CGtk /// Provides a way to associate widgets with actions. -/// +/// /// It primarily consists of two properties: [property@Gtk.Actionable:action-name] /// and [property@Gtk.Actionable:action-target]. There are also some convenience /// APIs for setting these properties. -/// +/// /// The action will be looked up in action groups that are found among /// the widgets ancestors. Most commonly, these will be the actions with /// the “win.” or “app.” prefix that are associated with the @@ -14,6 +14,7 @@ import CGtk /// as well. public protocol Actionable: GObjectRepresentable { /// The name of the action with which this widget should be associated. - var actionName: String? { get set } +var actionName: String? { get set } -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Align.swift b/Sources/Gtk/Generated/Align.swift index 120d4707f9..b711436f4c 100644 --- a/Sources/Gtk/Generated/Align.swift +++ b/Sources/Gtk/Generated/Align.swift @@ -1,17 +1,17 @@ import CGtk /// Controls how a widget deals with extra space in a single dimension. -/// +/// /// Alignment only matters if the widget receives a “too large” allocation, /// for example if you packed the widget with the [property@Gtk.Widget:hexpand] /// property inside a [class@Box], then the widget might get extra space. /// If you have for example a 16x16 icon inside a 32x32 space, the icon /// could be scaled and stretched, it could be centered, or it could be /// positioned to one side of the space. -/// +/// /// Note that in horizontal context `GTK_ALIGN_START` and `GTK_ALIGN_END` /// are interpreted relative to text direction. -/// +/// /// Baseline support is optional for containers and widgets, and is only available /// for vertical alignment. `GTK_ALIGN_BASELINE_CENTER` and `GTK_ALIGN_BASELINE_FILL` /// are treated similar to `GTK_ALIGN_CENTER` and `GTK_ALIGN_FILL`, except that it @@ -20,29 +20,29 @@ public enum Align: GValueRepresentableEnum { public typealias GtkEnum = GtkAlign /// Stretch to fill all space if possible, center if - /// no meaningful way to stretch - case fill - /// Snap to left or top side, leaving space on right or bottom - case start - /// Snap to right or bottom side, leaving space on left or top - case end - /// Center natural width of widget inside the allocation - case center +/// no meaningful way to stretch +case fill +/// Snap to left or top side, leaving space on right or bottom +case start +/// Snap to right or bottom side, leaving space on left or top +case end +/// Center natural width of widget inside the allocation +case center public static var type: GType { - gtk_align_get_type() - } + gtk_align_get_type() +} public init(from gtkEnum: GtkAlign) { switch gtkEnum { case GTK_ALIGN_FILL: - self = .fill - case GTK_ALIGN_START: - self = .start - case GTK_ALIGN_END: - self = .end - case GTK_ALIGN_CENTER: - self = .center + self = .fill +case GTK_ALIGN_START: + self = .start +case GTK_ALIGN_END: + self = .end +case GTK_ALIGN_CENTER: + self = .center default: fatalError("Unsupported GtkAlign enum value: \(gtkEnum.rawValue)") } @@ -51,13 +51,13 @@ public enum Align: GValueRepresentableEnum { public func toGtk() -> GtkAlign { switch self { case .fill: - return GTK_ALIGN_FILL - case .start: - return GTK_ALIGN_START - case .end: - return GTK_ALIGN_END - case .center: - return GTK_ALIGN_CENTER + return GTK_ALIGN_FILL +case .start: + return GTK_ALIGN_START +case .end: + return GTK_ALIGN_END +case .center: + return GTK_ALIGN_CENTER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AppChooser.swift b/Sources/Gtk/Generated/AppChooser.swift index 5d4489089c..142bef0320 100644 --- a/Sources/Gtk/Generated/AppChooser.swift +++ b/Sources/Gtk/Generated/AppChooser.swift @@ -2,11 +2,11 @@ import CGtk /// `GtkAppChooser` is an interface for widgets which allow the user to /// choose an application. -/// +/// /// The main objects that implement this interface are /// [class@Gtk.AppChooserWidget], /// [class@Gtk.AppChooserDialog] and [class@Gtk.AppChooserButton]. -/// +/// /// Applications are represented by GIO `GAppInfo` objects here. /// GIO has a concept of recommended and fallback applications for a /// given content type. Recommended applications are those that claim @@ -16,13 +16,14 @@ import CGtk /// type. The `GtkAppChooserWidget` provides detailed control over /// whether the shown list of applications should include default, /// recommended or fallback applications. -/// +/// /// To obtain the application that has been selected in a `GtkAppChooser`, /// use [method@Gtk.AppChooser.get_app_info]. public protocol AppChooser: GObjectRepresentable { /// The content type of the `GtkAppChooser` object. - /// - /// See `GContentType` for more information about content types. - var contentType: String { get set } +/// +/// See `GContentType` for more information about content types. +var contentType: String { get set } -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ArrowType.swift b/Sources/Gtk/Generated/ArrowType.swift index 8c591c0df6..2e6a4a3dd6 100644 --- a/Sources/Gtk/Generated/ArrowType.swift +++ b/Sources/Gtk/Generated/ArrowType.swift @@ -5,32 +5,32 @@ public enum ArrowType: GValueRepresentableEnum { public typealias GtkEnum = GtkArrowType /// Represents an upward pointing arrow. - case up - /// Represents a downward pointing arrow. - case down - /// Represents a left pointing arrow. - case left - /// Represents a right pointing arrow. - case right - /// No arrow. - case none +case up +/// Represents a downward pointing arrow. +case down +/// Represents a left pointing arrow. +case left +/// Represents a right pointing arrow. +case right +/// No arrow. +case none public static var type: GType { - gtk_arrow_type_get_type() - } + gtk_arrow_type_get_type() +} public init(from gtkEnum: GtkArrowType) { switch gtkEnum { case GTK_ARROW_UP: - self = .up - case GTK_ARROW_DOWN: - self = .down - case GTK_ARROW_LEFT: - self = .left - case GTK_ARROW_RIGHT: - self = .right - case GTK_ARROW_NONE: - self = .none + self = .up +case GTK_ARROW_DOWN: + self = .down +case GTK_ARROW_LEFT: + self = .left +case GTK_ARROW_RIGHT: + self = .right +case GTK_ARROW_NONE: + self = .none default: fatalError("Unsupported GtkArrowType enum value: \(gtkEnum.rawValue)") } @@ -39,15 +39,15 @@ public enum ArrowType: GValueRepresentableEnum { public func toGtk() -> GtkArrowType { switch self { case .up: - return GTK_ARROW_UP - case .down: - return GTK_ARROW_DOWN - case .left: - return GTK_ARROW_LEFT - case .right: - return GTK_ARROW_RIGHT - case .none: - return GTK_ARROW_NONE + return GTK_ARROW_UP +case .down: + return GTK_ARROW_DOWN +case .left: + return GTK_ARROW_LEFT +case .right: + return GTK_ARROW_RIGHT +case .none: + return GTK_ARROW_NONE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/AssistantPageType.swift b/Sources/Gtk/Generated/AssistantPageType.swift index 35e0bfdc55..a160f080c1 100644 --- a/Sources/Gtk/Generated/AssistantPageType.swift +++ b/Sources/Gtk/Generated/AssistantPageType.swift @@ -1,58 +1,58 @@ import CGtk /// Determines the role of a page inside a `GtkAssistant`. -/// +/// /// The role is used to handle buttons sensitivity and visibility. -/// +/// /// Note that an assistant needs to end its page flow with a page of type /// %GTK_ASSISTANT_PAGE_CONFIRM, %GTK_ASSISTANT_PAGE_SUMMARY or /// %GTK_ASSISTANT_PAGE_PROGRESS to be correct. -/// +/// /// The Cancel button will only be shown if the page isn’t “committed”. /// See gtk_assistant_commit() for details. public enum AssistantPageType: GValueRepresentableEnum { public typealias GtkEnum = GtkAssistantPageType /// The page has regular contents. Both the - /// Back and forward buttons will be shown. - case content - /// The page contains an introduction to the - /// assistant task. Only the Forward button will be shown if there is a - /// next page. - case intro - /// The page lets the user confirm or deny the - /// changes. The Back and Apply buttons will be shown. - case confirm - /// The page informs the user of the changes - /// done. Only the Close button will be shown. - case summary - /// Used for tasks that take a long time to - /// complete, blocks the assistant until the page is marked as complete. - /// Only the back button will be shown. - case progress - /// Used for when other page types are not - /// appropriate. No buttons will be shown, and the application must - /// add its own buttons through gtk_assistant_add_action_widget(). - case custom +/// Back and forward buttons will be shown. +case content +/// The page contains an introduction to the +/// assistant task. Only the Forward button will be shown if there is a +/// next page. +case intro +/// The page lets the user confirm or deny the +/// changes. The Back and Apply buttons will be shown. +case confirm +/// The page informs the user of the changes +/// done. Only the Close button will be shown. +case summary +/// Used for tasks that take a long time to +/// complete, blocks the assistant until the page is marked as complete. +/// Only the back button will be shown. +case progress +/// Used for when other page types are not +/// appropriate. No buttons will be shown, and the application must +/// add its own buttons through gtk_assistant_add_action_widget(). +case custom public static var type: GType { - gtk_assistant_page_type_get_type() - } + gtk_assistant_page_type_get_type() +} public init(from gtkEnum: GtkAssistantPageType) { switch gtkEnum { case GTK_ASSISTANT_PAGE_CONTENT: - self = .content - case GTK_ASSISTANT_PAGE_INTRO: - self = .intro - case GTK_ASSISTANT_PAGE_CONFIRM: - self = .confirm - case GTK_ASSISTANT_PAGE_SUMMARY: - self = .summary - case GTK_ASSISTANT_PAGE_PROGRESS: - self = .progress - case GTK_ASSISTANT_PAGE_CUSTOM: - self = .custom + self = .content +case GTK_ASSISTANT_PAGE_INTRO: + self = .intro +case GTK_ASSISTANT_PAGE_CONFIRM: + self = .confirm +case GTK_ASSISTANT_PAGE_SUMMARY: + self = .summary +case GTK_ASSISTANT_PAGE_PROGRESS: + self = .progress +case GTK_ASSISTANT_PAGE_CUSTOM: + self = .custom default: fatalError("Unsupported GtkAssistantPageType enum value: \(gtkEnum.rawValue)") } @@ -61,17 +61,17 @@ public enum AssistantPageType: GValueRepresentableEnum { public func toGtk() -> GtkAssistantPageType { switch self { case .content: - return GTK_ASSISTANT_PAGE_CONTENT - case .intro: - return GTK_ASSISTANT_PAGE_INTRO - case .confirm: - return GTK_ASSISTANT_PAGE_CONFIRM - case .summary: - return GTK_ASSISTANT_PAGE_SUMMARY - case .progress: - return GTK_ASSISTANT_PAGE_PROGRESS - case .custom: - return GTK_ASSISTANT_PAGE_CUSTOM + return GTK_ASSISTANT_PAGE_CONTENT +case .intro: + return GTK_ASSISTANT_PAGE_INTRO +case .confirm: + return GTK_ASSISTANT_PAGE_CONFIRM +case .summary: + return GTK_ASSISTANT_PAGE_SUMMARY +case .progress: + return GTK_ASSISTANT_PAGE_PROGRESS +case .custom: + return GTK_ASSISTANT_PAGE_CUSTOM } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/BaselinePosition.swift b/Sources/Gtk/Generated/BaselinePosition.swift index 9a1efe3a51..dc9baaee71 100644 --- a/Sources/Gtk/Generated/BaselinePosition.swift +++ b/Sources/Gtk/Generated/BaselinePosition.swift @@ -1,7 +1,7 @@ import CGtk /// Baseline position in a row of widgets. -/// +/// /// Whenever a container has some form of natural row it may align /// children in that row along a common typographical baseline. If /// the amount of vertical space in the row is taller than the total @@ -12,24 +12,24 @@ public enum BaselinePosition: GValueRepresentableEnum { public typealias GtkEnum = GtkBaselinePosition /// Align the baseline at the top - case top - /// Center the baseline - case center - /// Align the baseline at the bottom - case bottom +case top +/// Center the baseline +case center +/// Align the baseline at the bottom +case bottom public static var type: GType { - gtk_baseline_position_get_type() - } + gtk_baseline_position_get_type() +} public init(from gtkEnum: GtkBaselinePosition) { switch gtkEnum { case GTK_BASELINE_POSITION_TOP: - self = .top - case GTK_BASELINE_POSITION_CENTER: - self = .center - case GTK_BASELINE_POSITION_BOTTOM: - self = .bottom + self = .top +case GTK_BASELINE_POSITION_CENTER: + self = .center +case GTK_BASELINE_POSITION_BOTTOM: + self = .bottom default: fatalError("Unsupported GtkBaselinePosition enum value: \(gtkEnum.rawValue)") } @@ -38,11 +38,11 @@ public enum BaselinePosition: GValueRepresentableEnum { public func toGtk() -> GtkBaselinePosition { switch self { case .top: - return GTK_BASELINE_POSITION_TOP - case .center: - return GTK_BASELINE_POSITION_CENTER - case .bottom: - return GTK_BASELINE_POSITION_BOTTOM + return GTK_BASELINE_POSITION_TOP +case .center: + return GTK_BASELINE_POSITION_CENTER +case .bottom: + return GTK_BASELINE_POSITION_BOTTOM } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/BorderStyle.swift b/Sources/Gtk/Generated/BorderStyle.swift index e29013f349..65b71ef962 100644 --- a/Sources/Gtk/Generated/BorderStyle.swift +++ b/Sources/Gtk/Generated/BorderStyle.swift @@ -5,52 +5,52 @@ public enum BorderStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkBorderStyle /// No visible border - case none - /// Same as %GTK_BORDER_STYLE_NONE - case hidden - /// A single line segment - case solid - /// Looks as if the content is sunken into the canvas - case inset - /// Looks as if the content is coming out of the canvas - case outset - /// A series of round dots - case dotted - /// A series of square-ended dashes - case dashed - /// Two parallel lines with some space between them - case double - /// Looks as if it were carved in the canvas - case groove - /// Looks as if it were coming out of the canvas - case ridge +case none +/// Same as %GTK_BORDER_STYLE_NONE +case hidden +/// A single line segment +case solid +/// Looks as if the content is sunken into the canvas +case inset +/// Looks as if the content is coming out of the canvas +case outset +/// A series of round dots +case dotted +/// A series of square-ended dashes +case dashed +/// Two parallel lines with some space between them +case double +/// Looks as if it were carved in the canvas +case groove +/// Looks as if it were coming out of the canvas +case ridge public static var type: GType { - gtk_border_style_get_type() - } + gtk_border_style_get_type() +} public init(from gtkEnum: GtkBorderStyle) { switch gtkEnum { case GTK_BORDER_STYLE_NONE: - self = .none - case GTK_BORDER_STYLE_HIDDEN: - self = .hidden - case GTK_BORDER_STYLE_SOLID: - self = .solid - case GTK_BORDER_STYLE_INSET: - self = .inset - case GTK_BORDER_STYLE_OUTSET: - self = .outset - case GTK_BORDER_STYLE_DOTTED: - self = .dotted - case GTK_BORDER_STYLE_DASHED: - self = .dashed - case GTK_BORDER_STYLE_DOUBLE: - self = .double - case GTK_BORDER_STYLE_GROOVE: - self = .groove - case GTK_BORDER_STYLE_RIDGE: - self = .ridge + self = .none +case GTK_BORDER_STYLE_HIDDEN: + self = .hidden +case GTK_BORDER_STYLE_SOLID: + self = .solid +case GTK_BORDER_STYLE_INSET: + self = .inset +case GTK_BORDER_STYLE_OUTSET: + self = .outset +case GTK_BORDER_STYLE_DOTTED: + self = .dotted +case GTK_BORDER_STYLE_DASHED: + self = .dashed +case GTK_BORDER_STYLE_DOUBLE: + self = .double +case GTK_BORDER_STYLE_GROOVE: + self = .groove +case GTK_BORDER_STYLE_RIDGE: + self = .ridge default: fatalError("Unsupported GtkBorderStyle enum value: \(gtkEnum.rawValue)") } @@ -59,25 +59,25 @@ public enum BorderStyle: GValueRepresentableEnum { public func toGtk() -> GtkBorderStyle { switch self { case .none: - return GTK_BORDER_STYLE_NONE - case .hidden: - return GTK_BORDER_STYLE_HIDDEN - case .solid: - return GTK_BORDER_STYLE_SOLID - case .inset: - return GTK_BORDER_STYLE_INSET - case .outset: - return GTK_BORDER_STYLE_OUTSET - case .dotted: - return GTK_BORDER_STYLE_DOTTED - case .dashed: - return GTK_BORDER_STYLE_DASHED - case .double: - return GTK_BORDER_STYLE_DOUBLE - case .groove: - return GTK_BORDER_STYLE_GROOVE - case .ridge: - return GTK_BORDER_STYLE_RIDGE + return GTK_BORDER_STYLE_NONE +case .hidden: + return GTK_BORDER_STYLE_HIDDEN +case .solid: + return GTK_BORDER_STYLE_SOLID +case .inset: + return GTK_BORDER_STYLE_INSET +case .outset: + return GTK_BORDER_STYLE_OUTSET +case .dotted: + return GTK_BORDER_STYLE_DOTTED +case .dashed: + return GTK_BORDER_STYLE_DASHED +case .double: + return GTK_BORDER_STYLE_DOUBLE +case .groove: + return GTK_BORDER_STYLE_GROOVE +case .ridge: + return GTK_BORDER_STYLE_RIDGE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Buildable.swift b/Sources/Gtk/Generated/Buildable.swift index a72135d704..954cb37f73 100644 --- a/Sources/Gtk/Generated/Buildable.swift +++ b/Sources/Gtk/Generated/Buildable.swift @@ -1,17 +1,19 @@ import CGtk /// Allows objects to extend and customize deserialization from ui files. -/// +/// /// The `GtkBuildable` interface includes methods for setting names and /// properties of objects, parsing custom tags and constructing child objects. -/// +/// /// It is implemented by all widgets and many of the non-widget objects that are /// provided by GTK. The main user of this interface is [class@Gtk.Builder]. /// There should be very little need for applications to call any of these /// functions directly. -/// +/// /// An object only needs to implement this interface if it needs to extend the /// `GtkBuilder` XML format or run any extra routines at deserialization time. public protocol Buildable: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/BuilderError.swift b/Sources/Gtk/Generated/BuilderError.swift index aff20af88a..c41097eab7 100644 --- a/Sources/Gtk/Generated/BuilderError.swift +++ b/Sources/Gtk/Generated/BuilderError.swift @@ -6,83 +6,83 @@ public enum BuilderError: GValueRepresentableEnum { public typealias GtkEnum = GtkBuilderError /// A type-func attribute didn’t name - /// a function that returns a `GType`. - case invalidTypeFunction - /// The input contained a tag that `GtkBuilder` - /// can’t handle. - case unhandledTag - /// An attribute that is required by - /// `GtkBuilder` was missing. - case missingAttribute - /// `GtkBuilder` found an attribute that - /// it doesn’t understand. - case invalidAttribute - /// `GtkBuilder` found a tag that - /// it doesn’t understand. - case invalidTag - /// A required property value was - /// missing. - case missingPropertyValue - /// `GtkBuilder` couldn’t parse - /// some attribute value. - case invalidValue - /// The input file requires a newer version - /// of GTK. - case versionMismatch - /// An object id occurred twice. - case duplicateId - /// A specified object type is of the same type or - /// derived from the type of the composite class being extended with builder XML. - case objectTypeRefused - /// The wrong type was specified in a composite class’s template XML - case templateMismatch - /// The specified property is unknown for the object class. - case invalidProperty - /// The specified signal is unknown for the object class. - case invalidSignal - /// An object id is unknown. - case invalidId - /// A function could not be found. This often happens - /// when symbols are set to be kept private. Compiling code with -rdynamic or using the - /// `gmodule-export-2.0` pkgconfig module can fix this problem. - case invalidFunction +/// a function that returns a `GType`. +case invalidTypeFunction +/// The input contained a tag that `GtkBuilder` +/// can’t handle. +case unhandledTag +/// An attribute that is required by +/// `GtkBuilder` was missing. +case missingAttribute +/// `GtkBuilder` found an attribute that +/// it doesn’t understand. +case invalidAttribute +/// `GtkBuilder` found a tag that +/// it doesn’t understand. +case invalidTag +/// A required property value was +/// missing. +case missingPropertyValue +/// `GtkBuilder` couldn’t parse +/// some attribute value. +case invalidValue +/// The input file requires a newer version +/// of GTK. +case versionMismatch +/// An object id occurred twice. +case duplicateId +/// A specified object type is of the same type or +/// derived from the type of the composite class being extended with builder XML. +case objectTypeRefused +/// The wrong type was specified in a composite class’s template XML +case templateMismatch +/// The specified property is unknown for the object class. +case invalidProperty +/// The specified signal is unknown for the object class. +case invalidSignal +/// An object id is unknown. +case invalidId +/// A function could not be found. This often happens +/// when symbols are set to be kept private. Compiling code with -rdynamic or using the +/// `gmodule-export-2.0` pkgconfig module can fix this problem. +case invalidFunction public static var type: GType { - gtk_builder_error_get_type() - } + gtk_builder_error_get_type() +} public init(from gtkEnum: GtkBuilderError) { switch gtkEnum { case GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION: - self = .invalidTypeFunction - case GTK_BUILDER_ERROR_UNHANDLED_TAG: - self = .unhandledTag - case GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: - self = .missingAttribute - case GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: - self = .invalidAttribute - case GTK_BUILDER_ERROR_INVALID_TAG: - self = .invalidTag - case GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: - self = .missingPropertyValue - case GTK_BUILDER_ERROR_INVALID_VALUE: - self = .invalidValue - case GTK_BUILDER_ERROR_VERSION_MISMATCH: - self = .versionMismatch - case GTK_BUILDER_ERROR_DUPLICATE_ID: - self = .duplicateId - case GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED: - self = .objectTypeRefused - case GTK_BUILDER_ERROR_TEMPLATE_MISMATCH: - self = .templateMismatch - case GTK_BUILDER_ERROR_INVALID_PROPERTY: - self = .invalidProperty - case GTK_BUILDER_ERROR_INVALID_SIGNAL: - self = .invalidSignal - case GTK_BUILDER_ERROR_INVALID_ID: - self = .invalidId - case GTK_BUILDER_ERROR_INVALID_FUNCTION: - self = .invalidFunction + self = .invalidTypeFunction +case GTK_BUILDER_ERROR_UNHANDLED_TAG: + self = .unhandledTag +case GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: + self = .missingAttribute +case GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: + self = .invalidAttribute +case GTK_BUILDER_ERROR_INVALID_TAG: + self = .invalidTag +case GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: + self = .missingPropertyValue +case GTK_BUILDER_ERROR_INVALID_VALUE: + self = .invalidValue +case GTK_BUILDER_ERROR_VERSION_MISMATCH: + self = .versionMismatch +case GTK_BUILDER_ERROR_DUPLICATE_ID: + self = .duplicateId +case GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED: + self = .objectTypeRefused +case GTK_BUILDER_ERROR_TEMPLATE_MISMATCH: + self = .templateMismatch +case GTK_BUILDER_ERROR_INVALID_PROPERTY: + self = .invalidProperty +case GTK_BUILDER_ERROR_INVALID_SIGNAL: + self = .invalidSignal +case GTK_BUILDER_ERROR_INVALID_ID: + self = .invalidId +case GTK_BUILDER_ERROR_INVALID_FUNCTION: + self = .invalidFunction default: fatalError("Unsupported GtkBuilderError enum value: \(gtkEnum.rawValue)") } @@ -91,35 +91,35 @@ public enum BuilderError: GValueRepresentableEnum { public func toGtk() -> GtkBuilderError { switch self { case .invalidTypeFunction: - return GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION - case .unhandledTag: - return GTK_BUILDER_ERROR_UNHANDLED_TAG - case .missingAttribute: - return GTK_BUILDER_ERROR_MISSING_ATTRIBUTE - case .invalidAttribute: - return GTK_BUILDER_ERROR_INVALID_ATTRIBUTE - case .invalidTag: - return GTK_BUILDER_ERROR_INVALID_TAG - case .missingPropertyValue: - return GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE - case .invalidValue: - return GTK_BUILDER_ERROR_INVALID_VALUE - case .versionMismatch: - return GTK_BUILDER_ERROR_VERSION_MISMATCH - case .duplicateId: - return GTK_BUILDER_ERROR_DUPLICATE_ID - case .objectTypeRefused: - return GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED - case .templateMismatch: - return GTK_BUILDER_ERROR_TEMPLATE_MISMATCH - case .invalidProperty: - return GTK_BUILDER_ERROR_INVALID_PROPERTY - case .invalidSignal: - return GTK_BUILDER_ERROR_INVALID_SIGNAL - case .invalidId: - return GTK_BUILDER_ERROR_INVALID_ID - case .invalidFunction: - return GTK_BUILDER_ERROR_INVALID_FUNCTION + return GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION +case .unhandledTag: + return GTK_BUILDER_ERROR_UNHANDLED_TAG +case .missingAttribute: + return GTK_BUILDER_ERROR_MISSING_ATTRIBUTE +case .invalidAttribute: + return GTK_BUILDER_ERROR_INVALID_ATTRIBUTE +case .invalidTag: + return GTK_BUILDER_ERROR_INVALID_TAG +case .missingPropertyValue: + return GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE +case .invalidValue: + return GTK_BUILDER_ERROR_INVALID_VALUE +case .versionMismatch: + return GTK_BUILDER_ERROR_VERSION_MISMATCH +case .duplicateId: + return GTK_BUILDER_ERROR_DUPLICATE_ID +case .objectTypeRefused: + return GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED +case .templateMismatch: + return GTK_BUILDER_ERROR_TEMPLATE_MISMATCH +case .invalidProperty: + return GTK_BUILDER_ERROR_INVALID_PROPERTY +case .invalidSignal: + return GTK_BUILDER_ERROR_INVALID_SIGNAL +case .invalidId: + return GTK_BUILDER_ERROR_INVALID_ID +case .invalidFunction: + return GTK_BUILDER_ERROR_INVALID_FUNCTION } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/BuilderScope.swift b/Sources/Gtk/Generated/BuilderScope.swift index 2390cbc4bf..3aae527b45 100644 --- a/Sources/Gtk/Generated/BuilderScope.swift +++ b/Sources/Gtk/Generated/BuilderScope.swift @@ -1,22 +1,24 @@ import CGtk /// Provides language binding support to `GtkBuilder`. -/// +/// /// The goal of `GtkBuilderScope` is to look up programming-language-specific /// values for strings that are given in a `GtkBuilder` UI file. -/// +/// /// The primary intended audience is bindings that want to provide deeper /// integration of `GtkBuilder` into the language. -/// +/// /// A `GtkBuilderScope` instance may be used with multiple `GtkBuilder` objects, /// even at once. -/// +/// /// By default, GTK will use its own implementation of `GtkBuilderScope` /// for the C language which can be created via [ctor@Gtk.BuilderCScope.new]. -/// +/// /// If you implement `GtkBuilderScope` for a language binding, you /// may want to (partially) derive from or fall back to a [class@Gtk.BuilderCScope], /// as that class implements support for automatic lookups from C symbols. public protocol BuilderScope: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Button.swift b/Sources/Gtk/Generated/Button.swift index b932a6ac92..32a2c7b9a1 100644 --- a/Sources/Gtk/Generated/Button.swift +++ b/Sources/Gtk/Generated/Button.swift @@ -1,232 +1,224 @@ import CGtk /// Calls a callback function when the button is clicked. -/// +/// /// An example GtkButton -/// +/// /// The `GtkButton` widget can hold any valid child widget. That is, it can hold /// almost any other standard `GtkWidget`. The most commonly used child is the /// `GtkLabel`. -/// +/// /// # Shortcuts and Gestures -/// +/// /// The following signals have default keybindings: -/// +/// /// - [signal@Gtk.Button::activate] -/// +/// /// # CSS nodes -/// +/// /// `GtkButton` has a single CSS node with name button. The node will get the /// style classes .image-button or .text-button, if the content is just an /// image or label, respectively. It may also receive the .flat style class. /// When activating a button via the keyboard, the button will temporarily /// gain the .keyboard-activating style class. -/// +/// /// Other style classes that are commonly used with `GtkButton` include /// .suggested-action and .destructive-action. In special cases, buttons /// can be made round by adding the .circular style class. -/// +/// /// Button-like widgets like [class@Gtk.ToggleButton], [class@Gtk.MenuButton], /// [class@Gtk.VolumeButton], [class@Gtk.LockButton], [class@Gtk.ColorButton] /// or [class@Gtk.FontButton] use style classes such as .toggle, .popup, .scale, /// .lock, .color on the button node to differentiate themselves from a plain /// `GtkButton`. -/// +/// /// # Accessibility -/// +/// /// `GtkButton` uses the [enum@Gtk.AccessibleRole.button] role. open class Button: Widget, Actionable { /// Creates a new `GtkButton` widget. - /// - /// To add a child widget to the button, use [method@Gtk.Button.set_child]. - public convenience init() { - self.init( - gtk_button_new() - ) +/// +/// To add a child widget to the button, use [method@Gtk.Button.set_child]. +public convenience init() { + self.init( + gtk_button_new() + ) +} + +/// Creates a new button containing an icon from the current icon theme. +/// +/// If the icon name isn’t known, a “broken image” icon will be +/// displayed instead. If the current icon theme is changed, the icon +/// will be updated appropriately. +public convenience init(iconName: String) { + self.init( + gtk_button_new_from_icon_name(iconName) + ) +} + +/// Creates a `GtkButton` widget with a `GtkLabel` child. +public convenience init(label: String) { + self.init( + gtk_button_new_with_label(label) + ) +} + +/// Creates a new `GtkButton` containing a label. +/// +/// If characters in @label are preceded by an underscore, they are underlined. +/// If you need a literal underscore character in a label, use “__” (two +/// underscores). The first underlined character represents a keyboard +/// accelerator called a mnemonic. Pressing Alt and that key +/// activates the button. +public convenience init(mnemonic label: String) { + self.init( + gtk_button_new_with_mnemonic(label) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) +} + +addSignal(name: "clicked") { [weak self] () in + guard let self = self else { return } + self.clicked?(self) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new button containing an icon from the current icon theme. - /// - /// If the icon name isn’t known, a “broken image” icon will be - /// displayed instead. If the current icon theme is changed, the icon - /// will be updated appropriately. - public convenience init(iconName: String) { - self.init( - gtk_button_new_from_icon_name(iconName) - ) +addSignal(name: "notify::can-shrink", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCanShrink?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a `GtkButton` widget with a `GtkLabel` child. - public convenience init(label: String) { - self.init( - gtk_button_new_with_label(label) - ) +addSignal(name: "notify::child", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyChild?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new `GtkButton` containing a label. - /// - /// If characters in @label are preceded by an underscore, they are underlined. - /// If you need a literal underscore character in a label, use “__” (two - /// underscores). The first underlined character represents a keyboard - /// accelerator called a mnemonic. Pressing Alt and that key - /// activates the button. - public convenience init(mnemonic label: String) { - self.init( - gtk_button_new_with_mnemonic(label) - ) +addSignal(name: "notify::has-frame", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasFrame?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) - } - - addSignal(name: "clicked") { [weak self] () in - guard let self = self else { return } - self.clicked?(self) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::can-shrink", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCanShrink?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::child", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyChild?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::has-frame", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasFrame?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::icon-name", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIconName?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::label", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLabel?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-underline", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseUnderline?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::action-name", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionName?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::action-target", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionTarget?(self, param0) - } +addSignal(name: "notify::icon-name", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIconName?(self, param0) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::label", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLabel?(self, param0) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::use-underline", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseUnderline?(self, param0) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::action-name", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionName?(self, param0) +} + +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::action-target", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionTarget?(self, param0) +} +} + /// Whether the button has a frame. - @GObjectProperty(named: "has-frame") public var hasFrame: Bool +@GObjectProperty(named: "has-frame") public var hasFrame: Bool - /// The name of the icon used to automatically populate the button. - @GObjectProperty(named: "icon-name") public var iconName: String? +/// The name of the icon used to automatically populate the button. +@GObjectProperty(named: "icon-name") public var iconName: String? - /// Text of the label inside the button, if the button contains a label widget. - @GObjectProperty(named: "label") public var label: String? +/// Text of the label inside the button, if the button contains a label widget. +@GObjectProperty(named: "label") public var label: String? - /// If set, an underline in the text indicates that the following character is - /// to be used as mnemonic. - @GObjectProperty(named: "use-underline") public var useUnderline: Bool +/// If set, an underline in the text indicates that the following character is +/// to be used as mnemonic. +@GObjectProperty(named: "use-underline") public var useUnderline: Bool - /// The name of the action with which this widget should be associated. - @GObjectProperty(named: "action-name") public var actionName: String? +/// The name of the action with which this widget should be associated. +@GObjectProperty(named: "action-name") public var actionName: String? - /// Emitted to animate press then release. - /// - /// This is an action signal. Applications should never connect - /// to this signal, but use the [signal@Gtk.Button::clicked] signal. - /// - /// The default bindings for this signal are all forms of the - /// and Enter keys. - public var activate: ((Button) -> Void)? +/// Emitted to animate press then release. +/// +/// This is an action signal. Applications should never connect +/// to this signal, but use the [signal@Gtk.Button::clicked] signal. +/// +/// The default bindings for this signal are all forms of the +/// and Enter keys. +public var activate: ((Button) -> Void)? - /// Emitted when the button has been activated (pressed and released). - public var clicked: ((Button) -> Void)? +/// Emitted when the button has been activated (pressed and released). +public var clicked: ((Button) -> Void)? - public var notifyCanShrink: ((Button, OpaquePointer) -> Void)? - public var notifyChild: ((Button, OpaquePointer) -> Void)? +public var notifyCanShrink: ((Button, OpaquePointer) -> Void)? - public var notifyHasFrame: ((Button, OpaquePointer) -> Void)? - public var notifyIconName: ((Button, OpaquePointer) -> Void)? +public var notifyChild: ((Button, OpaquePointer) -> Void)? - public var notifyLabel: ((Button, OpaquePointer) -> Void)? - public var notifyUseUnderline: ((Button, OpaquePointer) -> Void)? +public var notifyHasFrame: ((Button, OpaquePointer) -> Void)? - public var notifyActionName: ((Button, OpaquePointer) -> Void)? - public var notifyActionTarget: ((Button, OpaquePointer) -> Void)? -} +public var notifyIconName: ((Button, OpaquePointer) -> Void)? + + +public var notifyLabel: ((Button, OpaquePointer) -> Void)? + + +public var notifyUseUnderline: ((Button, OpaquePointer) -> Void)? + + +public var notifyActionName: ((Button, OpaquePointer) -> Void)? + + +public var notifyActionTarget: ((Button, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ButtonsType.swift b/Sources/Gtk/Generated/ButtonsType.swift index ae70565d91..daa430f79a 100644 --- a/Sources/Gtk/Generated/ButtonsType.swift +++ b/Sources/Gtk/Generated/ButtonsType.swift @@ -1,10 +1,10 @@ import CGtk /// Prebuilt sets of buttons for `GtkDialog`. -/// +/// /// If none of these choices are appropriate, simply use /// %GTK_BUTTONS_NONE and call [method@Gtk.Dialog.add_buttons]. -/// +/// /// > Please note that %GTK_BUTTONS_OK, %GTK_BUTTONS_YES_NO /// > and %GTK_BUTTONS_OK_CANCEL are discouraged by the /// > [GNOME Human Interface Guidelines](https://developer.gnome.org/hig/). @@ -12,36 +12,36 @@ public enum ButtonsType: GValueRepresentableEnum { public typealias GtkEnum = GtkButtonsType /// No buttons at all - case none - /// An OK button - case ok - /// A Close button - case close - /// A Cancel button - case cancel - /// Yes and No buttons - case yesNo - /// OK and Cancel buttons - case okCancel +case none +/// An OK button +case ok +/// A Close button +case close +/// A Cancel button +case cancel +/// Yes and No buttons +case yesNo +/// OK and Cancel buttons +case okCancel public static var type: GType { - gtk_buttons_type_get_type() - } + gtk_buttons_type_get_type() +} public init(from gtkEnum: GtkButtonsType) { switch gtkEnum { case GTK_BUTTONS_NONE: - self = .none - case GTK_BUTTONS_OK: - self = .ok - case GTK_BUTTONS_CLOSE: - self = .close - case GTK_BUTTONS_CANCEL: - self = .cancel - case GTK_BUTTONS_YES_NO: - self = .yesNo - case GTK_BUTTONS_OK_CANCEL: - self = .okCancel + self = .none +case GTK_BUTTONS_OK: + self = .ok +case GTK_BUTTONS_CLOSE: + self = .close +case GTK_BUTTONS_CANCEL: + self = .cancel +case GTK_BUTTONS_YES_NO: + self = .yesNo +case GTK_BUTTONS_OK_CANCEL: + self = .okCancel default: fatalError("Unsupported GtkButtonsType enum value: \(gtkEnum.rawValue)") } @@ -50,17 +50,17 @@ public enum ButtonsType: GValueRepresentableEnum { public func toGtk() -> GtkButtonsType { switch self { case .none: - return GTK_BUTTONS_NONE - case .ok: - return GTK_BUTTONS_OK - case .close: - return GTK_BUTTONS_CLOSE - case .cancel: - return GTK_BUTTONS_CANCEL - case .yesNo: - return GTK_BUTTONS_YES_NO - case .okCancel: - return GTK_BUTTONS_OK_CANCEL + return GTK_BUTTONS_NONE +case .ok: + return GTK_BUTTONS_OK +case .close: + return GTK_BUTTONS_CLOSE +case .cancel: + return GTK_BUTTONS_CANCEL +case .yesNo: + return GTK_BUTTONS_YES_NO +case .okCancel: + return GTK_BUTTONS_OK_CANCEL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/CellEditable.swift b/Sources/Gtk/Generated/CellEditable.swift index fa4c171a02..918485f6a2 100644 --- a/Sources/Gtk/Generated/CellEditable.swift +++ b/Sources/Gtk/Generated/CellEditable.swift @@ -1,36 +1,37 @@ import CGtk /// Interface for widgets that can be used for editing cells -/// +/// /// The `GtkCellEditable` interface must be implemented for widgets to be usable /// to edit the contents of a `GtkTreeView` cell. It provides a way to specify how /// temporary widgets should be configured for editing, get the new value, etc. public protocol CellEditable: GObjectRepresentable { + /// This signal is a sign for the cell renderer to update its - /// value from the @cell_editable. - /// - /// Implementations of `GtkCellEditable` are responsible for - /// emitting this signal when they are done editing, e.g. - /// `GtkEntry` emits this signal when the user presses Enter. Typical things to - /// do in a handler for ::editing-done are to capture the edited value, - /// disconnect the @cell_editable from signals on the `GtkCellRenderer`, etc. - /// - /// gtk_cell_editable_editing_done() is a convenience method - /// for emitting `GtkCellEditable::editing-done`. - var editingDone: ((Self) -> Void)? { get set } +/// value from the @cell_editable. +/// +/// Implementations of `GtkCellEditable` are responsible for +/// emitting this signal when they are done editing, e.g. +/// `GtkEntry` emits this signal when the user presses Enter. Typical things to +/// do in a handler for ::editing-done are to capture the edited value, +/// disconnect the @cell_editable from signals on the `GtkCellRenderer`, etc. +/// +/// gtk_cell_editable_editing_done() is a convenience method +/// for emitting `GtkCellEditable::editing-done`. +var editingDone: ((Self) -> Void)? { get set } - /// This signal is meant to indicate that the cell is finished - /// editing, and the @cell_editable widget is being removed and may - /// subsequently be destroyed. - /// - /// Implementations of `GtkCellEditable` are responsible for - /// emitting this signal when they are done editing. It must - /// be emitted after the `GtkCellEditable::editing-done` signal, - /// to give the cell renderer a chance to update the cell's value - /// before the widget is removed. - /// - /// gtk_cell_editable_remove_widget() is a convenience method - /// for emitting `GtkCellEditable::remove-widget`. - var removeWidget: ((Self) -> Void)? { get set } -} +/// This signal is meant to indicate that the cell is finished +/// editing, and the @cell_editable widget is being removed and may +/// subsequently be destroyed. +/// +/// Implementations of `GtkCellEditable` are responsible for +/// emitting this signal when they are done editing. It must +/// be emitted after the `GtkCellEditable::editing-done` signal, +/// to give the cell renderer a chance to update the cell's value +/// before the widget is removed. +/// +/// gtk_cell_editable_remove_widget() is a convenience method +/// for emitting `GtkCellEditable::remove-widget`. +var removeWidget: ((Self) -> Void)? { get set } +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/CellLayout.swift b/Sources/Gtk/Generated/CellLayout.swift index 2aa7aa88b5..51c91867db 100644 --- a/Sources/Gtk/Generated/CellLayout.swift +++ b/Sources/Gtk/Generated/CellLayout.swift @@ -1,11 +1,11 @@ import CGtk /// An interface for packing cells -/// +/// /// `GtkCellLayout` is an interface to be implemented by all objects which /// want to provide a `GtkTreeViewColumn` like API for packing cells, /// setting attributes and data funcs. -/// +/// /// One of the notable features provided by implementations of /// `GtkCellLayout` are attributes. Attributes let you set the properties /// in flexible ways. They can just be set to constant values like regular @@ -15,9 +15,9 @@ import CGtk /// the cell renderer. Finally, it is possible to specify a function with /// gtk_cell_layout_set_cell_data_func() that is called to determine the /// value of the attribute for each cell that is rendered. -/// +/// /// ## GtkCellLayouts as GtkBuildable -/// +/// /// Implementations of GtkCellLayout which also implement the GtkBuildable /// interface (`GtkCellView`, `GtkIconView`, `GtkComboBox`, /// `GtkEntryCompletion`, `GtkTreeViewColumn`) accept `GtkCellRenderer` objects @@ -26,38 +26,38 @@ import CGtk /// elements. Each `` element has a name attribute which specifies /// a property of the cell renderer; the content of the element is the /// attribute value. -/// +/// /// This is an example of a UI definition fragment specifying attributes: -/// +/// /// ```xml /// 0 /// ``` -/// +/// /// Furthermore for implementations of `GtkCellLayout` that use a `GtkCellArea` /// to lay out cells (all `GtkCellLayout`s in GTK use a `GtkCellArea`) /// [cell properties](class.CellArea.html#cell-properties) can also be defined /// in the format by specifying the custom `` attribute which can /// contain multiple `` elements. -/// +/// /// Here is a UI definition fragment specifying cell properties: -/// +/// /// ```xml /// TrueFalse /// ``` -/// +/// /// ## Subclassing GtkCellLayout implementations -/// +/// /// When subclassing a widget that implements `GtkCellLayout` like /// `GtkIconView` or `GtkComboBox`, there are some considerations related /// to the fact that these widgets internally use a `GtkCellArea`. /// The cell area is exposed as a construct-only property by these /// widgets. This means that it is possible to e.g. do -/// +/// /// ```c /// GtkWIdget *combo = /// g_object_new (GTK_TYPE_COMBO_BOX, "cell-area", my_cell_area, NULL); /// ``` -/// +/// /// to use a custom cell area with a combo box. But construct properties /// are only initialized after instance `init()` /// functions have run, which means that using functions which rely on @@ -65,21 +65,21 @@ import CGtk /// cause the default cell area to be instantiated. In this case, a provided /// construct property value will be ignored (with a warning, to alert /// you to the problem). -/// +/// /// ```c /// static void /// my_combo_box_init (MyComboBox *b) /// { /// GtkCellRenderer *cell; -/// +/// /// cell = gtk_cell_renderer_pixbuf_new (); -/// +/// /// // The following call causes the default cell area for combo boxes, /// // a GtkCellAreaBox, to be instantiated /// gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (b), cell, FALSE); /// ... /// } -/// +/// /// GtkWidget * /// my_combo_box_new (GtkCellArea *area) /// { @@ -87,12 +87,14 @@ import CGtk /// return g_object_new (MY_TYPE_COMBO_BOX, "cell-area", area, NULL); /// } /// ``` -/// +/// /// If supporting alternative cell areas with your derived widget is /// not important, then this does not have to concern you. If you want /// to support alternative cell areas, you can do so by moving the /// problematic calls out of `init()` and into a `constructor()` /// for your class. public protocol CellLayout: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/CellRendererAccelMode.swift b/Sources/Gtk/Generated/CellRendererAccelMode.swift index 80a29bf5bd..4952def369 100644 --- a/Sources/Gtk/Generated/CellRendererAccelMode.swift +++ b/Sources/Gtk/Generated/CellRendererAccelMode.swift @@ -5,20 +5,20 @@ public enum CellRendererAccelMode: GValueRepresentableEnum { public typealias GtkEnum = GtkCellRendererAccelMode /// GTK accelerators mode - case gtk - /// Other accelerator mode - case other +case gtk +/// Other accelerator mode +case other public static var type: GType { - gtk_cell_renderer_accel_mode_get_type() - } + gtk_cell_renderer_accel_mode_get_type() +} public init(from gtkEnum: GtkCellRendererAccelMode) { switch gtkEnum { case GTK_CELL_RENDERER_ACCEL_MODE_GTK: - self = .gtk - case GTK_CELL_RENDERER_ACCEL_MODE_OTHER: - self = .other + self = .gtk +case GTK_CELL_RENDERER_ACCEL_MODE_OTHER: + self = .other default: fatalError("Unsupported GtkCellRendererAccelMode enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ public enum CellRendererAccelMode: GValueRepresentableEnum { public func toGtk() -> GtkCellRendererAccelMode { switch self { case .gtk: - return GTK_CELL_RENDERER_ACCEL_MODE_GTK - case .other: - return GTK_CELL_RENDERER_ACCEL_MODE_OTHER + return GTK_CELL_RENDERER_ACCEL_MODE_GTK +case .other: + return GTK_CELL_RENDERER_ACCEL_MODE_OTHER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/CellRendererMode.swift b/Sources/Gtk/Generated/CellRendererMode.swift index b073354ea2..74d702f294 100644 --- a/Sources/Gtk/Generated/CellRendererMode.swift +++ b/Sources/Gtk/Generated/CellRendererMode.swift @@ -5,27 +5,27 @@ public enum CellRendererMode: GValueRepresentableEnum { public typealias GtkEnum = GtkCellRendererMode /// The cell is just for display - /// and cannot be interacted with. Note that this doesn’t mean that eg. the - /// row being drawn can’t be selected -- just that a particular element of - /// it cannot be individually modified. - case inert - /// The cell can be clicked. - case activatable - /// The cell can be edited or otherwise modified. - case editable +/// and cannot be interacted with. Note that this doesn’t mean that eg. the +/// row being drawn can’t be selected -- just that a particular element of +/// it cannot be individually modified. +case inert +/// The cell can be clicked. +case activatable +/// The cell can be edited or otherwise modified. +case editable public static var type: GType { - gtk_cell_renderer_mode_get_type() - } + gtk_cell_renderer_mode_get_type() +} public init(from gtkEnum: GtkCellRendererMode) { switch gtkEnum { case GTK_CELL_RENDERER_MODE_INERT: - self = .inert - case GTK_CELL_RENDERER_MODE_ACTIVATABLE: - self = .activatable - case GTK_CELL_RENDERER_MODE_EDITABLE: - self = .editable + self = .inert +case GTK_CELL_RENDERER_MODE_ACTIVATABLE: + self = .activatable +case GTK_CELL_RENDERER_MODE_EDITABLE: + self = .editable default: fatalError("Unsupported GtkCellRendererMode enum value: \(gtkEnum.rawValue)") } @@ -34,11 +34,11 @@ public enum CellRendererMode: GValueRepresentableEnum { public func toGtk() -> GtkCellRendererMode { switch self { case .inert: - return GTK_CELL_RENDERER_MODE_INERT - case .activatable: - return GTK_CELL_RENDERER_MODE_ACTIVATABLE - case .editable: - return GTK_CELL_RENDERER_MODE_EDITABLE + return GTK_CELL_RENDERER_MODE_INERT +case .activatable: + return GTK_CELL_RENDERER_MODE_ACTIVATABLE +case .editable: + return GTK_CELL_RENDERER_MODE_EDITABLE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/CheckButton.swift b/Sources/Gtk/Generated/CheckButton.swift index 287ea926a3..9c15409bac 100644 --- a/Sources/Gtk/Generated/CheckButton.swift +++ b/Sources/Gtk/Generated/CheckButton.swift @@ -1,251 +1,243 @@ import CGtk /// Places a label next to an indicator. -/// +/// /// Example GtkCheckButtons -/// +/// /// A `GtkCheckButton` is created by calling either [ctor@Gtk.CheckButton.new] /// or [ctor@Gtk.CheckButton.new_with_label]. -/// +/// /// The state of a `GtkCheckButton` can be set specifically using /// [method@Gtk.CheckButton.set_active], and retrieved using /// [method@Gtk.CheckButton.get_active]. -/// +/// /// # Inconsistent state -/// +/// /// In addition to "on" and "off", check buttons can be an /// "in between" state that is neither on nor off. This can be used /// e.g. when the user has selected a range of elements (such as some /// text or spreadsheet cells) that are affected by a check button, /// and the current values in that range are inconsistent. -/// +/// /// To set a `GtkCheckButton` to inconsistent state, use /// [method@Gtk.CheckButton.set_inconsistent]. -/// +/// /// # Grouping -/// +/// /// Check buttons can be grouped together, to form mutually exclusive /// groups - only one of the buttons can be toggled at a time, and toggling /// another one will switch the currently toggled one off. -/// +/// /// Grouped check buttons use a different indicator, and are commonly referred /// to as *radio buttons*. -/// +/// /// Example GtkRadioButtons -/// +/// /// To add a `GtkCheckButton` to a group, use [method@Gtk.CheckButton.set_group]. -/// +/// /// When the code must keep track of the state of a group of radio buttons, it /// is recommended to keep track of such state through a stateful /// `GAction` with a target for each button. Using the `toggled` signals to keep /// track of the group changes and state is discouraged. -/// +/// /// # Shortcuts and Gestures -/// +/// /// `GtkCheckButton` supports the following keyboard shortcuts: -/// +/// /// - or Enter activates the button. -/// +/// /// # CSS nodes -/// +/// /// ``` /// checkbutton[.text-button][.grouped] /// ├── check /// ╰── [label] /// ``` -/// +/// /// A `GtkCheckButton` has a main node with name checkbutton. If the /// [property@Gtk.CheckButton:label] or [property@Gtk.CheckButton:child] /// properties are set, it contains a child widget. The indicator node /// is named check when no group is set, and radio if the checkbutton /// is grouped together with other checkbuttons. -/// +/// /// # Accessibility -/// +/// /// `GtkCheckButton` uses the [enum@Gtk.AccessibleRole.checkbox] role. open class CheckButton: Widget, Actionable { /// Creates a new `GtkCheckButton`. - public convenience init() { - self.init( - gtk_check_button_new() - ) +public convenience init() { + self.init( + gtk_check_button_new() + ) +} + +/// Creates a new `GtkCheckButton` with the given text. +public convenience init(label: String) { + self.init( + gtk_check_button_new_with_label(label) + ) +} + +/// Creates a new `GtkCheckButton` with the given text and a mnemonic. +public convenience init(mnemonic label: String) { + self.init( + gtk_check_button_new_with_mnemonic(label) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) +} + +addSignal(name: "toggled") { [weak self] () in + guard let self = self else { return } + self.toggled?(self) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new `GtkCheckButton` with the given text. - public convenience init(label: String) { - self.init( - gtk_check_button_new_with_label(label) - ) +addSignal(name: "notify::active", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActive?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new `GtkCheckButton` with the given text and a mnemonic. - public convenience init(mnemonic label: String) { - self.init( - gtk_check_button_new_with_mnemonic(label) - ) +addSignal(name: "notify::child", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyChild?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) - } - - addSignal(name: "toggled") { [weak self] () in - guard let self = self else { return } - self.toggled?(self) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::active", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActive?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::child", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyChild?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::group", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyGroup?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::inconsistent", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInconsistent?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::label", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLabel?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-underline", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseUnderline?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::action-name", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionName?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::action-target", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionTarget?(self, param0) - } +addSignal(name: "notify::group", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyGroup?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::inconsistent", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInconsistent?(self, param0) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::label", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLabel?(self, param0) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::use-underline", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseUnderline?(self, param0) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::action-name", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionName?(self, param0) +} + +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::action-target", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionTarget?(self, param0) +} +} + /// If the check button is active. - /// - /// Setting `active` to %TRUE will add the `:checked:` state to both - /// the check button and the indicator CSS node. - @GObjectProperty(named: "active") public var active: Bool +/// +/// Setting `active` to %TRUE will add the `:checked:` state to both +/// the check button and the indicator CSS node. +@GObjectProperty(named: "active") public var active: Bool - /// If the check button is in an “in between” state. - /// - /// The inconsistent state only affects visual appearance, - /// not the semantics of the button. - @GObjectProperty(named: "inconsistent") public var inconsistent: Bool +/// If the check button is in an “in between” state. +/// +/// The inconsistent state only affects visual appearance, +/// not the semantics of the button. +@GObjectProperty(named: "inconsistent") public var inconsistent: Bool - /// Text of the label inside the check button, if it contains a label widget. - @GObjectProperty(named: "label") public var label: String? +/// Text of the label inside the check button, if it contains a label widget. +@GObjectProperty(named: "label") public var label: String? - /// If set, an underline in the text indicates that the following - /// character is to be used as mnemonic. - @GObjectProperty(named: "use-underline") public var useUnderline: Bool +/// If set, an underline in the text indicates that the following +/// character is to be used as mnemonic. +@GObjectProperty(named: "use-underline") public var useUnderline: Bool - /// The name of the action with which this widget should be associated. - @GObjectProperty(named: "action-name") public var actionName: String? +/// The name of the action with which this widget should be associated. +@GObjectProperty(named: "action-name") public var actionName: String? - /// Emitted to when the check button is activated. - /// - /// The `::activate` signal on `GtkCheckButton` is an action signal and - /// emitting it causes the button to animate press then release. - /// - /// Applications should never connect to this signal, but use the - /// [signal@Gtk.CheckButton::toggled] signal. - /// - /// The default bindings for this signal are all forms of the - /// and Enter keys. - public var activate: ((CheckButton) -> Void)? +/// Emitted to when the check button is activated. +/// +/// The `::activate` signal on `GtkCheckButton` is an action signal and +/// emitting it causes the button to animate press then release. +/// +/// Applications should never connect to this signal, but use the +/// [signal@Gtk.CheckButton::toggled] signal. +/// +/// The default bindings for this signal are all forms of the +/// and Enter keys. +public var activate: ((CheckButton) -> Void)? - /// Emitted when the buttons's [property@Gtk.CheckButton:active] - /// property changes. - public var toggled: ((CheckButton) -> Void)? +/// Emitted when the buttons's [property@Gtk.CheckButton:active] +/// property changes. +public var toggled: ((CheckButton) -> Void)? - public var notifyActive: ((CheckButton, OpaquePointer) -> Void)? - public var notifyChild: ((CheckButton, OpaquePointer) -> Void)? +public var notifyActive: ((CheckButton, OpaquePointer) -> Void)? - public var notifyGroup: ((CheckButton, OpaquePointer) -> Void)? - public var notifyInconsistent: ((CheckButton, OpaquePointer) -> Void)? +public var notifyChild: ((CheckButton, OpaquePointer) -> Void)? - public var notifyLabel: ((CheckButton, OpaquePointer) -> Void)? - public var notifyUseUnderline: ((CheckButton, OpaquePointer) -> Void)? +public var notifyGroup: ((CheckButton, OpaquePointer) -> Void)? - public var notifyActionName: ((CheckButton, OpaquePointer) -> Void)? - public var notifyActionTarget: ((CheckButton, OpaquePointer) -> Void)? -} +public var notifyInconsistent: ((CheckButton, OpaquePointer) -> Void)? + + +public var notifyLabel: ((CheckButton, OpaquePointer) -> Void)? + + +public var notifyUseUnderline: ((CheckButton, OpaquePointer) -> Void)? + + +public var notifyActionName: ((CheckButton, OpaquePointer) -> Void)? + + +public var notifyActionTarget: ((CheckButton, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ConstraintAttribute.swift b/Sources/Gtk/Generated/ConstraintAttribute.swift index 1bc24638df..1e5c0ce066 100644 --- a/Sources/Gtk/Generated/ConstraintAttribute.swift +++ b/Sources/Gtk/Generated/ConstraintAttribute.swift @@ -5,69 +5,69 @@ public enum ConstraintAttribute: GValueRepresentableEnum { public typealias GtkEnum = GtkConstraintAttribute /// No attribute, used for constant - /// relations - case none - /// The left edge of a widget, regardless of - /// text direction - case left - /// The right edge of a widget, regardless - /// of text direction - case right - /// The top edge of a widget - case top - /// The bottom edge of a widget - case bottom - /// The leading edge of a widget, depending - /// on text direction; equivalent to %GTK_CONSTRAINT_ATTRIBUTE_LEFT for LTR - /// languages, and %GTK_CONSTRAINT_ATTRIBUTE_RIGHT for RTL ones - case start - /// The trailing edge of a widget, depending - /// on text direction; equivalent to %GTK_CONSTRAINT_ATTRIBUTE_RIGHT for LTR - /// languages, and %GTK_CONSTRAINT_ATTRIBUTE_LEFT for RTL ones - case end - /// The width of a widget - case width - /// The height of a widget - case height - /// The center of a widget, on the - /// horizontal axis - case centerX - /// The center of a widget, on the - /// vertical axis - case centerY - /// The baseline of a widget - case baseline +/// relations +case none +/// The left edge of a widget, regardless of +/// text direction +case left +/// The right edge of a widget, regardless +/// of text direction +case right +/// The top edge of a widget +case top +/// The bottom edge of a widget +case bottom +/// The leading edge of a widget, depending +/// on text direction; equivalent to %GTK_CONSTRAINT_ATTRIBUTE_LEFT for LTR +/// languages, and %GTK_CONSTRAINT_ATTRIBUTE_RIGHT for RTL ones +case start +/// The trailing edge of a widget, depending +/// on text direction; equivalent to %GTK_CONSTRAINT_ATTRIBUTE_RIGHT for LTR +/// languages, and %GTK_CONSTRAINT_ATTRIBUTE_LEFT for RTL ones +case end +/// The width of a widget +case width +/// The height of a widget +case height +/// The center of a widget, on the +/// horizontal axis +case centerX +/// The center of a widget, on the +/// vertical axis +case centerY +/// The baseline of a widget +case baseline public static var type: GType { - gtk_constraint_attribute_get_type() - } + gtk_constraint_attribute_get_type() +} public init(from gtkEnum: GtkConstraintAttribute) { switch gtkEnum { case GTK_CONSTRAINT_ATTRIBUTE_NONE: - self = .none - case GTK_CONSTRAINT_ATTRIBUTE_LEFT: - self = .left - case GTK_CONSTRAINT_ATTRIBUTE_RIGHT: - self = .right - case GTK_CONSTRAINT_ATTRIBUTE_TOP: - self = .top - case GTK_CONSTRAINT_ATTRIBUTE_BOTTOM: - self = .bottom - case GTK_CONSTRAINT_ATTRIBUTE_START: - self = .start - case GTK_CONSTRAINT_ATTRIBUTE_END: - self = .end - case GTK_CONSTRAINT_ATTRIBUTE_WIDTH: - self = .width - case GTK_CONSTRAINT_ATTRIBUTE_HEIGHT: - self = .height - case GTK_CONSTRAINT_ATTRIBUTE_CENTER_X: - self = .centerX - case GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y: - self = .centerY - case GTK_CONSTRAINT_ATTRIBUTE_BASELINE: - self = .baseline + self = .none +case GTK_CONSTRAINT_ATTRIBUTE_LEFT: + self = .left +case GTK_CONSTRAINT_ATTRIBUTE_RIGHT: + self = .right +case GTK_CONSTRAINT_ATTRIBUTE_TOP: + self = .top +case GTK_CONSTRAINT_ATTRIBUTE_BOTTOM: + self = .bottom +case GTK_CONSTRAINT_ATTRIBUTE_START: + self = .start +case GTK_CONSTRAINT_ATTRIBUTE_END: + self = .end +case GTK_CONSTRAINT_ATTRIBUTE_WIDTH: + self = .width +case GTK_CONSTRAINT_ATTRIBUTE_HEIGHT: + self = .height +case GTK_CONSTRAINT_ATTRIBUTE_CENTER_X: + self = .centerX +case GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y: + self = .centerY +case GTK_CONSTRAINT_ATTRIBUTE_BASELINE: + self = .baseline default: fatalError("Unsupported GtkConstraintAttribute enum value: \(gtkEnum.rawValue)") } @@ -76,29 +76,29 @@ public enum ConstraintAttribute: GValueRepresentableEnum { public func toGtk() -> GtkConstraintAttribute { switch self { case .none: - return GTK_CONSTRAINT_ATTRIBUTE_NONE - case .left: - return GTK_CONSTRAINT_ATTRIBUTE_LEFT - case .right: - return GTK_CONSTRAINT_ATTRIBUTE_RIGHT - case .top: - return GTK_CONSTRAINT_ATTRIBUTE_TOP - case .bottom: - return GTK_CONSTRAINT_ATTRIBUTE_BOTTOM - case .start: - return GTK_CONSTRAINT_ATTRIBUTE_START - case .end: - return GTK_CONSTRAINT_ATTRIBUTE_END - case .width: - return GTK_CONSTRAINT_ATTRIBUTE_WIDTH - case .height: - return GTK_CONSTRAINT_ATTRIBUTE_HEIGHT - case .centerX: - return GTK_CONSTRAINT_ATTRIBUTE_CENTER_X - case .centerY: - return GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y - case .baseline: - return GTK_CONSTRAINT_ATTRIBUTE_BASELINE + return GTK_CONSTRAINT_ATTRIBUTE_NONE +case .left: + return GTK_CONSTRAINT_ATTRIBUTE_LEFT +case .right: + return GTK_CONSTRAINT_ATTRIBUTE_RIGHT +case .top: + return GTK_CONSTRAINT_ATTRIBUTE_TOP +case .bottom: + return GTK_CONSTRAINT_ATTRIBUTE_BOTTOM +case .start: + return GTK_CONSTRAINT_ATTRIBUTE_START +case .end: + return GTK_CONSTRAINT_ATTRIBUTE_END +case .width: + return GTK_CONSTRAINT_ATTRIBUTE_WIDTH +case .height: + return GTK_CONSTRAINT_ATTRIBUTE_HEIGHT +case .centerX: + return GTK_CONSTRAINT_ATTRIBUTE_CENTER_X +case .centerY: + return GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y +case .baseline: + return GTK_CONSTRAINT_ATTRIBUTE_BASELINE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ConstraintRelation.swift b/Sources/Gtk/Generated/ConstraintRelation.swift index 58e75a256e..78cd718df6 100644 --- a/Sources/Gtk/Generated/ConstraintRelation.swift +++ b/Sources/Gtk/Generated/ConstraintRelation.swift @@ -5,24 +5,24 @@ public enum ConstraintRelation: GValueRepresentableEnum { public typealias GtkEnum = GtkConstraintRelation /// Less than, or equal - case le - /// Equal - case eq - /// Greater than, or equal - case ge +case le +/// Equal +case eq +/// Greater than, or equal +case ge public static var type: GType { - gtk_constraint_relation_get_type() - } + gtk_constraint_relation_get_type() +} public init(from gtkEnum: GtkConstraintRelation) { switch gtkEnum { case GTK_CONSTRAINT_RELATION_LE: - self = .le - case GTK_CONSTRAINT_RELATION_EQ: - self = .eq - case GTK_CONSTRAINT_RELATION_GE: - self = .ge + self = .le +case GTK_CONSTRAINT_RELATION_EQ: + self = .eq +case GTK_CONSTRAINT_RELATION_GE: + self = .ge default: fatalError("Unsupported GtkConstraintRelation enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ public enum ConstraintRelation: GValueRepresentableEnum { public func toGtk() -> GtkConstraintRelation { switch self { case .le: - return GTK_CONSTRAINT_RELATION_LE - case .eq: - return GTK_CONSTRAINT_RELATION_EQ - case .ge: - return GTK_CONSTRAINT_RELATION_GE + return GTK_CONSTRAINT_RELATION_LE +case .eq: + return GTK_CONSTRAINT_RELATION_EQ +case .ge: + return GTK_CONSTRAINT_RELATION_GE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ConstraintStrength.swift b/Sources/Gtk/Generated/ConstraintStrength.swift index 0e0fa5367b..56e0c59e20 100644 --- a/Sources/Gtk/Generated/ConstraintStrength.swift +++ b/Sources/Gtk/Generated/ConstraintStrength.swift @@ -1,35 +1,35 @@ import CGtk /// The strength of a constraint, expressed as a symbolic constant. -/// +/// /// The strength of a [class@Constraint] can be expressed with any positive /// integer; the values of this enumeration can be used for readability. public enum ConstraintStrength: GValueRepresentableEnum { public typealias GtkEnum = GtkConstraintStrength /// The constraint is required towards solving the layout - case required - /// A strong constraint - case strong - /// A medium constraint - case medium - /// A weak constraint - case weak +case required +/// A strong constraint +case strong +/// A medium constraint +case medium +/// A weak constraint +case weak public static var type: GType { - gtk_constraint_strength_get_type() - } + gtk_constraint_strength_get_type() +} public init(from gtkEnum: GtkConstraintStrength) { switch gtkEnum { case GTK_CONSTRAINT_STRENGTH_REQUIRED: - self = .required - case GTK_CONSTRAINT_STRENGTH_STRONG: - self = .strong - case GTK_CONSTRAINT_STRENGTH_MEDIUM: - self = .medium - case GTK_CONSTRAINT_STRENGTH_WEAK: - self = .weak + self = .required +case GTK_CONSTRAINT_STRENGTH_STRONG: + self = .strong +case GTK_CONSTRAINT_STRENGTH_MEDIUM: + self = .medium +case GTK_CONSTRAINT_STRENGTH_WEAK: + self = .weak default: fatalError("Unsupported GtkConstraintStrength enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ public enum ConstraintStrength: GValueRepresentableEnum { public func toGtk() -> GtkConstraintStrength { switch self { case .required: - return GTK_CONSTRAINT_STRENGTH_REQUIRED - case .strong: - return GTK_CONSTRAINT_STRENGTH_STRONG - case .medium: - return GTK_CONSTRAINT_STRENGTH_MEDIUM - case .weak: - return GTK_CONSTRAINT_STRENGTH_WEAK + return GTK_CONSTRAINT_STRENGTH_REQUIRED +case .strong: + return GTK_CONSTRAINT_STRENGTH_STRONG +case .medium: + return GTK_CONSTRAINT_STRENGTH_MEDIUM +case .weak: + return GTK_CONSTRAINT_STRENGTH_WEAK } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ConstraintTarget.swift b/Sources/Gtk/Generated/ConstraintTarget.swift index 07bfaf33b9..222de0a185 100644 --- a/Sources/Gtk/Generated/ConstraintTarget.swift +++ b/Sources/Gtk/Generated/ConstraintTarget.swift @@ -2,8 +2,10 @@ import CGtk /// Makes it possible to use an object as source or target in a /// [class@Gtk.Constraint]. -/// +/// /// Besides `GtkWidget`, it is also implemented by `GtkConstraintGuide`. public protocol ConstraintTarget: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ConstraintVflParserError.swift b/Sources/Gtk/Generated/ConstraintVflParserError.swift index 1b485c06f8..8bda010e9e 100644 --- a/Sources/Gtk/Generated/ConstraintVflParserError.swift +++ b/Sources/Gtk/Generated/ConstraintVflParserError.swift @@ -5,56 +5,55 @@ public enum ConstraintVflParserError: GValueRepresentableEnum { public typealias GtkEnum = GtkConstraintVflParserError /// Invalid or unknown symbol - case symbol - /// Invalid or unknown attribute - case attribute - /// Invalid or unknown view - case view - /// Invalid or unknown metric - case metric - /// Invalid or unknown priority - case priority - /// Invalid or unknown relation - case relation +case symbol +/// Invalid or unknown attribute +case attribute +/// Invalid or unknown view +case view +/// Invalid or unknown metric +case metric +/// Invalid or unknown priority +case priority +/// Invalid or unknown relation +case relation public static var type: GType { - gtk_constraint_vfl_parser_error_get_type() - } + gtk_constraint_vfl_parser_error_get_type() +} public init(from gtkEnum: GtkConstraintVflParserError) { switch gtkEnum { case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL: - self = .symbol - case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE: - self = .attribute - case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW: - self = .view - case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC: - self = .metric - case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY: - self = .priority - case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION: - self = .relation + self = .symbol +case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE: + self = .attribute +case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW: + self = .view +case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC: + self = .metric +case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY: + self = .priority +case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION: + self = .relation default: - fatalError( - "Unsupported GtkConstraintVflParserError enum value: \(gtkEnum.rawValue)") + fatalError("Unsupported GtkConstraintVflParserError enum value: \(gtkEnum.rawValue)") } } public func toGtk() -> GtkConstraintVflParserError { switch self { case .symbol: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL - case .attribute: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE - case .view: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW - case .metric: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC - case .priority: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY - case .relation: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL +case .attribute: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE +case .view: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW +case .metric: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC +case .priority: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY +case .relation: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/CornerType.swift b/Sources/Gtk/Generated/CornerType.swift index 8d6999bae6..4224f19381 100644 --- a/Sources/Gtk/Generated/CornerType.swift +++ b/Sources/Gtk/Generated/CornerType.swift @@ -2,38 +2,38 @@ import CGtk /// Specifies which corner a child widget should be placed in when packed into /// a `GtkScrolledWindow.` -/// +/// /// This is effectively the opposite of where the scroll bars are placed. public enum CornerType: GValueRepresentableEnum { public typealias GtkEnum = GtkCornerType /// Place the scrollbars on the right and bottom of the - /// widget (default behaviour). - case topLeft - /// Place the scrollbars on the top and right of the - /// widget. - case bottomLeft - /// Place the scrollbars on the left and bottom of the - /// widget. - case topRight - /// Place the scrollbars on the top and left of the - /// widget. - case bottomRight +/// widget (default behaviour). +case topLeft +/// Place the scrollbars on the top and right of the +/// widget. +case bottomLeft +/// Place the scrollbars on the left and bottom of the +/// widget. +case topRight +/// Place the scrollbars on the top and left of the +/// widget. +case bottomRight public static var type: GType { - gtk_corner_type_get_type() - } + gtk_corner_type_get_type() +} public init(from gtkEnum: GtkCornerType) { switch gtkEnum { case GTK_CORNER_TOP_LEFT: - self = .topLeft - case GTK_CORNER_BOTTOM_LEFT: - self = .bottomLeft - case GTK_CORNER_TOP_RIGHT: - self = .topRight - case GTK_CORNER_BOTTOM_RIGHT: - self = .bottomRight + self = .topLeft +case GTK_CORNER_BOTTOM_LEFT: + self = .bottomLeft +case GTK_CORNER_TOP_RIGHT: + self = .topRight +case GTK_CORNER_BOTTOM_RIGHT: + self = .bottomRight default: fatalError("Unsupported GtkCornerType enum value: \(gtkEnum.rawValue)") } @@ -42,13 +42,13 @@ public enum CornerType: GValueRepresentableEnum { public func toGtk() -> GtkCornerType { switch self { case .topLeft: - return GTK_CORNER_TOP_LEFT - case .bottomLeft: - return GTK_CORNER_BOTTOM_LEFT - case .topRight: - return GTK_CORNER_TOP_RIGHT - case .bottomRight: - return GTK_CORNER_BOTTOM_RIGHT + return GTK_CORNER_TOP_LEFT +case .bottomLeft: + return GTK_CORNER_BOTTOM_LEFT +case .topRight: + return GTK_CORNER_TOP_RIGHT +case .bottomRight: + return GTK_CORNER_BOTTOM_RIGHT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/CssParserError.swift b/Sources/Gtk/Generated/CssParserError.swift index 8036a95f88..9566e2db89 100644 --- a/Sources/Gtk/Generated/CssParserError.swift +++ b/Sources/Gtk/Generated/CssParserError.swift @@ -1,39 +1,39 @@ import CGtk /// Errors that can occur while parsing CSS. -/// +/// /// These errors are unexpected and will cause parts of the given CSS /// to be ignored. public enum CssParserError: GValueRepresentableEnum { public typealias GtkEnum = GtkCssParserError /// Unknown failure. - case failed - /// The given text does not form valid syntax - case syntax - /// Failed to import a resource - case import_ - /// The given name has not been defined - case name - /// The given value is not correct - case unknownValue +case failed +/// The given text does not form valid syntax +case syntax +/// Failed to import a resource +case import_ +/// The given name has not been defined +case name +/// The given value is not correct +case unknownValue public static var type: GType { - gtk_css_parser_error_get_type() - } + gtk_css_parser_error_get_type() +} public init(from gtkEnum: GtkCssParserError) { switch gtkEnum { case GTK_CSS_PARSER_ERROR_FAILED: - self = .failed - case GTK_CSS_PARSER_ERROR_SYNTAX: - self = .syntax - case GTK_CSS_PARSER_ERROR_IMPORT: - self = .import_ - case GTK_CSS_PARSER_ERROR_NAME: - self = .name - case GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE: - self = .unknownValue + self = .failed +case GTK_CSS_PARSER_ERROR_SYNTAX: + self = .syntax +case GTK_CSS_PARSER_ERROR_IMPORT: + self = .import_ +case GTK_CSS_PARSER_ERROR_NAME: + self = .name +case GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE: + self = .unknownValue default: fatalError("Unsupported GtkCssParserError enum value: \(gtkEnum.rawValue)") } @@ -42,15 +42,15 @@ public enum CssParserError: GValueRepresentableEnum { public func toGtk() -> GtkCssParserError { switch self { case .failed: - return GTK_CSS_PARSER_ERROR_FAILED - case .syntax: - return GTK_CSS_PARSER_ERROR_SYNTAX - case .import_: - return GTK_CSS_PARSER_ERROR_IMPORT - case .name: - return GTK_CSS_PARSER_ERROR_NAME - case .unknownValue: - return GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE + return GTK_CSS_PARSER_ERROR_FAILED +case .syntax: + return GTK_CSS_PARSER_ERROR_SYNTAX +case .import_: + return GTK_CSS_PARSER_ERROR_IMPORT +case .name: + return GTK_CSS_PARSER_ERROR_NAME +case .unknownValue: + return GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/CssParserWarning.swift b/Sources/Gtk/Generated/CssParserWarning.swift index 3050bfa3f3..459ecb80b9 100644 --- a/Sources/Gtk/Generated/CssParserWarning.swift +++ b/Sources/Gtk/Generated/CssParserWarning.swift @@ -1,33 +1,33 @@ import CGtk /// Warnings that can occur while parsing CSS. -/// +/// /// Unlike `GtkCssParserError`s, warnings do not cause the parser to /// skip any input, but they indicate issues that should be fixed. public enum CssParserWarning: GValueRepresentableEnum { public typealias GtkEnum = GtkCssParserWarning /// The given construct is - /// deprecated and will be removed in a future version - case deprecated - /// A syntax construct was used - /// that should be avoided - case syntax - /// A feature is not implemented - case unimplemented +/// deprecated and will be removed in a future version +case deprecated +/// A syntax construct was used +/// that should be avoided +case syntax +/// A feature is not implemented +case unimplemented public static var type: GType { - gtk_css_parser_warning_get_type() - } + gtk_css_parser_warning_get_type() +} public init(from gtkEnum: GtkCssParserWarning) { switch gtkEnum { case GTK_CSS_PARSER_WARNING_DEPRECATED: - self = .deprecated - case GTK_CSS_PARSER_WARNING_SYNTAX: - self = .syntax - case GTK_CSS_PARSER_WARNING_UNIMPLEMENTED: - self = .unimplemented + self = .deprecated +case GTK_CSS_PARSER_WARNING_SYNTAX: + self = .syntax +case GTK_CSS_PARSER_WARNING_UNIMPLEMENTED: + self = .unimplemented default: fatalError("Unsupported GtkCssParserWarning enum value: \(gtkEnum.rawValue)") } @@ -36,11 +36,11 @@ public enum CssParserWarning: GValueRepresentableEnum { public func toGtk() -> GtkCssParserWarning { switch self { case .deprecated: - return GTK_CSS_PARSER_WARNING_DEPRECATED - case .syntax: - return GTK_CSS_PARSER_WARNING_SYNTAX - case .unimplemented: - return GTK_CSS_PARSER_WARNING_UNIMPLEMENTED + return GTK_CSS_PARSER_WARNING_DEPRECATED +case .syntax: + return GTK_CSS_PARSER_WARNING_SYNTAX +case .unimplemented: + return GTK_CSS_PARSER_WARNING_UNIMPLEMENTED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/DeleteType.swift b/Sources/Gtk/Generated/DeleteType.swift index 9d5197ef0c..7b22266c3e 100644 --- a/Sources/Gtk/Generated/DeleteType.swift +++ b/Sources/Gtk/Generated/DeleteType.swift @@ -5,50 +5,50 @@ public enum DeleteType: GValueRepresentableEnum { public typealias GtkEnum = GtkDeleteType /// Delete characters. - case chars - /// Delete only the portion of the word to the - /// left/right of cursor if we’re in the middle of a word. - case wordEnds - /// Delete words. - case words - /// Delete display-lines. Display-lines - /// refers to the visible lines, with respect to the current line - /// breaks. As opposed to paragraphs, which are defined by line - /// breaks in the input. - case displayLines - /// Delete only the portion of the - /// display-line to the left/right of cursor. - case displayLineEnds - /// Delete to the end of the - /// paragraph. Like C-k in Emacs (or its reverse). - case paragraphEnds - /// Delete entire line. Like C-k in pico. - case paragraphs - /// Delete only whitespace. Like M-\ in Emacs. - case whitespace +case chars +/// Delete only the portion of the word to the +/// left/right of cursor if we’re in the middle of a word. +case wordEnds +/// Delete words. +case words +/// Delete display-lines. Display-lines +/// refers to the visible lines, with respect to the current line +/// breaks. As opposed to paragraphs, which are defined by line +/// breaks in the input. +case displayLines +/// Delete only the portion of the +/// display-line to the left/right of cursor. +case displayLineEnds +/// Delete to the end of the +/// paragraph. Like C-k in Emacs (or its reverse). +case paragraphEnds +/// Delete entire line. Like C-k in pico. +case paragraphs +/// Delete only whitespace. Like M-\ in Emacs. +case whitespace public static var type: GType { - gtk_delete_type_get_type() - } + gtk_delete_type_get_type() +} public init(from gtkEnum: GtkDeleteType) { switch gtkEnum { case GTK_DELETE_CHARS: - self = .chars - case GTK_DELETE_WORD_ENDS: - self = .wordEnds - case GTK_DELETE_WORDS: - self = .words - case GTK_DELETE_DISPLAY_LINES: - self = .displayLines - case GTK_DELETE_DISPLAY_LINE_ENDS: - self = .displayLineEnds - case GTK_DELETE_PARAGRAPH_ENDS: - self = .paragraphEnds - case GTK_DELETE_PARAGRAPHS: - self = .paragraphs - case GTK_DELETE_WHITESPACE: - self = .whitespace + self = .chars +case GTK_DELETE_WORD_ENDS: + self = .wordEnds +case GTK_DELETE_WORDS: + self = .words +case GTK_DELETE_DISPLAY_LINES: + self = .displayLines +case GTK_DELETE_DISPLAY_LINE_ENDS: + self = .displayLineEnds +case GTK_DELETE_PARAGRAPH_ENDS: + self = .paragraphEnds +case GTK_DELETE_PARAGRAPHS: + self = .paragraphs +case GTK_DELETE_WHITESPACE: + self = .whitespace default: fatalError("Unsupported GtkDeleteType enum value: \(gtkEnum.rawValue)") } @@ -57,21 +57,21 @@ public enum DeleteType: GValueRepresentableEnum { public func toGtk() -> GtkDeleteType { switch self { case .chars: - return GTK_DELETE_CHARS - case .wordEnds: - return GTK_DELETE_WORD_ENDS - case .words: - return GTK_DELETE_WORDS - case .displayLines: - return GTK_DELETE_DISPLAY_LINES - case .displayLineEnds: - return GTK_DELETE_DISPLAY_LINE_ENDS - case .paragraphEnds: - return GTK_DELETE_PARAGRAPH_ENDS - case .paragraphs: - return GTK_DELETE_PARAGRAPHS - case .whitespace: - return GTK_DELETE_WHITESPACE + return GTK_DELETE_CHARS +case .wordEnds: + return GTK_DELETE_WORD_ENDS +case .words: + return GTK_DELETE_WORDS +case .displayLines: + return GTK_DELETE_DISPLAY_LINES +case .displayLineEnds: + return GTK_DELETE_DISPLAY_LINE_ENDS +case .paragraphEnds: + return GTK_DELETE_PARAGRAPH_ENDS +case .paragraphs: + return GTK_DELETE_PARAGRAPHS +case .whitespace: + return GTK_DELETE_WHITESPACE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/DirectionType.swift b/Sources/Gtk/Generated/DirectionType.swift index af0b146996..bd80042ac2 100644 --- a/Sources/Gtk/Generated/DirectionType.swift +++ b/Sources/Gtk/Generated/DirectionType.swift @@ -5,36 +5,36 @@ public enum DirectionType: GValueRepresentableEnum { public typealias GtkEnum = GtkDirectionType /// Move forward. - case tabForward - /// Move backward. - case tabBackward - /// Move up. - case up - /// Move down. - case down - /// Move left. - case left - /// Move right. - case right +case tabForward +/// Move backward. +case tabBackward +/// Move up. +case up +/// Move down. +case down +/// Move left. +case left +/// Move right. +case right public static var type: GType { - gtk_direction_type_get_type() - } + gtk_direction_type_get_type() +} public init(from gtkEnum: GtkDirectionType) { switch gtkEnum { case GTK_DIR_TAB_FORWARD: - self = .tabForward - case GTK_DIR_TAB_BACKWARD: - self = .tabBackward - case GTK_DIR_UP: - self = .up - case GTK_DIR_DOWN: - self = .down - case GTK_DIR_LEFT: - self = .left - case GTK_DIR_RIGHT: - self = .right + self = .tabForward +case GTK_DIR_TAB_BACKWARD: + self = .tabBackward +case GTK_DIR_UP: + self = .up +case GTK_DIR_DOWN: + self = .down +case GTK_DIR_LEFT: + self = .left +case GTK_DIR_RIGHT: + self = .right default: fatalError("Unsupported GtkDirectionType enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ public enum DirectionType: GValueRepresentableEnum { public func toGtk() -> GtkDirectionType { switch self { case .tabForward: - return GTK_DIR_TAB_FORWARD - case .tabBackward: - return GTK_DIR_TAB_BACKWARD - case .up: - return GTK_DIR_UP - case .down: - return GTK_DIR_DOWN - case .left: - return GTK_DIR_LEFT - case .right: - return GTK_DIR_RIGHT + return GTK_DIR_TAB_FORWARD +case .tabBackward: + return GTK_DIR_TAB_BACKWARD +case .up: + return GTK_DIR_UP +case .down: + return GTK_DIR_DOWN +case .left: + return GTK_DIR_LEFT +case .right: + return GTK_DIR_RIGHT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/DrawingArea.swift b/Sources/Gtk/Generated/DrawingArea.swift index 4fa422c1dc..c24736f50a 100644 --- a/Sources/Gtk/Generated/DrawingArea.swift +++ b/Sources/Gtk/Generated/DrawingArea.swift @@ -1,28 +1,28 @@ import CGtk /// Allows drawing with cairo. -/// +/// /// An example GtkDrawingArea -/// +/// /// It’s essentially a blank widget; you can draw on it. After /// creating a drawing area, the application may want to connect to: -/// +/// /// - The [signal@Gtk.Widget::realize] signal to take any necessary actions /// when the widget is instantiated on a particular display. /// (Create GDK resources in response to this signal.) -/// +/// /// - The [signal@Gtk.DrawingArea::resize] signal to take any necessary /// actions when the widget changes size. -/// +/// /// - Call [method@Gtk.DrawingArea.set_draw_func] to handle redrawing the /// contents of the widget. -/// +/// /// The following code portion demonstrates using a drawing /// area to display a circle in the normal widget foreground /// color. -/// +/// /// ## Simple GtkDrawingArea usage -/// +/// /// ```c /// static void /// draw_function (GtkDrawingArea *area, @@ -32,24 +32,24 @@ import CGtk /// gpointer data) /// { /// GdkRGBA color; -/// +/// /// cairo_arc (cr, /// width / 2.0, height / 2.0, /// MIN (width, height) / 2.0, /// 0, 2 * G_PI); -/// +/// /// gtk_widget_get_color (GTK_WIDGET (area), /// &color); /// gdk_cairo_set_source_rgba (cr, &color); -/// +/// /// cairo_fill (cr); /// } -/// +/// /// int /// main (int argc, char **argv) /// { /// gtk_init (); -/// +/// /// GtkWidget *area = gtk_drawing_area_new (); /// gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (area), 100); /// gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (area), 100); @@ -59,87 +59,83 @@ import CGtk /// return 0; /// } /// ``` -/// +/// /// The draw function is normally called when a drawing area first comes /// onscreen, or when it’s covered by another window and then uncovered. /// You can also force a redraw by adding to the “damage region” of the /// drawing area’s window using [method@Gtk.Widget.queue_draw]. /// This will cause the drawing area to call the draw function again. -/// +/// /// The available routines for drawing are documented in the /// [Cairo documentation](https://www.cairographics.org/manual/); GDK /// offers additional API to integrate with Cairo, like [func@Gdk.cairo_set_source_rgba] /// or [func@Gdk.cairo_set_source_pixbuf]. -/// +/// /// To receive mouse events on a drawing area, you will need to use /// event controllers. To receive keyboard events, you will need to set /// the “can-focus” property on the drawing area, and you should probably /// draw some user-visible indication that the drawing area is focused. -/// +/// /// If you need more complex control over your widget, you should consider /// creating your own `GtkWidget` subclass. open class DrawingArea: Widget { /// Creates a new drawing area. - public convenience init() { - self.init( - gtk_drawing_area_new() - ) - } - - override func didMoveToParent() { - super.didMoveToParent() +public convenience init() { + self.init( + gtk_drawing_area_new() + ) +} - let handler0: - @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } + override func didMoveToParent() { + super.didMoveToParent() - addSignal(name: "resize", handler: gCallback(handler0)) { - [weak self] (param0: Int, param1: Int) in - guard let self = self else { return } - self.resize?(self, param0, param1) - } + let handler0: @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } +addSignal(name: "resize", handler: gCallback(handler0)) { [weak self] (param0: Int, param1: Int) in + guard let self = self else { return } + self.resize?(self, param0, param1) +} - addSignal(name: "notify::content-height", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContentHeight?(self, param0) - } +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } +addSignal(name: "notify::content-height", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContentHeight?(self, param0) +} - addSignal(name: "notify::content-width", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContentWidth?(self, param0) - } +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::content-width", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContentWidth?(self, param0) +} +} + /// The content height. - @GObjectProperty(named: "content-height") public var contentHeight: Int +@GObjectProperty(named: "content-height") public var contentHeight: Int - /// The content width. - @GObjectProperty(named: "content-width") public var contentWidth: Int +/// The content width. +@GObjectProperty(named: "content-width") public var contentWidth: Int - /// Emitted once when the widget is realized, and then each time the widget - /// is changed while realized. - /// - /// This is useful in order to keep state up to date with the widget size, - /// like for instance a backing surface. - public var resize: ((DrawingArea, Int, Int) -> Void)? +/// Emitted once when the widget is realized, and then each time the widget +/// is changed while realized. +/// +/// This is useful in order to keep state up to date with the widget size, +/// like for instance a backing surface. +public var resize: ((DrawingArea, Int, Int) -> Void)? - public var notifyContentHeight: ((DrawingArea, OpaquePointer) -> Void)? - public var notifyContentWidth: ((DrawingArea, OpaquePointer) -> Void)? -} +public var notifyContentHeight: ((DrawingArea, OpaquePointer) -> Void)? + + +public var notifyContentWidth: ((DrawingArea, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/DropDown.swift b/Sources/Gtk/Generated/DropDown.swift index 5ff024cbf5..16265c0ffb 100644 --- a/Sources/Gtk/Generated/DropDown.swift +++ b/Sources/Gtk/Generated/DropDown.swift @@ -1,230 +1,219 @@ import CGtk /// Allows the user to choose an item from a list of options. -/// +/// /// An example GtkDropDown -/// +/// /// The `GtkDropDown` displays the [selected][property@Gtk.DropDown:selected] /// choice. -/// +/// /// The options are given to `GtkDropDown` in the form of `GListModel` /// and how the individual options are represented is determined by /// a [class@Gtk.ListItemFactory]. The default factory displays simple strings, /// and adds a checkmark to the selected item in the popup. -/// +/// /// To set your own factory, use [method@Gtk.DropDown.set_factory]. It is /// possible to use a separate factory for the items in the popup, with /// [method@Gtk.DropDown.set_list_factory]. -/// +/// /// `GtkDropDown` knows how to obtain strings from the items in a /// [class@Gtk.StringList]; for other models, you have to provide an expression /// to find the strings via [method@Gtk.DropDown.set_expression]. -/// +/// /// `GtkDropDown` can optionally allow search in the popup, which is /// useful if the list of options is long. To enable the search entry, /// use [method@Gtk.DropDown.set_enable_search]. -/// +/// /// Here is a UI definition example for `GtkDropDown` with a simple model: -/// +/// /// ```xml /// FactoryHomeSubway /// ``` -/// +/// /// If a `GtkDropDown` is created in this manner, or with /// [ctor@Gtk.DropDown.new_from_strings], for instance, the object returned from /// [method@Gtk.DropDown.get_selected_item] will be a [class@Gtk.StringObject]. -/// +/// /// To learn more about the list widget framework, see the /// [overview](section-list-widget.html). -/// +/// /// ## CSS nodes -/// +/// /// `GtkDropDown` has a single CSS node with name dropdown, /// with the button and popover nodes as children. -/// +/// /// ## Accessibility -/// +/// /// `GtkDropDown` uses the [enum@Gtk.AccessibleRole.combo_box] role. open class DropDown: Widget { /// Creates a new `GtkDropDown` that is populated with - /// the strings. - public convenience init(strings: [String]) { - self.init( - gtk_drop_down_new_from_strings( - strings - .map({ UnsafePointer($0.unsafeUTF8Copy().baseAddress) }) - .unsafeCopy() - .baseAddress!) - ) +/// the strings. +public convenience init(strings: [String]) { + self.init( + gtk_drop_down_new_from_strings(strings + .map({ UnsafePointer($0.unsafeUTF8Copy().baseAddress) }) + .unsafeCopy() + .baseAddress!) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::enable-search", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEnableSearch?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::expression", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExpression?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::factory", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFactory?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::header-factory", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHeaderFactory?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::list-factory", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyListFactory?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::model", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyModel?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::search-match-mode", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySearchMatchMode?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::selected", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelected?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::selected-item", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectedItem?(self, param0) - } - - let handler10: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::show-arrow", handler: gCallback(handler10)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowArrow?(self, param0) - } +addSignal(name: "notify::enable-search", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEnableSearch?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Whether to show a search entry in the popup. - /// - /// Note that search requires [property@Gtk.DropDown:expression] - /// to be set. - @GObjectProperty(named: "enable-search") public var enableSearch: Bool +addSignal(name: "notify::expression", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExpression?(self, param0) +} - /// Model for the displayed items. - @GObjectProperty(named: "model") public var model: OpaquePointer? +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// The position of the selected item. - /// - /// If no item is selected, the property has the value - /// %GTK_INVALID_LIST_POSITION. - @GObjectProperty(named: "selected") public var selected: Int +addSignal(name: "notify::factory", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFactory?(self, param0) +} - /// Emitted to when the drop down is activated. - /// - /// The `::activate` signal on `GtkDropDown` is an action signal and - /// emitting it causes the drop down to pop up its dropdown. - public var activate: ((DropDown) -> Void)? +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyEnableSearch: ((DropDown, OpaquePointer) -> Void)? +addSignal(name: "notify::header-factory", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHeaderFactory?(self, param0) +} - public var notifyExpression: ((DropDown, OpaquePointer) -> Void)? +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyFactory: ((DropDown, OpaquePointer) -> Void)? +addSignal(name: "notify::list-factory", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyListFactory?(self, param0) +} - public var notifyHeaderFactory: ((DropDown, OpaquePointer) -> Void)? +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyListFactory: ((DropDown, OpaquePointer) -> Void)? +addSignal(name: "notify::model", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyModel?(self, param0) +} - public var notifyModel: ((DropDown, OpaquePointer) -> Void)? +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySearchMatchMode: ((DropDown, OpaquePointer) -> Void)? +addSignal(name: "notify::search-match-mode", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySearchMatchMode?(self, param0) +} - public var notifySelected: ((DropDown, OpaquePointer) -> Void)? +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySelectedItem: ((DropDown, OpaquePointer) -> Void)? +addSignal(name: "notify::selected", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelected?(self, param0) +} + +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::selected-item", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectedItem?(self, param0) +} + +let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyShowArrow: ((DropDown, OpaquePointer) -> Void)? +addSignal(name: "notify::show-arrow", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowArrow?(self, param0) } +} + + /// Whether to show a search entry in the popup. +/// +/// Note that search requires [property@Gtk.DropDown:expression] +/// to be set. +@GObjectProperty(named: "enable-search") public var enableSearch: Bool + +/// Model for the displayed items. +@GObjectProperty(named: "model") public var model: OpaquePointer? + +/// The position of the selected item. +/// +/// If no item is selected, the property has the value +/// %GTK_INVALID_LIST_POSITION. +@GObjectProperty(named: "selected") public var selected: Int + +/// Emitted to when the drop down is activated. +/// +/// The `::activate` signal on `GtkDropDown` is an action signal and +/// emitting it causes the drop down to pop up its dropdown. +public var activate: ((DropDown) -> Void)? + + +public var notifyEnableSearch: ((DropDown, OpaquePointer) -> Void)? + + +public var notifyExpression: ((DropDown, OpaquePointer) -> Void)? + + +public var notifyFactory: ((DropDown, OpaquePointer) -> Void)? + + +public var notifyHeaderFactory: ((DropDown, OpaquePointer) -> Void)? + + +public var notifyListFactory: ((DropDown, OpaquePointer) -> Void)? + + +public var notifyModel: ((DropDown, OpaquePointer) -> Void)? + + +public var notifySearchMatchMode: ((DropDown, OpaquePointer) -> Void)? + + +public var notifySelected: ((DropDown, OpaquePointer) -> Void)? + + +public var notifySelectedItem: ((DropDown, OpaquePointer) -> Void)? + + +public var notifyShowArrow: ((DropDown, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Editable.swift b/Sources/Gtk/Generated/Editable.swift index 7f75a1573c..b36043e6ab 100644 --- a/Sources/Gtk/Generated/Editable.swift +++ b/Sources/Gtk/Generated/Editable.swift @@ -1,22 +1,22 @@ import CGtk /// Interface for single-line text editing widgets. -/// +/// /// Typical examples of editable widgets are [class@Gtk.Entry] and /// [class@Gtk.SpinButton]. It contains functions for generically manipulating /// an editable widget, a large number of action signals used for key bindings, /// and several signals that an application can connect to modify the behavior /// of a widget. -/// +/// /// As an example of the latter usage, by connecting the following handler to /// [signal@Gtk.Editable::insert-text], an application can convert all entry /// into a widget into uppercase. -/// +/// /// ## Forcing entry to uppercase. -/// +/// /// ```c /// #include -/// +/// /// void /// insert_text_handler (GtkEditable *editable, /// const char *text, @@ -25,29 +25,29 @@ import CGtk /// gpointer data) /// { /// char *result = g_utf8_strup (text, length); -/// +/// /// g_signal_handlers_block_by_func (editable, /// (gpointer) insert_text_handler, data); /// gtk_editable_insert_text (editable, result, length, position); /// g_signal_handlers_unblock_by_func (editable, /// (gpointer) insert_text_handler, data); -/// +/// /// g_signal_stop_emission_by_name (editable, "insert_text"); -/// +/// /// g_free (result); /// } /// ``` -/// +/// /// ## Implementing GtkEditable -/// +/// /// The most likely scenario for implementing `GtkEditable` on your own widget /// is that you will embed a `GtkText` inside a complex widget, and want to /// delegate the editable functionality to that text widget. `GtkEditable` /// provides some utility functions to make this easy. -/// +/// /// In your class_init function, call [func@Gtk.Editable.install_properties], /// passing the first available property ID: -/// +/// /// ```c /// static void /// my_class_init (MyClass *class) @@ -58,31 +58,31 @@ import CGtk /// ... /// } /// ``` -/// +/// /// In your interface_init function for the `GtkEditable` interface, provide /// an implementation for the get_delegate vfunc that returns your text widget: -/// +/// /// ```c /// GtkEditable * /// get_editable_delegate (GtkEditable *editable) /// { /// return GTK_EDITABLE (MY_WIDGET (editable)->text_widget); /// } -/// +/// /// static void /// my_editable_init (GtkEditableInterface *iface) /// { /// iface->get_delegate = get_editable_delegate; /// } /// ``` -/// +/// /// You don't need to provide any other vfuncs. The default implementations /// work by forwarding to the delegate that the GtkEditableInterface.get_delegate() /// vfunc returns. -/// +/// /// In your instance_init function, create your text widget, and then call /// [method@Gtk.Editable.init_delegate]: -/// +/// /// ```c /// static void /// my_widget_init (MyWidget *self) @@ -93,10 +93,10 @@ import CGtk /// ... /// } /// ``` -/// +/// /// In your dispose function, call [method@Gtk.Editable.finish_delegate] before /// destroying your text widget: -/// +/// /// ```c /// static void /// my_widget_dispose (GObject *object) @@ -107,19 +107,19 @@ import CGtk /// ... /// } /// ``` -/// +/// /// Finally, use [func@Gtk.Editable.delegate_set_property] in your `set_property` /// function (and similar for `get_property`), to set the editable properties: -/// +/// /// ```c /// ... /// if (gtk_editable_delegate_set_property (object, prop_id, value, pspec)) /// return; -/// +/// /// switch (prop_id) /// ... /// ``` -/// +/// /// It is important to note that if you create a `GtkEditable` that uses /// a delegate, the low level [signal@Gtk.Editable::insert-text] and /// [signal@Gtk.Editable::delete-text] signals will be propagated from the @@ -130,54 +130,54 @@ import CGtk /// to them on the delegate obtained via [method@Gtk.Editable.get_delegate]. public protocol Editable: GObjectRepresentable { /// The current position of the insertion cursor in chars. - var cursorPosition: Int { get set } +var cursorPosition: Int { get set } - /// Whether the entry contents can be edited. - var editable: Bool { get set } +/// Whether the entry contents can be edited. +var editable: Bool { get set } - /// If undo/redo should be enabled for the editable. - var enableUndo: Bool { get set } +/// If undo/redo should be enabled for the editable. +var enableUndo: Bool { get set } - /// The desired maximum width of the entry, in characters. - var maxWidthChars: Int { get set } +/// The desired maximum width of the entry, in characters. +var maxWidthChars: Int { get set } - /// The contents of the entry. - var text: String { get set } +/// The contents of the entry. +var text: String { get set } - /// Number of characters to leave space for in the entry. - var widthChars: Int { get set } +/// Number of characters to leave space for in the entry. +var widthChars: Int { get set } - /// The horizontal alignment, from 0 (left) to 1 (right). - /// - /// Reversed for RTL layouts. - var xalign: Float { get set } +/// The horizontal alignment, from 0 (left) to 1 (right). +/// +/// Reversed for RTL layouts. +var xalign: Float { get set } /// Emitted at the end of a single user-visible operation on the - /// contents. - /// - /// E.g., a paste operation that replaces the contents of the - /// selection will cause only one signal emission (even though it - /// is implemented by first deleting the selection, then inserting - /// the new content, and may cause multiple ::notify::text signals - /// to be emitted). - var changed: ((Self) -> Void)? { get set } +/// contents. +/// +/// E.g., a paste operation that replaces the contents of the +/// selection will cause only one signal emission (even though it +/// is implemented by first deleting the selection, then inserting +/// the new content, and may cause multiple ::notify::text signals +/// to be emitted). +var changed: ((Self) -> Void)? { get set } - /// Emitted when text is deleted from the widget by the user. - /// - /// The default handler for this signal will normally be responsible for - /// deleting the text, so by connecting to this signal and then stopping - /// the signal with g_signal_stop_emission(), it is possible to modify the - /// range of deleted text, or prevent it from being deleted entirely. - /// - /// The @start_pos and @end_pos parameters are interpreted as for - /// [method@Gtk.Editable.delete_text]. - var deleteText: ((Self, Int, Int) -> Void)? { get set } +/// Emitted when text is deleted from the widget by the user. +/// +/// The default handler for this signal will normally be responsible for +/// deleting the text, so by connecting to this signal and then stopping +/// the signal with g_signal_stop_emission(), it is possible to modify the +/// range of deleted text, or prevent it from being deleted entirely. +/// +/// The @start_pos and @end_pos parameters are interpreted as for +/// [method@Gtk.Editable.delete_text]. +var deleteText: ((Self, Int, Int) -> Void)? { get set } - /// Emitted when text is inserted into the widget by the user. - /// - /// The default handler for this signal will normally be responsible - /// for inserting the text, so by connecting to this signal and then - /// stopping the signal with g_signal_stop_emission(), it is possible - /// to modify the inserted text, or prevent it from being inserted entirely. - var insertText: ((Self, UnsafePointer, Int, gpointer) -> Void)? { get set } -} +/// Emitted when text is inserted into the widget by the user. +/// +/// The default handler for this signal will normally be responsible +/// for inserting the text, so by connecting to this signal and then +/// stopping the signal with g_signal_stop_emission(), it is possible +/// to modify the inserted text, or prevent it from being inserted entirely. +var insertText: ((Self, UnsafePointer, Int, gpointer) -> Void)? { get set } +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/EditableProperties.swift b/Sources/Gtk/Generated/EditableProperties.swift index 99c51d3239..ac550444ea 100644 --- a/Sources/Gtk/Generated/EditableProperties.swift +++ b/Sources/Gtk/Generated/EditableProperties.swift @@ -1,55 +1,55 @@ import CGtk /// The identifiers for [iface@Gtk.Editable] properties. -/// +/// /// See [func@Gtk.Editable.install_properties] for details on how to /// implement the `GtkEditable` interface. public enum EditableProperties: GValueRepresentableEnum { public typealias GtkEnum = GtkEditableProperties /// The property id for [property@Gtk.Editable:text] - case propText - /// The property id for [property@Gtk.Editable:cursor-position] - case propCursorPosition - /// The property id for [property@Gtk.Editable:selection-bound] - case propSelectionBound - /// The property id for [property@Gtk.Editable:editable] - case propEditable - /// The property id for [property@Gtk.Editable:width-chars] - case propWidthChars - /// The property id for [property@Gtk.Editable:max-width-chars] - case propMaxWidthChars - /// The property id for [property@Gtk.Editable:xalign] - case propXalign - /// The property id for [property@Gtk.Editable:enable-undo] - case propEnableUndo - /// The number of properties - case numProperties +case propText +/// The property id for [property@Gtk.Editable:cursor-position] +case propCursorPosition +/// The property id for [property@Gtk.Editable:selection-bound] +case propSelectionBound +/// The property id for [property@Gtk.Editable:editable] +case propEditable +/// The property id for [property@Gtk.Editable:width-chars] +case propWidthChars +/// The property id for [property@Gtk.Editable:max-width-chars] +case propMaxWidthChars +/// The property id for [property@Gtk.Editable:xalign] +case propXalign +/// The property id for [property@Gtk.Editable:enable-undo] +case propEnableUndo +/// The number of properties +case numProperties public static var type: GType { - gtk_editable_properties_get_type() - } + gtk_editable_properties_get_type() +} public init(from gtkEnum: GtkEditableProperties) { switch gtkEnum { case GTK_EDITABLE_PROP_TEXT: - self = .propText - case GTK_EDITABLE_PROP_CURSOR_POSITION: - self = .propCursorPosition - case GTK_EDITABLE_PROP_SELECTION_BOUND: - self = .propSelectionBound - case GTK_EDITABLE_PROP_EDITABLE: - self = .propEditable - case GTK_EDITABLE_PROP_WIDTH_CHARS: - self = .propWidthChars - case GTK_EDITABLE_PROP_MAX_WIDTH_CHARS: - self = .propMaxWidthChars - case GTK_EDITABLE_PROP_XALIGN: - self = .propXalign - case GTK_EDITABLE_PROP_ENABLE_UNDO: - self = .propEnableUndo - case GTK_EDITABLE_NUM_PROPERTIES: - self = .numProperties + self = .propText +case GTK_EDITABLE_PROP_CURSOR_POSITION: + self = .propCursorPosition +case GTK_EDITABLE_PROP_SELECTION_BOUND: + self = .propSelectionBound +case GTK_EDITABLE_PROP_EDITABLE: + self = .propEditable +case GTK_EDITABLE_PROP_WIDTH_CHARS: + self = .propWidthChars +case GTK_EDITABLE_PROP_MAX_WIDTH_CHARS: + self = .propMaxWidthChars +case GTK_EDITABLE_PROP_XALIGN: + self = .propXalign +case GTK_EDITABLE_PROP_ENABLE_UNDO: + self = .propEnableUndo +case GTK_EDITABLE_NUM_PROPERTIES: + self = .numProperties default: fatalError("Unsupported GtkEditableProperties enum value: \(gtkEnum.rawValue)") } @@ -58,23 +58,23 @@ public enum EditableProperties: GValueRepresentableEnum { public func toGtk() -> GtkEditableProperties { switch self { case .propText: - return GTK_EDITABLE_PROP_TEXT - case .propCursorPosition: - return GTK_EDITABLE_PROP_CURSOR_POSITION - case .propSelectionBound: - return GTK_EDITABLE_PROP_SELECTION_BOUND - case .propEditable: - return GTK_EDITABLE_PROP_EDITABLE - case .propWidthChars: - return GTK_EDITABLE_PROP_WIDTH_CHARS - case .propMaxWidthChars: - return GTK_EDITABLE_PROP_MAX_WIDTH_CHARS - case .propXalign: - return GTK_EDITABLE_PROP_XALIGN - case .propEnableUndo: - return GTK_EDITABLE_PROP_ENABLE_UNDO - case .numProperties: - return GTK_EDITABLE_NUM_PROPERTIES + return GTK_EDITABLE_PROP_TEXT +case .propCursorPosition: + return GTK_EDITABLE_PROP_CURSOR_POSITION +case .propSelectionBound: + return GTK_EDITABLE_PROP_SELECTION_BOUND +case .propEditable: + return GTK_EDITABLE_PROP_EDITABLE +case .propWidthChars: + return GTK_EDITABLE_PROP_WIDTH_CHARS +case .propMaxWidthChars: + return GTK_EDITABLE_PROP_MAX_WIDTH_CHARS +case .propXalign: + return GTK_EDITABLE_PROP_XALIGN +case .propEnableUndo: + return GTK_EDITABLE_PROP_ENABLE_UNDO +case .numProperties: + return GTK_EDITABLE_NUM_PROPERTIES } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Entry.swift b/Sources/Gtk/Generated/Entry.swift index 26b74f887b..8a3d9764b7 100644 --- a/Sources/Gtk/Generated/Entry.swift +++ b/Sources/Gtk/Generated/Entry.swift @@ -1,25 +1,25 @@ import CGtk /// A single-line text entry widget. -/// +/// /// An example GtkEntry -/// +/// /// A fairly large set of key bindings are supported by default. If the /// entered text is longer than the allocation of the widget, the widget /// will scroll so that the cursor position is visible. -/// +/// /// When using an entry for passwords and other sensitive information, it /// can be put into “password mode” using [method@Gtk.Entry.set_visibility]. /// In this mode, entered text is displayed using a “invisible” character. /// By default, GTK picks the best invisible character that is available /// in the current font, but it can be changed with /// [method@Gtk.Entry.set_invisible_char]. -/// +/// /// `GtkEntry` has the ability to display progress or activity /// information behind the text. To make an entry display such information, /// use [method@Gtk.Entry.set_progress_fraction] or /// [method@Gtk.Entry.set_progress_pulse_step]. -/// +/// /// Additionally, `GtkEntry` can show icons at either side of the entry. /// These icons can be activatable by clicking, can be set up as drag source /// and can have tooltips. To add an icon, use @@ -30,15 +30,15 @@ import CGtk /// [method@Gtk.Entry.set_icon_drag_source]. To set a tooltip on an icon, use /// [method@Gtk.Entry.set_icon_tooltip_text] or the corresponding function /// for markup. -/// +/// /// Note that functionality or information that is only available by clicking /// on an icon in an entry may not be accessible at all to users which are not /// able to use a mouse or other pointing device. It is therefore recommended /// that any such functionality should also be available by other means, e.g. /// via the context menu of the entry. -/// +/// /// # CSS nodes -/// +/// /// ``` /// entry[.flat][.warning][.error] /// ├── text[.readonly] @@ -46,968 +46,904 @@ import CGtk /// ├── image.right /// ╰── [progress[.pulse]] /// ``` -/// +/// /// `GtkEntry` has a main node with the name entry. Depending on the properties /// of the entry, the style classes .read-only and .flat may appear. The style /// classes .warning and .error may also be used with entries. -/// +/// /// When the entry shows icons, it adds subnodes with the name image and the /// style class .left or .right, depending on where the icon appears. -/// +/// /// When the entry shows progress, it adds a subnode with the name progress. /// The node has the style class .pulse when the shown progress is pulsing. -/// +/// /// For all the subnodes added to the text node in various situations, /// see [class@Gtk.Text]. -/// +/// /// # GtkEntry as GtkBuildable -/// +/// /// The `GtkEntry` implementation of the `GtkBuildable` interface supports a /// custom `` element, which supports any number of `` /// elements. The `` element has attributes named “name“, “value“, /// “start“ and “end“ and allows you to specify `PangoAttribute` values for /// this label. -/// +/// /// An example of a UI definition fragment specifying Pango attributes: /// ```xml /// /// ``` -/// +/// /// The start and end attributes specify the range of characters to which the /// Pango attribute applies. If start and end are not specified, the attribute /// is applied to the whole text. Note that specifying ranges does not make much /// sense with translatable attributes. Use markup embedded in the translatable /// content instead. -/// +/// /// # Accessibility -/// +/// /// `GtkEntry` uses the [enum@Gtk.AccessibleRole.text_box] role. open class Entry: Widget, CellEditable, Editable { /// Creates a new entry. - public convenience init() { - self.init( - gtk_entry_new() - ) - } - - /// Creates a new entry with the specified text buffer. - public convenience init(buffer: UnsafeMutablePointer!) { - self.init( - gtk_entry_new_with_buffer(buffer) - ) - } - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, UnsafeMutableRawPointer) - -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "icon-press", handler: gCallback(handler1)) { - [weak self] (param0: GtkEntryIconPosition) in - guard let self = self else { return } - self.iconPress?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, UnsafeMutableRawPointer) - -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "icon-release", handler: gCallback(handler2)) { - [weak self] (param0: GtkEntryIconPosition) in - guard let self = self else { return } - self.iconRelease?(self, param0) - } - - addSignal(name: "editing-done") { [weak self] () in - guard let self = self else { return } - self.editingDone?(self) - } - - addSignal(name: "remove-widget") { [weak self] () in - guard let self = self else { return } - self.removeWidget?(self) - } - - addSignal(name: "changed") { [weak self] () in - guard let self = self else { return } - self.changed?(self) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "delete-text", handler: gCallback(handler6)) { - [weak self] (param0: Int, param1: Int) in - guard let self = self else { return } - self.deleteText?(self, param0, param1) - } - - let handler7: - @convention(c) ( - UnsafeMutableRawPointer, UnsafePointer, Int, gpointer, - UnsafeMutableRawPointer - ) -> Void = - { _, value1, value2, value3, data in - SignalBox3, Int, gpointer>.run( - data, value1, value2, value3) - } - - addSignal(name: "insert-text", handler: gCallback(handler7)) { - [weak self] (param0: UnsafePointer, param1: Int, param2: gpointer) in - guard let self = self else { return } - self.insertText?(self, param0, param1, param2) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::activates-default", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActivatesDefault?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::attributes", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAttributes?(self, param0) - } - - let handler10: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::buffer", handler: gCallback(handler10)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyBuffer?(self, param0) - } - - let handler11: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::completion", handler: gCallback(handler11)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCompletion?(self, param0) - } - - let handler12: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::enable-emoji-completion", handler: gCallback(handler12)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEnableEmojiCompletion?(self, param0) - } - - let handler13: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::extra-menu", handler: gCallback(handler13)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExtraMenu?(self, param0) - } - - let handler14: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::has-frame", handler: gCallback(handler14)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasFrame?(self, param0) - } - - let handler15: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::im-module", handler: gCallback(handler15)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyImModule?(self, param0) - } - - let handler16: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::input-hints", handler: gCallback(handler16)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInputHints?(self, param0) - } - - let handler17: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::input-purpose", handler: gCallback(handler17)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInputPurpose?(self, param0) - } - - let handler18: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::invisible-char", handler: gCallback(handler18)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInvisibleCharacter?(self, param0) - } - - let handler19: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::invisible-char-set", handler: gCallback(handler19)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInvisibleCharacterSet?(self, param0) - } - - let handler20: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::max-length", handler: gCallback(handler20)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMaxLength?(self, param0) - } - - let handler21: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::menu-entry-icon-primary-text", handler: gCallback(handler21)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMenuEntryIconPrimaryText?(self, param0) - } - - let handler22: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::menu-entry-icon-secondary-text", handler: gCallback(handler22)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMenuEntryIconSecondaryText?(self, param0) - } - - let handler23: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::overwrite-mode", handler: gCallback(handler23)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyOverwriteMode?(self, param0) - } - - let handler24: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::placeholder-text", handler: gCallback(handler24)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPlaceholderText?(self, param0) - } - - let handler25: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-activatable", handler: gCallback(handler25)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconActivatable?(self, param0) - } - - let handler26: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-gicon", handler: gCallback(handler26)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconGicon?(self, param0) - } - - let handler27: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-name", handler: gCallback(handler27)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconName?(self, param0) - } - - let handler28: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-paintable", handler: gCallback(handler28)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconPaintable?(self, param0) - } - - let handler29: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-sensitive", handler: gCallback(handler29)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconSensitive?(self, param0) - } - - let handler30: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-storage-type", handler: gCallback(handler30)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconStorageType?(self, param0) - } - - let handler31: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-tooltip-markup", handler: gCallback(handler31)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconTooltipMarkup?(self, param0) - } - - let handler32: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-tooltip-text", handler: gCallback(handler32)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconTooltipText?(self, param0) - } - - let handler33: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::progress-fraction", handler: gCallback(handler33)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyProgressFraction?(self, param0) - } - - let handler34: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::progress-pulse-step", handler: gCallback(handler34)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyProgressPulseStep?(self, param0) - } - - let handler35: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::scroll-offset", handler: gCallback(handler35)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyScrollOffset?(self, param0) - } - - let handler36: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-activatable", handler: gCallback(handler36)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconActivatable?(self, param0) - } - - let handler37: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-gicon", handler: gCallback(handler37)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconGicon?(self, param0) - } - - let handler38: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-name", handler: gCallback(handler38)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconName?(self, param0) - } - - let handler39: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-paintable", handler: gCallback(handler39)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconPaintable?(self, param0) - } - - let handler40: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-sensitive", handler: gCallback(handler40)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconSensitive?(self, param0) - } - - let handler41: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-storage-type", handler: gCallback(handler41)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconStorageType?(self, param0) - } - - let handler42: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-tooltip-markup", handler: gCallback(handler42)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconTooltipMarkup?(self, param0) - } - - let handler43: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-tooltip-text", handler: gCallback(handler43)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconTooltipText?(self, param0) - } - - let handler44: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::show-emoji-icon", handler: gCallback(handler44)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowEmojiIcon?(self, param0) - } - - let handler45: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::tabs", handler: gCallback(handler45)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTabs?(self, param0) - } - - let handler46: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::text-length", handler: gCallback(handler46)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTextLength?(self, param0) - } - - let handler47: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::truncate-multiline", handler: gCallback(handler47)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTruncateMultiline?(self, param0) - } - - let handler48: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::visibility", handler: gCallback(handler48)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyVisibility?(self, param0) - } - - let handler49: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::editing-canceled", handler: gCallback(handler49)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEditingCanceled?(self, param0) - } - - let handler50: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::cursor-position", handler: gCallback(handler50)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCursorPosition?(self, param0) - } - - let handler51: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::editable", handler: gCallback(handler51)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEditable?(self, param0) - } - - let handler52: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::enable-undo", handler: gCallback(handler52)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEnableUndo?(self, param0) - } - - let handler53: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::max-width-chars", handler: gCallback(handler53)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMaxWidthChars?(self, param0) - } - - let handler54: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::selection-bound", handler: gCallback(handler54)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectionBound?(self, param0) - } - - let handler55: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::text", handler: gCallback(handler55)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyText?(self, param0) - } - - let handler56: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::width-chars", handler: gCallback(handler56)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWidthChars?(self, param0) - } - - let handler57: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::xalign", handler: gCallback(handler57)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyXalign?(self, param0) - } +public convenience init() { + self.init( + gtk_entry_new() + ) +} + +/// Creates a new entry with the specified text buffer. +public convenience init(buffer: UnsafeMutablePointer!) { + self.init( + gtk_entry_new_with_buffer(buffer) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Whether to activate the default widget when Enter is pressed. - @GObjectProperty(named: "activates-default") public var activatesDefault: Bool - - /// Whether the entry should draw a frame. - @GObjectProperty(named: "has-frame") public var hasFrame: Bool - - /// The purpose of this text field. - /// - /// This property can be used by on-screen keyboards and other input - /// methods to adjust their behaviour. - /// - /// Note that setting the purpose to %GTK_INPUT_PURPOSE_PASSWORD or - /// %GTK_INPUT_PURPOSE_PIN is independent from setting - /// [property@Gtk.Entry:visibility]. - @GObjectProperty(named: "input-purpose") public var inputPurpose: InputPurpose - - /// The character to use when masking entry contents (“password mode”). - @GObjectProperty(named: "invisible-char") public var invisibleCharacter: UInt - - /// Maximum number of characters for this entry. - @GObjectProperty(named: "max-length") public var maxLength: Int - - /// If text is overwritten when typing in the `GtkEntry`. - @GObjectProperty(named: "overwrite-mode") public var overwriteMode: Bool - - /// The text that will be displayed in the `GtkEntry` when it is empty - /// and unfocused. - @GObjectProperty(named: "placeholder-text") public var placeholderText: String? - - /// The current fraction of the task that's been completed. - @GObjectProperty(named: "progress-fraction") public var progressFraction: Double - - /// The fraction of total entry width to move the progress - /// bouncing block for each pulse. - /// - /// See [method@Gtk.Entry.progress_pulse]. - @GObjectProperty(named: "progress-pulse-step") public var progressPulseStep: Double - - /// The length of the text in the `GtkEntry`. - @GObjectProperty(named: "text-length") public var textLength: UInt - - /// Whether the entry should show the “invisible char” instead of the - /// actual text (“password mode”). - @GObjectProperty(named: "visibility") public var visibility: Bool - - /// The current position of the insertion cursor in chars. - @GObjectProperty(named: "cursor-position") public var cursorPosition: Int - - /// Whether the entry contents can be edited. - @GObjectProperty(named: "editable") public var editable: Bool - - /// If undo/redo should be enabled for the editable. - @GObjectProperty(named: "enable-undo") public var enableUndo: Bool - - /// The desired maximum width of the entry, in characters. - @GObjectProperty(named: "max-width-chars") public var maxWidthChars: Int - - /// The contents of the entry. - @GObjectProperty(named: "text") public var text: String - - /// Number of characters to leave space for in the entry. - @GObjectProperty(named: "width-chars") public var widthChars: Int - - /// The horizontal alignment, from 0 (left) to 1 (right). - /// - /// Reversed for RTL layouts. - @GObjectProperty(named: "xalign") public var xalign: Float +addSignal(name: "icon-press", handler: gCallback(handler1)) { [weak self] (param0: GtkEntryIconPosition) in + guard let self = self else { return } + self.iconPress?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "icon-release", handler: gCallback(handler2)) { [weak self] (param0: GtkEntryIconPosition) in + guard let self = self else { return } + self.iconRelease?(self, param0) +} + +addSignal(name: "editing-done") { [weak self] () in + guard let self = self else { return } + self.editingDone?(self) +} + +addSignal(name: "remove-widget") { [weak self] () in + guard let self = self else { return } + self.removeWidget?(self) +} + +addSignal(name: "changed") { [weak self] () in + guard let self = self else { return } + self.changed?(self) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + +addSignal(name: "delete-text", handler: gCallback(handler6)) { [weak self] (param0: Int, param1: Int) in + guard let self = self else { return } + self.deleteText?(self, param0, param1) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, UnsafePointer, Int, gpointer, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, value3, data in + SignalBox3, Int, gpointer>.run(data, value1, value2, value3) + } + +addSignal(name: "insert-text", handler: gCallback(handler7)) { [weak self] (param0: UnsafePointer, param1: Int, param2: gpointer) in + guard let self = self else { return } + self.insertText?(self, param0, param1, param2) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::activates-default", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActivatesDefault?(self, param0) +} + +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::attributes", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAttributes?(self, param0) +} + +let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::buffer", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyBuffer?(self, param0) +} + +let handler11: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::completion", handler: gCallback(handler11)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCompletion?(self, param0) +} + +let handler12: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::enable-emoji-completion", handler: gCallback(handler12)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEnableEmojiCompletion?(self, param0) +} + +let handler13: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::extra-menu", handler: gCallback(handler13)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExtraMenu?(self, param0) +} + +let handler14: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::has-frame", handler: gCallback(handler14)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasFrame?(self, param0) +} + +let handler15: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::im-module", handler: gCallback(handler15)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyImModule?(self, param0) +} + +let handler16: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::input-hints", handler: gCallback(handler16)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInputHints?(self, param0) +} + +let handler17: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::input-purpose", handler: gCallback(handler17)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInputPurpose?(self, param0) +} + +let handler18: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::invisible-char", handler: gCallback(handler18)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInvisibleCharacter?(self, param0) +} - /// Emitted when the entry is activated. - /// - /// The keybindings for this signal are all forms of the Enter key. - public var activate: ((Entry) -> Void)? +let handler19: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Emitted when an activatable icon is clicked. - public var iconPress: ((Entry, GtkEntryIconPosition) -> Void)? +addSignal(name: "notify::invisible-char-set", handler: gCallback(handler19)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInvisibleCharacterSet?(self, param0) +} - /// Emitted on the button release from a mouse click - /// over an activatable icon. - public var iconRelease: ((Entry, GtkEntryIconPosition) -> Void)? +let handler20: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// This signal is a sign for the cell renderer to update its - /// value from the @cell_editable. - /// - /// Implementations of `GtkCellEditable` are responsible for - /// emitting this signal when they are done editing, e.g. - /// `GtkEntry` emits this signal when the user presses Enter. Typical things to - /// do in a handler for ::editing-done are to capture the edited value, - /// disconnect the @cell_editable from signals on the `GtkCellRenderer`, etc. - /// - /// gtk_cell_editable_editing_done() is a convenience method - /// for emitting `GtkCellEditable::editing-done`. - public var editingDone: ((Entry) -> Void)? +addSignal(name: "notify::max-length", handler: gCallback(handler20)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMaxLength?(self, param0) +} - /// This signal is meant to indicate that the cell is finished - /// editing, and the @cell_editable widget is being removed and may - /// subsequently be destroyed. - /// - /// Implementations of `GtkCellEditable` are responsible for - /// emitting this signal when they are done editing. It must - /// be emitted after the `GtkCellEditable::editing-done` signal, - /// to give the cell renderer a chance to update the cell's value - /// before the widget is removed. - /// - /// gtk_cell_editable_remove_widget() is a convenience method - /// for emitting `GtkCellEditable::remove-widget`. - public var removeWidget: ((Entry) -> Void)? +let handler21: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Emitted at the end of a single user-visible operation on the - /// contents. - /// - /// E.g., a paste operation that replaces the contents of the - /// selection will cause only one signal emission (even though it - /// is implemented by first deleting the selection, then inserting - /// the new content, and may cause multiple ::notify::text signals - /// to be emitted). - public var changed: ((Entry) -> Void)? +addSignal(name: "notify::menu-entry-icon-primary-text", handler: gCallback(handler21)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMenuEntryIconPrimaryText?(self, param0) +} - /// Emitted when text is deleted from the widget by the user. - /// - /// The default handler for this signal will normally be responsible for - /// deleting the text, so by connecting to this signal and then stopping - /// the signal with g_signal_stop_emission(), it is possible to modify the - /// range of deleted text, or prevent it from being deleted entirely. - /// - /// The @start_pos and @end_pos parameters are interpreted as for - /// [method@Gtk.Editable.delete_text]. - public var deleteText: ((Entry, Int, Int) -> Void)? +let handler22: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Emitted when text is inserted into the widget by the user. - /// - /// The default handler for this signal will normally be responsible - /// for inserting the text, so by connecting to this signal and then - /// stopping the signal with g_signal_stop_emission(), it is possible - /// to modify the inserted text, or prevent it from being inserted entirely. - public var insertText: ((Entry, UnsafePointer, Int, gpointer) -> Void)? +addSignal(name: "notify::menu-entry-icon-secondary-text", handler: gCallback(handler22)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMenuEntryIconSecondaryText?(self, param0) +} - public var notifyActivatesDefault: ((Entry, OpaquePointer) -> Void)? +let handler23: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyAttributes: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::overwrite-mode", handler: gCallback(handler23)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyOverwriteMode?(self, param0) +} - public var notifyBuffer: ((Entry, OpaquePointer) -> Void)? +let handler24: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyCompletion: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::placeholder-text", handler: gCallback(handler24)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPlaceholderText?(self, param0) +} - public var notifyEnableEmojiCompletion: ((Entry, OpaquePointer) -> Void)? +let handler25: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyExtraMenu: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-activatable", handler: gCallback(handler25)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconActivatable?(self, param0) +} - public var notifyHasFrame: ((Entry, OpaquePointer) -> Void)? +let handler26: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyImModule: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-gicon", handler: gCallback(handler26)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconGicon?(self, param0) +} - public var notifyInputHints: ((Entry, OpaquePointer) -> Void)? +let handler27: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyInputPurpose: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-name", handler: gCallback(handler27)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconName?(self, param0) +} - public var notifyInvisibleCharacter: ((Entry, OpaquePointer) -> Void)? +let handler28: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyInvisibleCharacterSet: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-paintable", handler: gCallback(handler28)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconPaintable?(self, param0) +} - public var notifyMaxLength: ((Entry, OpaquePointer) -> Void)? +let handler29: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyMenuEntryIconPrimaryText: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-sensitive", handler: gCallback(handler29)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconSensitive?(self, param0) +} - public var notifyMenuEntryIconSecondaryText: ((Entry, OpaquePointer) -> Void)? +let handler30: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyOverwriteMode: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-storage-type", handler: gCallback(handler30)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconStorageType?(self, param0) +} - public var notifyPlaceholderText: ((Entry, OpaquePointer) -> Void)? +let handler31: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyPrimaryIconActivatable: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-tooltip-markup", handler: gCallback(handler31)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconTooltipMarkup?(self, param0) +} - public var notifyPrimaryIconGicon: ((Entry, OpaquePointer) -> Void)? +let handler32: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyPrimaryIconName: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-tooltip-text", handler: gCallback(handler32)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconTooltipText?(self, param0) +} - public var notifyPrimaryIconPaintable: ((Entry, OpaquePointer) -> Void)? +let handler33: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyPrimaryIconSensitive: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::progress-fraction", handler: gCallback(handler33)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyProgressFraction?(self, param0) +} - public var notifyPrimaryIconStorageType: ((Entry, OpaquePointer) -> Void)? +let handler34: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyPrimaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::progress-pulse-step", handler: gCallback(handler34)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyProgressPulseStep?(self, param0) +} - public var notifyPrimaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? +let handler35: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyProgressFraction: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::scroll-offset", handler: gCallback(handler35)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyScrollOffset?(self, param0) +} - public var notifyProgressPulseStep: ((Entry, OpaquePointer) -> Void)? +let handler36: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyScrollOffset: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::secondary-icon-activatable", handler: gCallback(handler36)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconActivatable?(self, param0) +} - public var notifySecondaryIconActivatable: ((Entry, OpaquePointer) -> Void)? +let handler37: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySecondaryIconGicon: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::secondary-icon-gicon", handler: gCallback(handler37)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconGicon?(self, param0) +} - public var notifySecondaryIconName: ((Entry, OpaquePointer) -> Void)? +let handler38: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySecondaryIconPaintable: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::secondary-icon-name", handler: gCallback(handler38)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconName?(self, param0) +} - public var notifySecondaryIconSensitive: ((Entry, OpaquePointer) -> Void)? +let handler39: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySecondaryIconStorageType: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::secondary-icon-paintable", handler: gCallback(handler39)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconPaintable?(self, param0) +} - public var notifySecondaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? +let handler40: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySecondaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::secondary-icon-sensitive", handler: gCallback(handler40)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconSensitive?(self, param0) +} - public var notifyShowEmojiIcon: ((Entry, OpaquePointer) -> Void)? +let handler41: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyTabs: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::secondary-icon-storage-type", handler: gCallback(handler41)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconStorageType?(self, param0) +} - public var notifyTextLength: ((Entry, OpaquePointer) -> Void)? +let handler42: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyTruncateMultiline: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::secondary-icon-tooltip-markup", handler: gCallback(handler42)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconTooltipMarkup?(self, param0) +} - public var notifyVisibility: ((Entry, OpaquePointer) -> Void)? +let handler43: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyEditingCanceled: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::secondary-icon-tooltip-text", handler: gCallback(handler43)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconTooltipText?(self, param0) +} - public var notifyCursorPosition: ((Entry, OpaquePointer) -> Void)? +let handler44: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyEditable: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::show-emoji-icon", handler: gCallback(handler44)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowEmojiIcon?(self, param0) +} - public var notifyEnableUndo: ((Entry, OpaquePointer) -> Void)? +let handler45: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyMaxWidthChars: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::tabs", handler: gCallback(handler45)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTabs?(self, param0) +} - public var notifySelectionBound: ((Entry, OpaquePointer) -> Void)? +let handler46: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyText: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::text-length", handler: gCallback(handler46)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTextLength?(self, param0) +} - public var notifyWidthChars: ((Entry, OpaquePointer) -> Void)? +let handler47: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyXalign: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::truncate-multiline", handler: gCallback(handler47)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTruncateMultiline?(self, param0) } + +let handler48: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::visibility", handler: gCallback(handler48)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyVisibility?(self, param0) +} + +let handler49: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::editing-canceled", handler: gCallback(handler49)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEditingCanceled?(self, param0) +} + +let handler50: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::cursor-position", handler: gCallback(handler50)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCursorPosition?(self, param0) +} + +let handler51: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::editable", handler: gCallback(handler51)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEditable?(self, param0) +} + +let handler52: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::enable-undo", handler: gCallback(handler52)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEnableUndo?(self, param0) +} + +let handler53: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::max-width-chars", handler: gCallback(handler53)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMaxWidthChars?(self, param0) +} + +let handler54: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::selection-bound", handler: gCallback(handler54)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectionBound?(self, param0) +} + +let handler55: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::text", handler: gCallback(handler55)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyText?(self, param0) +} + +let handler56: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::width-chars", handler: gCallback(handler56)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWidthChars?(self, param0) +} + +let handler57: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::xalign", handler: gCallback(handler57)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyXalign?(self, param0) +} +} + + /// Whether to activate the default widget when Enter is pressed. +@GObjectProperty(named: "activates-default") public var activatesDefault: Bool + +/// Whether the entry should draw a frame. +@GObjectProperty(named: "has-frame") public var hasFrame: Bool + +/// The purpose of this text field. +/// +/// This property can be used by on-screen keyboards and other input +/// methods to adjust their behaviour. +/// +/// Note that setting the purpose to %GTK_INPUT_PURPOSE_PASSWORD or +/// %GTK_INPUT_PURPOSE_PIN is independent from setting +/// [property@Gtk.Entry:visibility]. +@GObjectProperty(named: "input-purpose") public var inputPurpose: InputPurpose + +/// The character to use when masking entry contents (“password mode”). +@GObjectProperty(named: "invisible-char") public var invisibleCharacter: UInt + +/// Maximum number of characters for this entry. +@GObjectProperty(named: "max-length") public var maxLength: Int + +/// If text is overwritten when typing in the `GtkEntry`. +@GObjectProperty(named: "overwrite-mode") public var overwriteMode: Bool + +/// The text that will be displayed in the `GtkEntry` when it is empty +/// and unfocused. +@GObjectProperty(named: "placeholder-text") public var placeholderText: String? + +/// The current fraction of the task that's been completed. +@GObjectProperty(named: "progress-fraction") public var progressFraction: Double + +/// The fraction of total entry width to move the progress +/// bouncing block for each pulse. +/// +/// See [method@Gtk.Entry.progress_pulse]. +@GObjectProperty(named: "progress-pulse-step") public var progressPulseStep: Double + +/// The length of the text in the `GtkEntry`. +@GObjectProperty(named: "text-length") public var textLength: UInt + +/// Whether the entry should show the “invisible char” instead of the +/// actual text (“password mode”). +@GObjectProperty(named: "visibility") public var visibility: Bool + +/// The current position of the insertion cursor in chars. +@GObjectProperty(named: "cursor-position") public var cursorPosition: Int + +/// Whether the entry contents can be edited. +@GObjectProperty(named: "editable") public var editable: Bool + +/// If undo/redo should be enabled for the editable. +@GObjectProperty(named: "enable-undo") public var enableUndo: Bool + +/// The desired maximum width of the entry, in characters. +@GObjectProperty(named: "max-width-chars") public var maxWidthChars: Int + +/// The contents of the entry. +@GObjectProperty(named: "text") public var text: String + +/// Number of characters to leave space for in the entry. +@GObjectProperty(named: "width-chars") public var widthChars: Int + +/// The horizontal alignment, from 0 (left) to 1 (right). +/// +/// Reversed for RTL layouts. +@GObjectProperty(named: "xalign") public var xalign: Float + +/// Emitted when the entry is activated. +/// +/// The keybindings for this signal are all forms of the Enter key. +public var activate: ((Entry) -> Void)? + +/// Emitted when an activatable icon is clicked. +public var iconPress: ((Entry, GtkEntryIconPosition) -> Void)? + +/// Emitted on the button release from a mouse click +/// over an activatable icon. +public var iconRelease: ((Entry, GtkEntryIconPosition) -> Void)? + +/// This signal is a sign for the cell renderer to update its +/// value from the @cell_editable. +/// +/// Implementations of `GtkCellEditable` are responsible for +/// emitting this signal when they are done editing, e.g. +/// `GtkEntry` emits this signal when the user presses Enter. Typical things to +/// do in a handler for ::editing-done are to capture the edited value, +/// disconnect the @cell_editable from signals on the `GtkCellRenderer`, etc. +/// +/// gtk_cell_editable_editing_done() is a convenience method +/// for emitting `GtkCellEditable::editing-done`. +public var editingDone: ((Entry) -> Void)? + +/// This signal is meant to indicate that the cell is finished +/// editing, and the @cell_editable widget is being removed and may +/// subsequently be destroyed. +/// +/// Implementations of `GtkCellEditable` are responsible for +/// emitting this signal when they are done editing. It must +/// be emitted after the `GtkCellEditable::editing-done` signal, +/// to give the cell renderer a chance to update the cell's value +/// before the widget is removed. +/// +/// gtk_cell_editable_remove_widget() is a convenience method +/// for emitting `GtkCellEditable::remove-widget`. +public var removeWidget: ((Entry) -> Void)? + +/// Emitted at the end of a single user-visible operation on the +/// contents. +/// +/// E.g., a paste operation that replaces the contents of the +/// selection will cause only one signal emission (even though it +/// is implemented by first deleting the selection, then inserting +/// the new content, and may cause multiple ::notify::text signals +/// to be emitted). +public var changed: ((Entry) -> Void)? + +/// Emitted when text is deleted from the widget by the user. +/// +/// The default handler for this signal will normally be responsible for +/// deleting the text, so by connecting to this signal and then stopping +/// the signal with g_signal_stop_emission(), it is possible to modify the +/// range of deleted text, or prevent it from being deleted entirely. +/// +/// The @start_pos and @end_pos parameters are interpreted as for +/// [method@Gtk.Editable.delete_text]. +public var deleteText: ((Entry, Int, Int) -> Void)? + +/// Emitted when text is inserted into the widget by the user. +/// +/// The default handler for this signal will normally be responsible +/// for inserting the text, so by connecting to this signal and then +/// stopping the signal with g_signal_stop_emission(), it is possible +/// to modify the inserted text, or prevent it from being inserted entirely. +public var insertText: ((Entry, UnsafePointer, Int, gpointer) -> Void)? + + +public var notifyActivatesDefault: ((Entry, OpaquePointer) -> Void)? + + +public var notifyAttributes: ((Entry, OpaquePointer) -> Void)? + + +public var notifyBuffer: ((Entry, OpaquePointer) -> Void)? + + +public var notifyCompletion: ((Entry, OpaquePointer) -> Void)? + + +public var notifyEnableEmojiCompletion: ((Entry, OpaquePointer) -> Void)? + + +public var notifyExtraMenu: ((Entry, OpaquePointer) -> Void)? + + +public var notifyHasFrame: ((Entry, OpaquePointer) -> Void)? + + +public var notifyImModule: ((Entry, OpaquePointer) -> Void)? + + +public var notifyInputHints: ((Entry, OpaquePointer) -> Void)? + + +public var notifyInputPurpose: ((Entry, OpaquePointer) -> Void)? + + +public var notifyInvisibleCharacter: ((Entry, OpaquePointer) -> Void)? + + +public var notifyInvisibleCharacterSet: ((Entry, OpaquePointer) -> Void)? + + +public var notifyMaxLength: ((Entry, OpaquePointer) -> Void)? + + +public var notifyMenuEntryIconPrimaryText: ((Entry, OpaquePointer) -> Void)? + + +public var notifyMenuEntryIconSecondaryText: ((Entry, OpaquePointer) -> Void)? + + +public var notifyOverwriteMode: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPlaceholderText: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconActivatable: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconGicon: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconName: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconPaintable: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconSensitive: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconStorageType: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? + + +public var notifyProgressFraction: ((Entry, OpaquePointer) -> Void)? + + +public var notifyProgressPulseStep: ((Entry, OpaquePointer) -> Void)? + + +public var notifyScrollOffset: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconActivatable: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconGicon: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconName: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconPaintable: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconSensitive: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconStorageType: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? + + +public var notifyShowEmojiIcon: ((Entry, OpaquePointer) -> Void)? + + +public var notifyTabs: ((Entry, OpaquePointer) -> Void)? + + +public var notifyTextLength: ((Entry, OpaquePointer) -> Void)? + + +public var notifyTruncateMultiline: ((Entry, OpaquePointer) -> Void)? + + +public var notifyVisibility: ((Entry, OpaquePointer) -> Void)? + + +public var notifyEditingCanceled: ((Entry, OpaquePointer) -> Void)? + + +public var notifyCursorPosition: ((Entry, OpaquePointer) -> Void)? + + +public var notifyEditable: ((Entry, OpaquePointer) -> Void)? + + +public var notifyEnableUndo: ((Entry, OpaquePointer) -> Void)? + + +public var notifyMaxWidthChars: ((Entry, OpaquePointer) -> Void)? + + +public var notifySelectionBound: ((Entry, OpaquePointer) -> Void)? + + +public var notifyText: ((Entry, OpaquePointer) -> Void)? + + +public var notifyWidthChars: ((Entry, OpaquePointer) -> Void)? + + +public var notifyXalign: ((Entry, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/EntryIconPosition.swift b/Sources/Gtk/Generated/EntryIconPosition.swift index 6ef056f05c..9528a4e836 100644 --- a/Sources/Gtk/Generated/EntryIconPosition.swift +++ b/Sources/Gtk/Generated/EntryIconPosition.swift @@ -5,20 +5,20 @@ public enum EntryIconPosition: GValueRepresentableEnum { public typealias GtkEnum = GtkEntryIconPosition /// At the beginning of the entry (depending on the text direction). - case primary - /// At the end of the entry (depending on the text direction). - case secondary +case primary +/// At the end of the entry (depending on the text direction). +case secondary public static var type: GType { - gtk_entry_icon_position_get_type() - } + gtk_entry_icon_position_get_type() +} public init(from gtkEnum: GtkEntryIconPosition) { switch gtkEnum { case GTK_ENTRY_ICON_PRIMARY: - self = .primary - case GTK_ENTRY_ICON_SECONDARY: - self = .secondary + self = .primary +case GTK_ENTRY_ICON_SECONDARY: + self = .secondary default: fatalError("Unsupported GtkEntryIconPosition enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ public enum EntryIconPosition: GValueRepresentableEnum { public func toGtk() -> GtkEntryIconPosition { switch self { case .primary: - return GTK_ENTRY_ICON_PRIMARY - case .secondary: - return GTK_ENTRY_ICON_SECONDARY + return GTK_ENTRY_ICON_PRIMARY +case .secondary: + return GTK_ENTRY_ICON_SECONDARY } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/EventController.swift b/Sources/Gtk/Generated/EventController.swift index c29ce1254a..6842e79b31 100644 --- a/Sources/Gtk/Generated/EventController.swift +++ b/Sources/Gtk/Generated/EventController.swift @@ -1,85 +1,82 @@ import CGtk /// The base class for event controllers. -/// +/// /// These are ancillary objects associated to widgets, which react /// to `GdkEvents`, and possibly trigger actions as a consequence. -/// +/// /// Event controllers are added to a widget with /// [method@Gtk.Widget.add_controller]. It is rarely necessary to /// explicitly remove a controller with [method@Gtk.Widget.remove_controller]. -/// +/// /// See the chapter on [input handling](input-handling.html) for /// an overview of the basic concepts, such as the capture and bubble /// phases of event propagation. open class EventController: GObject { + public override func registerSignals() { - super.registerSignals() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::name", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyName?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::propagation-limit", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPropagationLimit?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::propagation-phase", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPropagationPhase?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::widget", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWidget?(self, param0) - } + super.registerSignals() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// The name for this controller, typically used for debugging purposes. - @GObjectProperty(named: "name") public var name: String? +addSignal(name: "notify::name", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyName?(self, param0) +} - /// The limit for which events this controller will handle. - @GObjectProperty(named: "propagation-limit") public var propagationLimit: PropagationLimit +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// The propagation phase at which this controller will handle events. - @GObjectProperty(named: "propagation-phase") public var propagationPhase: PropagationPhase +addSignal(name: "notify::propagation-limit", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPropagationLimit?(self, param0) +} - public var notifyName: ((EventController, OpaquePointer) -> Void)? +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyPropagationLimit: ((EventController, OpaquePointer) -> Void)? +addSignal(name: "notify::propagation-phase", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPropagationPhase?(self, param0) +} - public var notifyPropagationPhase: ((EventController, OpaquePointer) -> Void)? +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyWidget: ((EventController, OpaquePointer) -> Void)? +addSignal(name: "notify::widget", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWidget?(self, param0) +} } + + /// The name for this controller, typically used for debugging purposes. +@GObjectProperty(named: "name") public var name: String? + +/// The limit for which events this controller will handle. +@GObjectProperty(named: "propagation-limit") public var propagationLimit: PropagationLimit + +/// The propagation phase at which this controller will handle events. +@GObjectProperty(named: "propagation-phase") public var propagationPhase: PropagationPhase + + +public var notifyName: ((EventController, OpaquePointer) -> Void)? + + +public var notifyPropagationLimit: ((EventController, OpaquePointer) -> Void)? + + +public var notifyPropagationPhase: ((EventController, OpaquePointer) -> Void)? + + +public var notifyWidget: ((EventController, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/EventControllerMotion.swift b/Sources/Gtk/Generated/EventControllerMotion.swift index 152ca94e59..9310628743 100644 --- a/Sources/Gtk/Generated/EventControllerMotion.swift +++ b/Sources/Gtk/Generated/EventControllerMotion.swift @@ -1,7 +1,7 @@ import CGtk /// Tracks the pointer position. -/// +/// /// The event controller offers [signal@Gtk.EventControllerMotion::enter] /// and [signal@Gtk.EventControllerMotion::leave] signals, as well as /// [property@Gtk.EventControllerMotion:is-pointer] and @@ -10,100 +10,92 @@ import CGtk /// moves over the widget. open class EventControllerMotion: EventController { /// Creates a new event controller that will handle motion events. - public convenience init() { - self.init( - gtk_event_controller_motion_new() - ) - } +public convenience init() { + self.init( + gtk_event_controller_motion_new() + ) +} public override func registerSignals() { - super.registerSignals() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> - Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "enter", handler: gCallback(handler0)) { - [weak self] (param0: Double, param1: Double) in - guard let self = self else { return } - self.enter?(self, param0, param1) - } - - addSignal(name: "leave") { [weak self] () in - guard let self = self else { return } - self.leave?(self) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> - Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "motion", handler: gCallback(handler2)) { - [weak self] (param0: Double, param1: Double) in - guard let self = self else { return } - self.motion?(self, param0, param1) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::contains-pointer", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContainsPointer?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::is-pointer", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIsPointer?(self, param0) - } + super.registerSignals() + + let handler0: @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) } - /// Whether the pointer is in the controllers widget or a descendant. - /// - /// See also [property@Gtk.EventControllerMotion:is-pointer]. - /// - /// When handling crossing events, this property is updated - /// before [signal@Gtk.EventControllerMotion::enter], but after - /// [signal@Gtk.EventControllerMotion::leave] is emitted. - @GObjectProperty(named: "contains-pointer") public var containsPointer: Bool - - /// Whether the pointer is in the controllers widget itself, - /// as opposed to in a descendent widget. - /// - /// See also [property@Gtk.EventControllerMotion:contains-pointer]. - /// - /// When handling crossing events, this property is updated - /// before [signal@Gtk.EventControllerMotion::enter], but after - /// [signal@Gtk.EventControllerMotion::leave] is emitted. - @GObjectProperty(named: "is-pointer") public var isPointer: Bool - - /// Signals that the pointer has entered the widget. - public var enter: ((EventControllerMotion, Double, Double) -> Void)? - - /// Signals that the pointer has left the widget. - public var leave: ((EventControllerMotion) -> Void)? - - /// Emitted when the pointer moves inside the widget. - public var motion: ((EventControllerMotion, Double, Double) -> Void)? - - public var notifyContainsPointer: ((EventControllerMotion, OpaquePointer) -> Void)? - - public var notifyIsPointer: ((EventControllerMotion, OpaquePointer) -> Void)? +addSignal(name: "enter", handler: gCallback(handler0)) { [weak self] (param0: Double, param1: Double) in + guard let self = self else { return } + self.enter?(self, param0, param1) } + +addSignal(name: "leave") { [weak self] () in + guard let self = self else { return } + self.leave?(self) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + +addSignal(name: "motion", handler: gCallback(handler2)) { [weak self] (param0: Double, param1: Double) in + guard let self = self else { return } + self.motion?(self, param0, param1) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::contains-pointer", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContainsPointer?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::is-pointer", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIsPointer?(self, param0) +} +} + + /// Whether the pointer is in the controllers widget or a descendant. +/// +/// See also [property@Gtk.EventControllerMotion:is-pointer]. +/// +/// When handling crossing events, this property is updated +/// before [signal@Gtk.EventControllerMotion::enter], but after +/// [signal@Gtk.EventControllerMotion::leave] is emitted. +@GObjectProperty(named: "contains-pointer") public var containsPointer: Bool + +/// Whether the pointer is in the controllers widget itself, +/// as opposed to in a descendent widget. +/// +/// See also [property@Gtk.EventControllerMotion:contains-pointer]. +/// +/// When handling crossing events, this property is updated +/// before [signal@Gtk.EventControllerMotion::enter], but after +/// [signal@Gtk.EventControllerMotion::leave] is emitted. +@GObjectProperty(named: "is-pointer") public var isPointer: Bool + +/// Signals that the pointer has entered the widget. +public var enter: ((EventControllerMotion, Double, Double) -> Void)? + +/// Signals that the pointer has left the widget. +public var leave: ((EventControllerMotion) -> Void)? + +/// Emitted when the pointer moves inside the widget. +public var motion: ((EventControllerMotion, Double, Double) -> Void)? + + +public var notifyContainsPointer: ((EventControllerMotion, OpaquePointer) -> Void)? + + +public var notifyIsPointer: ((EventControllerMotion, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/EventSequenceState.swift b/Sources/Gtk/Generated/EventSequenceState.swift index d64e046cab..ca6ae3e2d7 100644 --- a/Sources/Gtk/Generated/EventSequenceState.swift +++ b/Sources/Gtk/Generated/EventSequenceState.swift @@ -5,24 +5,24 @@ public enum EventSequenceState: GValueRepresentableEnum { public typealias GtkEnum = GtkEventSequenceState /// The sequence is handled, but not grabbed. - case none - /// The sequence is handled and grabbed. - case claimed - /// The sequence is denied. - case denied +case none +/// The sequence is handled and grabbed. +case claimed +/// The sequence is denied. +case denied public static var type: GType { - gtk_event_sequence_state_get_type() - } + gtk_event_sequence_state_get_type() +} public init(from gtkEnum: GtkEventSequenceState) { switch gtkEnum { case GTK_EVENT_SEQUENCE_NONE: - self = .none - case GTK_EVENT_SEQUENCE_CLAIMED: - self = .claimed - case GTK_EVENT_SEQUENCE_DENIED: - self = .denied + self = .none +case GTK_EVENT_SEQUENCE_CLAIMED: + self = .claimed +case GTK_EVENT_SEQUENCE_DENIED: + self = .denied default: fatalError("Unsupported GtkEventSequenceState enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ public enum EventSequenceState: GValueRepresentableEnum { public func toGtk() -> GtkEventSequenceState { switch self { case .none: - return GTK_EVENT_SEQUENCE_NONE - case .claimed: - return GTK_EVENT_SEQUENCE_CLAIMED - case .denied: - return GTK_EVENT_SEQUENCE_DENIED + return GTK_EVENT_SEQUENCE_NONE +case .claimed: + return GTK_EVENT_SEQUENCE_CLAIMED +case .denied: + return GTK_EVENT_SEQUENCE_DENIED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/FileChooser.swift b/Sources/Gtk/Generated/FileChooser.swift index 057280132d..ca019aca97 100644 --- a/Sources/Gtk/Generated/FileChooser.swift +++ b/Sources/Gtk/Generated/FileChooser.swift @@ -2,37 +2,37 @@ import CGtk /// `GtkFileChooser` is an interface that can be implemented by file /// selection widgets. -/// +/// /// In GTK, the main objects that implement this interface are /// [class@Gtk.FileChooserWidget] and [class@Gtk.FileChooserDialog]. -/// +/// /// You do not need to write an object that implements the `GtkFileChooser` /// interface unless you are trying to adapt an existing file selector to /// expose a standard programming interface. -/// +/// /// `GtkFileChooser` allows for shortcuts to various places in the filesystem. /// In the default implementation these are displayed in the left pane. It /// may be a bit confusing at first that these shortcuts come from various /// sources and in various flavours, so lets explain the terminology here: -/// +/// /// - Bookmarks: are created by the user, by dragging folders from the /// right pane to the left pane, or by using the “Add”. Bookmarks /// can be renamed and deleted by the user. -/// +/// /// - Shortcuts: can be provided by the application. For example, a Paint /// program may want to add a shortcut for a Clipart folder. Shortcuts /// cannot be modified by the user. -/// +/// /// - Volumes: are provided by the underlying filesystem abstraction. They are /// the “roots” of the filesystem. -/// +/// /// # File Names and Encodings -/// +/// /// When the user is finished selecting files in a `GtkFileChooser`, your /// program can get the selected filenames as `GFile`s. -/// +/// /// # Adding options -/// +/// /// You can add extra widgets to a file chooser to provide options /// that are not present in the default design, by using /// [method@Gtk.FileChooser.add_choice]. Each choice has an identifier and @@ -42,27 +42,28 @@ import CGtk /// be rendered as a combo box. public protocol FileChooser: GObjectRepresentable { /// The type of operation that the file chooser is performing. - var action: FileChooserAction { get set } +var action: FileChooserAction { get set } - /// Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode - /// will offer the user to create new folders. - var createFolders: Bool { get set } +/// Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode +/// will offer the user to create new folders. +var createFolders: Bool { get set } - /// A `GListModel` containing the filters that have been - /// added with gtk_file_chooser_add_filter(). - /// - /// The returned object should not be modified. It may - /// or may not be updated for later changes. - var filters: OpaquePointer { get set } +/// A `GListModel` containing the filters that have been +/// added with gtk_file_chooser_add_filter(). +/// +/// The returned object should not be modified. It may +/// or may not be updated for later changes. +var filters: OpaquePointer { get set } - /// Whether to allow multiple files to be selected. - var selectMultiple: Bool { get set } +/// Whether to allow multiple files to be selected. +var selectMultiple: Bool { get set } - /// A `GListModel` containing the shortcut folders that have been - /// added with gtk_file_chooser_add_shortcut_folder(). - /// - /// The returned object should not be modified. It may - /// or may not be updated for later changes. - var shortcutFolders: OpaquePointer { get set } +/// A `GListModel` containing the shortcut folders that have been +/// added with gtk_file_chooser_add_shortcut_folder(). +/// +/// The returned object should not be modified. It may +/// or may not be updated for later changes. +var shortcutFolders: OpaquePointer { get set } -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/FileChooserAction.swift b/Sources/Gtk/Generated/FileChooserAction.swift index fb1e889e94..dab1abc72c 100644 --- a/Sources/Gtk/Generated/FileChooserAction.swift +++ b/Sources/Gtk/Generated/FileChooserAction.swift @@ -6,29 +6,29 @@ public enum FileChooserAction: GValueRepresentableEnum { public typealias GtkEnum = GtkFileChooserAction /// Indicates open mode. The file chooser - /// will only let the user pick an existing file. - case open - /// Indicates save mode. The file chooser - /// will let the user pick an existing file, or type in a new - /// filename. - case save - /// Indicates an Open mode for - /// selecting folders. The file chooser will let the user pick an - /// existing folder. - case selectFolder +/// will only let the user pick an existing file. +case open +/// Indicates save mode. The file chooser +/// will let the user pick an existing file, or type in a new +/// filename. +case save +/// Indicates an Open mode for +/// selecting folders. The file chooser will let the user pick an +/// existing folder. +case selectFolder public static var type: GType { - gtk_file_chooser_action_get_type() - } + gtk_file_chooser_action_get_type() +} public init(from gtkEnum: GtkFileChooserAction) { switch gtkEnum { case GTK_FILE_CHOOSER_ACTION_OPEN: - self = .open - case GTK_FILE_CHOOSER_ACTION_SAVE: - self = .save - case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER: - self = .selectFolder + self = .open +case GTK_FILE_CHOOSER_ACTION_SAVE: + self = .save +case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER: + self = .selectFolder default: fatalError("Unsupported GtkFileChooserAction enum value: \(gtkEnum.rawValue)") } @@ -37,11 +37,11 @@ public enum FileChooserAction: GValueRepresentableEnum { public func toGtk() -> GtkFileChooserAction { switch self { case .open: - return GTK_FILE_CHOOSER_ACTION_OPEN - case .save: - return GTK_FILE_CHOOSER_ACTION_SAVE - case .selectFolder: - return GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER + return GTK_FILE_CHOOSER_ACTION_OPEN +case .save: + return GTK_FILE_CHOOSER_ACTION_SAVE +case .selectFolder: + return GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/FileChooserError.swift b/Sources/Gtk/Generated/FileChooserError.swift index 78085a9ffa..4b5ae8e16a 100644 --- a/Sources/Gtk/Generated/FileChooserError.swift +++ b/Sources/Gtk/Generated/FileChooserError.swift @@ -6,30 +6,30 @@ public enum FileChooserError: GValueRepresentableEnum { public typealias GtkEnum = GtkFileChooserError /// Indicates that a file does not exist. - case nonexistent - /// Indicates a malformed filename. - case badFilename - /// Indicates a duplicate path (e.g. when - /// adding a bookmark). - case alreadyExists - /// Indicates an incomplete hostname - /// (e.g. "http://foo" without a slash after that). - case incompleteHostname +case nonexistent +/// Indicates a malformed filename. +case badFilename +/// Indicates a duplicate path (e.g. when +/// adding a bookmark). +case alreadyExists +/// Indicates an incomplete hostname +/// (e.g. "http://foo" without a slash after that). +case incompleteHostname public static var type: GType { - gtk_file_chooser_error_get_type() - } + gtk_file_chooser_error_get_type() +} public init(from gtkEnum: GtkFileChooserError) { switch gtkEnum { case GTK_FILE_CHOOSER_ERROR_NONEXISTENT: - self = .nonexistent - case GTK_FILE_CHOOSER_ERROR_BAD_FILENAME: - self = .badFilename - case GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS: - self = .alreadyExists - case GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME: - self = .incompleteHostname + self = .nonexistent +case GTK_FILE_CHOOSER_ERROR_BAD_FILENAME: + self = .badFilename +case GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS: + self = .alreadyExists +case GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME: + self = .incompleteHostname default: fatalError("Unsupported GtkFileChooserError enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ public enum FileChooserError: GValueRepresentableEnum { public func toGtk() -> GtkFileChooserError { switch self { case .nonexistent: - return GTK_FILE_CHOOSER_ERROR_NONEXISTENT - case .badFilename: - return GTK_FILE_CHOOSER_ERROR_BAD_FILENAME - case .alreadyExists: - return GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS - case .incompleteHostname: - return GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME + return GTK_FILE_CHOOSER_ERROR_NONEXISTENT +case .badFilename: + return GTK_FILE_CHOOSER_ERROR_BAD_FILENAME +case .alreadyExists: + return GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS +case .incompleteHostname: + return GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/FileChooserNative.swift b/Sources/Gtk/Generated/FileChooserNative.swift index ad788b8891..970c5c4ead 100644 --- a/Sources/Gtk/Generated/FileChooserNative.swift +++ b/Sources/Gtk/Generated/FileChooserNative.swift @@ -2,7 +2,7 @@ import CGtk /// `GtkFileChooserNative` is an abstraction of a dialog suitable /// for use with “File Open” or “File Save as” commands. -/// +/// /// By default, this just uses a `GtkFileChooserDialog` to implement /// the actual dialog. However, on some platforms, such as Windows and /// macOS, the native platform file chooser is used instead. When the @@ -10,25 +10,25 @@ import CGtk /// filesystem access (such as Flatpak), `GtkFileChooserNative` may call /// the proper APIs (portals) to let the user choose a file and make it /// available to the application. -/// +/// /// While the API of `GtkFileChooserNative` closely mirrors `GtkFileChooserDialog`, /// the main difference is that there is no access to any `GtkWindow` or `GtkWidget` /// for the dialog. This is required, as there may not be one in the case of a /// platform native dialog. -/// +/// /// Showing, hiding and running the dialog is handled by the /// [class@Gtk.NativeDialog] functions. -/// +/// /// Note that unlike `GtkFileChooserDialog`, `GtkFileChooserNative` objects /// are not toplevel widgets, and GTK does not keep them alive. It is your /// responsibility to keep a reference until you are done with the /// object. -/// +/// /// ## Typical usage -/// +/// /// In the simplest of cases, you can the following code to use /// `GtkFileChooserNative` to select a file for opening: -/// +/// /// ```c /// static void /// on_response (GtkNativeDialog *native, @@ -38,31 +38,31 @@ import CGtk /// { /// GtkFileChooser *chooser = GTK_FILE_CHOOSER (native); /// GFile *file = gtk_file_chooser_get_file (chooser); -/// +/// /// open_file (file); -/// +/// /// g_object_unref (file); /// } -/// +/// /// g_object_unref (native); /// } -/// +/// /// // ... /// GtkFileChooserNative *native; /// GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN; -/// +/// /// native = gtk_file_chooser_native_new ("Open File", /// parent_window, /// action, /// "_Open", /// "_Cancel"); -/// +/// /// g_signal_connect (native, "response", G_CALLBACK (on_response), NULL); /// gtk_native_dialog_show (GTK_NATIVE_DIALOG (native)); /// ``` -/// +/// /// To use a `GtkFileChooserNative` for saving, you can use this: -/// +/// /// ```c /// static void /// on_response (GtkNativeDialog *native, @@ -72,236 +72,225 @@ import CGtk /// { /// GtkFileChooser *chooser = GTK_FILE_CHOOSER (native); /// GFile *file = gtk_file_chooser_get_file (chooser); -/// +/// /// save_to_file (file); -/// +/// /// g_object_unref (file); /// } -/// +/// /// g_object_unref (native); /// } -/// +/// /// // ... /// GtkFileChooserNative *native; /// GtkFileChooser *chooser; /// GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SAVE; -/// +/// /// native = gtk_file_chooser_native_new ("Save File", /// parent_window, /// action, /// "_Save", /// "_Cancel"); /// chooser = GTK_FILE_CHOOSER (native); -/// +/// /// if (user_edited_a_new_document) /// gtk_file_chooser_set_current_name (chooser, _("Untitled document")); /// else /// gtk_file_chooser_set_file (chooser, existing_file, NULL); -/// +/// /// g_signal_connect (native, "response", G_CALLBACK (on_response), NULL); /// gtk_native_dialog_show (GTK_NATIVE_DIALOG (native)); /// ``` -/// +/// /// For more information on how to best set up a file dialog, /// see the [class@Gtk.FileChooserDialog] documentation. -/// +/// /// ## Response Codes -/// +/// /// `GtkFileChooserNative` inherits from [class@Gtk.NativeDialog], /// which means it will return %GTK_RESPONSE_ACCEPT if the user accepted, /// and %GTK_RESPONSE_CANCEL if he pressed cancel. It can also return /// %GTK_RESPONSE_DELETE_EVENT if the window was unexpectedly closed. -/// +/// /// ## Differences from `GtkFileChooserDialog` -/// +/// /// There are a few things in the [iface@Gtk.FileChooser] interface that /// are not possible to use with `GtkFileChooserNative`, as such use would /// prohibit the use of a native dialog. -/// +/// /// No operations that change the dialog work while the dialog is visible. /// Set all the properties that are required before showing the dialog. -/// +/// /// ## Win32 details -/// +/// /// On windows the `IFileDialog` implementation (added in Windows Vista) is /// used. It supports many of the features that `GtkFileChooser` has, but /// there are some things it does not handle: -/// +/// /// * Any [class@Gtk.FileFilter] added using a mimetype -/// +/// /// If any of these features are used the regular `GtkFileChooserDialog` /// will be used in place of the native one. -/// +/// /// ## Portal details -/// +/// /// When the `org.freedesktop.portal.FileChooser` portal is available on /// the session bus, it is used to bring up an out-of-process file chooser. /// Depending on the kind of session the application is running in, this may /// or may not be a GTK file chooser. -/// +/// /// ## macOS details -/// +/// /// On macOS the `NSSavePanel` and `NSOpenPanel` classes are used to provide /// native file chooser dialogs. Some features provided by `GtkFileChooser` /// are not supported: -/// +/// /// * Shortcut folders. open class FileChooserNative: NativeDialog, FileChooser { /// Creates a new `GtkFileChooserNative`. - public convenience init( - title: String, parent: UnsafeMutablePointer!, action: GtkFileChooserAction, - acceptLabel: String, cancelLabel: String - ) { - self.init( - gtk_file_chooser_native_new(title, parent, action, acceptLabel, cancelLabel) - ) - } +public convenience init(title: String, parent: UnsafeMutablePointer!, action: GtkFileChooserAction, acceptLabel: String, cancelLabel: String) { + self.init( + gtk_file_chooser_native_new(title, parent, action, acceptLabel, cancelLabel) + ) +} public override func registerSignals() { - super.registerSignals() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::accept-label", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAcceptLabel?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::cancel-label", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCancelLabel?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::action", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAction?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::create-folders", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCreateFolders?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::filter", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFilter?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::filters", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFilters?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::select-multiple", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectMultiple?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::shortcut-folders", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShortcutFolders?(self, param0) - } + super.registerSignals() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// The text used for the label on the accept button in the dialog, or - /// %NULL to use the default text. - @GObjectProperty(named: "accept-label") public var acceptLabel: String? +addSignal(name: "notify::accept-label", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAcceptLabel?(self, param0) +} - /// The text used for the label on the cancel button in the dialog, or - /// %NULL to use the default text. - @GObjectProperty(named: "cancel-label") public var cancelLabel: String? +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// The type of operation that the file chooser is performing. - @GObjectProperty(named: "action") public var action: FileChooserAction +addSignal(name: "notify::cancel-label", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCancelLabel?(self, param0) +} - /// Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode - /// will offer the user to create new folders. - @GObjectProperty(named: "create-folders") public var createFolders: Bool +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// A `GListModel` containing the filters that have been - /// added with gtk_file_chooser_add_filter(). - /// - /// The returned object should not be modified. It may - /// or may not be updated for later changes. - @GObjectProperty(named: "filters") public var filters: OpaquePointer +addSignal(name: "notify::action", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAction?(self, param0) +} - /// Whether to allow multiple files to be selected. - @GObjectProperty(named: "select-multiple") public var selectMultiple: Bool +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// A `GListModel` containing the shortcut folders that have been - /// added with gtk_file_chooser_add_shortcut_folder(). - /// - /// The returned object should not be modified. It may - /// or may not be updated for later changes. - @GObjectProperty(named: "shortcut-folders") public var shortcutFolders: OpaquePointer +addSignal(name: "notify::create-folders", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCreateFolders?(self, param0) +} - public var notifyAcceptLabel: ((FileChooserNative, OpaquePointer) -> Void)? +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyCancelLabel: ((FileChooserNative, OpaquePointer) -> Void)? +addSignal(name: "notify::filter", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFilter?(self, param0) +} - public var notifyAction: ((FileChooserNative, OpaquePointer) -> Void)? +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyCreateFolders: ((FileChooserNative, OpaquePointer) -> Void)? +addSignal(name: "notify::filters", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFilters?(self, param0) +} - public var notifyFilter: ((FileChooserNative, OpaquePointer) -> Void)? +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyFilters: ((FileChooserNative, OpaquePointer) -> Void)? +addSignal(name: "notify::select-multiple", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectMultiple?(self, param0) +} - public var notifySelectMultiple: ((FileChooserNative, OpaquePointer) -> Void)? +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyShortcutFolders: ((FileChooserNative, OpaquePointer) -> Void)? +addSignal(name: "notify::shortcut-folders", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShortcutFolders?(self, param0) +} } + + /// The text used for the label on the accept button in the dialog, or +/// %NULL to use the default text. +@GObjectProperty(named: "accept-label") public var acceptLabel: String? + +/// The text used for the label on the cancel button in the dialog, or +/// %NULL to use the default text. +@GObjectProperty(named: "cancel-label") public var cancelLabel: String? + +/// The type of operation that the file chooser is performing. +@GObjectProperty(named: "action") public var action: FileChooserAction + +/// Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode +/// will offer the user to create new folders. +@GObjectProperty(named: "create-folders") public var createFolders: Bool + +/// A `GListModel` containing the filters that have been +/// added with gtk_file_chooser_add_filter(). +/// +/// The returned object should not be modified. It may +/// or may not be updated for later changes. +@GObjectProperty(named: "filters") public var filters: OpaquePointer + +/// Whether to allow multiple files to be selected. +@GObjectProperty(named: "select-multiple") public var selectMultiple: Bool + +/// A `GListModel` containing the shortcut folders that have been +/// added with gtk_file_chooser_add_shortcut_folder(). +/// +/// The returned object should not be modified. It may +/// or may not be updated for later changes. +@GObjectProperty(named: "shortcut-folders") public var shortcutFolders: OpaquePointer + + +public var notifyAcceptLabel: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyCancelLabel: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyAction: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyCreateFolders: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyFilter: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyFilters: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifySelectMultiple: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyShortcutFolders: ((FileChooserNative, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/FilterChange.swift b/Sources/Gtk/Generated/FilterChange.swift index ef229a3148..ff29ec0419 100644 --- a/Sources/Gtk/Generated/FilterChange.swift +++ b/Sources/Gtk/Generated/FilterChange.swift @@ -2,39 +2,39 @@ import CGtk /// Describes changes in a filter in more detail and allows objects /// using the filter to optimize refiltering items. -/// +/// /// If you are writing an implementation and are not sure which /// value to pass, `GTK_FILTER_CHANGE_DIFFERENT` is always a correct /// choice. -/// +/// /// New values may be added in the future. public enum FilterChange: GValueRepresentableEnum { public typealias GtkEnum = GtkFilterChange /// The filter change cannot be - /// described with any of the other enumeration values - case different - /// The filter is less strict than - /// it was before: All items that it used to return true - /// still return true, others now may, too. - case lessStrict - /// The filter is more strict than - /// it was before: All items that it used to return false - /// still return false, others now may, too. - case moreStrict +/// described with any of the other enumeration values +case different +/// The filter is less strict than +/// it was before: All items that it used to return true +/// still return true, others now may, too. +case lessStrict +/// The filter is more strict than +/// it was before: All items that it used to return false +/// still return false, others now may, too. +case moreStrict public static var type: GType { - gtk_filter_change_get_type() - } + gtk_filter_change_get_type() +} public init(from gtkEnum: GtkFilterChange) { switch gtkEnum { case GTK_FILTER_CHANGE_DIFFERENT: - self = .different - case GTK_FILTER_CHANGE_LESS_STRICT: - self = .lessStrict - case GTK_FILTER_CHANGE_MORE_STRICT: - self = .moreStrict + self = .different +case GTK_FILTER_CHANGE_LESS_STRICT: + self = .lessStrict +case GTK_FILTER_CHANGE_MORE_STRICT: + self = .moreStrict default: fatalError("Unsupported GtkFilterChange enum value: \(gtkEnum.rawValue)") } @@ -43,11 +43,11 @@ public enum FilterChange: GValueRepresentableEnum { public func toGtk() -> GtkFilterChange { switch self { case .different: - return GTK_FILTER_CHANGE_DIFFERENT - case .lessStrict: - return GTK_FILTER_CHANGE_LESS_STRICT - case .moreStrict: - return GTK_FILTER_CHANGE_MORE_STRICT + return GTK_FILTER_CHANGE_DIFFERENT +case .lessStrict: + return GTK_FILTER_CHANGE_LESS_STRICT +case .moreStrict: + return GTK_FILTER_CHANGE_MORE_STRICT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/FilterMatch.swift b/Sources/Gtk/Generated/FilterMatch.swift index 27def01204..6057e32d95 100644 --- a/Sources/Gtk/Generated/FilterMatch.swift +++ b/Sources/Gtk/Generated/FilterMatch.swift @@ -1,7 +1,7 @@ import CGtk /// Describes the known strictness of a filter. -/// +/// /// Note that for filters where the strictness is not known, /// `GTK_FILTER_MATCH_SOME` is always an acceptable value, /// even if a filter does match all or no items. @@ -9,27 +9,27 @@ public enum FilterMatch: GValueRepresentableEnum { public typealias GtkEnum = GtkFilterMatch /// The filter matches some items, - /// [method@Gtk.Filter.match] may return true or false - case some - /// The filter does not match any item, - /// [method@Gtk.Filter.match] will always return false - case none - /// The filter matches all items, - /// [method@Gtk.Filter.match] will alays return true - case all +/// [method@Gtk.Filter.match] may return true or false +case some +/// The filter does not match any item, +/// [method@Gtk.Filter.match] will always return false +case none +/// The filter matches all items, +/// [method@Gtk.Filter.match] will alays return true +case all public static var type: GType { - gtk_filter_match_get_type() - } + gtk_filter_match_get_type() +} public init(from gtkEnum: GtkFilterMatch) { switch gtkEnum { case GTK_FILTER_MATCH_SOME: - self = .some - case GTK_FILTER_MATCH_NONE: - self = .none - case GTK_FILTER_MATCH_ALL: - self = .all + self = .some +case GTK_FILTER_MATCH_NONE: + self = .none +case GTK_FILTER_MATCH_ALL: + self = .all default: fatalError("Unsupported GtkFilterMatch enum value: \(gtkEnum.rawValue)") } @@ -38,11 +38,11 @@ public enum FilterMatch: GValueRepresentableEnum { public func toGtk() -> GtkFilterMatch { switch self { case .some: - return GTK_FILTER_MATCH_SOME - case .none: - return GTK_FILTER_MATCH_NONE - case .all: - return GTK_FILTER_MATCH_ALL + return GTK_FILTER_MATCH_SOME +case .none: + return GTK_FILTER_MATCH_NONE +case .all: + return GTK_FILTER_MATCH_ALL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/FontChooser.swift b/Sources/Gtk/Generated/FontChooser.swift index 1739368b72..451dff6cdc 100644 --- a/Sources/Gtk/Generated/FontChooser.swift +++ b/Sources/Gtk/Generated/FontChooser.swift @@ -2,33 +2,33 @@ import CGtk /// `GtkFontChooser` is an interface that can be implemented by widgets /// for choosing fonts. -/// +/// /// In GTK, the main objects that implement this interface are /// [class@Gtk.FontChooserWidget], [class@Gtk.FontChooserDialog] and /// [class@Gtk.FontButton]. public protocol FontChooser: GObjectRepresentable { /// The font description as a string, e.g. "Sans Italic 12". - var font: String? { get set } +var font: String? { get set } - /// The selected font features. - /// - /// The format of the string is compatible with - /// CSS and with Pango attributes. - var fontFeatures: String { get set } +/// The selected font features. +/// +/// The format of the string is compatible with +/// CSS and with Pango attributes. +var fontFeatures: String { get set } - /// The language for which the font features were selected. - var language: String { get set } +/// The language for which the font features were selected. +var language: String { get set } - /// The string with which to preview the font. - var previewText: String { get set } +/// The string with which to preview the font. +var previewText: String { get set } - /// Whether to show an entry to change the preview text. - var showPreviewEntry: Bool { get set } +/// Whether to show an entry to change the preview text. +var showPreviewEntry: Bool { get set } /// Emitted when a font is activated. - /// - /// This usually happens when the user double clicks an item, - /// or an item is selected and the user presses one of the keys - /// Space, Shift+Space, Return or Enter. - var fontActivated: ((Self, UnsafePointer) -> Void)? { get set } -} +/// +/// This usually happens when the user double clicks an item, +/// or an item is selected and the user presses one of the keys +/// Space, Shift+Space, Return or Enter. +var fontActivated: ((Self, UnsafePointer) -> Void)? { get set } +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/GLArea.swift b/Sources/Gtk/Generated/GLArea.swift index 5247e75482..11bec91792 100644 --- a/Sources/Gtk/Generated/GLArea.swift +++ b/Sources/Gtk/Generated/GLArea.swift @@ -1,33 +1,33 @@ import CGtk /// Allows drawing with OpenGL. -/// +/// /// An example GtkGLArea -/// +/// /// `GtkGLArea` sets up its own [class@Gdk.GLContext], and creates a custom /// GL framebuffer that the widget will do GL rendering onto. It also ensures /// that this framebuffer is the default GL rendering target when rendering. /// The completed rendering is integrated into the larger GTK scene graph as /// a texture. -/// +/// /// In order to draw, you have to connect to the [signal@Gtk.GLArea::render] /// signal, or subclass `GtkGLArea` and override the GtkGLAreaClass.render /// virtual function. -/// +/// /// The `GtkGLArea` widget ensures that the `GdkGLContext` is associated with /// the widget's drawing area, and it is kept updated when the size and /// position of the drawing area changes. -/// +/// /// ## Drawing with GtkGLArea -/// +/// /// The simplest way to draw using OpenGL commands in a `GtkGLArea` is to /// create a widget instance and connect to the [signal@Gtk.GLArea::render] signal: -/// +/// /// The `render()` function will be called when the `GtkGLArea` is ready /// for you to draw its content: -/// +/// /// The initial contents of the framebuffer are transparent. -/// +/// /// ```c /// static gboolean /// render (GtkGLArea *area, GdkGLContext *context) @@ -36,45 +36,45 @@ import CGtk /// // GdkGLContext has been made current to the drawable /// // surface used by the `GtkGLArea` and the viewport has /// // already been set to be the size of the allocation -/// +/// /// // we can start by clearing the buffer /// glClearColor (0, 0, 0, 0); /// glClear (GL_COLOR_BUFFER_BIT); -/// +/// /// // record the active framebuffer ID, so we can return to it /// // with `glBindFramebuffer (GL_FRAMEBUFFER, screen_fb)` should /// // we, for instance, intend on utilizing the results of an /// // intermediate render texture pass /// GLuint screen_fb = 0; /// glGetIntegerv (GL_FRAMEBUFFER_BINDING, &screen_fb); -/// +/// /// // draw your object /// // draw_an_object (); -/// +/// /// // we completed our drawing; the draw commands will be /// // flushed at the end of the signal emission chain, and /// // the buffers will be drawn on the window /// return TRUE; /// } -/// +/// /// void setup_glarea (void) /// { /// // create a GtkGLArea instance /// GtkWidget *gl_area = gtk_gl_area_new (); -/// +/// /// // connect to the "render" signal /// g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL); /// } /// ``` -/// +/// /// If you need to initialize OpenGL state, e.g. buffer objects or /// shaders, you should use the [signal@Gtk.Widget::realize] signal; /// you can use the [signal@Gtk.Widget::unrealize] signal to clean up. /// Since the `GdkGLContext` creation and initialization may fail, you /// will need to check for errors, using [method@Gtk.GLArea.get_error]. -/// +/// /// An example of how to safely initialize the GL state is: -/// +/// /// ```c /// static void /// on_realize (GtkGLArea *area) @@ -82,13 +82,13 @@ import CGtk /// // We need to make the context current if we want to /// // call GL API /// gtk_gl_area_make_current (area); -/// +/// /// // If there were errors during the initialization or /// // when trying to make the context current, this /// // function will return a GError for you to catch /// if (gtk_gl_area_get_error (area) != NULL) /// return; -/// +/// /// // You can also use gtk_gl_area_set_error() in order /// // to show eventual initialization errors on the /// // GtkGLArea widget itself @@ -100,7 +100,7 @@ import CGtk /// g_error_free (error); /// return; /// } -/// +/// /// init_shaders (&error); /// if (error != NULL) /// { @@ -110,210 +110,199 @@ import CGtk /// } /// } /// ``` -/// +/// /// If you need to change the options for creating the `GdkGLContext` /// you should use the [signal@Gtk.GLArea::create-context] signal. open class GLArea: Widget { /// Creates a new `GtkGLArea` widget. - public convenience init() { - self.init( - gtk_gl_area_new() - ) +public convenience init() { + self.init( + gtk_gl_area_new() + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "create-context") { [weak self] () in + guard let self = self else { return } + self.createContext?(self) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "create-context") { [weak self] () in - guard let self = self else { return } - self.createContext?(self) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "render", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.render?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "resize", handler: gCallback(handler2)) { - [weak self] (param0: Int, param1: Int) in - guard let self = self else { return } - self.resize?(self, param0, param1) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::allowed-apis", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAllowedApis?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::api", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyApi?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::auto-render", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAutoRender?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::context", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContext?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::has-depth-buffer", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasDepthBuffer?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::has-stencil-buffer", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasStencilBuffer?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-es", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseEs?(self, param0) - } +addSignal(name: "render", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.render?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) } - /// If set to %TRUE the ::render signal will be emitted every time - /// the widget draws. - /// - /// This is the default and is useful if drawing the widget is faster. - /// - /// If set to %FALSE the data from previous rendering is kept around and will - /// be used for drawing the widget the next time, unless the window is resized. - /// In order to force a rendering [method@Gtk.GLArea.queue_render] must be called. - /// This mode is useful when the scene changes seldom, but takes a long time - /// to redraw. - @GObjectProperty(named: "auto-render") public var autoRender: Bool - - /// The `GdkGLContext` used by the `GtkGLArea` widget. - /// - /// The `GtkGLArea` widget is responsible for creating the `GdkGLContext` - /// instance. If you need to render with other kinds of buffers (stencil, - /// depth, etc), use render buffers. - @GObjectProperty(named: "context") public var context: OpaquePointer? - - /// If set to %TRUE the widget will allocate and enable a depth buffer for the - /// target framebuffer. - /// - /// Setting this property will enable GL's depth testing as a side effect. If - /// you don't need depth testing, you should call `glDisable(GL_DEPTH_TEST)` - /// in your `GtkGLArea::render` handler. - @GObjectProperty(named: "has-depth-buffer") public var hasDepthBuffer: Bool - - /// If set to %TRUE the widget will allocate and enable a stencil buffer for the - /// target framebuffer. - @GObjectProperty(named: "has-stencil-buffer") public var hasStencilBuffer: Bool - - /// If set to %TRUE the widget will try to create a `GdkGLContext` using - /// OpenGL ES instead of OpenGL. - @GObjectProperty(named: "use-es") public var useEs: Bool - - /// Emitted when the widget is being realized. - /// - /// This allows you to override how the GL context is created. - /// This is useful when you want to reuse an existing GL context, - /// or if you want to try creating different kinds of GL options. - /// - /// If context creation fails then the signal handler can use - /// [method@Gtk.GLArea.set_error] to register a more detailed error - /// of how the construction failed. - public var createContext: ((GLArea) -> Void)? - - /// Emitted every time the contents of the `GtkGLArea` should be redrawn. - /// - /// The @context is bound to the @area prior to emitting this function, - /// and the buffers are painted to the window once the emission terminates. - public var render: ((GLArea, OpaquePointer) -> Void)? - - /// Emitted once when the widget is realized, and then each time the widget - /// is changed while realized. - /// - /// This is useful in order to keep GL state up to date with the widget size, - /// like for instance camera properties which may depend on the width/height - /// ratio. - /// - /// The GL context for the area is guaranteed to be current when this signal - /// is emitted. - /// - /// The default handler sets up the GL viewport. - public var resize: ((GLArea, Int, Int) -> Void)? - - public var notifyAllowedApis: ((GLArea, OpaquePointer) -> Void)? - - public var notifyApi: ((GLArea, OpaquePointer) -> Void)? - - public var notifyAutoRender: ((GLArea, OpaquePointer) -> Void)? - - public var notifyContext: ((GLArea, OpaquePointer) -> Void)? - - public var notifyHasDepthBuffer: ((GLArea, OpaquePointer) -> Void)? - - public var notifyHasStencilBuffer: ((GLArea, OpaquePointer) -> Void)? - - public var notifyUseEs: ((GLArea, OpaquePointer) -> Void)? +addSignal(name: "resize", handler: gCallback(handler2)) { [weak self] (param0: Int, param1: Int) in + guard let self = self else { return } + self.resize?(self, param0, param1) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::allowed-apis", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAllowedApis?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::api", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyApi?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::auto-render", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAutoRender?(self, param0) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::context", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContext?(self, param0) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::has-depth-buffer", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasDepthBuffer?(self, param0) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::has-stencil-buffer", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasStencilBuffer?(self, param0) +} + +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::use-es", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseEs?(self, param0) } +} + + /// If set to %TRUE the ::render signal will be emitted every time +/// the widget draws. +/// +/// This is the default and is useful if drawing the widget is faster. +/// +/// If set to %FALSE the data from previous rendering is kept around and will +/// be used for drawing the widget the next time, unless the window is resized. +/// In order to force a rendering [method@Gtk.GLArea.queue_render] must be called. +/// This mode is useful when the scene changes seldom, but takes a long time +/// to redraw. +@GObjectProperty(named: "auto-render") public var autoRender: Bool + +/// The `GdkGLContext` used by the `GtkGLArea` widget. +/// +/// The `GtkGLArea` widget is responsible for creating the `GdkGLContext` +/// instance. If you need to render with other kinds of buffers (stencil, +/// depth, etc), use render buffers. +@GObjectProperty(named: "context") public var context: OpaquePointer? + +/// If set to %TRUE the widget will allocate and enable a depth buffer for the +/// target framebuffer. +/// +/// Setting this property will enable GL's depth testing as a side effect. If +/// you don't need depth testing, you should call `glDisable(GL_DEPTH_TEST)` +/// in your `GtkGLArea::render` handler. +@GObjectProperty(named: "has-depth-buffer") public var hasDepthBuffer: Bool + +/// If set to %TRUE the widget will allocate and enable a stencil buffer for the +/// target framebuffer. +@GObjectProperty(named: "has-stencil-buffer") public var hasStencilBuffer: Bool + +/// If set to %TRUE the widget will try to create a `GdkGLContext` using +/// OpenGL ES instead of OpenGL. +@GObjectProperty(named: "use-es") public var useEs: Bool + +/// Emitted when the widget is being realized. +/// +/// This allows you to override how the GL context is created. +/// This is useful when you want to reuse an existing GL context, +/// or if you want to try creating different kinds of GL options. +/// +/// If context creation fails then the signal handler can use +/// [method@Gtk.GLArea.set_error] to register a more detailed error +/// of how the construction failed. +public var createContext: ((GLArea) -> Void)? + +/// Emitted every time the contents of the `GtkGLArea` should be redrawn. +/// +/// The @context is bound to the @area prior to emitting this function, +/// and the buffers are painted to the window once the emission terminates. +public var render: ((GLArea, OpaquePointer) -> Void)? + +/// Emitted once when the widget is realized, and then each time the widget +/// is changed while realized. +/// +/// This is useful in order to keep GL state up to date with the widget size, +/// like for instance camera properties which may depend on the width/height +/// ratio. +/// +/// The GL context for the area is guaranteed to be current when this signal +/// is emitted. +/// +/// The default handler sets up the GL viewport. +public var resize: ((GLArea, Int, Int) -> Void)? + + +public var notifyAllowedApis: ((GLArea, OpaquePointer) -> Void)? + + +public var notifyApi: ((GLArea, OpaquePointer) -> Void)? + + +public var notifyAutoRender: ((GLArea, OpaquePointer) -> Void)? + + +public var notifyContext: ((GLArea, OpaquePointer) -> Void)? + + +public var notifyHasDepthBuffer: ((GLArea, OpaquePointer) -> Void)? + + +public var notifyHasStencilBuffer: ((GLArea, OpaquePointer) -> Void)? + + +public var notifyUseEs: ((GLArea, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Gesture.swift b/Sources/Gtk/Generated/Gesture.swift index 9b9b702cbf..d98561da4d 100644 --- a/Sources/Gtk/Generated/Gesture.swift +++ b/Sources/Gtk/Generated/Gesture.swift @@ -1,219 +1,206 @@ import CGtk /// The base class for gesture recognition. -/// +/// /// Although `GtkGesture` is quite generalized to serve as a base for /// multi-touch gestures, it is suitable to implement single-touch and /// pointer-based gestures (using the special %NULL `GdkEventSequence` /// value for these). -/// +/// /// The number of touches that a `GtkGesture` need to be recognized is /// controlled by the [property@Gtk.Gesture:n-points] property, if a /// gesture is keeping track of less or more than that number of sequences, /// it won't check whether the gesture is recognized. -/// +/// /// As soon as the gesture has the expected number of touches, it will check /// regularly if it is recognized, the criteria to consider a gesture as /// "recognized" is left to `GtkGesture` subclasses. -/// +/// /// A recognized gesture will then emit the following signals: -/// +/// /// - [signal@Gtk.Gesture::begin] when the gesture is recognized. /// - [signal@Gtk.Gesture::update], whenever an input event is processed. /// - [signal@Gtk.Gesture::end] when the gesture is no longer recognized. -/// +/// /// ## Event propagation -/// +/// /// In order to receive events, a gesture needs to set a propagation phase /// through [method@Gtk.EventController.set_propagation_phase]. -/// +/// /// In the capture phase, events are propagated from the toplevel down /// to the target widget, and gestures that are attached to containers /// above the widget get a chance to interact with the event before it /// reaches the target. -/// +/// /// In the bubble phase, events are propagated up from the target widget /// to the toplevel, and gestures that are attached to containers above /// the widget get a chance to interact with events that have not been /// handled yet. -/// +/// /// ## States of a sequence -/// +/// /// Whenever input interaction happens, a single event may trigger a cascade /// of `GtkGesture`s, both across the parents of the widget receiving the /// event and in parallel within an individual widget. It is a responsibility /// of the widgets using those gestures to set the state of touch sequences /// accordingly in order to enable cooperation of gestures around the /// `GdkEventSequence`s triggering those. -/// +/// /// Within a widget, gestures can be grouped through [method@Gtk.Gesture.group]. /// Grouped gestures synchronize the state of sequences, so calling /// [method@Gtk.Gesture.set_state] on one will effectively propagate /// the state throughout the group. -/// +/// /// By default, all sequences start out in the %GTK_EVENT_SEQUENCE_NONE state, /// sequences in this state trigger the gesture event handler, but event /// propagation will continue unstopped by gestures. -/// +/// /// If a sequence enters into the %GTK_EVENT_SEQUENCE_DENIED state, the gesture /// group will effectively ignore the sequence, letting events go unstopped /// through the gesture, but the "slot" will still remain occupied while /// the touch is active. -/// +/// /// If a sequence enters in the %GTK_EVENT_SEQUENCE_CLAIMED state, the gesture /// group will grab all interaction on the sequence, by: -/// +/// /// - Setting the same sequence to %GTK_EVENT_SEQUENCE_DENIED on every other /// gesture group within the widget, and every gesture on parent widgets /// in the propagation chain. /// - Emitting [signal@Gtk.Gesture::cancel] on every gesture in widgets /// underneath in the propagation chain. /// - Stopping event propagation after the gesture group handles the event. -/// +/// /// Note: if a sequence is set early to %GTK_EVENT_SEQUENCE_CLAIMED on /// %GDK_TOUCH_BEGIN/%GDK_BUTTON_PRESS (so those events are captured before /// reaching the event widget, this implies %GTK_PHASE_CAPTURE), one similar /// event will be emulated if the sequence changes to %GTK_EVENT_SEQUENCE_DENIED. /// This way event coherence is preserved before event propagation is unstopped /// again. -/// +/// /// Sequence states can't be changed freely. /// See [method@Gtk.Gesture.set_state] to know about the possible /// lifetimes of a `GdkEventSequence`. -/// +/// /// ## Touchpad gestures -/// +/// /// On the platforms that support it, `GtkGesture` will handle transparently /// touchpad gesture events. The only precautions users of `GtkGesture` should /// do to enable this support are: -/// +/// /// - If the gesture has %GTK_PHASE_NONE, ensuring events of type /// %GDK_TOUCHPAD_SWIPE and %GDK_TOUCHPAD_PINCH are handled by the `GtkGesture` open class Gesture: EventController { + public override func registerSignals() { - super.registerSignals() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "begin", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.begin?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "cancel", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.cancel?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "end", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.end?(self, param0) - } - - let handler3: - @convention(c) ( - UnsafeMutableRawPointer, OpaquePointer, GtkEventSequenceState, - UnsafeMutableRawPointer - ) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "sequence-state-changed", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer, param1: GtkEventSequenceState) in - guard let self = self else { return } - self.sequenceStateChanged?(self, param0, param1) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "update", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.update?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::n-points", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyNPoints?(self, param0) - } + super.registerSignals() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Emitted when the gesture is recognized. - /// - /// This means the number of touch sequences matches - /// [property@Gtk.Gesture:n-points]. - /// - /// Note: These conditions may also happen when an extra touch - /// (eg. a third touch on a 2-touches gesture) is lifted, in that - /// situation @sequence won't pertain to the current set of active - /// touches, so don't rely on this being true. - public var begin: ((Gesture, OpaquePointer) -> Void)? - - /// Emitted whenever a sequence is cancelled. - /// - /// This usually happens on active touches when - /// [method@Gtk.EventController.reset] is called on @gesture - /// (manually, due to grabs...), or the individual @sequence - /// was claimed by parent widgets' controllers (see - /// [method@Gtk.Gesture.set_sequence_state]). - /// - /// @gesture must forget everything about @sequence as in - /// response to this signal. - public var cancel: ((Gesture, OpaquePointer) -> Void)? - - /// Emitted when @gesture either stopped recognizing the event - /// sequences as something to be handled, or the number of touch - /// sequences became higher or lower than [property@Gtk.Gesture:n-points]. - /// - /// Note: @sequence might not pertain to the group of sequences that - /// were previously triggering recognition on @gesture (ie. a just - /// pressed touch sequence that exceeds [property@Gtk.Gesture:n-points]). - /// This situation may be detected by checking through - /// [method@Gtk.Gesture.handles_sequence]. - public var end: ((Gesture, OpaquePointer) -> Void)? - - /// Emitted whenever a sequence state changes. - /// - /// See [method@Gtk.Gesture.set_sequence_state] to know - /// more about the expectable sequence lifetimes. - public var sequenceStateChanged: ((Gesture, OpaquePointer, GtkEventSequenceState) -> Void)? - - /// Emitted whenever an event is handled while the gesture is recognized. - /// - /// @sequence is guaranteed to pertain to the set of active touches. - public var update: ((Gesture, OpaquePointer) -> Void)? - - public var notifyNPoints: ((Gesture, OpaquePointer) -> Void)? +addSignal(name: "begin", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.begin?(self, param0) } + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "cancel", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.cancel?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "end", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.end?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, GtkEventSequenceState, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + +addSignal(name: "sequence-state-changed", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer, param1: GtkEventSequenceState) in + guard let self = self else { return } + self.sequenceStateChanged?(self, param0, param1) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "update", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.update?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::n-points", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyNPoints?(self, param0) +} +} + + /// Emitted when the gesture is recognized. +/// +/// This means the number of touch sequences matches +/// [property@Gtk.Gesture:n-points]. +/// +/// Note: These conditions may also happen when an extra touch +/// (eg. a third touch on a 2-touches gesture) is lifted, in that +/// situation @sequence won't pertain to the current set of active +/// touches, so don't rely on this being true. +public var begin: ((Gesture, OpaquePointer) -> Void)? + +/// Emitted whenever a sequence is cancelled. +/// +/// This usually happens on active touches when +/// [method@Gtk.EventController.reset] is called on @gesture +/// (manually, due to grabs...), or the individual @sequence +/// was claimed by parent widgets' controllers (see +/// [method@Gtk.Gesture.set_sequence_state]). +/// +/// @gesture must forget everything about @sequence as in +/// response to this signal. +public var cancel: ((Gesture, OpaquePointer) -> Void)? + +/// Emitted when @gesture either stopped recognizing the event +/// sequences as something to be handled, or the number of touch +/// sequences became higher or lower than [property@Gtk.Gesture:n-points]. +/// +/// Note: @sequence might not pertain to the group of sequences that +/// were previously triggering recognition on @gesture (ie. a just +/// pressed touch sequence that exceeds [property@Gtk.Gesture:n-points]). +/// This situation may be detected by checking through +/// [method@Gtk.Gesture.handles_sequence]. +public var end: ((Gesture, OpaquePointer) -> Void)? + +/// Emitted whenever a sequence state changes. +/// +/// See [method@Gtk.Gesture.set_sequence_state] to know +/// more about the expectable sequence lifetimes. +public var sequenceStateChanged: ((Gesture, OpaquePointer, GtkEventSequenceState) -> Void)? + +/// Emitted whenever an event is handled while the gesture is recognized. +/// +/// @sequence is guaranteed to pertain to the set of active touches. +public var update: ((Gesture, OpaquePointer) -> Void)? + + +public var notifyNPoints: ((Gesture, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/GestureClick.swift b/Sources/Gtk/Generated/GestureClick.swift index f71c8f6c84..54cdd661b2 100644 --- a/Sources/Gtk/Generated/GestureClick.swift +++ b/Sources/Gtk/Generated/GestureClick.swift @@ -1,7 +1,7 @@ import CGtk /// Recognizes click gestures. -/// +/// /// It is able to recognize multiple clicks on a nearby zone, which /// can be listened for through the [signal@Gtk.GestureClick::pressed] /// signal. Whenever time or distance between clicks exceed the GTK @@ -9,83 +9,71 @@ import CGtk /// click counter is reset. open class GestureClick: GestureSingle { /// Returns a newly created `GtkGesture` that recognizes - /// single and multiple presses. - public convenience init() { - self.init( - gtk_gesture_click_new() - ) - } +/// single and multiple presses. +public convenience init() { + self.init( + gtk_gesture_click_new() + ) +} public override func registerSignals() { - super.registerSignals() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, Int, Double, Double, UnsafeMutableRawPointer) - -> Void = - { _, value1, value2, value3, data in - SignalBox3.run(data, value1, value2, value3) - } + super.registerSignals() - addSignal(name: "pressed", handler: gCallback(handler0)) { - [weak self] (param0: Int, param1: Double, param2: Double) in - guard let self = self else { return } - self.pressed?(self, param0, param1, param2) - } + let handler0: @convention(c) (UnsafeMutableRawPointer, Int, Double, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, value3, data in + SignalBox3.run(data, value1, value2, value3) + } - let handler1: - @convention(c) (UnsafeMutableRawPointer, Int, Double, Double, UnsafeMutableRawPointer) - -> Void = - { _, value1, value2, value3, data in - SignalBox3.run(data, value1, value2, value3) - } +addSignal(name: "pressed", handler: gCallback(handler0)) { [weak self] (param0: Int, param1: Double, param2: Double) in + guard let self = self else { return } + self.pressed?(self, param0, param1, param2) +} - addSignal(name: "released", handler: gCallback(handler1)) { - [weak self] (param0: Int, param1: Double, param2: Double) in - guard let self = self else { return } - self.released?(self, param0, param1, param2) - } +let handler1: @convention(c) (UnsafeMutableRawPointer, Int, Double, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, value3, data in + SignalBox3.run(data, value1, value2, value3) + } - addSignal(name: "stopped") { [weak self] () in - guard let self = self else { return } - self.stopped?(self) - } +addSignal(name: "released", handler: gCallback(handler1)) { [weak self] (param0: Int, param1: Double, param2: Double) in + guard let self = self else { return } + self.released?(self, param0, param1, param2) +} - let handler3: - @convention(c) ( - UnsafeMutableRawPointer, Double, Double, UInt, OpaquePointer, - UnsafeMutableRawPointer - ) -> Void = - { _, value1, value2, value3, value4, data in - SignalBox4.run( - data, value1, value2, value3, value4) - } +addSignal(name: "stopped") { [weak self] () in + guard let self = self else { return } + self.stopped?(self) +} - addSignal(name: "unpaired-release", handler: gCallback(handler3)) { - [weak self] (param0: Double, param1: Double, param2: UInt, param3: OpaquePointer) in - guard let self = self else { return } - self.unpairedRelease?(self, param0, param1, param2, param3) - } +let handler3: @convention(c) (UnsafeMutableRawPointer, Double, Double, UInt, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, value3, value4, data in + SignalBox4.run(data, value1, value2, value3, value4) } +addSignal(name: "unpaired-release", handler: gCallback(handler3)) { [weak self] (param0: Double, param1: Double, param2: UInt, param3: OpaquePointer) in + guard let self = self else { return } + self.unpairedRelease?(self, param0, param1, param2, param3) +} +} + /// Emitted whenever a button or touch press happens. - public var pressed: ((GestureClick, Int, Double, Double) -> Void)? +public var pressed: ((GestureClick, Int, Double, Double) -> Void)? - /// Emitted when a button or touch is released. - /// - /// @n_press will report the number of press that is paired to - /// this event, note that [signal@Gtk.GestureClick::stopped] may - /// have been emitted between the press and its release, @n_press - /// will only start over at the next press. - public var released: ((GestureClick, Int, Double, Double) -> Void)? +/// Emitted when a button or touch is released. +/// +/// @n_press will report the number of press that is paired to +/// this event, note that [signal@Gtk.GestureClick::stopped] may +/// have been emitted between the press and its release, @n_press +/// will only start over at the next press. +public var released: ((GestureClick, Int, Double, Double) -> Void)? - /// Emitted whenever any time/distance threshold has been exceeded. - public var stopped: ((GestureClick) -> Void)? +/// Emitted whenever any time/distance threshold has been exceeded. +public var stopped: ((GestureClick) -> Void)? - /// Emitted whenever the gesture receives a release - /// event that had no previous corresponding press. - /// - /// Due to implicit grabs, this can only happen on situations - /// where input is grabbed elsewhere mid-press or the pressed - /// widget voluntarily relinquishes its implicit grab. - public var unpairedRelease: ((GestureClick, Double, Double, UInt, OpaquePointer) -> Void)? -} +/// Emitted whenever the gesture receives a release +/// event that had no previous corresponding press. +/// +/// Due to implicit grabs, this can only happen on situations +/// where input is grabbed elsewhere mid-press or the pressed +/// widget voluntarily relinquishes its implicit grab. +public var unpairedRelease: ((GestureClick, Double, Double, UInt, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/GestureLongPress.swift b/Sources/Gtk/Generated/GestureLongPress.swift index ee0eaaa4df..5adcd3ef4d 100644 --- a/Sources/Gtk/Generated/GestureLongPress.swift +++ b/Sources/Gtk/Generated/GestureLongPress.swift @@ -1,72 +1,68 @@ import CGtk /// Recognizes long press gestures. -/// +/// /// This gesture is also known as “Press and Hold”. -/// +/// /// When the timeout is exceeded, the gesture is triggering the /// [signal@Gtk.GestureLongPress::pressed] signal. -/// +/// /// If the touchpoint is lifted before the timeout passes, or if /// it drifts too far of the initial press point, the /// [signal@Gtk.GestureLongPress::cancelled] signal will be emitted. -/// +/// /// How long the timeout is before the ::pressed signal gets emitted is /// determined by the [property@Gtk.Settings:gtk-long-press-time] setting. /// It can be modified by the [property@Gtk.GestureLongPress:delay-factor] /// property. open class GestureLongPress: GestureSingle { /// Returns a newly created `GtkGesture` that recognizes long presses. - public convenience init() { - self.init( - gtk_gesture_long_press_new() - ) - } +public convenience init() { + self.init( + gtk_gesture_long_press_new() + ) +} public override func registerSignals() { - super.registerSignals() - - addSignal(name: "cancelled") { [weak self] () in - guard let self = self else { return } - self.cancelled?(self) - } + super.registerSignals() - let handler1: - @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> - Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } + addSignal(name: "cancelled") { [weak self] () in + guard let self = self else { return } + self.cancelled?(self) +} - addSignal(name: "pressed", handler: gCallback(handler1)) { - [weak self] (param0: Double, param1: Double) in - guard let self = self else { return } - self.pressed?(self, param0, param1) - } +let handler1: @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } +addSignal(name: "pressed", handler: gCallback(handler1)) { [weak self] (param0: Double, param1: Double) in + guard let self = self else { return } + self.pressed?(self, param0, param1) +} - addSignal(name: "notify::delay-factor", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDelayFactor?(self, param0) - } +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::delay-factor", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDelayFactor?(self, param0) +} +} + /// Factor by which to modify the default timeout. - @GObjectProperty(named: "delay-factor") public var delayFactor: Double +@GObjectProperty(named: "delay-factor") public var delayFactor: Double - /// Emitted whenever a press moved too far, or was released - /// before [signal@Gtk.GestureLongPress::pressed] happened. - public var cancelled: ((GestureLongPress) -> Void)? +/// Emitted whenever a press moved too far, or was released +/// before [signal@Gtk.GestureLongPress::pressed] happened. +public var cancelled: ((GestureLongPress) -> Void)? - /// Emitted whenever a press goes unmoved/unreleased longer than - /// what the GTK defaults tell. - public var pressed: ((GestureLongPress, Double, Double) -> Void)? +/// Emitted whenever a press goes unmoved/unreleased longer than +/// what the GTK defaults tell. +public var pressed: ((GestureLongPress, Double, Double) -> Void)? - public var notifyDelayFactor: ((GestureLongPress, OpaquePointer) -> Void)? -} + +public var notifyDelayFactor: ((GestureLongPress, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/GestureSingle.swift b/Sources/Gtk/Generated/GestureSingle.swift index c131329c8a..8bb88f0de6 100644 --- a/Sources/Gtk/Generated/GestureSingle.swift +++ b/Sources/Gtk/Generated/GestureSingle.swift @@ -1,11 +1,11 @@ import CGtk /// A `GtkGesture` subclass optimized for singe-touch and mouse gestures. -/// +/// /// Under interaction, these gestures stick to the first interacting sequence, /// which is accessible through [method@Gtk.GestureSingle.get_current_sequence] /// while the gesture is being interacted with. -/// +/// /// By default gestures react to both %GDK_BUTTON_PRIMARY and touch events. /// [method@Gtk.GestureSingle.set_touch_only] can be used to change the /// touch behavior. Callers may also specify a different mouse button number @@ -14,61 +14,59 @@ import CGtk /// button being currently pressed can be known through /// [method@Gtk.GestureSingle.get_current_button]. open class GestureSingle: Gesture { + public override func registerSignals() { - super.registerSignals() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::button", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyButton?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::exclusive", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExclusive?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::touch-only", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTouchOnly?(self, param0) - } + super.registerSignals() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::button", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyButton?(self, param0) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::exclusive", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExclusive?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::touch-only", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTouchOnly?(self, param0) +} +} + /// Mouse button number to listen to, or 0 to listen for any button. - @GObjectProperty(named: "button") public var button: UInt +@GObjectProperty(named: "button") public var button: UInt - /// Whether the gesture is exclusive. - /// - /// Exclusive gestures only listen to pointer and pointer emulated events. - @GObjectProperty(named: "exclusive") public var exclusive: Bool +/// Whether the gesture is exclusive. +/// +/// Exclusive gestures only listen to pointer and pointer emulated events. +@GObjectProperty(named: "exclusive") public var exclusive: Bool - /// Whether the gesture handles only touch events. - @GObjectProperty(named: "touch-only") public var touchOnly: Bool +/// Whether the gesture handles only touch events. +@GObjectProperty(named: "touch-only") public var touchOnly: Bool - public var notifyButton: ((GestureSingle, OpaquePointer) -> Void)? - public var notifyExclusive: ((GestureSingle, OpaquePointer) -> Void)? +public var notifyButton: ((GestureSingle, OpaquePointer) -> Void)? - public var notifyTouchOnly: ((GestureSingle, OpaquePointer) -> Void)? -} + +public var notifyExclusive: ((GestureSingle, OpaquePointer) -> Void)? + + +public var notifyTouchOnly: ((GestureSingle, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/IconSize.swift b/Sources/Gtk/Generated/IconSize.swift index d16dd7398f..d1fb16ba73 100644 --- a/Sources/Gtk/Generated/IconSize.swift +++ b/Sources/Gtk/Generated/IconSize.swift @@ -1,10 +1,10 @@ import CGtk /// Built-in icon sizes. -/// +/// /// Icon sizes default to being inherited. Where they cannot be /// inherited, text size is the default. -/// +/// /// All widgets which use `GtkIconSize` set the normal-icons or /// large-icons style classes correspondingly, and let themes /// determine the actual size to be used with the @@ -13,24 +13,24 @@ public enum IconSize: GValueRepresentableEnum { public typealias GtkEnum = GtkIconSize /// Keep the size of the parent element - case inherit - /// Size similar to text size - case normal - /// Large size, for example in an icon view - case large +case inherit +/// Size similar to text size +case normal +/// Large size, for example in an icon view +case large public static var type: GType { - gtk_icon_size_get_type() - } + gtk_icon_size_get_type() +} public init(from gtkEnum: GtkIconSize) { switch gtkEnum { case GTK_ICON_SIZE_INHERIT: - self = .inherit - case GTK_ICON_SIZE_NORMAL: - self = .normal - case GTK_ICON_SIZE_LARGE: - self = .large + self = .inherit +case GTK_ICON_SIZE_NORMAL: + self = .normal +case GTK_ICON_SIZE_LARGE: + self = .large default: fatalError("Unsupported GtkIconSize enum value: \(gtkEnum.rawValue)") } @@ -39,11 +39,11 @@ public enum IconSize: GValueRepresentableEnum { public func toGtk() -> GtkIconSize { switch self { case .inherit: - return GTK_ICON_SIZE_INHERIT - case .normal: - return GTK_ICON_SIZE_NORMAL - case .large: - return GTK_ICON_SIZE_LARGE + return GTK_ICON_SIZE_INHERIT +case .normal: + return GTK_ICON_SIZE_NORMAL +case .large: + return GTK_ICON_SIZE_LARGE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/IconThemeError.swift b/Sources/Gtk/Generated/IconThemeError.swift index 537df0dc54..5a152db246 100644 --- a/Sources/Gtk/Generated/IconThemeError.swift +++ b/Sources/Gtk/Generated/IconThemeError.swift @@ -5,20 +5,20 @@ public enum IconThemeError: GValueRepresentableEnum { public typealias GtkEnum = GtkIconThemeError /// The icon specified does not exist in the theme - case notFound - /// An unspecified error occurred. - case failed +case notFound +/// An unspecified error occurred. +case failed public static var type: GType { - gtk_icon_theme_error_get_type() - } + gtk_icon_theme_error_get_type() +} public init(from gtkEnum: GtkIconThemeError) { switch gtkEnum { case GTK_ICON_THEME_NOT_FOUND: - self = .notFound - case GTK_ICON_THEME_FAILED: - self = .failed + self = .notFound +case GTK_ICON_THEME_FAILED: + self = .failed default: fatalError("Unsupported GtkIconThemeError enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ public enum IconThemeError: GValueRepresentableEnum { public func toGtk() -> GtkIconThemeError { switch self { case .notFound: - return GTK_ICON_THEME_NOT_FOUND - case .failed: - return GTK_ICON_THEME_FAILED + return GTK_ICON_THEME_NOT_FOUND +case .failed: + return GTK_ICON_THEME_FAILED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/IconViewDropPosition.swift b/Sources/Gtk/Generated/IconViewDropPosition.swift index b6c709f411..3f3b74fba7 100644 --- a/Sources/Gtk/Generated/IconViewDropPosition.swift +++ b/Sources/Gtk/Generated/IconViewDropPosition.swift @@ -5,36 +5,36 @@ public enum IconViewDropPosition: GValueRepresentableEnum { public typealias GtkEnum = GtkIconViewDropPosition /// No drop possible - case noDrop - /// Dropped item replaces the item - case dropInto - /// Dropped item is inserted to the left - case dropLeft - /// Dropped item is inserted to the right - case dropRight - /// Dropped item is inserted above - case dropAbove - /// Dropped item is inserted below - case dropBelow +case noDrop +/// Dropped item replaces the item +case dropInto +/// Dropped item is inserted to the left +case dropLeft +/// Dropped item is inserted to the right +case dropRight +/// Dropped item is inserted above +case dropAbove +/// Dropped item is inserted below +case dropBelow public static var type: GType { - gtk_icon_view_drop_position_get_type() - } + gtk_icon_view_drop_position_get_type() +} public init(from gtkEnum: GtkIconViewDropPosition) { switch gtkEnum { case GTK_ICON_VIEW_NO_DROP: - self = .noDrop - case GTK_ICON_VIEW_DROP_INTO: - self = .dropInto - case GTK_ICON_VIEW_DROP_LEFT: - self = .dropLeft - case GTK_ICON_VIEW_DROP_RIGHT: - self = .dropRight - case GTK_ICON_VIEW_DROP_ABOVE: - self = .dropAbove - case GTK_ICON_VIEW_DROP_BELOW: - self = .dropBelow + self = .noDrop +case GTK_ICON_VIEW_DROP_INTO: + self = .dropInto +case GTK_ICON_VIEW_DROP_LEFT: + self = .dropLeft +case GTK_ICON_VIEW_DROP_RIGHT: + self = .dropRight +case GTK_ICON_VIEW_DROP_ABOVE: + self = .dropAbove +case GTK_ICON_VIEW_DROP_BELOW: + self = .dropBelow default: fatalError("Unsupported GtkIconViewDropPosition enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ public enum IconViewDropPosition: GValueRepresentableEnum { public func toGtk() -> GtkIconViewDropPosition { switch self { case .noDrop: - return GTK_ICON_VIEW_NO_DROP - case .dropInto: - return GTK_ICON_VIEW_DROP_INTO - case .dropLeft: - return GTK_ICON_VIEW_DROP_LEFT - case .dropRight: - return GTK_ICON_VIEW_DROP_RIGHT - case .dropAbove: - return GTK_ICON_VIEW_DROP_ABOVE - case .dropBelow: - return GTK_ICON_VIEW_DROP_BELOW + return GTK_ICON_VIEW_NO_DROP +case .dropInto: + return GTK_ICON_VIEW_DROP_INTO +case .dropLeft: + return GTK_ICON_VIEW_DROP_LEFT +case .dropRight: + return GTK_ICON_VIEW_DROP_RIGHT +case .dropAbove: + return GTK_ICON_VIEW_DROP_ABOVE +case .dropBelow: + return GTK_ICON_VIEW_DROP_BELOW } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Image.swift b/Sources/Gtk/Generated/Image.swift index be138278de..c33bfbdeba 100644 --- a/Sources/Gtk/Generated/Image.swift +++ b/Sources/Gtk/Generated/Image.swift @@ -1,281 +1,272 @@ import CGtk /// Displays an image. -/// +/// /// picture>An example GtkImage -/// +/// /// Various kinds of object can be displayed as an image; most typically, /// you would load a `GdkTexture` from a file, using the convenience function /// [ctor@Gtk.Image.new_from_file], for instance: -/// +/// /// ```c /// GtkWidget *image = gtk_image_new_from_file ("myfile.png"); /// ``` -/// +/// /// If the file isn’t loaded successfully, the image will contain a /// “broken image” icon similar to that used in many web browsers. -/// +/// /// If you want to handle errors in loading the file yourself, for example /// by displaying an error message, then load the image with an image /// loading framework such as libglycin, then create the `GtkImage` with /// [ctor@Gtk.Image.new_from_paintable]. -/// +/// /// Sometimes an application will want to avoid depending on external data /// files, such as image files. See the documentation of `GResource` inside /// GIO, for details. In this case, [property@Gtk.Image:resource], /// [ctor@Gtk.Image.new_from_resource], and [method@Gtk.Image.set_from_resource] /// should be used. -/// +/// /// `GtkImage` displays its image as an icon, with a size that is determined /// by the application. See [class@Gtk.Picture] if you want to show an image /// at is actual size. -/// +/// /// ## CSS nodes -/// +/// /// `GtkImage` has a single CSS node with the name `image`. The style classes /// `.normal-icons` or `.large-icons` may appear, depending on the /// [property@Gtk.Image:icon-size] property. -/// +/// /// ## Accessibility -/// +/// /// `GtkImage` uses the [enum@Gtk.AccessibleRole.img] role. open class Image: Widget { /// Creates a new empty `GtkImage` widget. - public convenience init() { - self.init( - gtk_image_new() - ) +public convenience init() { + self.init( + gtk_image_new() + ) +} + +/// Creates a new `GtkImage` displaying the file @filename. +/// +/// If the file isn’t found or can’t be loaded, the resulting `GtkImage` +/// will display a “broken image” icon. This function never returns %NULL, +/// it always returns a valid `GtkImage` widget. +/// +/// If you need to detect failures to load the file, use an +/// image loading framework such as libglycin to load the file +/// yourself, then create the `GtkImage` from the texture. +/// +/// The storage type (see [method@Gtk.Image.get_storage_type]) +/// of the returned image is not defined, it will be whatever +/// is appropriate for displaying the file. +public convenience init(filename: String) { + self.init( + gtk_image_new_from_file(filename) + ) +} + +/// Creates a `GtkImage` displaying an icon from the current icon theme. +/// +/// If the icon name isn’t known, a “broken image” icon will be +/// displayed instead. If the current icon theme is changed, the icon +/// will be updated appropriately. +public convenience init(icon: OpaquePointer) { + self.init( + gtk_image_new_from_gicon(icon) + ) +} + +/// Creates a `GtkImage` displaying an icon from the current icon theme. +/// +/// If the icon name isn’t known, a “broken image” icon will be +/// displayed instead. If the current icon theme is changed, the icon +/// will be updated appropriately. +public convenience init(iconName: String) { + self.init( + gtk_image_new_from_icon_name(iconName) + ) +} + +/// Creates a new `GtkImage` displaying @paintable. +/// +/// The `GtkImage` does not assume a reference to the paintable; you still +/// need to unref it if you own references. `GtkImage` will add its own +/// reference rather than adopting yours. +/// +/// The `GtkImage` will track changes to the @paintable and update +/// its size and contents in response to it. +/// +/// Note that paintables are still subject to the icon size that is +/// set on the image. If you want to display a paintable at its intrinsic +/// size, use [class@Gtk.Picture] instead. +/// +/// If @paintable is a [iface@Gtk.SymbolicPaintable], then it will be +/// recolored with the symbolic palette from the theme. +public convenience init(paintable: OpaquePointer) { + self.init( + gtk_image_new_from_paintable(paintable) + ) +} + +/// Creates a new `GtkImage` displaying the resource file @resource_path. +/// +/// If the file isn’t found or can’t be loaded, the resulting `GtkImage` will +/// display a “broken image” icon. This function never returns %NULL, +/// it always returns a valid `GtkImage` widget. +/// +/// If you need to detect failures to load the file, use an +/// image loading framework such as libglycin to load the file +/// yourself, then create the `GtkImage` from the texture. +/// +/// The storage type (see [method@Gtk.Image.get_storage_type]) of +/// the returned image is not defined, it will be whatever is +/// appropriate for displaying the file. +public convenience init(resourcePath: String) { + self.init( + gtk_image_new_from_resource(resourcePath) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::file", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFile?(self, param0) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new `GtkImage` displaying the file @filename. - /// - /// If the file isn’t found or can’t be loaded, the resulting `GtkImage` - /// will display a “broken image” icon. This function never returns %NULL, - /// it always returns a valid `GtkImage` widget. - /// - /// If you need to detect failures to load the file, use an - /// image loading framework such as libglycin to load the file - /// yourself, then create the `GtkImage` from the texture. - /// - /// The storage type (see [method@Gtk.Image.get_storage_type]) - /// of the returned image is not defined, it will be whatever - /// is appropriate for displaying the file. - public convenience init(filename: String) { - self.init( - gtk_image_new_from_file(filename) - ) +addSignal(name: "notify::gicon", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyGicon?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::icon-name", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIconName?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a `GtkImage` displaying an icon from the current icon theme. - /// - /// If the icon name isn’t known, a “broken image” icon will be - /// displayed instead. If the current icon theme is changed, the icon - /// will be updated appropriately. - public convenience init(icon: OpaquePointer) { - self.init( - gtk_image_new_from_gicon(icon) - ) +addSignal(name: "notify::icon-size", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIconSize?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a `GtkImage` displaying an icon from the current icon theme. - /// - /// If the icon name isn’t known, a “broken image” icon will be - /// displayed instead. If the current icon theme is changed, the icon - /// will be updated appropriately. - public convenience init(iconName: String) { - self.init( - gtk_image_new_from_icon_name(iconName) - ) +addSignal(name: "notify::paintable", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPaintable?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new `GtkImage` displaying @paintable. - /// - /// The `GtkImage` does not assume a reference to the paintable; you still - /// need to unref it if you own references. `GtkImage` will add its own - /// reference rather than adopting yours. - /// - /// The `GtkImage` will track changes to the @paintable and update - /// its size and contents in response to it. - /// - /// Note that paintables are still subject to the icon size that is - /// set on the image. If you want to display a paintable at its intrinsic - /// size, use [class@Gtk.Picture] instead. - /// - /// If @paintable is a [iface@Gtk.SymbolicPaintable], then it will be - /// recolored with the symbolic palette from the theme. - public convenience init(paintable: OpaquePointer) { - self.init( - gtk_image_new_from_paintable(paintable) - ) +addSignal(name: "notify::pixel-size", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPixelSize?(self, param0) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new `GtkImage` displaying the resource file @resource_path. - /// - /// If the file isn’t found or can’t be loaded, the resulting `GtkImage` will - /// display a “broken image” icon. This function never returns %NULL, - /// it always returns a valid `GtkImage` widget. - /// - /// If you need to detect failures to load the file, use an - /// image loading framework such as libglycin to load the file - /// yourself, then create the `GtkImage` from the texture. - /// - /// The storage type (see [method@Gtk.Image.get_storage_type]) of - /// the returned image is not defined, it will be whatever is - /// appropriate for displaying the file. - public convenience init(resourcePath: String) { - self.init( - gtk_image_new_from_resource(resourcePath) - ) +addSignal(name: "notify::resource", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyResource?(self, param0) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::file", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFile?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::gicon", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyGicon?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::icon-name", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIconName?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::icon-size", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIconSize?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::paintable", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPaintable?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::pixel-size", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPixelSize?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::resource", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyResource?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::storage-type", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyStorageType?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-fallback", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseFallback?(self, param0) - } +addSignal(name: "notify::storage-type", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyStorageType?(self, param0) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::use-fallback", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseFallback?(self, param0) +} +} + /// The name of the icon in the icon theme. - /// - /// If the icon theme is changed, the image will be updated automatically. - @GObjectProperty(named: "icon-name") public var iconName: String? +/// +/// If the icon theme is changed, the image will be updated automatically. +@GObjectProperty(named: "icon-name") public var iconName: String? - /// The symbolic size to display icons at. - @GObjectProperty(named: "icon-size") public var iconSize: IconSize +/// The symbolic size to display icons at. +@GObjectProperty(named: "icon-size") public var iconSize: IconSize - /// The `GdkPaintable` to display. - @GObjectProperty(named: "paintable") public var paintable: OpaquePointer? +/// The `GdkPaintable` to display. +@GObjectProperty(named: "paintable") public var paintable: OpaquePointer? - /// The size in pixels to display icons at. - /// - /// If set to a value != -1, this property overrides the - /// [property@Gtk.Image:icon-size] property for images of type - /// `GTK_IMAGE_ICON_NAME`. - @GObjectProperty(named: "pixel-size") public var pixelSize: Int +/// The size in pixels to display icons at. +/// +/// If set to a value != -1, this property overrides the +/// [property@Gtk.Image:icon-size] property for images of type +/// `GTK_IMAGE_ICON_NAME`. +@GObjectProperty(named: "pixel-size") public var pixelSize: Int - /// The representation being used for image data. - @GObjectProperty(named: "storage-type") public var storageType: ImageType +/// The representation being used for image data. +@GObjectProperty(named: "storage-type") public var storageType: ImageType - public var notifyFile: ((Image, OpaquePointer) -> Void)? - public var notifyGicon: ((Image, OpaquePointer) -> Void)? +public var notifyFile: ((Image, OpaquePointer) -> Void)? - public var notifyIconName: ((Image, OpaquePointer) -> Void)? - public var notifyIconSize: ((Image, OpaquePointer) -> Void)? +public var notifyGicon: ((Image, OpaquePointer) -> Void)? - public var notifyPaintable: ((Image, OpaquePointer) -> Void)? - public var notifyPixelSize: ((Image, OpaquePointer) -> Void)? +public var notifyIconName: ((Image, OpaquePointer) -> Void)? - public var notifyResource: ((Image, OpaquePointer) -> Void)? - public var notifyStorageType: ((Image, OpaquePointer) -> Void)? +public var notifyIconSize: ((Image, OpaquePointer) -> Void)? - public var notifyUseFallback: ((Image, OpaquePointer) -> Void)? -} + +public var notifyPaintable: ((Image, OpaquePointer) -> Void)? + + +public var notifyPixelSize: ((Image, OpaquePointer) -> Void)? + + +public var notifyResource: ((Image, OpaquePointer) -> Void)? + + +public var notifyStorageType: ((Image, OpaquePointer) -> Void)? + + +public var notifyUseFallback: ((Image, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ImageType.swift b/Sources/Gtk/Generated/ImageType.swift index 1adff5b1de..f34b0ae104 100644 --- a/Sources/Gtk/Generated/ImageType.swift +++ b/Sources/Gtk/Generated/ImageType.swift @@ -1,39 +1,39 @@ import CGtk /// Describes the image data representation used by a [class@Gtk.Image]. -/// +/// /// If you want to get the image from the widget, you can only get the /// currently-stored representation; for instance, if the gtk_image_get_storage_type() /// returns %GTK_IMAGE_PAINTABLE, then you can call gtk_image_get_paintable(). -/// +/// /// For empty images, you can request any storage type (call any of the "get" /// functions), but they will all return %NULL values. public enum ImageType: GValueRepresentableEnum { public typealias GtkEnum = GtkImageType /// There is no image displayed by the widget - case empty - /// The widget contains a named icon - case iconName - /// The widget contains a `GIcon` - case gicon - /// The widget contains a `GdkPaintable` - case paintable +case empty +/// The widget contains a named icon +case iconName +/// The widget contains a `GIcon` +case gicon +/// The widget contains a `GdkPaintable` +case paintable public static var type: GType { - gtk_image_type_get_type() - } + gtk_image_type_get_type() +} public init(from gtkEnum: GtkImageType) { switch gtkEnum { case GTK_IMAGE_EMPTY: - self = .empty - case GTK_IMAGE_ICON_NAME: - self = .iconName - case GTK_IMAGE_GICON: - self = .gicon - case GTK_IMAGE_PAINTABLE: - self = .paintable + self = .empty +case GTK_IMAGE_ICON_NAME: + self = .iconName +case GTK_IMAGE_GICON: + self = .gicon +case GTK_IMAGE_PAINTABLE: + self = .paintable default: fatalError("Unsupported GtkImageType enum value: \(gtkEnum.rawValue)") } @@ -42,13 +42,13 @@ public enum ImageType: GValueRepresentableEnum { public func toGtk() -> GtkImageType { switch self { case .empty: - return GTK_IMAGE_EMPTY - case .iconName: - return GTK_IMAGE_ICON_NAME - case .gicon: - return GTK_IMAGE_GICON - case .paintable: - return GTK_IMAGE_PAINTABLE + return GTK_IMAGE_EMPTY +case .iconName: + return GTK_IMAGE_ICON_NAME +case .gicon: + return GTK_IMAGE_GICON +case .paintable: + return GTK_IMAGE_PAINTABLE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/InputPurpose.swift b/Sources/Gtk/Generated/InputPurpose.swift index c18b9b1cad..e4ac62b696 100644 --- a/Sources/Gtk/Generated/InputPurpose.swift +++ b/Sources/Gtk/Generated/InputPurpose.swift @@ -1,78 +1,78 @@ import CGtk /// Describes primary purpose of the input widget. -/// +/// /// This information is useful for on-screen keyboards and similar input /// methods to decide which keys should be presented to the user. -/// +/// /// Note that the purpose is not meant to impose a totally strict rule /// about allowed characters, and does not replace input validation. /// It is fine for an on-screen keyboard to let the user override the /// character set restriction that is expressed by the purpose. The /// application is expected to validate the entry contents, even if /// it specified a purpose. -/// +/// /// The difference between %GTK_INPUT_PURPOSE_DIGITS and /// %GTK_INPUT_PURPOSE_NUMBER is that the former accepts only digits /// while the latter also some punctuation (like commas or points, plus, /// minus) and “e” or “E” as in 3.14E+000. -/// +/// /// This enumeration may be extended in the future; input methods should /// interpret unknown values as “free form”. public enum InputPurpose: GValueRepresentableEnum { public typealias GtkEnum = GtkInputPurpose /// Allow any character - case freeForm - /// Allow only alphabetic characters - case alpha - /// Allow only digits - case digits - /// Edited field expects numbers - case number - /// Edited field expects phone number - case phone - /// Edited field expects URL - case url - /// Edited field expects email address - case email - /// Edited field expects the name of a person - case name - /// Like %GTK_INPUT_PURPOSE_FREE_FORM, but characters are hidden - case password - /// Like %GTK_INPUT_PURPOSE_DIGITS, but characters are hidden - case pin - /// Allow any character, in addition to control codes - case terminal +case freeForm +/// Allow only alphabetic characters +case alpha +/// Allow only digits +case digits +/// Edited field expects numbers +case number +/// Edited field expects phone number +case phone +/// Edited field expects URL +case url +/// Edited field expects email address +case email +/// Edited field expects the name of a person +case name +/// Like %GTK_INPUT_PURPOSE_FREE_FORM, but characters are hidden +case password +/// Like %GTK_INPUT_PURPOSE_DIGITS, but characters are hidden +case pin +/// Allow any character, in addition to control codes +case terminal public static var type: GType { - gtk_input_purpose_get_type() - } + gtk_input_purpose_get_type() +} public init(from gtkEnum: GtkInputPurpose) { switch gtkEnum { case GTK_INPUT_PURPOSE_FREE_FORM: - self = .freeForm - case GTK_INPUT_PURPOSE_ALPHA: - self = .alpha - case GTK_INPUT_PURPOSE_DIGITS: - self = .digits - case GTK_INPUT_PURPOSE_NUMBER: - self = .number - case GTK_INPUT_PURPOSE_PHONE: - self = .phone - case GTK_INPUT_PURPOSE_URL: - self = .url - case GTK_INPUT_PURPOSE_EMAIL: - self = .email - case GTK_INPUT_PURPOSE_NAME: - self = .name - case GTK_INPUT_PURPOSE_PASSWORD: - self = .password - case GTK_INPUT_PURPOSE_PIN: - self = .pin - case GTK_INPUT_PURPOSE_TERMINAL: - self = .terminal + self = .freeForm +case GTK_INPUT_PURPOSE_ALPHA: + self = .alpha +case GTK_INPUT_PURPOSE_DIGITS: + self = .digits +case GTK_INPUT_PURPOSE_NUMBER: + self = .number +case GTK_INPUT_PURPOSE_PHONE: + self = .phone +case GTK_INPUT_PURPOSE_URL: + self = .url +case GTK_INPUT_PURPOSE_EMAIL: + self = .email +case GTK_INPUT_PURPOSE_NAME: + self = .name +case GTK_INPUT_PURPOSE_PASSWORD: + self = .password +case GTK_INPUT_PURPOSE_PIN: + self = .pin +case GTK_INPUT_PURPOSE_TERMINAL: + self = .terminal default: fatalError("Unsupported GtkInputPurpose enum value: \(gtkEnum.rawValue)") } @@ -81,27 +81,27 @@ public enum InputPurpose: GValueRepresentableEnum { public func toGtk() -> GtkInputPurpose { switch self { case .freeForm: - return GTK_INPUT_PURPOSE_FREE_FORM - case .alpha: - return GTK_INPUT_PURPOSE_ALPHA - case .digits: - return GTK_INPUT_PURPOSE_DIGITS - case .number: - return GTK_INPUT_PURPOSE_NUMBER - case .phone: - return GTK_INPUT_PURPOSE_PHONE - case .url: - return GTK_INPUT_PURPOSE_URL - case .email: - return GTK_INPUT_PURPOSE_EMAIL - case .name: - return GTK_INPUT_PURPOSE_NAME - case .password: - return GTK_INPUT_PURPOSE_PASSWORD - case .pin: - return GTK_INPUT_PURPOSE_PIN - case .terminal: - return GTK_INPUT_PURPOSE_TERMINAL + return GTK_INPUT_PURPOSE_FREE_FORM +case .alpha: + return GTK_INPUT_PURPOSE_ALPHA +case .digits: + return GTK_INPUT_PURPOSE_DIGITS +case .number: + return GTK_INPUT_PURPOSE_NUMBER +case .phone: + return GTK_INPUT_PURPOSE_PHONE +case .url: + return GTK_INPUT_PURPOSE_URL +case .email: + return GTK_INPUT_PURPOSE_EMAIL +case .name: + return GTK_INPUT_PURPOSE_NAME +case .password: + return GTK_INPUT_PURPOSE_PASSWORD +case .pin: + return GTK_INPUT_PURPOSE_PIN +case .terminal: + return GTK_INPUT_PURPOSE_TERMINAL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Justification.swift b/Sources/Gtk/Generated/Justification.swift index a8d21f5f87..334fad46ff 100644 --- a/Sources/Gtk/Generated/Justification.swift +++ b/Sources/Gtk/Generated/Justification.swift @@ -5,28 +5,28 @@ public enum Justification: GValueRepresentableEnum { public typealias GtkEnum = GtkJustification /// The text is placed at the left edge of the label. - case left - /// The text is placed at the right edge of the label. - case right - /// The text is placed in the center of the label. - case center - /// The text is placed is distributed across the label. - case fill +case left +/// The text is placed at the right edge of the label. +case right +/// The text is placed in the center of the label. +case center +/// The text is placed is distributed across the label. +case fill public static var type: GType { - gtk_justification_get_type() - } + gtk_justification_get_type() +} public init(from gtkEnum: GtkJustification) { switch gtkEnum { case GTK_JUSTIFY_LEFT: - self = .left - case GTK_JUSTIFY_RIGHT: - self = .right - case GTK_JUSTIFY_CENTER: - self = .center - case GTK_JUSTIFY_FILL: - self = .fill + self = .left +case GTK_JUSTIFY_RIGHT: + self = .right +case GTK_JUSTIFY_CENTER: + self = .center +case GTK_JUSTIFY_FILL: + self = .fill default: fatalError("Unsupported GtkJustification enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum Justification: GValueRepresentableEnum { public func toGtk() -> GtkJustification { switch self { case .left: - return GTK_JUSTIFY_LEFT - case .right: - return GTK_JUSTIFY_RIGHT - case .center: - return GTK_JUSTIFY_CENTER - case .fill: - return GTK_JUSTIFY_FILL + return GTK_JUSTIFY_LEFT +case .right: + return GTK_JUSTIFY_RIGHT +case .center: + return GTK_JUSTIFY_CENTER +case .fill: + return GTK_JUSTIFY_FILL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Label.swift b/Sources/Gtk/Generated/Label.swift index f1e759cca0..0cba1191aa 100644 --- a/Sources/Gtk/Generated/Label.swift +++ b/Sources/Gtk/Generated/Label.swift @@ -1,32 +1,32 @@ import CGtk /// Displays a small amount of text. -/// +/// /// Most labels are used to label another widget (such as an [class@Entry]). -/// +/// /// An example GtkLabel -/// +/// /// ## Shortcuts and Gestures -/// +/// /// `GtkLabel` supports the following keyboard shortcuts, when the cursor is /// visible: -/// +/// /// - Shift+F10 or Menu opens the context menu. /// - Ctrl+A or Ctrl+/ /// selects all. /// - Ctrl+Shift+A or /// Ctrl+\ unselects all. -/// +/// /// Additionally, the following signals have default keybindings: -/// +/// /// - [signal@Gtk.Label::activate-current-link] /// - [signal@Gtk.Label::copy-clipboard] /// - [signal@Gtk.Label::move-cursor] -/// +/// /// ## Actions -/// +/// /// `GtkLabel` defines a set of built-in actions: -/// +/// /// - `clipboard.copy` copies the text to the clipboard. /// - `clipboard.cut` doesn't do anything, since text in labels can't be deleted. /// - `clipboard.paste` doesn't do anything, since text in labels can't be @@ -39,9 +39,9 @@ import CGtk /// deleted. /// - `selection.select-all` selects all of the text, if the label allows /// selection. -/// +/// /// ## CSS nodes -/// +/// /// ``` /// label /// ├── [selection] @@ -49,103 +49,103 @@ import CGtk /// ┊ /// ╰── [link] /// ``` -/// +/// /// `GtkLabel` has a single CSS node with the name label. A wide variety /// of style classes may be applied to labels, such as .title, .subtitle, /// .dim-label, etc. In the `GtkShortcutsWindow`, labels are used with the /// .keycap style class. -/// +/// /// If the label has a selection, it gets a subnode with name selection. -/// +/// /// If the label has links, there is one subnode per link. These subnodes /// carry the link or visited state depending on whether they have been /// visited. In this case, label node also gets a .link style class. -/// +/// /// ## GtkLabel as GtkBuildable -/// +/// /// The GtkLabel implementation of the GtkBuildable interface supports a /// custom `` element, which supports any number of `` /// elements. The `` element has attributes named “name“, “value“, /// “start“ and “end“ and allows you to specify [struct@Pango.Attribute] /// values for this label. -/// +/// /// An example of a UI definition fragment specifying Pango attributes: -/// +/// /// ```xml /// /// ``` -/// +/// /// The start and end attributes specify the range of characters to which the /// Pango attribute applies. If start and end are not specified, the attribute is /// applied to the whole text. Note that specifying ranges does not make much /// sense with translatable attributes. Use markup embedded in the translatable /// content instead. -/// +/// /// ## Accessibility -/// +/// /// `GtkLabel` uses the [enum@Gtk.AccessibleRole.label] role. -/// +/// /// ## Mnemonics -/// +/// /// Labels may contain “mnemonics”. Mnemonics are underlined characters in the /// label, used for keyboard navigation. Mnemonics are created by providing a /// string with an underscore before the mnemonic character, such as `"_File"`, /// to the functions [ctor@Gtk.Label.new_with_mnemonic] or /// [method@Gtk.Label.set_text_with_mnemonic]. -/// +/// /// Mnemonics automatically activate any activatable widget the label is /// inside, such as a [class@Gtk.Button]; if the label is not inside the /// mnemonic’s target widget, you have to tell the label about the target /// using [method@Gtk.Label.set_mnemonic_widget]. -/// +/// /// Here’s a simple example where the label is inside a button: -/// +/// /// ```c /// // Pressing Alt+H will activate this button /// GtkWidget *button = gtk_button_new (); /// GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello"); /// gtk_button_set_child (GTK_BUTTON (button), label); /// ``` -/// +/// /// There’s a convenience function to create buttons with a mnemonic label /// already inside: -/// +/// /// ```c /// // Pressing Alt+H will activate this button /// GtkWidget *button = gtk_button_new_with_mnemonic ("_Hello"); /// ``` -/// +/// /// To create a mnemonic for a widget alongside the label, such as a /// [class@Gtk.Entry], you have to point the label at the entry with /// [method@Gtk.Label.set_mnemonic_widget]: -/// +/// /// ```c /// // Pressing Alt+H will focus the entry /// GtkWidget *entry = gtk_entry_new (); /// GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello"); /// gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry); /// ``` -/// +/// /// ## Markup (styled text) -/// +/// /// To make it easy to format text in a label (changing colors, fonts, etc.), /// label text can be provided in a simple markup format: -/// +/// /// Here’s how to create a label with a small font: /// ```c /// GtkWidget *label = gtk_label_new (NULL); /// gtk_label_set_markup (GTK_LABEL (label), "Small text"); /// ``` -/// +/// /// (See the Pango manual for complete documentation] of available /// tags, [func@Pango.parse_markup]) -/// +/// /// The markup passed to [method@Gtk.Label.set_markup] must be valid XML; for example, /// literal `<`, `>` and `&` characters must be escaped as `<`, `>`, and `&`. /// If you pass text obtained from the user, file, or a network to /// [method@Gtk.Label.set_markup], you’ll want to escape it with /// [func@GLib.markup_escape_text] or [func@GLib.markup_printf_escaped]. -/// +/// /// Markup strings are just a convenient way to set the [struct@Pango.AttrList] /// on a label; [method@Gtk.Label.set_attributes] may be a simpler way to set /// attributes in some cases. Be careful though; [struct@Pango.AttrList] tends @@ -154,28 +154,28 @@ import CGtk /// to [0, `G_MAXINT`)). The reason is that specifying the `start_index` and /// `end_index` for a [struct@Pango.Attribute] requires knowledge of the exact /// string being displayed, so translations will cause problems. -/// +/// /// ## Selectable labels -/// +/// /// Labels can be made selectable with [method@Gtk.Label.set_selectable]. /// Selectable labels allow the user to copy the label contents to the /// clipboard. Only labels that contain useful-to-copy information — such /// as error messages — should be made selectable. -/// +/// /// ## Text layout -/// +/// /// A label can contain any number of paragraphs, but will have /// performance problems if it contains more than a small number. /// Paragraphs are separated by newlines or other paragraph separators /// understood by Pango. -/// +/// /// Labels can automatically wrap text if you call [method@Gtk.Label.set_wrap]. -/// +/// /// [method@Gtk.Label.set_justify] sets how the lines in a label align /// with one another. If you want to set how the label as a whole aligns /// in its available space, see the [property@Gtk.Widget:halign] and /// [property@Gtk.Widget:valign] properties. -/// +/// /// The [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] /// properties can be used to control the size allocation of ellipsized or /// wrapped labels. For ellipsizing labels, if either is specified (and less @@ -184,18 +184,18 @@ import CGtk /// width-chars is used as the minimum width, if specified, and max-width-chars /// is used as the natural width. Even if max-width-chars specified, wrapping /// labels will be rewrapped to use all of the available width. -/// +/// /// ## Links -/// +/// /// GTK supports markup for clickable hyperlinks in addition to regular Pango /// markup. The markup for links is borrowed from HTML, using the `` tag /// with “href“, “title“ and “class“ attributes. GTK renders links similar to /// the way they appear in web browsers, with colored, underlined text. The /// “title“ attribute is displayed as a tooltip on the link. The “class“ /// attribute is used as style class on the CSS node for the link. -/// +/// /// An example of inline links looks like this: -/// +/// /// ```c /// const char *text = /// "Go to the " @@ -204,481 +204,455 @@ import CGtk /// GtkWidget *label = gtk_label_new (NULL); /// gtk_label_set_markup (GTK_LABEL (label), text); /// ``` -/// +/// /// It is possible to implement custom handling for links and their tooltips /// with the [signal@Gtk.Label::activate-link] signal and the /// [method@Gtk.Label.get_current_uri] function. open class Label: Widget { /// Creates a new label with the given text inside it. - /// - /// You can pass `NULL` to get an empty label widget. - public convenience init(string: String) { - self.init( - gtk_label_new(string) - ) +/// +/// You can pass `NULL` to get an empty label widget. +public convenience init(string: String) { + self.init( + gtk_label_new(string) + ) +} + +/// Creates a new label with the given text inside it, and a mnemonic. +/// +/// If characters in @str are preceded by an underscore, they are +/// underlined. If you need a literal underscore character in a label, use +/// '__' (two underscores). The first underlined character represents a +/// keyboard accelerator called a mnemonic. The mnemonic key can be used +/// to activate another widget, chosen automatically, or explicitly using +/// [method@Gtk.Label.set_mnemonic_widget]. +/// +/// If [method@Gtk.Label.set_mnemonic_widget] is not called, then the first +/// activatable ancestor of the label will be chosen as the mnemonic +/// widget. For instance, if the label is inside a button or menu item, +/// the button or menu item will automatically become the mnemonic widget +/// and be activated by the mnemonic. +public convenience init(mnemonic string: String) { + self.init( + gtk_label_new_with_mnemonic(string) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate-current-link") { [weak self] () in + guard let self = self else { return } + self.activateCurrentLink?(self) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1>.run(data, value1) } - /// Creates a new label with the given text inside it, and a mnemonic. - /// - /// If characters in @str are preceded by an underscore, they are - /// underlined. If you need a literal underscore character in a label, use - /// '__' (two underscores). The first underlined character represents a - /// keyboard accelerator called a mnemonic. The mnemonic key can be used - /// to activate another widget, chosen automatically, or explicitly using - /// [method@Gtk.Label.set_mnemonic_widget]. - /// - /// If [method@Gtk.Label.set_mnemonic_widget] is not called, then the first - /// activatable ancestor of the label will be chosen as the mnemonic - /// widget. For instance, if the label is inside a button or menu item, - /// the button or menu item will automatically become the mnemonic widget - /// and be activated by the mnemonic. - public convenience init(mnemonic string: String) { - self.init( - gtk_label_new_with_mnemonic(string) - ) +addSignal(name: "activate-link", handler: gCallback(handler1)) { [weak self] (param0: UnsafePointer) in + guard let self = self else { return } + self.activateLink?(self, param0) +} + +addSignal(name: "copy-clipboard") { [weak self] () in + guard let self = self else { return } + self.copyClipboard?(self) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, value3, data in + SignalBox3.run(data, value1, value2, value3) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate-current-link") { [weak self] () in - guard let self = self else { return } - self.activateCurrentLink?(self) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) - -> Void = - { _, value1, data in - SignalBox1>.run(data, value1) - } - - addSignal(name: "activate-link", handler: gCallback(handler1)) { - [weak self] (param0: UnsafePointer) in - guard let self = self else { return } - self.activateLink?(self, param0) - } - - addSignal(name: "copy-clipboard") { [weak self] () in - guard let self = self else { return } - self.copyClipboard?(self) - } - - let handler3: - @convention(c) ( - UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, UnsafeMutableRawPointer - ) -> Void = - { _, value1, value2, value3, data in - SignalBox3.run(data, value1, value2, value3) - } - - addSignal(name: "move-cursor", handler: gCallback(handler3)) { - [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool) in - guard let self = self else { return } - self.moveCursor?(self, param0, param1, param2) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::attributes", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAttributes?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::ellipsize", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEllipsize?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::extra-menu", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExtraMenu?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::justify", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyJustify?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::label", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLabel?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::lines", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLines?(self, param0) - } - - let handler10: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::max-width-chars", handler: gCallback(handler10)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMaxWidthChars?(self, param0) - } - - let handler11: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::mnemonic-keyval", handler: gCallback(handler11)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMnemonicKeyval?(self, param0) - } - - let handler12: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::natural-wrap-mode", handler: gCallback(handler12)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyNaturalWrapMode?(self, param0) - } - - let handler13: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::selectable", handler: gCallback(handler13)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectable?(self, param0) - } - - let handler14: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::single-line-mode", handler: gCallback(handler14)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySingleLineMode?(self, param0) - } - - let handler15: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::tabs", handler: gCallback(handler15)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTabs?(self, param0) - } - - let handler16: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-markup", handler: gCallback(handler16)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseMarkup?(self, param0) - } - - let handler17: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-underline", handler: gCallback(handler17)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseUnderline?(self, param0) - } - - let handler18: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::width-chars", handler: gCallback(handler18)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWidthChars?(self, param0) - } - - let handler19: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::wrap", handler: gCallback(handler19)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWrap?(self, param0) - } - - let handler20: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::wrap-mode", handler: gCallback(handler20)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWrapMode?(self, param0) - } - - let handler21: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::xalign", handler: gCallback(handler21)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyXalign?(self, param0) - } - - let handler22: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::yalign", handler: gCallback(handler22)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyYalign?(self, param0) - } +addSignal(name: "move-cursor", handler: gCallback(handler3)) { [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool) in + guard let self = self else { return } + self.moveCursor?(self, param0, param1, param2) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// The alignment of the lines in the text of the label, relative to each other. - /// - /// This does *not* affect the alignment of the label within its allocation. - /// See [property@Gtk.Label:xalign] for that. - @GObjectProperty(named: "justify") public var justify: Justification - - /// The contents of the label. - /// - /// If the string contains Pango markup (see [func@Pango.parse_markup]), - /// you will have to set the [property@Gtk.Label:use-markup] property to - /// true in order for the label to display the markup attributes. See also - /// [method@Gtk.Label.set_markup] for a convenience function that sets both - /// this property and the [property@Gtk.Label:use-markup] property at the - /// same time. - /// - /// If the string contains underlines acting as mnemonics, you will have to - /// set the [property@Gtk.Label:use-underline] property to true in order - /// for the label to display them. - @GObjectProperty(named: "label") public var label: String - - /// The number of lines to which an ellipsized, wrapping label - /// should display before it gets ellipsized. This both prevents the label - /// from ellipsizing before this many lines are displayed, and limits the - /// height request of the label to this many lines. - /// - /// ::: warning - /// Setting this property has unintuitive and unfortunate consequences - /// for the minimum _width_ of the label. Specifically, if the height - /// of the label is such that it fits a smaller number of lines than - /// the value of this property, the label can not be ellipsized at all, - /// which means it must be wide enough to fit all the text fully. - /// - /// This property has no effect if the label is not wrapping or ellipsized. - /// - /// Set this property to -1 if you don't want to limit the number of lines. - @GObjectProperty(named: "lines") public var lines: Int - - /// The desired maximum width of the label, in characters. - /// - /// If this property is set to -1, the width will be calculated automatically. - /// - /// See the section on [text layout](class.Label.html#text-layout) for details - /// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] - /// determine the width of ellipsized and wrapped labels. - @GObjectProperty(named: "max-width-chars") public var maxWidthChars: Int - - /// The mnemonic accelerator key for the label. - @GObjectProperty(named: "mnemonic-keyval") public var mnemonicKeyval: UInt - - /// Whether the label text can be selected with the mouse. - @GObjectProperty(named: "selectable") public var selectable: Bool - - /// Whether the label is in single line mode. - /// - /// In single line mode, the height of the label does not depend on the - /// actual text, it is always set to ascent + descent of the font. This - /// can be an advantage in situations where resizing the label because - /// of text changes would be distracting, e.g. in a statusbar. - @GObjectProperty(named: "single-line-mode") public var singleLineMode: Bool - - /// True if the text of the label includes Pango markup. - /// - /// See [func@Pango.parse_markup]. - @GObjectProperty(named: "use-markup") public var useMarkup: Bool - - /// True if the text of the label indicates a mnemonic with an `_` - /// before the mnemonic character. - @GObjectProperty(named: "use-underline") public var useUnderline: Bool - - /// The desired width of the label, in characters. - /// - /// If this property is set to -1, the width will be calculated automatically. - /// - /// See the section on [text layout](class.Label.html#text-layout) for details - /// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] - /// determine the width of ellipsized and wrapped labels. - @GObjectProperty(named: "width-chars") public var widthChars: Int - - /// True if the label text will wrap if it gets too wide. - @GObjectProperty(named: "wrap") public var wrap: Bool - - /// The horizontal alignment of the label text inside its size allocation. - /// - /// Compare this to [property@Gtk.Widget:halign], which determines how the - /// labels size allocation is positioned in the space available for the label. - @GObjectProperty(named: "xalign") public var xalign: Float - - /// The vertical alignment of the label text inside its size allocation. - /// - /// Compare this to [property@Gtk.Widget:valign], which determines how the - /// labels size allocation is positioned in the space available for the label. - @GObjectProperty(named: "yalign") public var yalign: Float - - /// Gets emitted when the user activates a link in the label. - /// - /// The `::activate-current-link` is a [keybinding signal](class.SignalAction.html). - /// - /// Applications may also emit the signal with g_signal_emit_by_name() - /// if they need to control activation of URIs programmatically. - /// - /// The default bindings for this signal are all forms of the Enter key. - public var activateCurrentLink: ((Label) -> Void)? - - /// Gets emitted to activate a URI. - /// - /// Applications may connect to it to override the default behaviour, - /// which is to call [method@Gtk.FileLauncher.launch]. - public var activateLink: ((Label, UnsafePointer) -> Void)? - - /// Gets emitted to copy the selection to the clipboard. - /// - /// The `::copy-clipboard` signal is a [keybinding signal](class.SignalAction.html). - /// - /// The default binding for this signal is Ctrl+c. - public var copyClipboard: ((Label) -> Void)? - - /// Gets emitted when the user initiates a cursor movement. - /// - /// The `::move-cursor` signal is a [keybinding signal](class.SignalAction.html). - /// If the cursor is not visible in @entry, this signal causes the viewport to - /// be moved instead. - /// - /// Applications should not connect to it, but may emit it with - /// [func@GObject.signal_emit_by_name] if they need to control - /// the cursor programmatically. - /// - /// The default bindings for this signal come in two variants, the - /// variant with the Shift modifier extends the selection, - /// the variant without the Shift modifier does not. - /// There are too many key combinations to list them all here. - /// - /// - , , , - /// move by individual characters/lines - /// - Ctrl+, etc. move by words/paragraphs - /// - Home and End move to the ends of the buffer - public var moveCursor: ((Label, GtkMovementStep, Int, Bool) -> Void)? - - public var notifyAttributes: ((Label, OpaquePointer) -> Void)? - - public var notifyEllipsize: ((Label, OpaquePointer) -> Void)? - - public var notifyExtraMenu: ((Label, OpaquePointer) -> Void)? - - public var notifyJustify: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::attributes", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAttributes?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::ellipsize", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEllipsize?(self, param0) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::extra-menu", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExtraMenu?(self, param0) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::justify", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyJustify?(self, param0) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::label", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLabel?(self, param0) +} - public var notifyLabel: ((Label, OpaquePointer) -> Void)? - - public var notifyLines: ((Label, OpaquePointer) -> Void)? +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::lines", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLines?(self, param0) +} + +let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::max-width-chars", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMaxWidthChars?(self, param0) +} - public var notifyMaxWidthChars: ((Label, OpaquePointer) -> Void)? - - public var notifyMnemonicKeyval: ((Label, OpaquePointer) -> Void)? - - public var notifyNaturalWrapMode: ((Label, OpaquePointer) -> Void)? - - public var notifySelectable: ((Label, OpaquePointer) -> Void)? +let handler11: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySingleLineMode: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::mnemonic-keyval", handler: gCallback(handler11)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMnemonicKeyval?(self, param0) +} - public var notifyTabs: ((Label, OpaquePointer) -> Void)? +let handler12: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyUseMarkup: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::natural-wrap-mode", handler: gCallback(handler12)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyNaturalWrapMode?(self, param0) +} - public var notifyUseUnderline: ((Label, OpaquePointer) -> Void)? +let handler13: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyWidthChars: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::selectable", handler: gCallback(handler13)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectable?(self, param0) +} - public var notifyWrap: ((Label, OpaquePointer) -> Void)? +let handler14: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyWrapMode: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::single-line-mode", handler: gCallback(handler14)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySingleLineMode?(self, param0) +} - public var notifyXalign: ((Label, OpaquePointer) -> Void)? +let handler15: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyYalign: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::tabs", handler: gCallback(handler15)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTabs?(self, param0) } + +let handler16: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::use-markup", handler: gCallback(handler16)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseMarkup?(self, param0) +} + +let handler17: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::use-underline", handler: gCallback(handler17)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseUnderline?(self, param0) +} + +let handler18: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::width-chars", handler: gCallback(handler18)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWidthChars?(self, param0) +} + +let handler19: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::wrap", handler: gCallback(handler19)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWrap?(self, param0) +} + +let handler20: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::wrap-mode", handler: gCallback(handler20)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWrapMode?(self, param0) +} + +let handler21: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::xalign", handler: gCallback(handler21)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyXalign?(self, param0) +} + +let handler22: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::yalign", handler: gCallback(handler22)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyYalign?(self, param0) +} +} + + /// The alignment of the lines in the text of the label, relative to each other. +/// +/// This does *not* affect the alignment of the label within its allocation. +/// See [property@Gtk.Label:xalign] for that. +@GObjectProperty(named: "justify") public var justify: Justification + +/// The contents of the label. +/// +/// If the string contains Pango markup (see [func@Pango.parse_markup]), +/// you will have to set the [property@Gtk.Label:use-markup] property to +/// true in order for the label to display the markup attributes. See also +/// [method@Gtk.Label.set_markup] for a convenience function that sets both +/// this property and the [property@Gtk.Label:use-markup] property at the +/// same time. +/// +/// If the string contains underlines acting as mnemonics, you will have to +/// set the [property@Gtk.Label:use-underline] property to true in order +/// for the label to display them. +@GObjectProperty(named: "label") public var label: String + +/// The number of lines to which an ellipsized, wrapping label +/// should display before it gets ellipsized. This both prevents the label +/// from ellipsizing before this many lines are displayed, and limits the +/// height request of the label to this many lines. +/// +/// ::: warning +/// Setting this property has unintuitive and unfortunate consequences +/// for the minimum _width_ of the label. Specifically, if the height +/// of the label is such that it fits a smaller number of lines than +/// the value of this property, the label can not be ellipsized at all, +/// which means it must be wide enough to fit all the text fully. +/// +/// This property has no effect if the label is not wrapping or ellipsized. +/// +/// Set this property to -1 if you don't want to limit the number of lines. +@GObjectProperty(named: "lines") public var lines: Int + +/// The desired maximum width of the label, in characters. +/// +/// If this property is set to -1, the width will be calculated automatically. +/// +/// See the section on [text layout](class.Label.html#text-layout) for details +/// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] +/// determine the width of ellipsized and wrapped labels. +@GObjectProperty(named: "max-width-chars") public var maxWidthChars: Int + +/// The mnemonic accelerator key for the label. +@GObjectProperty(named: "mnemonic-keyval") public var mnemonicKeyval: UInt + +/// Whether the label text can be selected with the mouse. +@GObjectProperty(named: "selectable") public var selectable: Bool + +/// Whether the label is in single line mode. +/// +/// In single line mode, the height of the label does not depend on the +/// actual text, it is always set to ascent + descent of the font. This +/// can be an advantage in situations where resizing the label because +/// of text changes would be distracting, e.g. in a statusbar. +@GObjectProperty(named: "single-line-mode") public var singleLineMode: Bool + +/// True if the text of the label includes Pango markup. +/// +/// See [func@Pango.parse_markup]. +@GObjectProperty(named: "use-markup") public var useMarkup: Bool + +/// True if the text of the label indicates a mnemonic with an `_` +/// before the mnemonic character. +@GObjectProperty(named: "use-underline") public var useUnderline: Bool + +/// The desired width of the label, in characters. +/// +/// If this property is set to -1, the width will be calculated automatically. +/// +/// See the section on [text layout](class.Label.html#text-layout) for details +/// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] +/// determine the width of ellipsized and wrapped labels. +@GObjectProperty(named: "width-chars") public var widthChars: Int + +/// True if the label text will wrap if it gets too wide. +@GObjectProperty(named: "wrap") public var wrap: Bool + +/// The horizontal alignment of the label text inside its size allocation. +/// +/// Compare this to [property@Gtk.Widget:halign], which determines how the +/// labels size allocation is positioned in the space available for the label. +@GObjectProperty(named: "xalign") public var xalign: Float + +/// The vertical alignment of the label text inside its size allocation. +/// +/// Compare this to [property@Gtk.Widget:valign], which determines how the +/// labels size allocation is positioned in the space available for the label. +@GObjectProperty(named: "yalign") public var yalign: Float + +/// Gets emitted when the user activates a link in the label. +/// +/// The `::activate-current-link` is a [keybinding signal](class.SignalAction.html). +/// +/// Applications may also emit the signal with g_signal_emit_by_name() +/// if they need to control activation of URIs programmatically. +/// +/// The default bindings for this signal are all forms of the Enter key. +public var activateCurrentLink: ((Label) -> Void)? + +/// Gets emitted to activate a URI. +/// +/// Applications may connect to it to override the default behaviour, +/// which is to call [method@Gtk.FileLauncher.launch]. +public var activateLink: ((Label, UnsafePointer) -> Void)? + +/// Gets emitted to copy the selection to the clipboard. +/// +/// The `::copy-clipboard` signal is a [keybinding signal](class.SignalAction.html). +/// +/// The default binding for this signal is Ctrl+c. +public var copyClipboard: ((Label) -> Void)? + +/// Gets emitted when the user initiates a cursor movement. +/// +/// The `::move-cursor` signal is a [keybinding signal](class.SignalAction.html). +/// If the cursor is not visible in @entry, this signal causes the viewport to +/// be moved instead. +/// +/// Applications should not connect to it, but may emit it with +/// [func@GObject.signal_emit_by_name] if they need to control +/// the cursor programmatically. +/// +/// The default bindings for this signal come in two variants, the +/// variant with the Shift modifier extends the selection, +/// the variant without the Shift modifier does not. +/// There are too many key combinations to list them all here. +/// +/// - , , , +/// move by individual characters/lines +/// - Ctrl+, etc. move by words/paragraphs +/// - Home and End move to the ends of the buffer +public var moveCursor: ((Label, GtkMovementStep, Int, Bool) -> Void)? + + +public var notifyAttributes: ((Label, OpaquePointer) -> Void)? + + +public var notifyEllipsize: ((Label, OpaquePointer) -> Void)? + + +public var notifyExtraMenu: ((Label, OpaquePointer) -> Void)? + + +public var notifyJustify: ((Label, OpaquePointer) -> Void)? + + +public var notifyLabel: ((Label, OpaquePointer) -> Void)? + + +public var notifyLines: ((Label, OpaquePointer) -> Void)? + + +public var notifyMaxWidthChars: ((Label, OpaquePointer) -> Void)? + + +public var notifyMnemonicKeyval: ((Label, OpaquePointer) -> Void)? + + +public var notifyNaturalWrapMode: ((Label, OpaquePointer) -> Void)? + + +public var notifySelectable: ((Label, OpaquePointer) -> Void)? + + +public var notifySingleLineMode: ((Label, OpaquePointer) -> Void)? + + +public var notifyTabs: ((Label, OpaquePointer) -> Void)? + + +public var notifyUseMarkup: ((Label, OpaquePointer) -> Void)? + + +public var notifyUseUnderline: ((Label, OpaquePointer) -> Void)? + + +public var notifyWidthChars: ((Label, OpaquePointer) -> Void)? + + +public var notifyWrap: ((Label, OpaquePointer) -> Void)? + + +public var notifyWrapMode: ((Label, OpaquePointer) -> Void)? + + +public var notifyXalign: ((Label, OpaquePointer) -> Void)? + + +public var notifyYalign: ((Label, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/LevelBarMode.swift b/Sources/Gtk/Generated/LevelBarMode.swift index 999e280dea..508c23645a 100644 --- a/Sources/Gtk/Generated/LevelBarMode.swift +++ b/Sources/Gtk/Generated/LevelBarMode.swift @@ -1,27 +1,27 @@ import CGtk /// Describes how [class@LevelBar] contents should be rendered. -/// +/// /// Note that this enumeration could be extended with additional modes /// in the future. public enum LevelBarMode: GValueRepresentableEnum { public typealias GtkEnum = GtkLevelBarMode /// The bar has a continuous mode - case continuous - /// The bar has a discrete mode - case discrete +case continuous +/// The bar has a discrete mode +case discrete public static var type: GType { - gtk_level_bar_mode_get_type() - } + gtk_level_bar_mode_get_type() +} public init(from gtkEnum: GtkLevelBarMode) { switch gtkEnum { case GTK_LEVEL_BAR_MODE_CONTINUOUS: - self = .continuous - case GTK_LEVEL_BAR_MODE_DISCRETE: - self = .discrete + self = .continuous +case GTK_LEVEL_BAR_MODE_DISCRETE: + self = .discrete default: fatalError("Unsupported GtkLevelBarMode enum value: \(gtkEnum.rawValue)") } @@ -30,9 +30,9 @@ public enum LevelBarMode: GValueRepresentableEnum { public func toGtk() -> GtkLevelBarMode { switch self { case .continuous: - return GTK_LEVEL_BAR_MODE_CONTINUOUS - case .discrete: - return GTK_LEVEL_BAR_MODE_DISCRETE + return GTK_LEVEL_BAR_MODE_CONTINUOUS +case .discrete: + return GTK_LEVEL_BAR_MODE_DISCRETE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ListBox.swift b/Sources/Gtk/Generated/ListBox.swift index bc5762d6c7..f10b14d5fe 100644 --- a/Sources/Gtk/Generated/ListBox.swift +++ b/Sources/Gtk/Generated/ListBox.swift @@ -1,253 +1,233 @@ import CGtk /// Shows a vertical list. -/// +/// /// An example GtkListBox -/// +/// /// A `GtkListBox` only contains `GtkListBoxRow` children. These rows can /// by dynamically sorted and filtered, and headers can be added dynamically /// depending on the row content. It also allows keyboard and mouse navigation /// and selection like a typical list. -/// +/// /// Using `GtkListBox` is often an alternative to `GtkTreeView`, especially /// when the list contents has a more complicated layout than what is allowed /// by a `GtkCellRenderer`, or when the contents is interactive (i.e. has a /// button in it). -/// +/// /// Although a `GtkListBox` must have only `GtkListBoxRow` children, you can /// add any kind of widget to it via [method@Gtk.ListBox.prepend], /// [method@Gtk.ListBox.append] and [method@Gtk.ListBox.insert] and a /// `GtkListBoxRow` widget will automatically be inserted between the list /// and the widget. -/// +/// /// `GtkListBoxRows` can be marked as activatable or selectable. If a row is /// activatable, [signal@Gtk.ListBox::row-activated] will be emitted for it when /// the user tries to activate it. If it is selectable, the row will be marked /// as selected when the user tries to select it. -/// +/// /// # GtkListBox as GtkBuildable -/// +/// /// The `GtkListBox` implementation of the `GtkBuildable` interface supports /// setting a child as the placeholder by specifying “placeholder” as the “type” /// attribute of a `` element. See [method@Gtk.ListBox.set_placeholder] /// for info. -/// +/// /// # Shortcuts and Gestures -/// +/// /// The following signals have default keybindings: -/// +/// /// - [signal@Gtk.ListBox::move-cursor] /// - [signal@Gtk.ListBox::select-all] /// - [signal@Gtk.ListBox::toggle-cursor-row] /// - [signal@Gtk.ListBox::unselect-all] -/// +/// /// # CSS nodes -/// +/// /// ``` /// list[.separators][.rich-list][.navigation-sidebar][.boxed-list] /// ╰── row[.activatable] /// ``` -/// +/// /// `GtkListBox` uses a single CSS node named list. It may carry the .separators /// style class, when the [property@Gtk.ListBox:show-separators] property is set. /// Each `GtkListBoxRow` uses a single CSS node named row. The row nodes get the /// .activatable style class added when appropriate. -/// +/// /// It may also carry the .boxed-list style class. In this case, the list will be /// automatically surrounded by a frame and have separators. -/// +/// /// The main list node may also carry style classes to select /// the style of [list presentation](section-list-widget.html#list-styles): /// .rich-list, .navigation-sidebar or .data-table. -/// +/// /// # Accessibility -/// +/// /// `GtkListBox` uses the [enum@Gtk.AccessibleRole.list] role and `GtkListBoxRow` uses /// the [enum@Gtk.AccessibleRole.list_item] role. open class ListBox: Widget { /// Creates a new `GtkListBox` container. - public convenience init() { - self.init( - gtk_list_box_new() - ) +public convenience init() { + self.init( + gtk_list_box_new() + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate-cursor-row") { [weak self] () in + guard let self = self else { return } + self.activateCursorRow?(self) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, Bool, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, value3, value4, data in + SignalBox4.run(data, value1, value2, value3, value4) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate-cursor-row") { [weak self] () in - guard let self = self else { return } - self.activateCursorRow?(self) - } - - let handler1: - @convention(c) ( - UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, Bool, UnsafeMutableRawPointer - ) -> Void = - { _, value1, value2, value3, value4, data in - SignalBox4.run( - data, value1, value2, value3, value4) - } - - addSignal(name: "move-cursor", handler: gCallback(handler1)) { - [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool, param3: Bool) in - guard let self = self else { return } - self.moveCursor?(self, param0, param1, param2, param3) - } - - let handler2: - @convention(c) ( - UnsafeMutableRawPointer, UnsafeMutablePointer, - UnsafeMutableRawPointer - ) -> Void = - { _, value1, data in - SignalBox1>.run(data, value1) - } - - addSignal(name: "row-activated", handler: gCallback(handler2)) { - [weak self] (param0: UnsafeMutablePointer) in - guard let self = self else { return } - self.rowActivated?(self, param0) - } - - let handler3: - @convention(c) ( - UnsafeMutableRawPointer, UnsafeMutablePointer?, - UnsafeMutableRawPointer - ) -> Void = - { _, value1, data in - SignalBox1?>.run(data, value1) - } - - addSignal(name: "row-selected", handler: gCallback(handler3)) { - [weak self] (param0: UnsafeMutablePointer?) in - guard let self = self else { return } - self.rowSelected?(self, param0) - } - - addSignal(name: "selected-rows-changed") { [weak self] () in - guard let self = self else { return } - self.selectedRowsChanged?(self) - } - - addSignal(name: "toggle-cursor-row") { [weak self] () in - guard let self = self else { return } - self.toggleCursorRow?(self) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::accept-unpaired-release", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAcceptUnpairedRelease?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::activate-on-single-click", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActivateOnSingleClick?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::selection-mode", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectionMode?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::show-separators", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowSeparators?(self, param0) - } - - let handler10: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::tab-behavior", handler: gCallback(handler10)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTabBehavior?(self, param0) - } +addSignal(name: "move-cursor", handler: gCallback(handler1)) { [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool, param3: Bool) in + guard let self = self else { return } + self.moveCursor?(self, param0, param1, param2, param3) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, UnsafeMutablePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1>.run(data, value1) } - /// Determines whether children can be activated with a single - /// click, or require a double-click. - @GObjectProperty(named: "activate-on-single-click") public var activateOnSingleClick: Bool +addSignal(name: "row-activated", handler: gCallback(handler2)) { [weak self] (param0: UnsafeMutablePointer) in + guard let self = self else { return } + self.rowActivated?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, UnsafeMutablePointer?, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1?>.run(data, value1) + } - /// The selection mode used by the list box. - @GObjectProperty(named: "selection-mode") public var selectionMode: SelectionMode +addSignal(name: "row-selected", handler: gCallback(handler3)) { [weak self] (param0: UnsafeMutablePointer?) in + guard let self = self else { return } + self.rowSelected?(self, param0) +} - /// Whether to show separators between rows. - @GObjectProperty(named: "show-separators") public var showSeparators: Bool +addSignal(name: "selected-rows-changed") { [weak self] () in + guard let self = self else { return } + self.selectedRowsChanged?(self) +} - /// Emitted when the cursor row is activated. - public var activateCursorRow: ((ListBox) -> Void)? +addSignal(name: "toggle-cursor-row") { [weak self] () in + guard let self = self else { return } + self.toggleCursorRow?(self) +} - /// Emitted when the user initiates a cursor movement. - /// - /// The default bindings for this signal come in two variants, the variant with - /// the Shift modifier extends the selection, the variant without the Shift - /// modifier does not. There are too many key combinations to list them all - /// here. - /// - /// - , , , - /// move by individual children - /// - Home, End move to the ends of the box - /// - PgUp, PgDn move vertically by pages - public var moveCursor: ((ListBox, GtkMovementStep, Int, Bool, Bool) -> Void)? +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Emitted when a row has been activated by the user. - public var rowActivated: ((ListBox, UnsafeMutablePointer) -> Void)? +addSignal(name: "notify::accept-unpaired-release", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAcceptUnpairedRelease?(self, param0) +} - /// Emitted when a new row is selected, or (with a %NULL @row) - /// when the selection is cleared. - /// - /// When the @box is using %GTK_SELECTION_MULTIPLE, this signal will not - /// give you the full picture of selection changes, and you should use - /// the [signal@Gtk.ListBox::selected-rows-changed] signal instead. - public var rowSelected: ((ListBox, UnsafeMutablePointer?) -> Void)? +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Emitted when the set of selected rows changes. - public var selectedRowsChanged: ((ListBox) -> Void)? +addSignal(name: "notify::activate-on-single-click", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActivateOnSingleClick?(self, param0) +} - /// Emitted when the cursor row is toggled. - /// - /// The default bindings for this signal is Ctrl+. - public var toggleCursorRow: ((ListBox) -> Void)? +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyAcceptUnpairedRelease: ((ListBox, OpaquePointer) -> Void)? +addSignal(name: "notify::selection-mode", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectionMode?(self, param0) +} - public var notifyActivateOnSingleClick: ((ListBox, OpaquePointer) -> Void)? +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySelectionMode: ((ListBox, OpaquePointer) -> Void)? +addSignal(name: "notify::show-separators", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowSeparators?(self, param0) +} - public var notifyShowSeparators: ((ListBox, OpaquePointer) -> Void)? +let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyTabBehavior: ((ListBox, OpaquePointer) -> Void)? +addSignal(name: "notify::tab-behavior", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTabBehavior?(self, param0) +} } + + /// Determines whether children can be activated with a single +/// click, or require a double-click. +@GObjectProperty(named: "activate-on-single-click") public var activateOnSingleClick: Bool + +/// The selection mode used by the list box. +@GObjectProperty(named: "selection-mode") public var selectionMode: SelectionMode + +/// Whether to show separators between rows. +@GObjectProperty(named: "show-separators") public var showSeparators: Bool + +/// Emitted when the cursor row is activated. +public var activateCursorRow: ((ListBox) -> Void)? + +/// Emitted when the user initiates a cursor movement. +/// +/// The default bindings for this signal come in two variants, the variant with +/// the Shift modifier extends the selection, the variant without the Shift +/// modifier does not. There are too many key combinations to list them all +/// here. +/// +/// - , , , +/// move by individual children +/// - Home, End move to the ends of the box +/// - PgUp, PgDn move vertically by pages +public var moveCursor: ((ListBox, GtkMovementStep, Int, Bool, Bool) -> Void)? + +/// Emitted when a row has been activated by the user. +public var rowActivated: ((ListBox, UnsafeMutablePointer) -> Void)? + +/// Emitted when a new row is selected, or (with a %NULL @row) +/// when the selection is cleared. +/// +/// When the @box is using %GTK_SELECTION_MULTIPLE, this signal will not +/// give you the full picture of selection changes, and you should use +/// the [signal@Gtk.ListBox::selected-rows-changed] signal instead. +public var rowSelected: ((ListBox, UnsafeMutablePointer?) -> Void)? + +/// Emitted when the set of selected rows changes. +public var selectedRowsChanged: ((ListBox) -> Void)? + +/// Emitted when the cursor row is toggled. +/// +/// The default bindings for this signal is Ctrl+. +public var toggleCursorRow: ((ListBox) -> Void)? + + +public var notifyAcceptUnpairedRelease: ((ListBox, OpaquePointer) -> Void)? + + +public var notifyActivateOnSingleClick: ((ListBox, OpaquePointer) -> Void)? + + +public var notifySelectionMode: ((ListBox, OpaquePointer) -> Void)? + + +public var notifyShowSeparators: ((ListBox, OpaquePointer) -> Void)? + + +public var notifyTabBehavior: ((ListBox, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/MessageType.swift b/Sources/Gtk/Generated/MessageType.swift index f842063b16..ec25435d64 100644 --- a/Sources/Gtk/Generated/MessageType.swift +++ b/Sources/Gtk/Generated/MessageType.swift @@ -5,32 +5,32 @@ public enum MessageType: GValueRepresentableEnum { public typealias GtkEnum = GtkMessageType /// Informational message - case info - /// Non-fatal warning message - case warning - /// Question requiring a choice - case question - /// Fatal error message - case error - /// None of the above - case other +case info +/// Non-fatal warning message +case warning +/// Question requiring a choice +case question +/// Fatal error message +case error +/// None of the above +case other public static var type: GType { - gtk_message_type_get_type() - } + gtk_message_type_get_type() +} public init(from gtkEnum: GtkMessageType) { switch gtkEnum { case GTK_MESSAGE_INFO: - self = .info - case GTK_MESSAGE_WARNING: - self = .warning - case GTK_MESSAGE_QUESTION: - self = .question - case GTK_MESSAGE_ERROR: - self = .error - case GTK_MESSAGE_OTHER: - self = .other + self = .info +case GTK_MESSAGE_WARNING: + self = .warning +case GTK_MESSAGE_QUESTION: + self = .question +case GTK_MESSAGE_ERROR: + self = .error +case GTK_MESSAGE_OTHER: + self = .other default: fatalError("Unsupported GtkMessageType enum value: \(gtkEnum.rawValue)") } @@ -39,15 +39,15 @@ public enum MessageType: GValueRepresentableEnum { public func toGtk() -> GtkMessageType { switch self { case .info: - return GTK_MESSAGE_INFO - case .warning: - return GTK_MESSAGE_WARNING - case .question: - return GTK_MESSAGE_QUESTION - case .error: - return GTK_MESSAGE_ERROR - case .other: - return GTK_MESSAGE_OTHER + return GTK_MESSAGE_INFO +case .warning: + return GTK_MESSAGE_WARNING +case .question: + return GTK_MESSAGE_QUESTION +case .error: + return GTK_MESSAGE_ERROR +case .other: + return GTK_MESSAGE_OTHER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/MovementStep.swift b/Sources/Gtk/Generated/MovementStep.swift index 60162d7795..f6652e1c43 100644 --- a/Sources/Gtk/Generated/MovementStep.swift +++ b/Sources/Gtk/Generated/MovementStep.swift @@ -6,52 +6,52 @@ public enum MovementStep: GValueRepresentableEnum { public typealias GtkEnum = GtkMovementStep /// Move forward or back by graphemes - case logicalPositions - /// Move left or right by graphemes - case visualPositions - /// Move forward or back by words - case words - /// Move up or down lines (wrapped lines) - case displayLines - /// Move to either end of a line - case displayLineEnds - /// Move up or down paragraphs (newline-ended lines) - case paragraphs - /// Move to either end of a paragraph - case paragraphEnds - /// Move by pages - case pages - /// Move to ends of the buffer - case bufferEnds - /// Move horizontally by pages - case horizontalPages +case logicalPositions +/// Move left or right by graphemes +case visualPositions +/// Move forward or back by words +case words +/// Move up or down lines (wrapped lines) +case displayLines +/// Move to either end of a line +case displayLineEnds +/// Move up or down paragraphs (newline-ended lines) +case paragraphs +/// Move to either end of a paragraph +case paragraphEnds +/// Move by pages +case pages +/// Move to ends of the buffer +case bufferEnds +/// Move horizontally by pages +case horizontalPages public static var type: GType { - gtk_movement_step_get_type() - } + gtk_movement_step_get_type() +} public init(from gtkEnum: GtkMovementStep) { switch gtkEnum { case GTK_MOVEMENT_LOGICAL_POSITIONS: - self = .logicalPositions - case GTK_MOVEMENT_VISUAL_POSITIONS: - self = .visualPositions - case GTK_MOVEMENT_WORDS: - self = .words - case GTK_MOVEMENT_DISPLAY_LINES: - self = .displayLines - case GTK_MOVEMENT_DISPLAY_LINE_ENDS: - self = .displayLineEnds - case GTK_MOVEMENT_PARAGRAPHS: - self = .paragraphs - case GTK_MOVEMENT_PARAGRAPH_ENDS: - self = .paragraphEnds - case GTK_MOVEMENT_PAGES: - self = .pages - case GTK_MOVEMENT_BUFFER_ENDS: - self = .bufferEnds - case GTK_MOVEMENT_HORIZONTAL_PAGES: - self = .horizontalPages + self = .logicalPositions +case GTK_MOVEMENT_VISUAL_POSITIONS: + self = .visualPositions +case GTK_MOVEMENT_WORDS: + self = .words +case GTK_MOVEMENT_DISPLAY_LINES: + self = .displayLines +case GTK_MOVEMENT_DISPLAY_LINE_ENDS: + self = .displayLineEnds +case GTK_MOVEMENT_PARAGRAPHS: + self = .paragraphs +case GTK_MOVEMENT_PARAGRAPH_ENDS: + self = .paragraphEnds +case GTK_MOVEMENT_PAGES: + self = .pages +case GTK_MOVEMENT_BUFFER_ENDS: + self = .bufferEnds +case GTK_MOVEMENT_HORIZONTAL_PAGES: + self = .horizontalPages default: fatalError("Unsupported GtkMovementStep enum value: \(gtkEnum.rawValue)") } @@ -60,25 +60,25 @@ public enum MovementStep: GValueRepresentableEnum { public func toGtk() -> GtkMovementStep { switch self { case .logicalPositions: - return GTK_MOVEMENT_LOGICAL_POSITIONS - case .visualPositions: - return GTK_MOVEMENT_VISUAL_POSITIONS - case .words: - return GTK_MOVEMENT_WORDS - case .displayLines: - return GTK_MOVEMENT_DISPLAY_LINES - case .displayLineEnds: - return GTK_MOVEMENT_DISPLAY_LINE_ENDS - case .paragraphs: - return GTK_MOVEMENT_PARAGRAPHS - case .paragraphEnds: - return GTK_MOVEMENT_PARAGRAPH_ENDS - case .pages: - return GTK_MOVEMENT_PAGES - case .bufferEnds: - return GTK_MOVEMENT_BUFFER_ENDS - case .horizontalPages: - return GTK_MOVEMENT_HORIZONTAL_PAGES + return GTK_MOVEMENT_LOGICAL_POSITIONS +case .visualPositions: + return GTK_MOVEMENT_VISUAL_POSITIONS +case .words: + return GTK_MOVEMENT_WORDS +case .displayLines: + return GTK_MOVEMENT_DISPLAY_LINES +case .displayLineEnds: + return GTK_MOVEMENT_DISPLAY_LINE_ENDS +case .paragraphs: + return GTK_MOVEMENT_PARAGRAPHS +case .paragraphEnds: + return GTK_MOVEMENT_PARAGRAPH_ENDS +case .pages: + return GTK_MOVEMENT_PAGES +case .bufferEnds: + return GTK_MOVEMENT_BUFFER_ENDS +case .horizontalPages: + return GTK_MOVEMENT_HORIZONTAL_PAGES } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Native.swift b/Sources/Gtk/Generated/Native.swift index df37f3f405..3decd0c521 100644 --- a/Sources/Gtk/Generated/Native.swift +++ b/Sources/Gtk/Generated/Native.swift @@ -1,19 +1,21 @@ import CGtk /// An interface for widgets that have their own [class@Gdk.Surface]. -/// +/// /// The obvious example of a `GtkNative` is `GtkWindow`. -/// +/// /// Every widget that is not itself a `GtkNative` is contained in one, /// and you can get it with [method@Gtk.Widget.get_native]. -/// +/// /// To get the surface of a `GtkNative`, use [method@Gtk.Native.get_surface]. /// It is also possible to find the `GtkNative` to which a surface /// belongs, with [func@Gtk.Native.get_for_surface]. -/// +/// /// In addition to a [class@Gdk.Surface], a `GtkNative` also provides /// a [class@Gsk.Renderer] for rendering on that surface. To get the /// renderer, use [method@Gtk.Native.get_renderer]. public protocol Native: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/NativeDialog.swift b/Sources/Gtk/Generated/NativeDialog.swift index 1f7e967650..052aa5d409 100644 --- a/Sources/Gtk/Generated/NativeDialog.swift +++ b/Sources/Gtk/Generated/NativeDialog.swift @@ -1,109 +1,105 @@ import CGtk /// Base class for platform dialogs that don't use `GtkDialog`. -/// +/// /// Native dialogs are used in order to integrate better with a platform, /// by looking the same as other native applications and supporting /// platform specific features. -/// +/// /// The [class@Gtk.Dialog] functions cannot be used on such objects, /// but we need a similar API in order to drive them. The `GtkNativeDialog` /// object is an API that allows you to do this. It allows you to set /// various common properties on the dialog, as well as show and hide /// it and get a [signal@Gtk.NativeDialog::response] signal when the user /// finished with the dialog. -/// +/// /// Note that unlike `GtkDialog`, `GtkNativeDialog` objects are not /// toplevel widgets, and GTK does not keep them alive. It is your /// responsibility to keep a reference until you are done with the /// object. open class NativeDialog: GObject { + public override func registerSignals() { - super.registerSignals() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "response", handler: gCallback(handler0)) { [weak self] (param0: Int) in - guard let self = self else { return } - self.response?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::modal", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyModal?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::title", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTitle?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::transient-for", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTransientFor?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::visible", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyVisible?(self, param0) - } + super.registerSignals() + + let handler0: @convention(c) (UnsafeMutableRawPointer, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Whether the window should be modal with respect to its transient parent. - @GObjectProperty(named: "modal") public var modal: Bool +addSignal(name: "response", handler: gCallback(handler0)) { [weak self] (param0: Int) in + guard let self = self else { return } + self.response?(self, param0) +} - /// The title of the dialog window - @GObjectProperty(named: "title") public var title: String? +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Whether the window is currently visible. - @GObjectProperty(named: "visible") public var visible: Bool +addSignal(name: "notify::modal", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyModal?(self, param0) +} - /// Emitted when the user responds to the dialog. - /// - /// When this is called the dialog has been hidden. - /// - /// If you call [method@Gtk.NativeDialog.hide] before the user - /// responds to the dialog this signal will not be emitted. - public var response: ((NativeDialog, Int) -> Void)? +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyModal: ((NativeDialog, OpaquePointer) -> Void)? +addSignal(name: "notify::title", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTitle?(self, param0) +} - public var notifyTitle: ((NativeDialog, OpaquePointer) -> Void)? +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::transient-for", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTransientFor?(self, param0) +} - public var notifyTransientFor: ((NativeDialog, OpaquePointer) -> Void)? +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyVisible: ((NativeDialog, OpaquePointer) -> Void)? +addSignal(name: "notify::visible", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyVisible?(self, param0) +} } + + /// Whether the window should be modal with respect to its transient parent. +@GObjectProperty(named: "modal") public var modal: Bool + +/// The title of the dialog window +@GObjectProperty(named: "title") public var title: String? + +/// Whether the window is currently visible. +@GObjectProperty(named: "visible") public var visible: Bool + +/// Emitted when the user responds to the dialog. +/// +/// When this is called the dialog has been hidden. +/// +/// If you call [method@Gtk.NativeDialog.hide] before the user +/// responds to the dialog this signal will not be emitted. +public var response: ((NativeDialog, Int) -> Void)? + + +public var notifyModal: ((NativeDialog, OpaquePointer) -> Void)? + + +public var notifyTitle: ((NativeDialog, OpaquePointer) -> Void)? + + +public var notifyTransientFor: ((NativeDialog, OpaquePointer) -> Void)? + + +public var notifyVisible: ((NativeDialog, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/NotebookTab.swift b/Sources/Gtk/Generated/NotebookTab.swift index 3c521e29d5..ad7ee8720b 100644 --- a/Sources/Gtk/Generated/NotebookTab.swift +++ b/Sources/Gtk/Generated/NotebookTab.swift @@ -5,20 +5,20 @@ public enum NotebookTab: GValueRepresentableEnum { public typealias GtkEnum = GtkNotebookTab /// The first tab in the notebook - case first - /// The last tab in the notebook - case last +case first +/// The last tab in the notebook +case last public static var type: GType { - gtk_notebook_tab_get_type() - } + gtk_notebook_tab_get_type() +} public init(from gtkEnum: GtkNotebookTab) { switch gtkEnum { case GTK_NOTEBOOK_TAB_FIRST: - self = .first - case GTK_NOTEBOOK_TAB_LAST: - self = .last + self = .first +case GTK_NOTEBOOK_TAB_LAST: + self = .last default: fatalError("Unsupported GtkNotebookTab enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ public enum NotebookTab: GValueRepresentableEnum { public func toGtk() -> GtkNotebookTab { switch self { case .first: - return GTK_NOTEBOOK_TAB_FIRST - case .last: - return GTK_NOTEBOOK_TAB_LAST + return GTK_NOTEBOOK_TAB_FIRST +case .last: + return GTK_NOTEBOOK_TAB_LAST } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/NumberUpLayout.swift b/Sources/Gtk/Generated/NumberUpLayout.swift index 5d81e7641e..4d8fdd0b28 100644 --- a/Sources/Gtk/Generated/NumberUpLayout.swift +++ b/Sources/Gtk/Generated/NumberUpLayout.swift @@ -6,44 +6,44 @@ public enum NumberUpLayout: GValueRepresentableEnum { public typealias GtkEnum = GtkNumberUpLayout /// ![](layout-lrtb.png) - case lrtb - /// ![](layout-lrbt.png) - case lrbt - /// ![](layout-rltb.png) - case rltb - /// ![](layout-rlbt.png) - case rlbt - /// ![](layout-tblr.png) - case tblr - /// ![](layout-tbrl.png) - case tbrl - /// ![](layout-btlr.png) - case btlr - /// ![](layout-btrl.png) - case btrl +case lrtb +/// ![](layout-lrbt.png) +case lrbt +/// ![](layout-rltb.png) +case rltb +/// ![](layout-rlbt.png) +case rlbt +/// ![](layout-tblr.png) +case tblr +/// ![](layout-tbrl.png) +case tbrl +/// ![](layout-btlr.png) +case btlr +/// ![](layout-btrl.png) +case btrl public static var type: GType { - gtk_number_up_layout_get_type() - } + gtk_number_up_layout_get_type() +} public init(from gtkEnum: GtkNumberUpLayout) { switch gtkEnum { case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM: - self = .lrtb - case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP: - self = .lrbt - case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM: - self = .rltb - case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP: - self = .rlbt - case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT: - self = .tblr - case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT: - self = .tbrl - case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT: - self = .btlr - case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT: - self = .btrl + self = .lrtb +case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP: + self = .lrbt +case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM: + self = .rltb +case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP: + self = .rlbt +case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT: + self = .tblr +case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT: + self = .tbrl +case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT: + self = .btlr +case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT: + self = .btrl default: fatalError("Unsupported GtkNumberUpLayout enum value: \(gtkEnum.rawValue)") } @@ -52,21 +52,21 @@ public enum NumberUpLayout: GValueRepresentableEnum { public func toGtk() -> GtkNumberUpLayout { switch self { case .lrtb: - return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM - case .lrbt: - return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP - case .rltb: - return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM - case .rlbt: - return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP - case .tblr: - return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT - case .tbrl: - return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT - case .btlr: - return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT - case .btrl: - return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT + return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM +case .lrbt: + return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP +case .rltb: + return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM +case .rlbt: + return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP +case .tblr: + return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT +case .tbrl: + return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT +case .btlr: + return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT +case .btrl: + return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Ordering.swift b/Sources/Gtk/Generated/Ordering.swift index ac58f25c48..65bc101c37 100644 --- a/Sources/Gtk/Generated/Ordering.swift +++ b/Sources/Gtk/Generated/Ordering.swift @@ -1,7 +1,7 @@ import CGtk /// Describes the way two values can be compared. -/// +/// /// These values can be used with a [callback@GLib.CompareFunc]. However, /// a `GCompareFunc` is allowed to return any integer values. /// For converting such a value to a `GtkOrdering` value, use @@ -10,24 +10,24 @@ public enum Ordering: GValueRepresentableEnum { public typealias GtkEnum = GtkOrdering /// The first value is smaller than the second - case smaller - /// The two values are equal - case equal - /// The first value is larger than the second - case larger +case smaller +/// The two values are equal +case equal +/// The first value is larger than the second +case larger public static var type: GType { - gtk_ordering_get_type() - } + gtk_ordering_get_type() +} public init(from gtkEnum: GtkOrdering) { switch gtkEnum { case GTK_ORDERING_SMALLER: - self = .smaller - case GTK_ORDERING_EQUAL: - self = .equal - case GTK_ORDERING_LARGER: - self = .larger + self = .smaller +case GTK_ORDERING_EQUAL: + self = .equal +case GTK_ORDERING_LARGER: + self = .larger default: fatalError("Unsupported GtkOrdering enum value: \(gtkEnum.rawValue)") } @@ -36,11 +36,11 @@ public enum Ordering: GValueRepresentableEnum { public func toGtk() -> GtkOrdering { switch self { case .smaller: - return GTK_ORDERING_SMALLER - case .equal: - return GTK_ORDERING_EQUAL - case .larger: - return GTK_ORDERING_LARGER + return GTK_ORDERING_SMALLER +case .equal: + return GTK_ORDERING_EQUAL +case .larger: + return GTK_ORDERING_LARGER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Orientation.swift b/Sources/Gtk/Generated/Orientation.swift index 15d9fbac6f..e323c5d837 100644 --- a/Sources/Gtk/Generated/Orientation.swift +++ b/Sources/Gtk/Generated/Orientation.swift @@ -1,26 +1,26 @@ import CGtk /// Represents the orientation of widgets and other objects. -/// +/// /// Typical examples are [class@Box] or [class@GesturePan]. public enum Orientation: GValueRepresentableEnum { public typealias GtkEnum = GtkOrientation /// The element is in horizontal orientation. - case horizontal - /// The element is in vertical orientation. - case vertical +case horizontal +/// The element is in vertical orientation. +case vertical public static var type: GType { - gtk_orientation_get_type() - } + gtk_orientation_get_type() +} public init(from gtkEnum: GtkOrientation) { switch gtkEnum { case GTK_ORIENTATION_HORIZONTAL: - self = .horizontal - case GTK_ORIENTATION_VERTICAL: - self = .vertical + self = .horizontal +case GTK_ORIENTATION_VERTICAL: + self = .vertical default: fatalError("Unsupported GtkOrientation enum value: \(gtkEnum.rawValue)") } @@ -29,9 +29,9 @@ public enum Orientation: GValueRepresentableEnum { public func toGtk() -> GtkOrientation { switch self { case .horizontal: - return GTK_ORIENTATION_HORIZONTAL - case .vertical: - return GTK_ORIENTATION_VERTICAL + return GTK_ORIENTATION_HORIZONTAL +case .vertical: + return GTK_ORIENTATION_VERTICAL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Overflow.swift b/Sources/Gtk/Generated/Overflow.swift index d28097d9c1..ef8e4379ec 100644 --- a/Sources/Gtk/Generated/Overflow.swift +++ b/Sources/Gtk/Generated/Overflow.swift @@ -1,7 +1,7 @@ import CGtk /// Defines how content overflowing a given area should be handled. -/// +/// /// This is used in [method@Gtk.Widget.set_overflow]. The /// [property@Gtk.Widget:overflow] property is modeled after the /// CSS overflow property, but implements it only partially. @@ -9,22 +9,22 @@ public enum Overflow: GValueRepresentableEnum { public typealias GtkEnum = GtkOverflow /// No change is applied. Content is drawn at the specified - /// position. - case visible - /// Content is clipped to the bounds of the area. Content - /// outside the area is not drawn and cannot be interacted with. - case hidden +/// position. +case visible +/// Content is clipped to the bounds of the area. Content +/// outside the area is not drawn and cannot be interacted with. +case hidden public static var type: GType { - gtk_overflow_get_type() - } + gtk_overflow_get_type() +} public init(from gtkEnum: GtkOverflow) { switch gtkEnum { case GTK_OVERFLOW_VISIBLE: - self = .visible - case GTK_OVERFLOW_HIDDEN: - self = .hidden + self = .visible +case GTK_OVERFLOW_HIDDEN: + self = .hidden default: fatalError("Unsupported GtkOverflow enum value: \(gtkEnum.rawValue)") } @@ -33,9 +33,9 @@ public enum Overflow: GValueRepresentableEnum { public func toGtk() -> GtkOverflow { switch self { case .visible: - return GTK_OVERFLOW_VISIBLE - case .hidden: - return GTK_OVERFLOW_HIDDEN + return GTK_OVERFLOW_VISIBLE +case .hidden: + return GTK_OVERFLOW_HIDDEN } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PackType.swift b/Sources/Gtk/Generated/PackType.swift index 283619f764..fd74570593 100644 --- a/Sources/Gtk/Generated/PackType.swift +++ b/Sources/Gtk/Generated/PackType.swift @@ -1,26 +1,26 @@ import CGtk /// Represents the packing location of a children in its parent. -/// +/// /// See [class@WindowControls] for example. public enum PackType: GValueRepresentableEnum { public typealias GtkEnum = GtkPackType /// The child is packed into the start of the widget - case start - /// The child is packed into the end of the widget - case end +case start +/// The child is packed into the end of the widget +case end public static var type: GType { - gtk_pack_type_get_type() - } + gtk_pack_type_get_type() +} public init(from gtkEnum: GtkPackType) { switch gtkEnum { case GTK_PACK_START: - self = .start - case GTK_PACK_END: - self = .end + self = .start +case GTK_PACK_END: + self = .end default: fatalError("Unsupported GtkPackType enum value: \(gtkEnum.rawValue)") } @@ -29,9 +29,9 @@ public enum PackType: GValueRepresentableEnum { public func toGtk() -> GtkPackType { switch self { case .start: - return GTK_PACK_START - case .end: - return GTK_PACK_END + return GTK_PACK_START +case .end: + return GTK_PACK_END } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PadActionType.swift b/Sources/Gtk/Generated/PadActionType.swift index 6a6471e167..c77e3cf20f 100644 --- a/Sources/Gtk/Generated/PadActionType.swift +++ b/Sources/Gtk/Generated/PadActionType.swift @@ -5,28 +5,24 @@ public enum PadActionType: GValueRepresentableEnum { public typealias GtkEnum = GtkPadActionType /// Action is triggered by a pad button - case button - /// Action is triggered by a pad ring - case ring - /// Action is triggered by a pad strip - case strip - /// Action is triggered by a pad dial - case dial +case button +/// Action is triggered by a pad ring +case ring +/// Action is triggered by a pad strip +case strip public static var type: GType { - gtk_pad_action_type_get_type() - } + gtk_pad_action_type_get_type() +} public init(from gtkEnum: GtkPadActionType) { switch gtkEnum { case GTK_PAD_ACTION_BUTTON: - self = .button - case GTK_PAD_ACTION_RING: - self = .ring - case GTK_PAD_ACTION_STRIP: - self = .strip - case GTK_PAD_ACTION_DIAL: - self = .dial + self = .button +case GTK_PAD_ACTION_RING: + self = .ring +case GTK_PAD_ACTION_STRIP: + self = .strip default: fatalError("Unsupported GtkPadActionType enum value: \(gtkEnum.rawValue)") } @@ -35,13 +31,11 @@ public enum PadActionType: GValueRepresentableEnum { public func toGtk() -> GtkPadActionType { switch self { case .button: - return GTK_PAD_ACTION_BUTTON - case .ring: - return GTK_PAD_ACTION_RING - case .strip: - return GTK_PAD_ACTION_STRIP - case .dial: - return GTK_PAD_ACTION_DIAL + return GTK_PAD_ACTION_BUTTON +case .ring: + return GTK_PAD_ACTION_RING +case .strip: + return GTK_PAD_ACTION_STRIP } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PageOrientation.swift b/Sources/Gtk/Generated/PageOrientation.swift index c58cf50992..11056e7960 100644 --- a/Sources/Gtk/Generated/PageOrientation.swift +++ b/Sources/Gtk/Generated/PageOrientation.swift @@ -5,28 +5,28 @@ public enum PageOrientation: GValueRepresentableEnum { public typealias GtkEnum = GtkPageOrientation /// Portrait mode. - case portrait - /// Landscape mode. - case landscape - /// Reverse portrait mode. - case reversePortrait - /// Reverse landscape mode. - case reverseLandscape +case portrait +/// Landscape mode. +case landscape +/// Reverse portrait mode. +case reversePortrait +/// Reverse landscape mode. +case reverseLandscape public static var type: GType { - gtk_page_orientation_get_type() - } + gtk_page_orientation_get_type() +} public init(from gtkEnum: GtkPageOrientation) { switch gtkEnum { case GTK_PAGE_ORIENTATION_PORTRAIT: - self = .portrait - case GTK_PAGE_ORIENTATION_LANDSCAPE: - self = .landscape - case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT: - self = .reversePortrait - case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE: - self = .reverseLandscape + self = .portrait +case GTK_PAGE_ORIENTATION_LANDSCAPE: + self = .landscape +case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT: + self = .reversePortrait +case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE: + self = .reverseLandscape default: fatalError("Unsupported GtkPageOrientation enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum PageOrientation: GValueRepresentableEnum { public func toGtk() -> GtkPageOrientation { switch self { case .portrait: - return GTK_PAGE_ORIENTATION_PORTRAIT - case .landscape: - return GTK_PAGE_ORIENTATION_LANDSCAPE - case .reversePortrait: - return GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT - case .reverseLandscape: - return GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE + return GTK_PAGE_ORIENTATION_PORTRAIT +case .landscape: + return GTK_PAGE_ORIENTATION_LANDSCAPE +case .reversePortrait: + return GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT +case .reverseLandscape: + return GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PageSet.swift b/Sources/Gtk/Generated/PageSet.swift index be8ebed1e7..74cc516b41 100644 --- a/Sources/Gtk/Generated/PageSet.swift +++ b/Sources/Gtk/Generated/PageSet.swift @@ -5,24 +5,24 @@ public enum PageSet: GValueRepresentableEnum { public typealias GtkEnum = GtkPageSet /// All pages. - case all - /// Even pages. - case even - /// Odd pages. - case odd +case all +/// Even pages. +case even +/// Odd pages. +case odd public static var type: GType { - gtk_page_set_get_type() - } + gtk_page_set_get_type() +} public init(from gtkEnum: GtkPageSet) { switch gtkEnum { case GTK_PAGE_SET_ALL: - self = .all - case GTK_PAGE_SET_EVEN: - self = .even - case GTK_PAGE_SET_ODD: - self = .odd + self = .all +case GTK_PAGE_SET_EVEN: + self = .even +case GTK_PAGE_SET_ODD: + self = .odd default: fatalError("Unsupported GtkPageSet enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ public enum PageSet: GValueRepresentableEnum { public func toGtk() -> GtkPageSet { switch self { case .all: - return GTK_PAGE_SET_ALL - case .even: - return GTK_PAGE_SET_EVEN - case .odd: - return GTK_PAGE_SET_ODD + return GTK_PAGE_SET_ALL +case .even: + return GTK_PAGE_SET_EVEN +case .odd: + return GTK_PAGE_SET_ODD } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PanDirection.swift b/Sources/Gtk/Generated/PanDirection.swift index 671e76d754..6c0f476926 100644 --- a/Sources/Gtk/Generated/PanDirection.swift +++ b/Sources/Gtk/Generated/PanDirection.swift @@ -5,28 +5,28 @@ public enum PanDirection: GValueRepresentableEnum { public typealias GtkEnum = GtkPanDirection /// Panned towards the left - case left - /// Panned towards the right - case right - /// Panned upwards - case up - /// Panned downwards - case down +case left +/// Panned towards the right +case right +/// Panned upwards +case up +/// Panned downwards +case down public static var type: GType { - gtk_pan_direction_get_type() - } + gtk_pan_direction_get_type() +} public init(from gtkEnum: GtkPanDirection) { switch gtkEnum { case GTK_PAN_DIRECTION_LEFT: - self = .left - case GTK_PAN_DIRECTION_RIGHT: - self = .right - case GTK_PAN_DIRECTION_UP: - self = .up - case GTK_PAN_DIRECTION_DOWN: - self = .down + self = .left +case GTK_PAN_DIRECTION_RIGHT: + self = .right +case GTK_PAN_DIRECTION_UP: + self = .up +case GTK_PAN_DIRECTION_DOWN: + self = .down default: fatalError("Unsupported GtkPanDirection enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum PanDirection: GValueRepresentableEnum { public func toGtk() -> GtkPanDirection { switch self { case .left: - return GTK_PAN_DIRECTION_LEFT - case .right: - return GTK_PAN_DIRECTION_RIGHT - case .up: - return GTK_PAN_DIRECTION_UP - case .down: - return GTK_PAN_DIRECTION_DOWN + return GTK_PAN_DIRECTION_LEFT +case .right: + return GTK_PAN_DIRECTION_RIGHT +case .up: + return GTK_PAN_DIRECTION_UP +case .down: + return GTK_PAN_DIRECTION_DOWN } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Picture.swift b/Sources/Gtk/Generated/Picture.swift index 641cd3ecf3..b75884c0a8 100644 --- a/Sources/Gtk/Generated/Picture.swift +++ b/Sources/Gtk/Generated/Picture.swift @@ -1,34 +1,34 @@ import CGtk /// Displays a `GdkPaintable`. -/// +/// /// picture>An example GtkPicture -/// +/// /// Many convenience functions are provided to make pictures simple to use. /// For example, if you want to load an image from a file, and then display /// it, there’s a convenience function to do this: -/// +/// /// ```c /// GtkWidget *widget = gtk_picture_new_for_filename ("myfile.png"); /// ``` -/// +/// /// If the file isn’t loaded successfully, the picture will contain a /// “broken image” icon similar to that used in many web browsers. /// If you want to handle errors in loading the file yourself, /// for example by displaying an error message, then load the image with /// and image loading framework such as libglycin, then create the `GtkPicture` /// with [ctor@Gtk.Picture.new_for_paintable]. -/// +/// /// Sometimes an application will want to avoid depending on external data /// files, such as image files. See the documentation of `GResource` for details. /// In this case, [ctor@Gtk.Picture.new_for_resource] and /// [method@Gtk.Picture.set_resource] should be used. -/// +/// /// `GtkPicture` displays an image at its natural size. See [class@Gtk.Image] /// if you want to display a fixed-size image, such as an icon. -/// +/// /// ## Sizing the paintable -/// +/// /// You can influence how the paintable is displayed inside the `GtkPicture` /// by changing [property@Gtk.Picture:content-fit]. See [enum@Gtk.ContentFit] /// for details. [property@Gtk.Picture:can-shrink] can be unset to make sure @@ -38,150 +38,144 @@ import CGtk /// grow larger than the screen. And [property@Gtk.Widget:halign] and /// [property@Gtk.Widget:valign] can be used to make sure the paintable doesn't /// fill all available space but is instead displayed at its original size. -/// +/// /// ## CSS nodes -/// +/// /// `GtkPicture` has a single CSS node with the name `picture`. -/// +/// /// ## Accessibility -/// +/// /// `GtkPicture` uses the [enum@Gtk.AccessibleRole.img] role. open class Picture: Widget { /// Creates a new empty `GtkPicture` widget. - public convenience init() { - self.init( - gtk_picture_new() - ) +public convenience init() { + self.init( + gtk_picture_new() + ) +} + +/// Creates a new `GtkPicture` displaying the file @filename. +/// +/// This is a utility function that calls [ctor@Gtk.Picture.new_for_file]. +/// See that function for details. +public convenience init(filename: String) { + self.init( + gtk_picture_new_for_filename(filename) + ) +} + +/// Creates a new `GtkPicture` displaying @paintable. +/// +/// The `GtkPicture` will track changes to the @paintable and update +/// its size and contents in response to it. +public convenience init(paintable: OpaquePointer) { + self.init( + gtk_picture_new_for_paintable(paintable) + ) +} + +/// Creates a new `GtkPicture` displaying the resource at @resource_path. +/// +/// This is a utility function that calls [ctor@Gtk.Picture.new_for_file]. +/// See that function for details. +public convenience init(resourcePath: String) { + self.init( + gtk_picture_new_for_resource(resourcePath) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new `GtkPicture` displaying the file @filename. - /// - /// This is a utility function that calls [ctor@Gtk.Picture.new_for_file]. - /// See that function for details. - public convenience init(filename: String) { - self.init( - gtk_picture_new_for_filename(filename) - ) +addSignal(name: "notify::alternative-text", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAlternativeText?(self, param0) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new `GtkPicture` displaying @paintable. - /// - /// The `GtkPicture` will track changes to the @paintable and update - /// its size and contents in response to it. - public convenience init(paintable: OpaquePointer) { - self.init( - gtk_picture_new_for_paintable(paintable) - ) +addSignal(name: "notify::can-shrink", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCanShrink?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new `GtkPicture` displaying the resource at @resource_path. - /// - /// This is a utility function that calls [ctor@Gtk.Picture.new_for_file]. - /// See that function for details. - public convenience init(resourcePath: String) { - self.init( - gtk_picture_new_for_resource(resourcePath) - ) +addSignal(name: "notify::content-fit", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContentFit?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::alternative-text", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAlternativeText?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::can-shrink", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCanShrink?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::content-fit", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContentFit?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::file", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFile?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::keep-aspect-ratio", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyKeepAspectRatio?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::paintable", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPaintable?(self, param0) - } +addSignal(name: "notify::file", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFile?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::keep-aspect-ratio", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyKeepAspectRatio?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::paintable", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPaintable?(self, param0) +} +} + /// The alternative textual description for the picture. - @GObjectProperty(named: "alternative-text") public var alternativeText: String? +@GObjectProperty(named: "alternative-text") public var alternativeText: String? - /// If the `GtkPicture` can be made smaller than the natural size of its contents. - @GObjectProperty(named: "can-shrink") public var canShrink: Bool +/// If the `GtkPicture` can be made smaller than the natural size of its contents. +@GObjectProperty(named: "can-shrink") public var canShrink: Bool - /// Whether the GtkPicture will render its contents trying to preserve the aspect - /// ratio. - @GObjectProperty(named: "keep-aspect-ratio") public var keepAspectRatio: Bool +/// Whether the GtkPicture will render its contents trying to preserve the aspect +/// ratio. +@GObjectProperty(named: "keep-aspect-ratio") public var keepAspectRatio: Bool - /// The `GdkPaintable` to be displayed by this `GtkPicture`. - @GObjectProperty(named: "paintable") public var paintable: OpaquePointer? +/// The `GdkPaintable` to be displayed by this `GtkPicture`. +@GObjectProperty(named: "paintable") public var paintable: OpaquePointer? - public var notifyAlternativeText: ((Picture, OpaquePointer) -> Void)? - public var notifyCanShrink: ((Picture, OpaquePointer) -> Void)? +public var notifyAlternativeText: ((Picture, OpaquePointer) -> Void)? - public var notifyContentFit: ((Picture, OpaquePointer) -> Void)? - public var notifyFile: ((Picture, OpaquePointer) -> Void)? +public var notifyCanShrink: ((Picture, OpaquePointer) -> Void)? - public var notifyKeepAspectRatio: ((Picture, OpaquePointer) -> Void)? - public var notifyPaintable: ((Picture, OpaquePointer) -> Void)? -} +public var notifyContentFit: ((Picture, OpaquePointer) -> Void)? + + +public var notifyFile: ((Picture, OpaquePointer) -> Void)? + + +public var notifyKeepAspectRatio: ((Picture, OpaquePointer) -> Void)? + + +public var notifyPaintable: ((Picture, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PolicyType.swift b/Sources/Gtk/Generated/PolicyType.swift index 6c8b2f3718..723782bc54 100644 --- a/Sources/Gtk/Generated/PolicyType.swift +++ b/Sources/Gtk/Generated/PolicyType.swift @@ -6,33 +6,33 @@ public enum PolicyType: GValueRepresentableEnum { public typealias GtkEnum = GtkPolicyType /// The scrollbar is always visible. The view size is - /// independent of the content. - case always - /// The scrollbar will appear and disappear as necessary. - /// For example, when all of a `GtkTreeView` can not be seen. - case automatic - /// The scrollbar should never appear. In this mode the - /// content determines the size. - case never - /// Don't show a scrollbar, but don't force the - /// size to follow the content. This can be used e.g. to make multiple - /// scrolled windows share a scrollbar. - case external +/// independent of the content. +case always +/// The scrollbar will appear and disappear as necessary. +/// For example, when all of a `GtkTreeView` can not be seen. +case automatic +/// The scrollbar should never appear. In this mode the +/// content determines the size. +case never +/// Don't show a scrollbar, but don't force the +/// size to follow the content. This can be used e.g. to make multiple +/// scrolled windows share a scrollbar. +case external public static var type: GType { - gtk_policy_type_get_type() - } + gtk_policy_type_get_type() +} public init(from gtkEnum: GtkPolicyType) { switch gtkEnum { case GTK_POLICY_ALWAYS: - self = .always - case GTK_POLICY_AUTOMATIC: - self = .automatic - case GTK_POLICY_NEVER: - self = .never - case GTK_POLICY_EXTERNAL: - self = .external + self = .always +case GTK_POLICY_AUTOMATIC: + self = .automatic +case GTK_POLICY_NEVER: + self = .never +case GTK_POLICY_EXTERNAL: + self = .external default: fatalError("Unsupported GtkPolicyType enum value: \(gtkEnum.rawValue)") } @@ -41,13 +41,13 @@ public enum PolicyType: GValueRepresentableEnum { public func toGtk() -> GtkPolicyType { switch self { case .always: - return GTK_POLICY_ALWAYS - case .automatic: - return GTK_POLICY_AUTOMATIC - case .never: - return GTK_POLICY_NEVER - case .external: - return GTK_POLICY_EXTERNAL + return GTK_POLICY_ALWAYS +case .automatic: + return GTK_POLICY_AUTOMATIC +case .never: + return GTK_POLICY_NEVER +case .external: + return GTK_POLICY_EXTERNAL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Popover.swift b/Sources/Gtk/Generated/Popover.swift index 0a68d9b281..7095c5824c 100644 --- a/Sources/Gtk/Generated/Popover.swift +++ b/Sources/Gtk/Generated/Popover.swift @@ -1,9 +1,9 @@ import CGtk /// Presents a bubble-like popup. -/// +/// /// An example GtkPopover -/// +/// /// It is primarily meant to provide context-dependent information /// or options. Popovers are attached to a parent widget. The parent widget /// must support popover children, as [class@Gtk.MenuButton] and @@ -11,62 +11,62 @@ import CGtk /// has an attached popover, you need to call [method@Gtk.Popover.present] /// in your [vfunc@Gtk.Widget.size_allocate] vfunc, in order to update the /// positioning of the popover. -/// +/// /// The position of a popover relative to the widget it is attached to /// can also be changed with [method@Gtk.Popover.set_position]. By default, /// it points to the whole widget area, but it can be made to point to /// a specific area using [method@Gtk.Popover.set_pointing_to]. -/// +/// /// By default, `GtkPopover` performs a grab, in order to ensure input /// events get redirected to it while it is shown, and also so the popover /// is dismissed in the expected situations (clicks outside the popover, /// or the Escape key being pressed). If no such modal behavior is desired /// on a popover, [method@Gtk.Popover.set_autohide] may be called on it to /// tweak its behavior. -/// +/// /// ## GtkPopover as menu replacement -/// +/// /// `GtkPopover` is often used to replace menus. The best way to do this /// is to use the [class@Gtk.PopoverMenu] subclass which supports being /// populated from a `GMenuModel` with [ctor@Gtk.PopoverMenu.new_from_model]. -/// +/// /// ```xml ///
horizontal-buttonsCutapp.cutedit-cut-symbolicCopyapp.copyedit-copy-symbolicPasteapp.pasteedit-paste-symbolic
/// ``` -/// +/// /// # Shortcuts and Gestures -/// +/// /// `GtkPopover` supports the following keyboard shortcuts: -/// +/// /// - Escape closes the popover. /// - Alt makes the mnemonics visible. -/// +/// /// The following signals have default keybindings: -/// +/// /// - [signal@Gtk.Popover::activate-default] -/// +/// /// # CSS nodes -/// +/// /// ``` /// popover.background[.menu] /// ├── arrow /// ╰── contents /// ╰── /// ``` -/// +/// /// `GtkPopover` has a main node with name `popover`, an arrow with name `arrow`, /// and another node for the content named `contents`. The `popover` node always /// gets the `.background` style class. It also gets the `.menu` style class /// if the popover is menu-like, e.g. is a [class@Gtk.PopoverMenu]. -/// +/// /// Particular uses of `GtkPopover`, such as touch selection popups or /// magnifiers in `GtkEntry` or `GtkTextView` get style classes like /// `.touch-selection` or `.magnifier` to differentiate from plain popovers. -/// +/// /// When styling a popover directly, the `popover` node should usually /// not have any background. The visible part of the popover can have /// a shadow. To specify it in CSS, set the box-shadow of the `contents` node. -/// +/// /// Note that, in order to accomplish appropriate arrow visuals, `GtkPopover` /// uses custom drawing for the `arrow` node. This makes it possible for the /// arrow to change its shape dynamically, but it also limits the possibilities @@ -78,162 +78,154 @@ import CGtk /// used) and no box-shadow. open class Popover: Widget, Native, ShortcutManager { /// Creates a new `GtkPopover`. - public convenience init() { - self.init( - gtk_popover_new() - ) +public convenience init() { + self.init( + gtk_popover_new() + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate-default") { [weak self] () in + guard let self = self else { return } + self.activateDefault?(self) +} + +addSignal(name: "closed") { [weak self] () in + guard let self = self else { return } + self.closed?(self) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate-default") { [weak self] () in - guard let self = self else { return } - self.activateDefault?(self) - } - - addSignal(name: "closed") { [weak self] () in - guard let self = self else { return } - self.closed?(self) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::autohide", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAutohide?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::cascade-popdown", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCascadePopdown?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::child", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyChild?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::default-widget", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDefaultWidget?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::has-arrow", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasArrow?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::mnemonics-visible", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMnemonicsVisible?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::pointing-to", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPointingTo?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::position", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPosition?(self, param0) - } +addSignal(name: "notify::autohide", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAutohide?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::cascade-popdown", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCascadePopdown?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::child", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyChild?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::default-widget", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDefaultWidget?(self, param0) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::has-arrow", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasArrow?(self, param0) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::mnemonics-visible", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMnemonicsVisible?(self, param0) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::pointing-to", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPointingTo?(self, param0) +} + +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::position", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPosition?(self, param0) +} +} + /// Whether to dismiss the popover on outside clicks. - @GObjectProperty(named: "autohide") public var autohide: Bool +@GObjectProperty(named: "autohide") public var autohide: Bool - /// Whether the popover pops down after a child popover. - /// - /// This is used to implement the expected behavior of submenus. - @GObjectProperty(named: "cascade-popdown") public var cascadePopdown: Bool +/// Whether the popover pops down after a child popover. +/// +/// This is used to implement the expected behavior of submenus. +@GObjectProperty(named: "cascade-popdown") public var cascadePopdown: Bool - /// Whether to draw an arrow. - @GObjectProperty(named: "has-arrow") public var hasArrow: Bool +/// Whether to draw an arrow. +@GObjectProperty(named: "has-arrow") public var hasArrow: Bool - /// Whether mnemonics are currently visible in this popover. - @GObjectProperty(named: "mnemonics-visible") public var mnemonicsVisible: Bool +/// Whether mnemonics are currently visible in this popover. +@GObjectProperty(named: "mnemonics-visible") public var mnemonicsVisible: Bool - /// How to place the popover, relative to its parent. - @GObjectProperty(named: "position") public var position: PositionType +/// How to place the popover, relative to its parent. +@GObjectProperty(named: "position") public var position: PositionType - /// Emitted whend the user activates the default widget. - /// - /// This is a [keybinding signal](class.SignalAction.html). - /// - /// The default binding for this signal is Enter. - public var activateDefault: ((Popover) -> Void)? +/// Emitted whend the user activates the default widget. +/// +/// This is a [keybinding signal](class.SignalAction.html). +/// +/// The default binding for this signal is Enter. +public var activateDefault: ((Popover) -> Void)? - /// Emitted when the popover is closed. - public var closed: ((Popover) -> Void)? +/// Emitted when the popover is closed. +public var closed: ((Popover) -> Void)? - public var notifyAutohide: ((Popover, OpaquePointer) -> Void)? - public var notifyCascadePopdown: ((Popover, OpaquePointer) -> Void)? +public var notifyAutohide: ((Popover, OpaquePointer) -> Void)? - public var notifyChild: ((Popover, OpaquePointer) -> Void)? - public var notifyDefaultWidget: ((Popover, OpaquePointer) -> Void)? +public var notifyCascadePopdown: ((Popover, OpaquePointer) -> Void)? - public var notifyHasArrow: ((Popover, OpaquePointer) -> Void)? - public var notifyMnemonicsVisible: ((Popover, OpaquePointer) -> Void)? +public var notifyChild: ((Popover, OpaquePointer) -> Void)? - public var notifyPointingTo: ((Popover, OpaquePointer) -> Void)? - public var notifyPosition: ((Popover, OpaquePointer) -> Void)? -} +public var notifyDefaultWidget: ((Popover, OpaquePointer) -> Void)? + + +public var notifyHasArrow: ((Popover, OpaquePointer) -> Void)? + + +public var notifyMnemonicsVisible: ((Popover, OpaquePointer) -> Void)? + + +public var notifyPointingTo: ((Popover, OpaquePointer) -> Void)? + + +public var notifyPosition: ((Popover, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PositionType.swift b/Sources/Gtk/Generated/PositionType.swift index cd0c7bcd4e..1ae80235e0 100644 --- a/Sources/Gtk/Generated/PositionType.swift +++ b/Sources/Gtk/Generated/PositionType.swift @@ -1,35 +1,35 @@ import CGtk /// Describes which edge of a widget a certain feature is positioned at. -/// +/// /// For examples, see the tabs of a [class@Notebook], or the label /// of a [class@Scale]. public enum PositionType: GValueRepresentableEnum { public typealias GtkEnum = GtkPositionType /// The feature is at the left edge. - case left - /// The feature is at the right edge. - case right - /// The feature is at the top edge. - case top - /// The feature is at the bottom edge. - case bottom +case left +/// The feature is at the right edge. +case right +/// The feature is at the top edge. +case top +/// The feature is at the bottom edge. +case bottom public static var type: GType { - gtk_position_type_get_type() - } + gtk_position_type_get_type() +} public init(from gtkEnum: GtkPositionType) { switch gtkEnum { case GTK_POS_LEFT: - self = .left - case GTK_POS_RIGHT: - self = .right - case GTK_POS_TOP: - self = .top - case GTK_POS_BOTTOM: - self = .bottom + self = .left +case GTK_POS_RIGHT: + self = .right +case GTK_POS_TOP: + self = .top +case GTK_POS_BOTTOM: + self = .bottom default: fatalError("Unsupported GtkPositionType enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ public enum PositionType: GValueRepresentableEnum { public func toGtk() -> GtkPositionType { switch self { case .left: - return GTK_POS_LEFT - case .right: - return GTK_POS_RIGHT - case .top: - return GTK_POS_TOP - case .bottom: - return GTK_POS_BOTTOM + return GTK_POS_LEFT +case .right: + return GTK_POS_RIGHT +case .top: + return GTK_POS_TOP +case .bottom: + return GTK_POS_BOTTOM } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PrintDuplex.swift b/Sources/Gtk/Generated/PrintDuplex.swift index fdf4854f27..8d59014fc4 100644 --- a/Sources/Gtk/Generated/PrintDuplex.swift +++ b/Sources/Gtk/Generated/PrintDuplex.swift @@ -5,24 +5,24 @@ public enum PrintDuplex: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintDuplex /// No duplex. - case simplex - /// Horizontal duplex. - case horizontal - /// Vertical duplex. - case vertical +case simplex +/// Horizontal duplex. +case horizontal +/// Vertical duplex. +case vertical public static var type: GType { - gtk_print_duplex_get_type() - } + gtk_print_duplex_get_type() +} public init(from gtkEnum: GtkPrintDuplex) { switch gtkEnum { case GTK_PRINT_DUPLEX_SIMPLEX: - self = .simplex - case GTK_PRINT_DUPLEX_HORIZONTAL: - self = .horizontal - case GTK_PRINT_DUPLEX_VERTICAL: - self = .vertical + self = .simplex +case GTK_PRINT_DUPLEX_HORIZONTAL: + self = .horizontal +case GTK_PRINT_DUPLEX_VERTICAL: + self = .vertical default: fatalError("Unsupported GtkPrintDuplex enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ public enum PrintDuplex: GValueRepresentableEnum { public func toGtk() -> GtkPrintDuplex { switch self { case .simplex: - return GTK_PRINT_DUPLEX_SIMPLEX - case .horizontal: - return GTK_PRINT_DUPLEX_HORIZONTAL - case .vertical: - return GTK_PRINT_DUPLEX_VERTICAL + return GTK_PRINT_DUPLEX_SIMPLEX +case .horizontal: + return GTK_PRINT_DUPLEX_HORIZONTAL +case .vertical: + return GTK_PRINT_DUPLEX_VERTICAL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PrintError.swift b/Sources/Gtk/Generated/PrintError.swift index c4397c6f19..b61a09f4ab 100644 --- a/Sources/Gtk/Generated/PrintError.swift +++ b/Sources/Gtk/Generated/PrintError.swift @@ -6,29 +6,29 @@ public enum PrintError: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintError /// An unspecified error occurred. - case general - /// An internal error occurred. - case internalError - /// A memory allocation failed. - case nomem - /// An error occurred while loading a page setup - /// or paper size from a key file. - case invalidFile +case general +/// An internal error occurred. +case internalError +/// A memory allocation failed. +case nomem +/// An error occurred while loading a page setup +/// or paper size from a key file. +case invalidFile public static var type: GType { - gtk_print_error_get_type() - } + gtk_print_error_get_type() +} public init(from gtkEnum: GtkPrintError) { switch gtkEnum { case GTK_PRINT_ERROR_GENERAL: - self = .general - case GTK_PRINT_ERROR_INTERNAL_ERROR: - self = .internalError - case GTK_PRINT_ERROR_NOMEM: - self = .nomem - case GTK_PRINT_ERROR_INVALID_FILE: - self = .invalidFile + self = .general +case GTK_PRINT_ERROR_INTERNAL_ERROR: + self = .internalError +case GTK_PRINT_ERROR_NOMEM: + self = .nomem +case GTK_PRINT_ERROR_INVALID_FILE: + self = .invalidFile default: fatalError("Unsupported GtkPrintError enum value: \(gtkEnum.rawValue)") } @@ -37,13 +37,13 @@ public enum PrintError: GValueRepresentableEnum { public func toGtk() -> GtkPrintError { switch self { case .general: - return GTK_PRINT_ERROR_GENERAL - case .internalError: - return GTK_PRINT_ERROR_INTERNAL_ERROR - case .nomem: - return GTK_PRINT_ERROR_NOMEM - case .invalidFile: - return GTK_PRINT_ERROR_INVALID_FILE + return GTK_PRINT_ERROR_GENERAL +case .internalError: + return GTK_PRINT_ERROR_INTERNAL_ERROR +case .nomem: + return GTK_PRINT_ERROR_NOMEM +case .invalidFile: + return GTK_PRINT_ERROR_INVALID_FILE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PrintOperationAction.swift b/Sources/Gtk/Generated/PrintOperationAction.swift index dc3be60a12..3c4579d6cd 100644 --- a/Sources/Gtk/Generated/PrintOperationAction.swift +++ b/Sources/Gtk/Generated/PrintOperationAction.swift @@ -1,37 +1,37 @@ import CGtk /// Determines what action the print operation should perform. -/// +/// /// A parameter of this typs is passed to [method@Gtk.PrintOperation.run]. public enum PrintOperationAction: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintOperationAction /// Show the print dialog. - case printDialog - /// Start to print without showing - /// the print dialog, based on the current print settings, if possible. - /// Depending on the platform, a print dialog might appear anyway. - case print - /// Show the print preview. - case preview - /// Export to a file. This requires - /// the export-filename property to be set. - case export +case printDialog +/// Start to print without showing +/// the print dialog, based on the current print settings, if possible. +/// Depending on the platform, a print dialog might appear anyway. +case print +/// Show the print preview. +case preview +/// Export to a file. This requires +/// the export-filename property to be set. +case export public static var type: GType { - gtk_print_operation_action_get_type() - } + gtk_print_operation_action_get_type() +} public init(from gtkEnum: GtkPrintOperationAction) { switch gtkEnum { case GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG: - self = .printDialog - case GTK_PRINT_OPERATION_ACTION_PRINT: - self = .print - case GTK_PRINT_OPERATION_ACTION_PREVIEW: - self = .preview - case GTK_PRINT_OPERATION_ACTION_EXPORT: - self = .export + self = .printDialog +case GTK_PRINT_OPERATION_ACTION_PRINT: + self = .print +case GTK_PRINT_OPERATION_ACTION_PREVIEW: + self = .preview +case GTK_PRINT_OPERATION_ACTION_EXPORT: + self = .export default: fatalError("Unsupported GtkPrintOperationAction enum value: \(gtkEnum.rawValue)") } @@ -40,13 +40,13 @@ public enum PrintOperationAction: GValueRepresentableEnum { public func toGtk() -> GtkPrintOperationAction { switch self { case .printDialog: - return GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG - case .print: - return GTK_PRINT_OPERATION_ACTION_PRINT - case .preview: - return GTK_PRINT_OPERATION_ACTION_PREVIEW - case .export: - return GTK_PRINT_OPERATION_ACTION_EXPORT + return GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG +case .print: + return GTK_PRINT_OPERATION_ACTION_PRINT +case .preview: + return GTK_PRINT_OPERATION_ACTION_PREVIEW +case .export: + return GTK_PRINT_OPERATION_ACTION_EXPORT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PrintOperationResult.swift b/Sources/Gtk/Generated/PrintOperationResult.swift index 07a29bb38e..46bf28eb4d 100644 --- a/Sources/Gtk/Generated/PrintOperationResult.swift +++ b/Sources/Gtk/Generated/PrintOperationResult.swift @@ -1,36 +1,36 @@ import CGtk /// The result of a print operation. -/// +/// /// A value of this type is returned by [method@Gtk.PrintOperation.run]. public enum PrintOperationResult: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintOperationResult /// An error has occurred. - case error - /// The print settings should be stored. - case apply - /// The print operation has been canceled, - /// the print settings should not be stored. - case cancel - /// The print operation is not complete - /// yet. This value will only be returned when running asynchronously. - case inProgress +case error +/// The print settings should be stored. +case apply +/// The print operation has been canceled, +/// the print settings should not be stored. +case cancel +/// The print operation is not complete +/// yet. This value will only be returned when running asynchronously. +case inProgress public static var type: GType { - gtk_print_operation_result_get_type() - } + gtk_print_operation_result_get_type() +} public init(from gtkEnum: GtkPrintOperationResult) { switch gtkEnum { case GTK_PRINT_OPERATION_RESULT_ERROR: - self = .error - case GTK_PRINT_OPERATION_RESULT_APPLY: - self = .apply - case GTK_PRINT_OPERATION_RESULT_CANCEL: - self = .cancel - case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS: - self = .inProgress + self = .error +case GTK_PRINT_OPERATION_RESULT_APPLY: + self = .apply +case GTK_PRINT_OPERATION_RESULT_CANCEL: + self = .cancel +case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS: + self = .inProgress default: fatalError("Unsupported GtkPrintOperationResult enum value: \(gtkEnum.rawValue)") } @@ -39,13 +39,13 @@ public enum PrintOperationResult: GValueRepresentableEnum { public func toGtk() -> GtkPrintOperationResult { switch self { case .error: - return GTK_PRINT_OPERATION_RESULT_ERROR - case .apply: - return GTK_PRINT_OPERATION_RESULT_APPLY - case .cancel: - return GTK_PRINT_OPERATION_RESULT_CANCEL - case .inProgress: - return GTK_PRINT_OPERATION_RESULT_IN_PROGRESS + return GTK_PRINT_OPERATION_RESULT_ERROR +case .apply: + return GTK_PRINT_OPERATION_RESULT_APPLY +case .cancel: + return GTK_PRINT_OPERATION_RESULT_CANCEL +case .inProgress: + return GTK_PRINT_OPERATION_RESULT_IN_PROGRESS } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PrintPages.swift b/Sources/Gtk/Generated/PrintPages.swift index 6806476cf3..0daf9facdb 100644 --- a/Sources/Gtk/Generated/PrintPages.swift +++ b/Sources/Gtk/Generated/PrintPages.swift @@ -5,28 +5,28 @@ public enum PrintPages: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintPages /// All pages. - case all - /// Current page. - case current - /// Range of pages. - case ranges - /// Selected pages. - case selection +case all +/// Current page. +case current +/// Range of pages. +case ranges +/// Selected pages. +case selection public static var type: GType { - gtk_print_pages_get_type() - } + gtk_print_pages_get_type() +} public init(from gtkEnum: GtkPrintPages) { switch gtkEnum { case GTK_PRINT_PAGES_ALL: - self = .all - case GTK_PRINT_PAGES_CURRENT: - self = .current - case GTK_PRINT_PAGES_RANGES: - self = .ranges - case GTK_PRINT_PAGES_SELECTION: - self = .selection + self = .all +case GTK_PRINT_PAGES_CURRENT: + self = .current +case GTK_PRINT_PAGES_RANGES: + self = .ranges +case GTK_PRINT_PAGES_SELECTION: + self = .selection default: fatalError("Unsupported GtkPrintPages enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum PrintPages: GValueRepresentableEnum { public func toGtk() -> GtkPrintPages { switch self { case .all: - return GTK_PRINT_PAGES_ALL - case .current: - return GTK_PRINT_PAGES_CURRENT - case .ranges: - return GTK_PRINT_PAGES_RANGES - case .selection: - return GTK_PRINT_PAGES_SELECTION + return GTK_PRINT_PAGES_ALL +case .current: + return GTK_PRINT_PAGES_CURRENT +case .ranges: + return GTK_PRINT_PAGES_RANGES +case .selection: + return GTK_PRINT_PAGES_SELECTION } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PrintQuality.swift b/Sources/Gtk/Generated/PrintQuality.swift index 08c785ae17..66848c3d9c 100644 --- a/Sources/Gtk/Generated/PrintQuality.swift +++ b/Sources/Gtk/Generated/PrintQuality.swift @@ -5,28 +5,28 @@ public enum PrintQuality: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintQuality /// Low quality. - case low - /// Normal quality. - case normal - /// High quality. - case high - /// Draft quality. - case draft +case low +/// Normal quality. +case normal +/// High quality. +case high +/// Draft quality. +case draft public static var type: GType { - gtk_print_quality_get_type() - } + gtk_print_quality_get_type() +} public init(from gtkEnum: GtkPrintQuality) { switch gtkEnum { case GTK_PRINT_QUALITY_LOW: - self = .low - case GTK_PRINT_QUALITY_NORMAL: - self = .normal - case GTK_PRINT_QUALITY_HIGH: - self = .high - case GTK_PRINT_QUALITY_DRAFT: - self = .draft + self = .low +case GTK_PRINT_QUALITY_NORMAL: + self = .normal +case GTK_PRINT_QUALITY_HIGH: + self = .high +case GTK_PRINT_QUALITY_DRAFT: + self = .draft default: fatalError("Unsupported GtkPrintQuality enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum PrintQuality: GValueRepresentableEnum { public func toGtk() -> GtkPrintQuality { switch self { case .low: - return GTK_PRINT_QUALITY_LOW - case .normal: - return GTK_PRINT_QUALITY_NORMAL - case .high: - return GTK_PRINT_QUALITY_HIGH - case .draft: - return GTK_PRINT_QUALITY_DRAFT + return GTK_PRINT_QUALITY_LOW +case .normal: + return GTK_PRINT_QUALITY_NORMAL +case .high: + return GTK_PRINT_QUALITY_HIGH +case .draft: + return GTK_PRINT_QUALITY_DRAFT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PrintStatus.swift b/Sources/Gtk/Generated/PrintStatus.swift index 5078e9369f..9409b327c4 100644 --- a/Sources/Gtk/Generated/PrintStatus.swift +++ b/Sources/Gtk/Generated/PrintStatus.swift @@ -6,54 +6,54 @@ public enum PrintStatus: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintStatus /// The printing has not started yet; this - /// status is set initially, and while the print dialog is shown. - case initial - /// This status is set while the begin-print - /// signal is emitted and during pagination. - case preparing - /// This status is set while the - /// pages are being rendered. - case generatingData - /// The print job is being sent off to the - /// printer. - case sendingData - /// The print job has been sent to the printer, - /// but is not printed for some reason, e.g. the printer may be stopped. - case pending - /// Some problem has occurred during - /// printing, e.g. a paper jam. - case pendingIssue - /// The printer is processing the print job. - case printing - /// The printing has been completed successfully. - case finished - /// The printing has been aborted. - case finishedAborted +/// status is set initially, and while the print dialog is shown. +case initial +/// This status is set while the begin-print +/// signal is emitted and during pagination. +case preparing +/// This status is set while the +/// pages are being rendered. +case generatingData +/// The print job is being sent off to the +/// printer. +case sendingData +/// The print job has been sent to the printer, +/// but is not printed for some reason, e.g. the printer may be stopped. +case pending +/// Some problem has occurred during +/// printing, e.g. a paper jam. +case pendingIssue +/// The printer is processing the print job. +case printing +/// The printing has been completed successfully. +case finished +/// The printing has been aborted. +case finishedAborted public static var type: GType { - gtk_print_status_get_type() - } + gtk_print_status_get_type() +} public init(from gtkEnum: GtkPrintStatus) { switch gtkEnum { case GTK_PRINT_STATUS_INITIAL: - self = .initial - case GTK_PRINT_STATUS_PREPARING: - self = .preparing - case GTK_PRINT_STATUS_GENERATING_DATA: - self = .generatingData - case GTK_PRINT_STATUS_SENDING_DATA: - self = .sendingData - case GTK_PRINT_STATUS_PENDING: - self = .pending - case GTK_PRINT_STATUS_PENDING_ISSUE: - self = .pendingIssue - case GTK_PRINT_STATUS_PRINTING: - self = .printing - case GTK_PRINT_STATUS_FINISHED: - self = .finished - case GTK_PRINT_STATUS_FINISHED_ABORTED: - self = .finishedAborted + self = .initial +case GTK_PRINT_STATUS_PREPARING: + self = .preparing +case GTK_PRINT_STATUS_GENERATING_DATA: + self = .generatingData +case GTK_PRINT_STATUS_SENDING_DATA: + self = .sendingData +case GTK_PRINT_STATUS_PENDING: + self = .pending +case GTK_PRINT_STATUS_PENDING_ISSUE: + self = .pendingIssue +case GTK_PRINT_STATUS_PRINTING: + self = .printing +case GTK_PRINT_STATUS_FINISHED: + self = .finished +case GTK_PRINT_STATUS_FINISHED_ABORTED: + self = .finishedAborted default: fatalError("Unsupported GtkPrintStatus enum value: \(gtkEnum.rawValue)") } @@ -62,23 +62,23 @@ public enum PrintStatus: GValueRepresentableEnum { public func toGtk() -> GtkPrintStatus { switch self { case .initial: - return GTK_PRINT_STATUS_INITIAL - case .preparing: - return GTK_PRINT_STATUS_PREPARING - case .generatingData: - return GTK_PRINT_STATUS_GENERATING_DATA - case .sendingData: - return GTK_PRINT_STATUS_SENDING_DATA - case .pending: - return GTK_PRINT_STATUS_PENDING - case .pendingIssue: - return GTK_PRINT_STATUS_PENDING_ISSUE - case .printing: - return GTK_PRINT_STATUS_PRINTING - case .finished: - return GTK_PRINT_STATUS_FINISHED - case .finishedAborted: - return GTK_PRINT_STATUS_FINISHED_ABORTED + return GTK_PRINT_STATUS_INITIAL +case .preparing: + return GTK_PRINT_STATUS_PREPARING +case .generatingData: + return GTK_PRINT_STATUS_GENERATING_DATA +case .sendingData: + return GTK_PRINT_STATUS_SENDING_DATA +case .pending: + return GTK_PRINT_STATUS_PENDING +case .pendingIssue: + return GTK_PRINT_STATUS_PENDING_ISSUE +case .printing: + return GTK_PRINT_STATUS_PRINTING +case .finished: + return GTK_PRINT_STATUS_FINISHED +case .finishedAborted: + return GTK_PRINT_STATUS_FINISHED_ABORTED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ProgressBar.swift b/Sources/Gtk/Generated/ProgressBar.swift index 65796c4396..23d464f7d1 100644 --- a/Sources/Gtk/Generated/ProgressBar.swift +++ b/Sources/Gtk/Generated/ProgressBar.swift @@ -1,39 +1,39 @@ import CGtk /// Displays the progress of a long-running operation. -/// +/// /// `GtkProgressBar` provides a visual clue that processing is underway. /// It can be used in two different modes: percentage mode and activity mode. -/// +/// /// An example GtkProgressBar -/// +/// /// When an application can determine how much work needs to take place /// (e.g. read a fixed number of bytes from a file) and can monitor its /// progress, it can use the `GtkProgressBar` in percentage mode and the /// user sees a growing bar indicating the percentage of the work that /// has been completed. In this mode, the application is required to call /// [method@Gtk.ProgressBar.set_fraction] periodically to update the progress bar. -/// +/// /// When an application has no accurate way of knowing the amount of work /// to do, it can use the `GtkProgressBar` in activity mode, which shows /// activity by a block moving back and forth within the progress area. In /// this mode, the application is required to call [method@Gtk.ProgressBar.pulse] /// periodically to update the progress bar. -/// +/// /// There is quite a bit of flexibility provided to control the appearance /// of the `GtkProgressBar`. Functions are provided to control the orientation /// of the bar, optional text can be displayed along with the bar, and the /// step size used in activity mode can be set. -/// +/// /// # CSS nodes -/// +/// /// ``` /// progressbar[.osd] /// ├── [text] /// ╰── trough[.empty][.full] /// ╰── progress[.pulse] /// ``` -/// +/// /// `GtkProgressBar` has a main CSS node with name progressbar and subnodes with /// names text and trough, of which the latter has a subnode named progress. The /// text subnode is only present if text is shown. The progress subnode has the @@ -41,144 +41,137 @@ import CGtk /// .right, .top or .bottom added when the progress 'touches' the corresponding /// end of the GtkProgressBar. The .osd class on the progressbar node is for use /// in overlays like the one Epiphany has for page loading progress. -/// +/// /// # Accessibility -/// +/// /// `GtkProgressBar` uses the [enum@Gtk.AccessibleRole.progress_bar] role. open class ProgressBar: Widget, Orientable { /// Creates a new `GtkProgressBar`. - public convenience init() { - self.init( - gtk_progress_bar_new() - ) +public convenience init() { + self.init( + gtk_progress_bar_new() + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::ellipsize", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEllipsize?(self, param0) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::fraction", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFraction?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::inverted", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInverted?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::pulse-step", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPulseStep?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::ellipsize", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEllipsize?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::fraction", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFraction?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::inverted", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInverted?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::pulse-step", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPulseStep?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::show-text", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowText?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::text", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyText?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::orientation", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyOrientation?(self, param0) - } +addSignal(name: "notify::show-text", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowText?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::text", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyText?(self, param0) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::orientation", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyOrientation?(self, param0) +} +} + /// The fraction of total work that has been completed. - @GObjectProperty(named: "fraction") public var fraction: Double +@GObjectProperty(named: "fraction") public var fraction: Double - /// Invert the direction in which the progress bar grows. - @GObjectProperty(named: "inverted") public var inverted: Bool +/// Invert the direction in which the progress bar grows. +@GObjectProperty(named: "inverted") public var inverted: Bool - /// The fraction of total progress to move the bounding block when pulsed. - @GObjectProperty(named: "pulse-step") public var pulseStep: Double +/// The fraction of total progress to move the bounding block when pulsed. +@GObjectProperty(named: "pulse-step") public var pulseStep: Double - /// Sets whether the progress bar will show a text in addition - /// to the bar itself. - /// - /// The shown text is either the value of the [property@Gtk.ProgressBar:text] - /// property or, if that is %NULL, the [property@Gtk.ProgressBar:fraction] - /// value, as a percentage. - /// - /// To make a progress bar that is styled and sized suitably for showing text - /// (even if the actual text is blank), set [property@Gtk.ProgressBar:show-text] - /// to %TRUE and [property@Gtk.ProgressBar:text] to the empty string (not %NULL). - @GObjectProperty(named: "show-text") public var showText: Bool +/// Sets whether the progress bar will show a text in addition +/// to the bar itself. +/// +/// The shown text is either the value of the [property@Gtk.ProgressBar:text] +/// property or, if that is %NULL, the [property@Gtk.ProgressBar:fraction] +/// value, as a percentage. +/// +/// To make a progress bar that is styled and sized suitably for showing text +/// (even if the actual text is blank), set [property@Gtk.ProgressBar:show-text] +/// to %TRUE and [property@Gtk.ProgressBar:text] to the empty string (not %NULL). +@GObjectProperty(named: "show-text") public var showText: Bool - /// Text to be displayed in the progress bar. - @GObjectProperty(named: "text") public var text: String? +/// Text to be displayed in the progress bar. +@GObjectProperty(named: "text") public var text: String? - /// The orientation of the orientable. - @GObjectProperty(named: "orientation") public var orientation: Orientation +/// The orientation of the orientable. +@GObjectProperty(named: "orientation") public var orientation: Orientation - public var notifyEllipsize: ((ProgressBar, OpaquePointer) -> Void)? - public var notifyFraction: ((ProgressBar, OpaquePointer) -> Void)? +public var notifyEllipsize: ((ProgressBar, OpaquePointer) -> Void)? - public var notifyInverted: ((ProgressBar, OpaquePointer) -> Void)? - public var notifyPulseStep: ((ProgressBar, OpaquePointer) -> Void)? +public var notifyFraction: ((ProgressBar, OpaquePointer) -> Void)? - public var notifyShowText: ((ProgressBar, OpaquePointer) -> Void)? - public var notifyText: ((ProgressBar, OpaquePointer) -> Void)? +public var notifyInverted: ((ProgressBar, OpaquePointer) -> Void)? - public var notifyOrientation: ((ProgressBar, OpaquePointer) -> Void)? -} + +public var notifyPulseStep: ((ProgressBar, OpaquePointer) -> Void)? + + +public var notifyShowText: ((ProgressBar, OpaquePointer) -> Void)? + + +public var notifyText: ((ProgressBar, OpaquePointer) -> Void)? + + +public var notifyOrientation: ((ProgressBar, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PropagationLimit.swift b/Sources/Gtk/Generated/PropagationLimit.swift index 47544d5c1e..9b818c7b7f 100644 --- a/Sources/Gtk/Generated/PropagationLimit.swift +++ b/Sources/Gtk/Generated/PropagationLimit.swift @@ -6,24 +6,24 @@ public enum PropagationLimit: GValueRepresentableEnum { public typealias GtkEnum = GtkPropagationLimit /// Events are handled regardless of what their - /// target is. - case none - /// Events are only handled if their target is in - /// the same [iface@Native] (or widget with [property@Gtk.Widget:limit-events] - /// set) as the event controllers widget. - /// Note that some event types have two targets (origin and destination). - case sameNative +/// target is. +case none +/// Events are only handled if their target is in +/// the same [iface@Native] (or widget with [property@Gtk.Widget:limit-events] +/// set) as the event controllers widget. +/// Note that some event types have two targets (origin and destination). +case sameNative public static var type: GType { - gtk_propagation_limit_get_type() - } + gtk_propagation_limit_get_type() +} public init(from gtkEnum: GtkPropagationLimit) { switch gtkEnum { case GTK_LIMIT_NONE: - self = .none - case GTK_LIMIT_SAME_NATIVE: - self = .sameNative + self = .none +case GTK_LIMIT_SAME_NATIVE: + self = .sameNative default: fatalError("Unsupported GtkPropagationLimit enum value: \(gtkEnum.rawValue)") } @@ -32,9 +32,9 @@ public enum PropagationLimit: GValueRepresentableEnum { public func toGtk() -> GtkPropagationLimit { switch self { case .none: - return GTK_LIMIT_NONE - case .sameNative: - return GTK_LIMIT_SAME_NATIVE + return GTK_LIMIT_NONE +case .sameNative: + return GTK_LIMIT_SAME_NATIVE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/PropagationPhase.swift b/Sources/Gtk/Generated/PropagationPhase.swift index fad15a5c44..c863676051 100644 --- a/Sources/Gtk/Generated/PropagationPhase.swift +++ b/Sources/Gtk/Generated/PropagationPhase.swift @@ -5,35 +5,35 @@ public enum PropagationPhase: GValueRepresentableEnum { public typealias GtkEnum = GtkPropagationPhase /// Events are not delivered. - case none - /// Events are delivered in the capture phase. The - /// capture phase happens before the bubble phase, runs from the toplevel down - /// to the event widget. This option should only be used on containers that - /// might possibly handle events before their children do. - case capture - /// Events are delivered in the bubble phase. The bubble - /// phase happens after the capture phase, and before the default handlers - /// are run. This phase runs from the event widget, up to the toplevel. - case bubble - /// Events are delivered in the default widget event handlers, - /// note that widget implementations must chain up on button, motion, touch and - /// grab broken handlers for controllers in this phase to be run. - case target +case none +/// Events are delivered in the capture phase. The +/// capture phase happens before the bubble phase, runs from the toplevel down +/// to the event widget. This option should only be used on containers that +/// might possibly handle events before their children do. +case capture +/// Events are delivered in the bubble phase. The bubble +/// phase happens after the capture phase, and before the default handlers +/// are run. This phase runs from the event widget, up to the toplevel. +case bubble +/// Events are delivered in the default widget event handlers, +/// note that widget implementations must chain up on button, motion, touch and +/// grab broken handlers for controllers in this phase to be run. +case target public static var type: GType { - gtk_propagation_phase_get_type() - } + gtk_propagation_phase_get_type() +} public init(from gtkEnum: GtkPropagationPhase) { switch gtkEnum { case GTK_PHASE_NONE: - self = .none - case GTK_PHASE_CAPTURE: - self = .capture - case GTK_PHASE_BUBBLE: - self = .bubble - case GTK_PHASE_TARGET: - self = .target + self = .none +case GTK_PHASE_CAPTURE: + self = .capture +case GTK_PHASE_BUBBLE: + self = .bubble +case GTK_PHASE_TARGET: + self = .target default: fatalError("Unsupported GtkPropagationPhase enum value: \(gtkEnum.rawValue)") } @@ -42,13 +42,13 @@ public enum PropagationPhase: GValueRepresentableEnum { public func toGtk() -> GtkPropagationPhase { switch self { case .none: - return GTK_PHASE_NONE - case .capture: - return GTK_PHASE_CAPTURE - case .bubble: - return GTK_PHASE_BUBBLE - case .target: - return GTK_PHASE_TARGET + return GTK_PHASE_NONE +case .capture: + return GTK_PHASE_CAPTURE +case .bubble: + return GTK_PHASE_BUBBLE +case .target: + return GTK_PHASE_TARGET } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Range.swift b/Sources/Gtk/Generated/Range.swift index 8bb7e472c1..de54f2c7d4 100644 --- a/Sources/Gtk/Generated/Range.swift +++ b/Sources/Gtk/Generated/Range.swift @@ -1,211 +1,198 @@ import CGtk /// Base class for widgets which visualize an adjustment. -/// +/// /// Widgets that are derived from `GtkRange` include /// [class@Gtk.Scale] and [class@Gtk.Scrollbar]. -/// +/// /// Apart from signals for monitoring the parameters of the adjustment, /// `GtkRange` provides properties and methods for setting a /// “fill level” on range widgets. See [method@Gtk.Range.set_fill_level]. -/// +/// /// # Shortcuts and Gestures -/// +/// /// The `GtkRange` slider is draggable. Holding the Shift key while /// dragging, or initiating the drag with a long-press will enable the /// fine-tuning mode. open class Range: Widget, Orientable { + - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "adjust-bounds", handler: gCallback(handler0)) { - [weak self] (param0: Double) in - guard let self = self else { return } - self.adjustBounds?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, GtkScrollType, Double, UnsafeMutableRawPointer) - -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "change-value", handler: gCallback(handler1)) { - [weak self] (param0: GtkScrollType, param1: Double) in - guard let self = self else { return } - self.changeValue?(self, param0, param1) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, GtkScrollType, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "move-slider", handler: gCallback(handler2)) { - [weak self] (param0: GtkScrollType) in - guard let self = self else { return } - self.moveSlider?(self, param0) - } - - addSignal(name: "value-changed") { [weak self] () in - guard let self = self else { return } - self.valueChanged?(self) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::adjustment", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAdjustment?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::fill-level", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFillLevel?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::inverted", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInverted?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::restrict-to-fill-level", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyRestrictToFillLevel?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::round-digits", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyRoundDigits?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::show-fill-level", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowFillLevel?(self, param0) - } - - let handler10: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::orientation", handler: gCallback(handler10)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyOrientation?(self, param0) - } + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: @convention(c) (UnsafeMutableRawPointer, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// The fill level (e.g. prebuffering of a network stream). - @GObjectProperty(named: "fill-level") public var fillLevel: Double +addSignal(name: "adjust-bounds", handler: gCallback(handler0)) { [weak self] (param0: Double) in + guard let self = self else { return } + self.adjustBounds?(self, param0) +} - /// If %TRUE, the direction in which the slider moves is inverted. - @GObjectProperty(named: "inverted") public var inverted: Bool +let handler1: @convention(c) (UnsafeMutableRawPointer, GtkScrollType, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } - /// Controls whether slider movement is restricted to an - /// upper boundary set by the fill level. - @GObjectProperty(named: "restrict-to-fill-level") public var restrictToFillLevel: Bool +addSignal(name: "change-value", handler: gCallback(handler1)) { [weak self] (param0: GtkScrollType, param1: Double) in + guard let self = self else { return } + self.changeValue?(self, param0, param1) +} - /// The number of digits to round the value to when - /// it changes. - /// - /// See [signal@Gtk.Range::change-value]. - @GObjectProperty(named: "round-digits") public var roundDigits: Int +let handler2: @convention(c) (UnsafeMutableRawPointer, GtkScrollType, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Controls whether fill level indicator graphics are displayed - /// on the trough. - @GObjectProperty(named: "show-fill-level") public var showFillLevel: Bool +addSignal(name: "move-slider", handler: gCallback(handler2)) { [weak self] (param0: GtkScrollType) in + guard let self = self else { return } + self.moveSlider?(self, param0) +} - /// The orientation of the orientable. - @GObjectProperty(named: "orientation") public var orientation: Orientation +addSignal(name: "value-changed") { [weak self] () in + guard let self = self else { return } + self.valueChanged?(self) +} - /// Emitted before clamping a value, to give the application a - /// chance to adjust the bounds. - public var adjustBounds: ((Range, Double) -> Void)? +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Emitted when a scroll action is performed on a range. - /// - /// It allows an application to determine the type of scroll event - /// that occurred and the resultant new value. The application can - /// handle the event itself and return %TRUE to prevent further - /// processing. Or, by returning %FALSE, it can pass the event to - /// other handlers until the default GTK handler is reached. - /// - /// The value parameter is unrounded. An application that overrides - /// the ::change-value signal is responsible for clamping the value - /// to the desired number of decimal digits; the default GTK - /// handler clamps the value based on [property@Gtk.Range:round-digits]. - public var changeValue: ((Range, GtkScrollType, Double) -> Void)? +addSignal(name: "notify::adjustment", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAdjustment?(self, param0) +} - /// Virtual function that moves the slider. - /// - /// Used for keybindings. - public var moveSlider: ((Range, GtkScrollType) -> Void)? +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Emitted when the range value changes. - public var valueChanged: ((Range) -> Void)? +addSignal(name: "notify::fill-level", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFillLevel?(self, param0) +} - public var notifyAdjustment: ((Range, OpaquePointer) -> Void)? +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyFillLevel: ((Range, OpaquePointer) -> Void)? +addSignal(name: "notify::inverted", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInverted?(self, param0) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::restrict-to-fill-level", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyRestrictToFillLevel?(self, param0) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyInverted: ((Range, OpaquePointer) -> Void)? +addSignal(name: "notify::round-digits", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyRoundDigits?(self, param0) +} - public var notifyRestrictToFillLevel: ((Range, OpaquePointer) -> Void)? +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyRoundDigits: ((Range, OpaquePointer) -> Void)? +addSignal(name: "notify::show-fill-level", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowFillLevel?(self, param0) +} - public var notifyShowFillLevel: ((Range, OpaquePointer) -> Void)? +let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyOrientation: ((Range, OpaquePointer) -> Void)? +addSignal(name: "notify::orientation", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyOrientation?(self, param0) +} } + + /// The fill level (e.g. prebuffering of a network stream). +@GObjectProperty(named: "fill-level") public var fillLevel: Double + +/// If %TRUE, the direction in which the slider moves is inverted. +@GObjectProperty(named: "inverted") public var inverted: Bool + +/// Controls whether slider movement is restricted to an +/// upper boundary set by the fill level. +@GObjectProperty(named: "restrict-to-fill-level") public var restrictToFillLevel: Bool + +/// The number of digits to round the value to when +/// it changes. +/// +/// See [signal@Gtk.Range::change-value]. +@GObjectProperty(named: "round-digits") public var roundDigits: Int + +/// Controls whether fill level indicator graphics are displayed +/// on the trough. +@GObjectProperty(named: "show-fill-level") public var showFillLevel: Bool + +/// The orientation of the orientable. +@GObjectProperty(named: "orientation") public var orientation: Orientation + +/// Emitted before clamping a value, to give the application a +/// chance to adjust the bounds. +public var adjustBounds: ((Range, Double) -> Void)? + +/// Emitted when a scroll action is performed on a range. +/// +/// It allows an application to determine the type of scroll event +/// that occurred and the resultant new value. The application can +/// handle the event itself and return %TRUE to prevent further +/// processing. Or, by returning %FALSE, it can pass the event to +/// other handlers until the default GTK handler is reached. +/// +/// The value parameter is unrounded. An application that overrides +/// the ::change-value signal is responsible for clamping the value +/// to the desired number of decimal digits; the default GTK +/// handler clamps the value based on [property@Gtk.Range:round-digits]. +public var changeValue: ((Range, GtkScrollType, Double) -> Void)? + +/// Virtual function that moves the slider. +/// +/// Used for keybindings. +public var moveSlider: ((Range, GtkScrollType) -> Void)? + +/// Emitted when the range value changes. +public var valueChanged: ((Range) -> Void)? + + +public var notifyAdjustment: ((Range, OpaquePointer) -> Void)? + + +public var notifyFillLevel: ((Range, OpaquePointer) -> Void)? + + +public var notifyInverted: ((Range, OpaquePointer) -> Void)? + + +public var notifyRestrictToFillLevel: ((Range, OpaquePointer) -> Void)? + + +public var notifyRoundDigits: ((Range, OpaquePointer) -> Void)? + + +public var notifyShowFillLevel: ((Range, OpaquePointer) -> Void)? + + +public var notifyOrientation: ((Range, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/RecentManagerError.swift b/Sources/Gtk/Generated/RecentManagerError.swift index f6dfdfa16f..2770a426a1 100644 --- a/Sources/Gtk/Generated/RecentManagerError.swift +++ b/Sources/Gtk/Generated/RecentManagerError.swift @@ -5,45 +5,45 @@ public enum RecentManagerError: GValueRepresentableEnum { public typealias GtkEnum = GtkRecentManagerError /// The URI specified does not exists in - /// the recently used resources list. - case notFound - /// The URI specified is not valid. - case invalidUri - /// The supplied string is not - /// UTF-8 encoded. - case invalidEncoding - /// No application has registered - /// the specified item. - case notRegistered - /// Failure while reading the recently used - /// resources file. - case read - /// Failure while writing the recently used - /// resources file. - case write - /// Unspecified error. - case unknown +/// the recently used resources list. +case notFound +/// The URI specified is not valid. +case invalidUri +/// The supplied string is not +/// UTF-8 encoded. +case invalidEncoding +/// No application has registered +/// the specified item. +case notRegistered +/// Failure while reading the recently used +/// resources file. +case read +/// Failure while writing the recently used +/// resources file. +case write +/// Unspecified error. +case unknown public static var type: GType { - gtk_recent_manager_error_get_type() - } + gtk_recent_manager_error_get_type() +} public init(from gtkEnum: GtkRecentManagerError) { switch gtkEnum { case GTK_RECENT_MANAGER_ERROR_NOT_FOUND: - self = .notFound - case GTK_RECENT_MANAGER_ERROR_INVALID_URI: - self = .invalidUri - case GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING: - self = .invalidEncoding - case GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED: - self = .notRegistered - case GTK_RECENT_MANAGER_ERROR_READ: - self = .read - case GTK_RECENT_MANAGER_ERROR_WRITE: - self = .write - case GTK_RECENT_MANAGER_ERROR_UNKNOWN: - self = .unknown + self = .notFound +case GTK_RECENT_MANAGER_ERROR_INVALID_URI: + self = .invalidUri +case GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING: + self = .invalidEncoding +case GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED: + self = .notRegistered +case GTK_RECENT_MANAGER_ERROR_READ: + self = .read +case GTK_RECENT_MANAGER_ERROR_WRITE: + self = .write +case GTK_RECENT_MANAGER_ERROR_UNKNOWN: + self = .unknown default: fatalError("Unsupported GtkRecentManagerError enum value: \(gtkEnum.rawValue)") } @@ -52,19 +52,19 @@ public enum RecentManagerError: GValueRepresentableEnum { public func toGtk() -> GtkRecentManagerError { switch self { case .notFound: - return GTK_RECENT_MANAGER_ERROR_NOT_FOUND - case .invalidUri: - return GTK_RECENT_MANAGER_ERROR_INVALID_URI - case .invalidEncoding: - return GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING - case .notRegistered: - return GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED - case .read: - return GTK_RECENT_MANAGER_ERROR_READ - case .write: - return GTK_RECENT_MANAGER_ERROR_WRITE - case .unknown: - return GTK_RECENT_MANAGER_ERROR_UNKNOWN + return GTK_RECENT_MANAGER_ERROR_NOT_FOUND +case .invalidUri: + return GTK_RECENT_MANAGER_ERROR_INVALID_URI +case .invalidEncoding: + return GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING +case .notRegistered: + return GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED +case .read: + return GTK_RECENT_MANAGER_ERROR_READ +case .write: + return GTK_RECENT_MANAGER_ERROR_WRITE +case .unknown: + return GTK_RECENT_MANAGER_ERROR_UNKNOWN } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ResponseType.swift b/Sources/Gtk/Generated/ResponseType.swift index 3fd9f7cffc..3c68948d07 100644 --- a/Sources/Gtk/Generated/ResponseType.swift +++ b/Sources/Gtk/Generated/ResponseType.swift @@ -1,64 +1,64 @@ import CGtk /// Predefined values for use as response ids in gtk_dialog_add_button(). -/// +/// /// All predefined values are negative; GTK leaves values of 0 or greater for /// application-defined response ids. public enum ResponseType: GValueRepresentableEnum { public typealias GtkEnum = GtkResponseType /// Returned if an action widget has no response id, - /// or if the dialog gets programmatically hidden or destroyed - case none - /// Generic response id, not used by GTK dialogs - case reject - /// Generic response id, not used by GTK dialogs - case accept - /// Returned if the dialog is deleted - case deleteEvent - /// Returned by OK buttons in GTK dialogs - case ok - /// Returned by Cancel buttons in GTK dialogs - case cancel - /// Returned by Close buttons in GTK dialogs - case close - /// Returned by Yes buttons in GTK dialogs - case yes - /// Returned by No buttons in GTK dialogs - case no - /// Returned by Apply buttons in GTK dialogs - case apply - /// Returned by Help buttons in GTK dialogs - case help +/// or if the dialog gets programmatically hidden or destroyed +case none +/// Generic response id, not used by GTK dialogs +case reject +/// Generic response id, not used by GTK dialogs +case accept +/// Returned if the dialog is deleted +case deleteEvent +/// Returned by OK buttons in GTK dialogs +case ok +/// Returned by Cancel buttons in GTK dialogs +case cancel +/// Returned by Close buttons in GTK dialogs +case close +/// Returned by Yes buttons in GTK dialogs +case yes +/// Returned by No buttons in GTK dialogs +case no +/// Returned by Apply buttons in GTK dialogs +case apply +/// Returned by Help buttons in GTK dialogs +case help public static var type: GType { - gtk_response_type_get_type() - } + gtk_response_type_get_type() +} public init(from gtkEnum: GtkResponseType) { switch gtkEnum { case GTK_RESPONSE_NONE: - self = .none - case GTK_RESPONSE_REJECT: - self = .reject - case GTK_RESPONSE_ACCEPT: - self = .accept - case GTK_RESPONSE_DELETE_EVENT: - self = .deleteEvent - case GTK_RESPONSE_OK: - self = .ok - case GTK_RESPONSE_CANCEL: - self = .cancel - case GTK_RESPONSE_CLOSE: - self = .close - case GTK_RESPONSE_YES: - self = .yes - case GTK_RESPONSE_NO: - self = .no - case GTK_RESPONSE_APPLY: - self = .apply - case GTK_RESPONSE_HELP: - self = .help + self = .none +case GTK_RESPONSE_REJECT: + self = .reject +case GTK_RESPONSE_ACCEPT: + self = .accept +case GTK_RESPONSE_DELETE_EVENT: + self = .deleteEvent +case GTK_RESPONSE_OK: + self = .ok +case GTK_RESPONSE_CANCEL: + self = .cancel +case GTK_RESPONSE_CLOSE: + self = .close +case GTK_RESPONSE_YES: + self = .yes +case GTK_RESPONSE_NO: + self = .no +case GTK_RESPONSE_APPLY: + self = .apply +case GTK_RESPONSE_HELP: + self = .help default: fatalError("Unsupported GtkResponseType enum value: \(gtkEnum.rawValue)") } @@ -67,27 +67,27 @@ public enum ResponseType: GValueRepresentableEnum { public func toGtk() -> GtkResponseType { switch self { case .none: - return GTK_RESPONSE_NONE - case .reject: - return GTK_RESPONSE_REJECT - case .accept: - return GTK_RESPONSE_ACCEPT - case .deleteEvent: - return GTK_RESPONSE_DELETE_EVENT - case .ok: - return GTK_RESPONSE_OK - case .cancel: - return GTK_RESPONSE_CANCEL - case .close: - return GTK_RESPONSE_CLOSE - case .yes: - return GTK_RESPONSE_YES - case .no: - return GTK_RESPONSE_NO - case .apply: - return GTK_RESPONSE_APPLY - case .help: - return GTK_RESPONSE_HELP + return GTK_RESPONSE_NONE +case .reject: + return GTK_RESPONSE_REJECT +case .accept: + return GTK_RESPONSE_ACCEPT +case .deleteEvent: + return GTK_RESPONSE_DELETE_EVENT +case .ok: + return GTK_RESPONSE_OK +case .cancel: + return GTK_RESPONSE_CANCEL +case .close: + return GTK_RESPONSE_CLOSE +case .yes: + return GTK_RESPONSE_YES +case .no: + return GTK_RESPONSE_NO +case .apply: + return GTK_RESPONSE_APPLY +case .help: + return GTK_RESPONSE_HELP } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/RevealerTransitionType.swift b/Sources/Gtk/Generated/RevealerTransitionType.swift index d7908fc3a2..3762a6d618 100644 --- a/Sources/Gtk/Generated/RevealerTransitionType.swift +++ b/Sources/Gtk/Generated/RevealerTransitionType.swift @@ -6,52 +6,52 @@ public enum RevealerTransitionType: GValueRepresentableEnum { public typealias GtkEnum = GtkRevealerTransitionType /// No transition - case none - /// Fade in - case crossfade - /// Slide in from the left - case slideRight - /// Slide in from the right - case slideLeft - /// Slide in from the bottom - case slideUp - /// Slide in from the top - case slideDown - /// Floop in from the left - case swingRight - /// Floop in from the right - case swingLeft - /// Floop in from the bottom - case swingUp - /// Floop in from the top - case swingDown +case none +/// Fade in +case crossfade +/// Slide in from the left +case slideRight +/// Slide in from the right +case slideLeft +/// Slide in from the bottom +case slideUp +/// Slide in from the top +case slideDown +/// Floop in from the left +case swingRight +/// Floop in from the right +case swingLeft +/// Floop in from the bottom +case swingUp +/// Floop in from the top +case swingDown public static var type: GType { - gtk_revealer_transition_type_get_type() - } + gtk_revealer_transition_type_get_type() +} public init(from gtkEnum: GtkRevealerTransitionType) { switch gtkEnum { case GTK_REVEALER_TRANSITION_TYPE_NONE: - self = .none - case GTK_REVEALER_TRANSITION_TYPE_CROSSFADE: - self = .crossfade - case GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT: - self = .slideRight - case GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT: - self = .slideLeft - case GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP: - self = .slideUp - case GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN: - self = .slideDown - case GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT: - self = .swingRight - case GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT: - self = .swingLeft - case GTK_REVEALER_TRANSITION_TYPE_SWING_UP: - self = .swingUp - case GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN: - self = .swingDown + self = .none +case GTK_REVEALER_TRANSITION_TYPE_CROSSFADE: + self = .crossfade +case GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT: + self = .slideRight +case GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT: + self = .slideLeft +case GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP: + self = .slideUp +case GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN: + self = .slideDown +case GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT: + self = .swingRight +case GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT: + self = .swingLeft +case GTK_REVEALER_TRANSITION_TYPE_SWING_UP: + self = .swingUp +case GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN: + self = .swingDown default: fatalError("Unsupported GtkRevealerTransitionType enum value: \(gtkEnum.rawValue)") } @@ -60,25 +60,25 @@ public enum RevealerTransitionType: GValueRepresentableEnum { public func toGtk() -> GtkRevealerTransitionType { switch self { case .none: - return GTK_REVEALER_TRANSITION_TYPE_NONE - case .crossfade: - return GTK_REVEALER_TRANSITION_TYPE_CROSSFADE - case .slideRight: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT - case .slideLeft: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT - case .slideUp: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP - case .slideDown: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN - case .swingRight: - return GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT - case .swingLeft: - return GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT - case .swingUp: - return GTK_REVEALER_TRANSITION_TYPE_SWING_UP - case .swingDown: - return GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN + return GTK_REVEALER_TRANSITION_TYPE_NONE +case .crossfade: + return GTK_REVEALER_TRANSITION_TYPE_CROSSFADE +case .slideRight: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT +case .slideLeft: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT +case .slideUp: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP +case .slideDown: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN +case .swingRight: + return GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT +case .swingLeft: + return GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT +case .swingUp: + return GTK_REVEALER_TRANSITION_TYPE_SWING_UP +case .swingDown: + return GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Root.swift b/Sources/Gtk/Generated/Root.swift index c2dd7d45e0..b398cdbd3c 100644 --- a/Sources/Gtk/Generated/Root.swift +++ b/Sources/Gtk/Generated/Root.swift @@ -1,18 +1,20 @@ import CGtk /// An interface for widgets that can act as the root of a widget hierarchy. -/// +/// /// The root widget takes care of providing the connection to the windowing /// system and manages layout, drawing and event delivery for its widget /// hierarchy. -/// +/// /// The obvious example of a `GtkRoot` is `GtkWindow`. -/// +/// /// To get the display to which a `GtkRoot` belongs, use /// [method@Gtk.Root.get_display]. -/// +/// /// `GtkRoot` also maintains the location of keyboard focus inside its widget /// hierarchy, with [method@Gtk.Root.set_focus] and [method@Gtk.Root.get_focus]. public protocol Root: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Scale.swift b/Sources/Gtk/Generated/Scale.swift index 7d9d13b964..c73941ef80 100644 --- a/Sources/Gtk/Generated/Scale.swift +++ b/Sources/Gtk/Generated/Scale.swift @@ -1,40 +1,40 @@ import CGtk /// Allows to select a numeric value with a slider control. -/// +/// /// An example GtkScale -/// +/// /// To use it, you’ll probably want to investigate the methods on its base /// class, [class@Gtk.Range], in addition to the methods for `GtkScale` itself. /// To set the value of a scale, you would normally use [method@Gtk.Range.set_value]. /// To detect changes to the value, you would normally use the /// [signal@Gtk.Range::value-changed] signal. -/// +/// /// Note that using the same upper and lower bounds for the `GtkScale` (through /// the `GtkRange` methods) will hide the slider itself. This is useful for /// applications that want to show an undeterminate value on the scale, without /// changing the layout of the application (such as movie or music players). -/// +/// /// # GtkScale as GtkBuildable -/// +/// /// `GtkScale` supports a custom `` element, which can contain multiple /// `` elements. The “value” and “position” attributes have the same /// meaning as [method@Gtk.Scale.add_mark] parameters of the same name. If /// the element is not empty, its content is taken as the markup to show at /// the mark. It can be translated with the usual ”translatable” and /// “context” attributes. -/// +/// /// # Shortcuts and Gestures -/// +/// /// `GtkPopoverMenu` supports the following keyboard shortcuts: -/// +/// /// - Arrow keys, + and - will increment or decrement /// by step, or by page when combined with Ctrl. /// - PgUp and PgDn will increment or decrement by page. /// - Home and End will set the minimum or maximum value. -/// +/// /// # CSS nodes -/// +/// /// ``` /// scale[.fine-tune][.marks-before][.marks-after] /// ├── [value][.top][.right][.bottom][.left] @@ -55,138 +55,130 @@ import CGtk /// ├── [highlight] /// ╰── slider /// ``` -/// +/// /// `GtkScale` has a main CSS node with name scale and a subnode for its contents, /// with subnodes named trough and slider. -/// +/// /// The main node gets the style class .fine-tune added when the scale is in /// 'fine-tuning' mode. -/// +/// /// If the scale has an origin (see [method@Gtk.Scale.set_has_origin]), there is /// a subnode with name highlight below the trough node that is used for rendering /// the highlighted part of the trough. -/// +/// /// If the scale is showing a fill level (see [method@Gtk.Range.set_show_fill_level]), /// there is a subnode with name fill below the trough node that is used for /// rendering the filled in part of the trough. -/// +/// /// If marks are present, there is a marks subnode before or after the trough /// node, below which each mark gets a node with name mark. The marks nodes get /// either the .top or .bottom style class. -/// +/// /// The mark node has a subnode named indicator. If the mark has text, it also /// has a subnode named label. When the mark is either above or left of the /// scale, the label subnode is the first when present. Otherwise, the indicator /// subnode is the first. -/// +/// /// The main CSS node gets the 'marks-before' and/or 'marks-after' style classes /// added depending on what marks are present. -/// +/// /// If the scale is displaying the value (see [property@Gtk.Scale:draw-value]), /// there is subnode with name value. This node will get the .top or .bottom style /// classes similar to the marks node. -/// +/// /// # Accessibility -/// +/// /// `GtkScale` uses the [enum@Gtk.AccessibleRole.slider] role. open class Scale: Range { /// Creates a new `GtkScale`. - public convenience init( - orientation: GtkOrientation, adjustment: UnsafeMutablePointer! - ) { - self.init( - gtk_scale_new(orientation, adjustment) - ) +public convenience init(orientation: GtkOrientation, adjustment: UnsafeMutablePointer!) { + self.init( + gtk_scale_new(orientation, adjustment) + ) +} + +/// Creates a new scale widget with a range from @min to @max. +/// +/// The returns scale will have the given orientation and will let the +/// user input a number between @min and @max (including @min and @max) +/// with the increment @step. @step must be nonzero; it’s the distance +/// the slider moves when using the arrow keys to adjust the scale +/// value. +/// +/// Note that the way in which the precision is derived works best if +/// @step is a power of ten. If the resulting precision is not suitable +/// for your needs, use [method@Gtk.Scale.set_digits] to correct it. +public convenience init(range orientation: GtkOrientation, min: Double, max: Double, step: Double) { + self.init( + gtk_scale_new_with_range(orientation, min, max, step) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new scale widget with a range from @min to @max. - /// - /// The returns scale will have the given orientation and will let the - /// user input a number between @min and @max (including @min and @max) - /// with the increment @step. @step must be nonzero; it’s the distance - /// the slider moves when using the arrow keys to adjust the scale - /// value. - /// - /// Note that the way in which the precision is derived works best if - /// @step is a power of ten. If the resulting precision is not suitable - /// for your needs, use [method@Gtk.Scale.set_digits] to correct it. - public convenience init( - range orientation: GtkOrientation, min: Double, max: Double, step: Double - ) { - self.init( - gtk_scale_new_with_range(orientation, min, max, step) - ) +addSignal(name: "notify::digits", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDigits?(self, param0) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::digits", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDigits?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::draw-value", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDrawValue?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::has-origin", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasOrigin?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::value-pos", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyValuePos?(self, param0) - } +addSignal(name: "notify::draw-value", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDrawValue?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::has-origin", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasOrigin?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::value-pos", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyValuePos?(self, param0) +} +} + /// The number of decimal places that are displayed in the value. - @GObjectProperty(named: "digits") public var digits: Int +@GObjectProperty(named: "digits") public var digits: Int - /// Whether the current value is displayed as a string next to the slider. - @GObjectProperty(named: "draw-value") public var drawValue: Bool +/// Whether the current value is displayed as a string next to the slider. +@GObjectProperty(named: "draw-value") public var drawValue: Bool - /// Whether the scale has an origin. - @GObjectProperty(named: "has-origin") public var hasOrigin: Bool +/// Whether the scale has an origin. +@GObjectProperty(named: "has-origin") public var hasOrigin: Bool - /// The position in which the current value is displayed. - @GObjectProperty(named: "value-pos") public var valuePos: PositionType +/// The position in which the current value is displayed. +@GObjectProperty(named: "value-pos") public var valuePos: PositionType - public var notifyDigits: ((Scale, OpaquePointer) -> Void)? - public var notifyDrawValue: ((Scale, OpaquePointer) -> Void)? +public var notifyDigits: ((Scale, OpaquePointer) -> Void)? - public var notifyHasOrigin: ((Scale, OpaquePointer) -> Void)? - public var notifyValuePos: ((Scale, OpaquePointer) -> Void)? -} +public var notifyDrawValue: ((Scale, OpaquePointer) -> Void)? + + +public var notifyHasOrigin: ((Scale, OpaquePointer) -> Void)? + + +public var notifyValuePos: ((Scale, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ScrollStep.swift b/Sources/Gtk/Generated/ScrollStep.swift index 0432f12244..4b408bad16 100644 --- a/Sources/Gtk/Generated/ScrollStep.swift +++ b/Sources/Gtk/Generated/ScrollStep.swift @@ -5,36 +5,36 @@ public enum ScrollStep: GValueRepresentableEnum { public typealias GtkEnum = GtkScrollStep /// Scroll in steps. - case steps - /// Scroll by pages. - case pages - /// Scroll to ends. - case ends - /// Scroll in horizontal steps. - case horizontalSteps - /// Scroll by horizontal pages. - case horizontalPages - /// Scroll to the horizontal ends. - case horizontalEnds +case steps +/// Scroll by pages. +case pages +/// Scroll to ends. +case ends +/// Scroll in horizontal steps. +case horizontalSteps +/// Scroll by horizontal pages. +case horizontalPages +/// Scroll to the horizontal ends. +case horizontalEnds public static var type: GType { - gtk_scroll_step_get_type() - } + gtk_scroll_step_get_type() +} public init(from gtkEnum: GtkScrollStep) { switch gtkEnum { case GTK_SCROLL_STEPS: - self = .steps - case GTK_SCROLL_PAGES: - self = .pages - case GTK_SCROLL_ENDS: - self = .ends - case GTK_SCROLL_HORIZONTAL_STEPS: - self = .horizontalSteps - case GTK_SCROLL_HORIZONTAL_PAGES: - self = .horizontalPages - case GTK_SCROLL_HORIZONTAL_ENDS: - self = .horizontalEnds + self = .steps +case GTK_SCROLL_PAGES: + self = .pages +case GTK_SCROLL_ENDS: + self = .ends +case GTK_SCROLL_HORIZONTAL_STEPS: + self = .horizontalSteps +case GTK_SCROLL_HORIZONTAL_PAGES: + self = .horizontalPages +case GTK_SCROLL_HORIZONTAL_ENDS: + self = .horizontalEnds default: fatalError("Unsupported GtkScrollStep enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ public enum ScrollStep: GValueRepresentableEnum { public func toGtk() -> GtkScrollStep { switch self { case .steps: - return GTK_SCROLL_STEPS - case .pages: - return GTK_SCROLL_PAGES - case .ends: - return GTK_SCROLL_ENDS - case .horizontalSteps: - return GTK_SCROLL_HORIZONTAL_STEPS - case .horizontalPages: - return GTK_SCROLL_HORIZONTAL_PAGES - case .horizontalEnds: - return GTK_SCROLL_HORIZONTAL_ENDS + return GTK_SCROLL_STEPS +case .pages: + return GTK_SCROLL_PAGES +case .ends: + return GTK_SCROLL_ENDS +case .horizontalSteps: + return GTK_SCROLL_HORIZONTAL_STEPS +case .horizontalPages: + return GTK_SCROLL_HORIZONTAL_PAGES +case .horizontalEnds: + return GTK_SCROLL_HORIZONTAL_ENDS } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ScrollType.swift b/Sources/Gtk/Generated/ScrollType.swift index 88054fa724..d952af8897 100644 --- a/Sources/Gtk/Generated/ScrollType.swift +++ b/Sources/Gtk/Generated/ScrollType.swift @@ -5,76 +5,76 @@ public enum ScrollType: GValueRepresentableEnum { public typealias GtkEnum = GtkScrollType /// No scrolling. - case none - /// Jump to new location. - case jump - /// Step backward. - case stepBackward - /// Step forward. - case stepForward - /// Page backward. - case pageBackward - /// Page forward. - case pageForward - /// Step up. - case stepUp - /// Step down. - case stepDown - /// Page up. - case pageUp - /// Page down. - case pageDown - /// Step to the left. - case stepLeft - /// Step to the right. - case stepRight - /// Page to the left. - case pageLeft - /// Page to the right. - case pageRight - /// Scroll to start. - case start - /// Scroll to end. - case end +case none +/// Jump to new location. +case jump +/// Step backward. +case stepBackward +/// Step forward. +case stepForward +/// Page backward. +case pageBackward +/// Page forward. +case pageForward +/// Step up. +case stepUp +/// Step down. +case stepDown +/// Page up. +case pageUp +/// Page down. +case pageDown +/// Step to the left. +case stepLeft +/// Step to the right. +case stepRight +/// Page to the left. +case pageLeft +/// Page to the right. +case pageRight +/// Scroll to start. +case start +/// Scroll to end. +case end public static var type: GType { - gtk_scroll_type_get_type() - } + gtk_scroll_type_get_type() +} public init(from gtkEnum: GtkScrollType) { switch gtkEnum { case GTK_SCROLL_NONE: - self = .none - case GTK_SCROLL_JUMP: - self = .jump - case GTK_SCROLL_STEP_BACKWARD: - self = .stepBackward - case GTK_SCROLL_STEP_FORWARD: - self = .stepForward - case GTK_SCROLL_PAGE_BACKWARD: - self = .pageBackward - case GTK_SCROLL_PAGE_FORWARD: - self = .pageForward - case GTK_SCROLL_STEP_UP: - self = .stepUp - case GTK_SCROLL_STEP_DOWN: - self = .stepDown - case GTK_SCROLL_PAGE_UP: - self = .pageUp - case GTK_SCROLL_PAGE_DOWN: - self = .pageDown - case GTK_SCROLL_STEP_LEFT: - self = .stepLeft - case GTK_SCROLL_STEP_RIGHT: - self = .stepRight - case GTK_SCROLL_PAGE_LEFT: - self = .pageLeft - case GTK_SCROLL_PAGE_RIGHT: - self = .pageRight - case GTK_SCROLL_START: - self = .start - case GTK_SCROLL_END: - self = .end + self = .none +case GTK_SCROLL_JUMP: + self = .jump +case GTK_SCROLL_STEP_BACKWARD: + self = .stepBackward +case GTK_SCROLL_STEP_FORWARD: + self = .stepForward +case GTK_SCROLL_PAGE_BACKWARD: + self = .pageBackward +case GTK_SCROLL_PAGE_FORWARD: + self = .pageForward +case GTK_SCROLL_STEP_UP: + self = .stepUp +case GTK_SCROLL_STEP_DOWN: + self = .stepDown +case GTK_SCROLL_PAGE_UP: + self = .pageUp +case GTK_SCROLL_PAGE_DOWN: + self = .pageDown +case GTK_SCROLL_STEP_LEFT: + self = .stepLeft +case GTK_SCROLL_STEP_RIGHT: + self = .stepRight +case GTK_SCROLL_PAGE_LEFT: + self = .pageLeft +case GTK_SCROLL_PAGE_RIGHT: + self = .pageRight +case GTK_SCROLL_START: + self = .start +case GTK_SCROLL_END: + self = .end default: fatalError("Unsupported GtkScrollType enum value: \(gtkEnum.rawValue)") } @@ -83,37 +83,37 @@ public enum ScrollType: GValueRepresentableEnum { public func toGtk() -> GtkScrollType { switch self { case .none: - return GTK_SCROLL_NONE - case .jump: - return GTK_SCROLL_JUMP - case .stepBackward: - return GTK_SCROLL_STEP_BACKWARD - case .stepForward: - return GTK_SCROLL_STEP_FORWARD - case .pageBackward: - return GTK_SCROLL_PAGE_BACKWARD - case .pageForward: - return GTK_SCROLL_PAGE_FORWARD - case .stepUp: - return GTK_SCROLL_STEP_UP - case .stepDown: - return GTK_SCROLL_STEP_DOWN - case .pageUp: - return GTK_SCROLL_PAGE_UP - case .pageDown: - return GTK_SCROLL_PAGE_DOWN - case .stepLeft: - return GTK_SCROLL_STEP_LEFT - case .stepRight: - return GTK_SCROLL_STEP_RIGHT - case .pageLeft: - return GTK_SCROLL_PAGE_LEFT - case .pageRight: - return GTK_SCROLL_PAGE_RIGHT - case .start: - return GTK_SCROLL_START - case .end: - return GTK_SCROLL_END + return GTK_SCROLL_NONE +case .jump: + return GTK_SCROLL_JUMP +case .stepBackward: + return GTK_SCROLL_STEP_BACKWARD +case .stepForward: + return GTK_SCROLL_STEP_FORWARD +case .pageBackward: + return GTK_SCROLL_PAGE_BACKWARD +case .pageForward: + return GTK_SCROLL_PAGE_FORWARD +case .stepUp: + return GTK_SCROLL_STEP_UP +case .stepDown: + return GTK_SCROLL_STEP_DOWN +case .pageUp: + return GTK_SCROLL_PAGE_UP +case .pageDown: + return GTK_SCROLL_PAGE_DOWN +case .stepLeft: + return GTK_SCROLL_STEP_LEFT +case .stepRight: + return GTK_SCROLL_STEP_RIGHT +case .pageLeft: + return GTK_SCROLL_PAGE_LEFT +case .pageRight: + return GTK_SCROLL_PAGE_RIGHT +case .start: + return GTK_SCROLL_START +case .end: + return GTK_SCROLL_END } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Scrollable.swift b/Sources/Gtk/Generated/Scrollable.swift index 10f42ccffd..9e9cf83579 100644 --- a/Sources/Gtk/Generated/Scrollable.swift +++ b/Sources/Gtk/Generated/Scrollable.swift @@ -1,38 +1,39 @@ import CGtk /// An interface for widgets with native scrolling ability. -/// +/// /// To implement this interface you should override the /// [property@Gtk.Scrollable:hadjustment] and /// [property@Gtk.Scrollable:vadjustment] properties. -/// +/// /// ## Creating a scrollable widget -/// +/// /// All scrollable widgets should do the following. -/// +/// /// - When a parent widget sets the scrollable child widget’s adjustments, /// the widget should connect to the [signal@Gtk.Adjustment::value-changed] /// signal. The child widget should then populate the adjustments’ properties /// as soon as possible, which usually means queueing an allocation right away /// and populating the properties in the [vfunc@Gtk.Widget.size_allocate] /// implementation. -/// +/// /// - Because its preferred size is the size for a fully expanded widget, /// the scrollable widget must be able to cope with underallocations. /// This means that it must accept any value passed to its /// [vfunc@Gtk.Widget.size_allocate] implementation. -/// +/// /// - When the parent allocates space to the scrollable child widget, /// the widget must ensure the adjustments’ property values are correct and up /// to date, for example using [method@Gtk.Adjustment.configure]. -/// +/// /// - When any of the adjustments emits the [signal@Gtk.Adjustment::value-changed] /// signal, the scrollable widget should scroll its contents. public protocol Scrollable: GObjectRepresentable { /// Determines when horizontal scrolling should start. - var hscrollPolicy: ScrollablePolicy { get set } +var hscrollPolicy: ScrollablePolicy { get set } - /// Determines when vertical scrolling should start. - var vscrollPolicy: ScrollablePolicy { get set } +/// Determines when vertical scrolling should start. +var vscrollPolicy: ScrollablePolicy { get set } -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ScrollablePolicy.swift b/Sources/Gtk/Generated/ScrollablePolicy.swift index 1e47fa44d0..5b2f2cd335 100644 --- a/Sources/Gtk/Generated/ScrollablePolicy.swift +++ b/Sources/Gtk/Generated/ScrollablePolicy.swift @@ -6,20 +6,20 @@ public enum ScrollablePolicy: GValueRepresentableEnum { public typealias GtkEnum = GtkScrollablePolicy /// Scrollable adjustments are based on the minimum size - case minimum - /// Scrollable adjustments are based on the natural size - case natural +case minimum +/// Scrollable adjustments are based on the natural size +case natural public static var type: GType { - gtk_scrollable_policy_get_type() - } + gtk_scrollable_policy_get_type() +} public init(from gtkEnum: GtkScrollablePolicy) { switch gtkEnum { case GTK_SCROLL_MINIMUM: - self = .minimum - case GTK_SCROLL_NATURAL: - self = .natural + self = .minimum +case GTK_SCROLL_NATURAL: + self = .natural default: fatalError("Unsupported GtkScrollablePolicy enum value: \(gtkEnum.rawValue)") } @@ -28,9 +28,9 @@ public enum ScrollablePolicy: GValueRepresentableEnum { public func toGtk() -> GtkScrollablePolicy { switch self { case .minimum: - return GTK_SCROLL_MINIMUM - case .natural: - return GTK_SCROLL_NATURAL + return GTK_SCROLL_MINIMUM +case .natural: + return GTK_SCROLL_NATURAL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SelectionMode.swift b/Sources/Gtk/Generated/SelectionMode.swift index c97d0a94b3..594b4d82d9 100644 --- a/Sources/Gtk/Generated/SelectionMode.swift +++ b/Sources/Gtk/Generated/SelectionMode.swift @@ -5,36 +5,36 @@ public enum SelectionMode: GValueRepresentableEnum { public typealias GtkEnum = GtkSelectionMode /// No selection is possible. - case none - /// Zero or one element may be selected. - case single - /// Exactly one element is selected. - /// In some circumstances, such as initially or during a search - /// operation, it’s possible for no element to be selected with - /// %GTK_SELECTION_BROWSE. What is really enforced is that the user - /// can’t deselect a currently selected element except by selecting - /// another element. - case browse - /// Any number of elements may be selected. - /// The Ctrl key may be used to enlarge the selection, and Shift - /// key to select between the focus and the child pointed to. - /// Some widgets may also allow Click-drag to select a range of elements. - case multiple +case none +/// Zero or one element may be selected. +case single +/// Exactly one element is selected. +/// In some circumstances, such as initially or during a search +/// operation, it’s possible for no element to be selected with +/// %GTK_SELECTION_BROWSE. What is really enforced is that the user +/// can’t deselect a currently selected element except by selecting +/// another element. +case browse +/// Any number of elements may be selected. +/// The Ctrl key may be used to enlarge the selection, and Shift +/// key to select between the focus and the child pointed to. +/// Some widgets may also allow Click-drag to select a range of elements. +case multiple public static var type: GType { - gtk_selection_mode_get_type() - } + gtk_selection_mode_get_type() +} public init(from gtkEnum: GtkSelectionMode) { switch gtkEnum { case GTK_SELECTION_NONE: - self = .none - case GTK_SELECTION_SINGLE: - self = .single - case GTK_SELECTION_BROWSE: - self = .browse - case GTK_SELECTION_MULTIPLE: - self = .multiple + self = .none +case GTK_SELECTION_SINGLE: + self = .single +case GTK_SELECTION_BROWSE: + self = .browse +case GTK_SELECTION_MULTIPLE: + self = .multiple default: fatalError("Unsupported GtkSelectionMode enum value: \(gtkEnum.rawValue)") } @@ -43,13 +43,13 @@ public enum SelectionMode: GValueRepresentableEnum { public func toGtk() -> GtkSelectionMode { switch self { case .none: - return GTK_SELECTION_NONE - case .single: - return GTK_SELECTION_SINGLE - case .browse: - return GTK_SELECTION_BROWSE - case .multiple: - return GTK_SELECTION_MULTIPLE + return GTK_SELECTION_NONE +case .single: + return GTK_SELECTION_SINGLE +case .browse: + return GTK_SELECTION_BROWSE +case .multiple: + return GTK_SELECTION_MULTIPLE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SelectionModel.swift b/Sources/Gtk/Generated/SelectionModel.swift index 4b401bb239..fd59aa71c9 100644 --- a/Sources/Gtk/Generated/SelectionModel.swift +++ b/Sources/Gtk/Generated/SelectionModel.swift @@ -1,14 +1,14 @@ import CGtk /// An interface that adds support for selection to list models. -/// +/// /// This support is then used by widgets using list models to add the ability /// to select and unselect various items. -/// +/// /// GTK provides default implementations of the most common selection modes such /// as [class@Gtk.SingleSelection], so you will only need to implement this /// interface if you want detailed control about how selections should be handled. -/// +/// /// A `GtkSelectionModel` supports a single boolean per item indicating if an item is /// selected or not. This can be queried via [method@Gtk.SelectionModel.is_selected]. /// When the selected state of one or more items changes, the model will emit the @@ -18,32 +18,33 @@ import CGtk /// requirement. If new items added to the model via the /// [signal@Gio.ListModel::items-changed] signal are selected or not is up to the /// implementation. -/// +/// /// Note that items added via [signal@Gio.ListModel::items-changed] may already /// be selected and no [signal@Gtk.SelectionModel::selection-changed] will be /// emitted for them. So to track which items are selected, it is necessary to /// listen to both signals. -/// +/// /// Additionally, the interface can expose functionality to select and unselect /// items. If these functions are implemented, GTK's list widgets will allow users /// to select and unselect items. However, `GtkSelectionModel`s are free to only /// implement them partially or not at all. In that case the widgets will not /// support the unimplemented operations. -/// +/// /// When selecting or unselecting is supported by a model, the return values of /// the selection functions do *not* indicate if selection or unselection happened. /// They are only meant to indicate complete failure, like when this mode of /// selecting is not supported by the model. -/// +/// /// Selections may happen asynchronously, so the only reliable way to find out /// when an item was selected is to listen to the signals that indicate selection. public protocol SelectionModel: GObjectRepresentable { + /// Emitted when the selection state of some of the items in @model changes. - /// - /// Note that this signal does not specify the new selection state of the - /// items, they need to be queried manually. It is also not necessary for - /// a model to change the selection state of any of the items in the selection - /// model, though it would be rather useless to emit such a signal. - var selectionChanged: ((Self, UInt, UInt) -> Void)? { get set } -} +/// +/// Note that this signal does not specify the new selection state of the +/// items, they need to be queried manually. It is also not necessary for +/// a model to change the selection state of any of the items in the selection +/// model, though it would be rather useless to emit such a signal. +var selectionChanged: ((Self, UInt, UInt) -> Void)? { get set } +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SensitivityType.swift b/Sources/Gtk/Generated/SensitivityType.swift index df5c24ecb6..edff95c786 100644 --- a/Sources/Gtk/Generated/SensitivityType.swift +++ b/Sources/Gtk/Generated/SensitivityType.swift @@ -6,25 +6,25 @@ public enum SensitivityType: GValueRepresentableEnum { public typealias GtkEnum = GtkSensitivityType /// The control is made insensitive if no - /// action can be triggered - case auto - /// The control is always sensitive - case on - /// The control is always insensitive - case off +/// action can be triggered +case auto +/// The control is always sensitive +case on +/// The control is always insensitive +case off public static var type: GType { - gtk_sensitivity_type_get_type() - } + gtk_sensitivity_type_get_type() +} public init(from gtkEnum: GtkSensitivityType) { switch gtkEnum { case GTK_SENSITIVITY_AUTO: - self = .auto - case GTK_SENSITIVITY_ON: - self = .on - case GTK_SENSITIVITY_OFF: - self = .off + self = .auto +case GTK_SENSITIVITY_ON: + self = .on +case GTK_SENSITIVITY_OFF: + self = .off default: fatalError("Unsupported GtkSensitivityType enum value: \(gtkEnum.rawValue)") } @@ -33,11 +33,11 @@ public enum SensitivityType: GValueRepresentableEnum { public func toGtk() -> GtkSensitivityType { switch self { case .auto: - return GTK_SENSITIVITY_AUTO - case .on: - return GTK_SENSITIVITY_ON - case .off: - return GTK_SENSITIVITY_OFF + return GTK_SENSITIVITY_AUTO +case .on: + return GTK_SENSITIVITY_ON +case .off: + return GTK_SENSITIVITY_OFF } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ShortcutManager.swift b/Sources/Gtk/Generated/ShortcutManager.swift index 793602901d..9faa713766 100644 --- a/Sources/Gtk/Generated/ShortcutManager.swift +++ b/Sources/Gtk/Generated/ShortcutManager.swift @@ -1,16 +1,18 @@ import CGtk /// An interface that is used to implement shortcut scopes. -/// +/// /// This is important for [iface@Gtk.Native] widgets that have their /// own surface, since the event controllers that are used to implement /// managed and global scopes are limited to the same native. -/// +/// /// Examples for widgets implementing `GtkShortcutManager` are /// [class@Gtk.Window] and [class@Gtk.Popover]. -/// +/// /// Every widget that implements `GtkShortcutManager` will be used as a /// `GTK_SHORTCUT_SCOPE_MANAGED`. public protocol ShortcutManager: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ShortcutScope.swift b/Sources/Gtk/Generated/ShortcutScope.swift index 52c905c929..5f52020322 100644 --- a/Sources/Gtk/Generated/ShortcutScope.swift +++ b/Sources/Gtk/Generated/ShortcutScope.swift @@ -6,27 +6,27 @@ public enum ShortcutScope: GValueRepresentableEnum { public typealias GtkEnum = GtkShortcutScope /// Shortcuts are handled inside - /// the widget the controller belongs to. - case local - /// Shortcuts are handled by - /// the first ancestor that is a [iface@ShortcutManager] - case managed - /// Shortcuts are handled by - /// the root widget. - case global +/// the widget the controller belongs to. +case local +/// Shortcuts are handled by +/// the first ancestor that is a [iface@ShortcutManager] +case managed +/// Shortcuts are handled by +/// the root widget. +case global public static var type: GType { - gtk_shortcut_scope_get_type() - } + gtk_shortcut_scope_get_type() +} public init(from gtkEnum: GtkShortcutScope) { switch gtkEnum { case GTK_SHORTCUT_SCOPE_LOCAL: - self = .local - case GTK_SHORTCUT_SCOPE_MANAGED: - self = .managed - case GTK_SHORTCUT_SCOPE_GLOBAL: - self = .global + self = .local +case GTK_SHORTCUT_SCOPE_MANAGED: + self = .managed +case GTK_SHORTCUT_SCOPE_GLOBAL: + self = .global default: fatalError("Unsupported GtkShortcutScope enum value: \(gtkEnum.rawValue)") } @@ -35,11 +35,11 @@ public enum ShortcutScope: GValueRepresentableEnum { public func toGtk() -> GtkShortcutScope { switch self { case .local: - return GTK_SHORTCUT_SCOPE_LOCAL - case .managed: - return GTK_SHORTCUT_SCOPE_MANAGED - case .global: - return GTK_SHORTCUT_SCOPE_GLOBAL + return GTK_SHORTCUT_SCOPE_LOCAL +case .managed: + return GTK_SHORTCUT_SCOPE_MANAGED +case .global: + return GTK_SHORTCUT_SCOPE_GLOBAL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/ShortcutType.swift b/Sources/Gtk/Generated/ShortcutType.swift index 8461c30a95..a3d57b53c7 100644 --- a/Sources/Gtk/Generated/ShortcutType.swift +++ b/Sources/Gtk/Generated/ShortcutType.swift @@ -1,60 +1,60 @@ import CGtk /// GtkShortcutType specifies the kind of shortcut that is being described. -/// +/// /// More values may be added to this enumeration over time. public enum ShortcutType: GValueRepresentableEnum { public typealias GtkEnum = GtkShortcutType /// The shortcut is a keyboard accelerator. The GtkShortcutsShortcut:accelerator - /// property will be used. - case accelerator - /// The shortcut is a pinch gesture. GTK provides an icon and subtitle. - case gesturePinch - /// The shortcut is a stretch gesture. GTK provides an icon and subtitle. - case gestureStretch - /// The shortcut is a clockwise rotation gesture. GTK provides an icon and subtitle. - case gestureRotateClockwise - /// The shortcut is a counterclockwise rotation gesture. GTK provides an icon and subtitle. - case gestureRotateCounterclockwise - /// The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle. - case gestureTwoFingerSwipeLeft - /// The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle. - case gestureTwoFingerSwipeRight - /// The shortcut is a gesture. The GtkShortcutsShortcut:icon property will be - /// used. - case gesture - /// The shortcut is a swipe gesture. GTK provides an icon and subtitle. - case gestureSwipeLeft - /// The shortcut is a swipe gesture. GTK provides an icon and subtitle. - case gestureSwipeRight +/// property will be used. +case accelerator +/// The shortcut is a pinch gesture. GTK provides an icon and subtitle. +case gesturePinch +/// The shortcut is a stretch gesture. GTK provides an icon and subtitle. +case gestureStretch +/// The shortcut is a clockwise rotation gesture. GTK provides an icon and subtitle. +case gestureRotateClockwise +/// The shortcut is a counterclockwise rotation gesture. GTK provides an icon and subtitle. +case gestureRotateCounterclockwise +/// The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle. +case gestureTwoFingerSwipeLeft +/// The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle. +case gestureTwoFingerSwipeRight +/// The shortcut is a gesture. The GtkShortcutsShortcut:icon property will be +/// used. +case gesture +/// The shortcut is a swipe gesture. GTK provides an icon and subtitle. +case gestureSwipeLeft +/// The shortcut is a swipe gesture. GTK provides an icon and subtitle. +case gestureSwipeRight public static var type: GType { - gtk_shortcut_type_get_type() - } + gtk_shortcut_type_get_type() +} public init(from gtkEnum: GtkShortcutType) { switch gtkEnum { case GTK_SHORTCUT_ACCELERATOR: - self = .accelerator - case GTK_SHORTCUT_GESTURE_PINCH: - self = .gesturePinch - case GTK_SHORTCUT_GESTURE_STRETCH: - self = .gestureStretch - case GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE: - self = .gestureRotateClockwise - case GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE: - self = .gestureRotateCounterclockwise - case GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT: - self = .gestureTwoFingerSwipeLeft - case GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT: - self = .gestureTwoFingerSwipeRight - case GTK_SHORTCUT_GESTURE: - self = .gesture - case GTK_SHORTCUT_GESTURE_SWIPE_LEFT: - self = .gestureSwipeLeft - case GTK_SHORTCUT_GESTURE_SWIPE_RIGHT: - self = .gestureSwipeRight + self = .accelerator +case GTK_SHORTCUT_GESTURE_PINCH: + self = .gesturePinch +case GTK_SHORTCUT_GESTURE_STRETCH: + self = .gestureStretch +case GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE: + self = .gestureRotateClockwise +case GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE: + self = .gestureRotateCounterclockwise +case GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT: + self = .gestureTwoFingerSwipeLeft +case GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT: + self = .gestureTwoFingerSwipeRight +case GTK_SHORTCUT_GESTURE: + self = .gesture +case GTK_SHORTCUT_GESTURE_SWIPE_LEFT: + self = .gestureSwipeLeft +case GTK_SHORTCUT_GESTURE_SWIPE_RIGHT: + self = .gestureSwipeRight default: fatalError("Unsupported GtkShortcutType enum value: \(gtkEnum.rawValue)") } @@ -63,25 +63,25 @@ public enum ShortcutType: GValueRepresentableEnum { public func toGtk() -> GtkShortcutType { switch self { case .accelerator: - return GTK_SHORTCUT_ACCELERATOR - case .gesturePinch: - return GTK_SHORTCUT_GESTURE_PINCH - case .gestureStretch: - return GTK_SHORTCUT_GESTURE_STRETCH - case .gestureRotateClockwise: - return GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE - case .gestureRotateCounterclockwise: - return GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE - case .gestureTwoFingerSwipeLeft: - return GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT - case .gestureTwoFingerSwipeRight: - return GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT - case .gesture: - return GTK_SHORTCUT_GESTURE - case .gestureSwipeLeft: - return GTK_SHORTCUT_GESTURE_SWIPE_LEFT - case .gestureSwipeRight: - return GTK_SHORTCUT_GESTURE_SWIPE_RIGHT + return GTK_SHORTCUT_ACCELERATOR +case .gesturePinch: + return GTK_SHORTCUT_GESTURE_PINCH +case .gestureStretch: + return GTK_SHORTCUT_GESTURE_STRETCH +case .gestureRotateClockwise: + return GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE +case .gestureRotateCounterclockwise: + return GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE +case .gestureTwoFingerSwipeLeft: + return GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT +case .gestureTwoFingerSwipeRight: + return GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT +case .gesture: + return GTK_SHORTCUT_GESTURE +case .gestureSwipeLeft: + return GTK_SHORTCUT_GESTURE_SWIPE_LEFT +case .gestureSwipeRight: + return GTK_SHORTCUT_GESTURE_SWIPE_RIGHT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SizeGroupMode.swift b/Sources/Gtk/Generated/SizeGroupMode.swift index 5a4a684fbd..bd98e748f7 100644 --- a/Sources/Gtk/Generated/SizeGroupMode.swift +++ b/Sources/Gtk/Generated/SizeGroupMode.swift @@ -6,28 +6,28 @@ public enum SizeGroupMode: GValueRepresentableEnum { public typealias GtkEnum = GtkSizeGroupMode /// Group has no effect - case none - /// Group affects horizontal requisition - case horizontal - /// Group affects vertical requisition - case vertical - /// Group affects both horizontal and vertical requisition - case both +case none +/// Group affects horizontal requisition +case horizontal +/// Group affects vertical requisition +case vertical +/// Group affects both horizontal and vertical requisition +case both public static var type: GType { - gtk_size_group_mode_get_type() - } + gtk_size_group_mode_get_type() +} public init(from gtkEnum: GtkSizeGroupMode) { switch gtkEnum { case GTK_SIZE_GROUP_NONE: - self = .none - case GTK_SIZE_GROUP_HORIZONTAL: - self = .horizontal - case GTK_SIZE_GROUP_VERTICAL: - self = .vertical - case GTK_SIZE_GROUP_BOTH: - self = .both + self = .none +case GTK_SIZE_GROUP_HORIZONTAL: + self = .horizontal +case GTK_SIZE_GROUP_VERTICAL: + self = .vertical +case GTK_SIZE_GROUP_BOTH: + self = .both default: fatalError("Unsupported GtkSizeGroupMode enum value: \(gtkEnum.rawValue)") } @@ -36,13 +36,13 @@ public enum SizeGroupMode: GValueRepresentableEnum { public func toGtk() -> GtkSizeGroupMode { switch self { case .none: - return GTK_SIZE_GROUP_NONE - case .horizontal: - return GTK_SIZE_GROUP_HORIZONTAL - case .vertical: - return GTK_SIZE_GROUP_VERTICAL - case .both: - return GTK_SIZE_GROUP_BOTH + return GTK_SIZE_GROUP_NONE +case .horizontal: + return GTK_SIZE_GROUP_HORIZONTAL +case .vertical: + return GTK_SIZE_GROUP_VERTICAL +case .both: + return GTK_SIZE_GROUP_BOTH } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SizeRequestMode.swift b/Sources/Gtk/Generated/SizeRequestMode.swift index 4ed9def07c..14b590f8e2 100644 --- a/Sources/Gtk/Generated/SizeRequestMode.swift +++ b/Sources/Gtk/Generated/SizeRequestMode.swift @@ -6,24 +6,24 @@ public enum SizeRequestMode: GValueRepresentableEnum { public typealias GtkEnum = GtkSizeRequestMode /// Prefer height-for-width geometry management - case heightForWidth - /// Prefer width-for-height geometry management - case widthForHeight - /// Don’t trade height-for-width or width-for-height - case constantSize +case heightForWidth +/// Prefer width-for-height geometry management +case widthForHeight +/// Don’t trade height-for-width or width-for-height +case constantSize public static var type: GType { - gtk_size_request_mode_get_type() - } + gtk_size_request_mode_get_type() +} public init(from gtkEnum: GtkSizeRequestMode) { switch gtkEnum { case GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH: - self = .heightForWidth - case GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT: - self = .widthForHeight - case GTK_SIZE_REQUEST_CONSTANT_SIZE: - self = .constantSize + self = .heightForWidth +case GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT: + self = .widthForHeight +case GTK_SIZE_REQUEST_CONSTANT_SIZE: + self = .constantSize default: fatalError("Unsupported GtkSizeRequestMode enum value: \(gtkEnum.rawValue)") } @@ -32,11 +32,11 @@ public enum SizeRequestMode: GValueRepresentableEnum { public func toGtk() -> GtkSizeRequestMode { switch self { case .heightForWidth: - return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH - case .widthForHeight: - return GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT - case .constantSize: - return GTK_SIZE_REQUEST_CONSTANT_SIZE + return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH +case .widthForHeight: + return GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT +case .constantSize: + return GTK_SIZE_REQUEST_CONSTANT_SIZE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SortType.swift b/Sources/Gtk/Generated/SortType.swift index 2a19d30b89..78d4dab6ae 100644 --- a/Sources/Gtk/Generated/SortType.swift +++ b/Sources/Gtk/Generated/SortType.swift @@ -5,20 +5,20 @@ public enum SortType: GValueRepresentableEnum { public typealias GtkEnum = GtkSortType /// Sorting is in ascending order. - case ascending - /// Sorting is in descending order. - case descending +case ascending +/// Sorting is in descending order. +case descending public static var type: GType { - gtk_sort_type_get_type() - } + gtk_sort_type_get_type() +} public init(from gtkEnum: GtkSortType) { switch gtkEnum { case GTK_SORT_ASCENDING: - self = .ascending - case GTK_SORT_DESCENDING: - self = .descending + self = .ascending +case GTK_SORT_DESCENDING: + self = .descending default: fatalError("Unsupported GtkSortType enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ public enum SortType: GValueRepresentableEnum { public func toGtk() -> GtkSortType { switch self { case .ascending: - return GTK_SORT_ASCENDING - case .descending: - return GTK_SORT_DESCENDING + return GTK_SORT_ASCENDING +case .descending: + return GTK_SORT_DESCENDING } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SorterChange.swift b/Sources/Gtk/Generated/SorterChange.swift index a7cf38e399..1624530ab0 100644 --- a/Sources/Gtk/Generated/SorterChange.swift +++ b/Sources/Gtk/Generated/SorterChange.swift @@ -6,33 +6,33 @@ public enum SorterChange: GValueRepresentableEnum { public typealias GtkEnum = GtkSorterChange /// The sorter change cannot be described - /// by any of the other enumeration values - case different - /// The sort order was inverted. Comparisons - /// that returned %GTK_ORDERING_SMALLER now return %GTK_ORDERING_LARGER - /// and vice versa. Other comparisons return the same values as before. - case inverted - /// The sorter is less strict: Comparisons - /// may now return %GTK_ORDERING_EQUAL that did not do so before. - case lessStrict - /// The sorter is more strict: Comparisons - /// that did return %GTK_ORDERING_EQUAL may not do so anymore. - case moreStrict +/// by any of the other enumeration values +case different +/// The sort order was inverted. Comparisons +/// that returned %GTK_ORDERING_SMALLER now return %GTK_ORDERING_LARGER +/// and vice versa. Other comparisons return the same values as before. +case inverted +/// The sorter is less strict: Comparisons +/// may now return %GTK_ORDERING_EQUAL that did not do so before. +case lessStrict +/// The sorter is more strict: Comparisons +/// that did return %GTK_ORDERING_EQUAL may not do so anymore. +case moreStrict public static var type: GType { - gtk_sorter_change_get_type() - } + gtk_sorter_change_get_type() +} public init(from gtkEnum: GtkSorterChange) { switch gtkEnum { case GTK_SORTER_CHANGE_DIFFERENT: - self = .different - case GTK_SORTER_CHANGE_INVERTED: - self = .inverted - case GTK_SORTER_CHANGE_LESS_STRICT: - self = .lessStrict - case GTK_SORTER_CHANGE_MORE_STRICT: - self = .moreStrict + self = .different +case GTK_SORTER_CHANGE_INVERTED: + self = .inverted +case GTK_SORTER_CHANGE_LESS_STRICT: + self = .lessStrict +case GTK_SORTER_CHANGE_MORE_STRICT: + self = .moreStrict default: fatalError("Unsupported GtkSorterChange enum value: \(gtkEnum.rawValue)") } @@ -41,13 +41,13 @@ public enum SorterChange: GValueRepresentableEnum { public func toGtk() -> GtkSorterChange { switch self { case .different: - return GTK_SORTER_CHANGE_DIFFERENT - case .inverted: - return GTK_SORTER_CHANGE_INVERTED - case .lessStrict: - return GTK_SORTER_CHANGE_LESS_STRICT - case .moreStrict: - return GTK_SORTER_CHANGE_MORE_STRICT + return GTK_SORTER_CHANGE_DIFFERENT +case .inverted: + return GTK_SORTER_CHANGE_INVERTED +case .lessStrict: + return GTK_SORTER_CHANGE_LESS_STRICT +case .moreStrict: + return GTK_SORTER_CHANGE_MORE_STRICT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SorterOrder.swift b/Sources/Gtk/Generated/SorterOrder.swift index 193596801b..4fb6394d40 100644 --- a/Sources/Gtk/Generated/SorterOrder.swift +++ b/Sources/Gtk/Generated/SorterOrder.swift @@ -5,27 +5,27 @@ public enum SorterOrder: GValueRepresentableEnum { public typealias GtkEnum = GtkSorterOrder /// A partial order. Any `GtkOrdering` is possible. - case partial - /// No order, all elements are considered equal. - /// gtk_sorter_compare() will only return %GTK_ORDERING_EQUAL. - case none - /// A total order. gtk_sorter_compare() will only - /// return %GTK_ORDERING_EQUAL if an item is compared with itself. Two - /// different items will never cause this value to be returned. - case total +case partial +/// No order, all elements are considered equal. +/// gtk_sorter_compare() will only return %GTK_ORDERING_EQUAL. +case none +/// A total order. gtk_sorter_compare() will only +/// return %GTK_ORDERING_EQUAL if an item is compared with itself. Two +/// different items will never cause this value to be returned. +case total public static var type: GType { - gtk_sorter_order_get_type() - } + gtk_sorter_order_get_type() +} public init(from gtkEnum: GtkSorterOrder) { switch gtkEnum { case GTK_SORTER_ORDER_PARTIAL: - self = .partial - case GTK_SORTER_ORDER_NONE: - self = .none - case GTK_SORTER_ORDER_TOTAL: - self = .total + self = .partial +case GTK_SORTER_ORDER_NONE: + self = .none +case GTK_SORTER_ORDER_TOTAL: + self = .total default: fatalError("Unsupported GtkSorterOrder enum value: \(gtkEnum.rawValue)") } @@ -34,11 +34,11 @@ public enum SorterOrder: GValueRepresentableEnum { public func toGtk() -> GtkSorterOrder { switch self { case .partial: - return GTK_SORTER_ORDER_PARTIAL - case .none: - return GTK_SORTER_ORDER_NONE - case .total: - return GTK_SORTER_ORDER_TOTAL + return GTK_SORTER_ORDER_PARTIAL +case .none: + return GTK_SORTER_ORDER_NONE +case .total: + return GTK_SORTER_ORDER_TOTAL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SpinButtonUpdatePolicy.swift b/Sources/Gtk/Generated/SpinButtonUpdatePolicy.swift index f2064ada87..14e0410ba8 100644 --- a/Sources/Gtk/Generated/SpinButtonUpdatePolicy.swift +++ b/Sources/Gtk/Generated/SpinButtonUpdatePolicy.swift @@ -2,29 +2,29 @@ import CGtk /// Determines whether the spin button displays values outside the adjustment /// bounds. -/// +/// /// See [method@Gtk.SpinButton.set_update_policy]. public enum SpinButtonUpdatePolicy: GValueRepresentableEnum { public typealias GtkEnum = GtkSpinButtonUpdatePolicy /// When refreshing your `GtkSpinButton`, the value is - /// always displayed - case always - /// When refreshing your `GtkSpinButton`, the value is - /// only displayed if it is valid within the bounds of the spin button's - /// adjustment - case ifValid +/// always displayed +case always +/// When refreshing your `GtkSpinButton`, the value is +/// only displayed if it is valid within the bounds of the spin button's +/// adjustment +case ifValid public static var type: GType { - gtk_spin_button_update_policy_get_type() - } + gtk_spin_button_update_policy_get_type() +} public init(from gtkEnum: GtkSpinButtonUpdatePolicy) { switch gtkEnum { case GTK_UPDATE_ALWAYS: - self = .always - case GTK_UPDATE_IF_VALID: - self = .ifValid + self = .always +case GTK_UPDATE_IF_VALID: + self = .ifValid default: fatalError("Unsupported GtkSpinButtonUpdatePolicy enum value: \(gtkEnum.rawValue)") } @@ -33,9 +33,9 @@ public enum SpinButtonUpdatePolicy: GValueRepresentableEnum { public func toGtk() -> GtkSpinButtonUpdatePolicy { switch self { case .always: - return GTK_UPDATE_ALWAYS - case .ifValid: - return GTK_UPDATE_IF_VALID + return GTK_UPDATE_ALWAYS +case .ifValid: + return GTK_UPDATE_IF_VALID } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SpinType.swift b/Sources/Gtk/Generated/SpinType.swift index 495515dffa..da575388ec 100644 --- a/Sources/Gtk/Generated/SpinType.swift +++ b/Sources/Gtk/Generated/SpinType.swift @@ -6,40 +6,40 @@ public enum SpinType: GValueRepresentableEnum { public typealias GtkEnum = GtkSpinType /// Increment by the adjustments step increment. - case stepForward - /// Decrement by the adjustments step increment. - case stepBackward - /// Increment by the adjustments page increment. - case pageForward - /// Decrement by the adjustments page increment. - case pageBackward - /// Go to the adjustments lower bound. - case home - /// Go to the adjustments upper bound. - case end - /// Change by a specified amount. - case userDefined +case stepForward +/// Decrement by the adjustments step increment. +case stepBackward +/// Increment by the adjustments page increment. +case pageForward +/// Decrement by the adjustments page increment. +case pageBackward +/// Go to the adjustments lower bound. +case home +/// Go to the adjustments upper bound. +case end +/// Change by a specified amount. +case userDefined public static var type: GType { - gtk_spin_type_get_type() - } + gtk_spin_type_get_type() +} public init(from gtkEnum: GtkSpinType) { switch gtkEnum { case GTK_SPIN_STEP_FORWARD: - self = .stepForward - case GTK_SPIN_STEP_BACKWARD: - self = .stepBackward - case GTK_SPIN_PAGE_FORWARD: - self = .pageForward - case GTK_SPIN_PAGE_BACKWARD: - self = .pageBackward - case GTK_SPIN_HOME: - self = .home - case GTK_SPIN_END: - self = .end - case GTK_SPIN_USER_DEFINED: - self = .userDefined + self = .stepForward +case GTK_SPIN_STEP_BACKWARD: + self = .stepBackward +case GTK_SPIN_PAGE_FORWARD: + self = .pageForward +case GTK_SPIN_PAGE_BACKWARD: + self = .pageBackward +case GTK_SPIN_HOME: + self = .home +case GTK_SPIN_END: + self = .end +case GTK_SPIN_USER_DEFINED: + self = .userDefined default: fatalError("Unsupported GtkSpinType enum value: \(gtkEnum.rawValue)") } @@ -48,19 +48,19 @@ public enum SpinType: GValueRepresentableEnum { public func toGtk() -> GtkSpinType { switch self { case .stepForward: - return GTK_SPIN_STEP_FORWARD - case .stepBackward: - return GTK_SPIN_STEP_BACKWARD - case .pageForward: - return GTK_SPIN_PAGE_FORWARD - case .pageBackward: - return GTK_SPIN_PAGE_BACKWARD - case .home: - return GTK_SPIN_HOME - case .end: - return GTK_SPIN_END - case .userDefined: - return GTK_SPIN_USER_DEFINED + return GTK_SPIN_STEP_FORWARD +case .stepBackward: + return GTK_SPIN_STEP_BACKWARD +case .pageForward: + return GTK_SPIN_PAGE_FORWARD +case .pageBackward: + return GTK_SPIN_PAGE_BACKWARD +case .home: + return GTK_SPIN_HOME +case .end: + return GTK_SPIN_END +case .userDefined: + return GTK_SPIN_USER_DEFINED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Spinner.swift b/Sources/Gtk/Generated/Spinner.swift index 3ba1db393c..b3394a0ac2 100644 --- a/Sources/Gtk/Generated/Spinner.swift +++ b/Sources/Gtk/Generated/Spinner.swift @@ -1,46 +1,45 @@ import CGtk /// Displays an icon-size spinning animation. -/// +/// /// It is often used as an alternative to a [class@Gtk.ProgressBar] /// for displaying indefinite activity, instead of actual progress. -/// +/// /// An example GtkSpinner -/// +/// /// To start the animation, use [method@Gtk.Spinner.start], to stop it /// use [method@Gtk.Spinner.stop]. -/// +/// /// # CSS nodes -/// +/// /// `GtkSpinner` has a single CSS node with the name spinner. /// When the animation is active, the :checked pseudoclass is /// added to this node. open class Spinner: Widget { /// Returns a new spinner widget. Not yet started. - public convenience init() { - self.init( - gtk_spinner_new() - ) - } - - override func didMoveToParent() { - super.didMoveToParent() +public convenience init() { + self.init( + gtk_spinner_new() + ) +} - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + override func didMoveToParent() { + super.didMoveToParent() - addSignal(name: "notify::spinning", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySpinning?(self, param0) - } + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } +addSignal(name: "notify::spinning", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySpinning?(self, param0) +} +} + /// Whether the spinner is spinning - @GObjectProperty(named: "spinning") public var spinning: Bool +@GObjectProperty(named: "spinning") public var spinning: Bool - public var notifySpinning: ((Spinner, OpaquePointer) -> Void)? -} + +public var notifySpinning: ((Spinner, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/StackTransitionType.swift b/Sources/Gtk/Generated/StackTransitionType.swift index 670e993e87..6c06a23b37 100644 --- a/Sources/Gtk/Generated/StackTransitionType.swift +++ b/Sources/Gtk/Generated/StackTransitionType.swift @@ -1,110 +1,110 @@ import CGtk /// Possible transitions between pages in a `GtkStack` widget. -/// +/// /// New values may be added to this enumeration over time. public enum StackTransitionType: GValueRepresentableEnum { public typealias GtkEnum = GtkStackTransitionType /// No transition - case none - /// A cross-fade - case crossfade - /// Slide from left to right - case slideRight - /// Slide from right to left - case slideLeft - /// Slide from bottom up - case slideUp - /// Slide from top down - case slideDown - /// Slide from left or right according to the children order - case slideLeftRight - /// Slide from top down or bottom up according to the order - case slideUpDown - /// Cover the old page by sliding up - case overUp - /// Cover the old page by sliding down - case overDown - /// Cover the old page by sliding to the left - case overLeft - /// Cover the old page by sliding to the right - case overRight - /// Uncover the new page by sliding up - case underUp - /// Uncover the new page by sliding down - case underDown - /// Uncover the new page by sliding to the left - case underLeft - /// Uncover the new page by sliding to the right - case underRight - /// Cover the old page sliding up or uncover the new page sliding down, according to order - case overUpDown - /// Cover the old page sliding down or uncover the new page sliding up, according to order - case overDownUp - /// Cover the old page sliding left or uncover the new page sliding right, according to order - case overLeftRight - /// Cover the old page sliding right or uncover the new page sliding left, according to order - case overRightLeft - /// Pretend the pages are sides of a cube and rotate that cube to the left - case rotateLeft - /// Pretend the pages are sides of a cube and rotate that cube to the right - case rotateRight - /// Pretend the pages are sides of a cube and rotate that cube to the left or right according to the children order - case rotateLeftRight +case none +/// A cross-fade +case crossfade +/// Slide from left to right +case slideRight +/// Slide from right to left +case slideLeft +/// Slide from bottom up +case slideUp +/// Slide from top down +case slideDown +/// Slide from left or right according to the children order +case slideLeftRight +/// Slide from top down or bottom up according to the order +case slideUpDown +/// Cover the old page by sliding up +case overUp +/// Cover the old page by sliding down +case overDown +/// Cover the old page by sliding to the left +case overLeft +/// Cover the old page by sliding to the right +case overRight +/// Uncover the new page by sliding up +case underUp +/// Uncover the new page by sliding down +case underDown +/// Uncover the new page by sliding to the left +case underLeft +/// Uncover the new page by sliding to the right +case underRight +/// Cover the old page sliding up or uncover the new page sliding down, according to order +case overUpDown +/// Cover the old page sliding down or uncover the new page sliding up, according to order +case overDownUp +/// Cover the old page sliding left or uncover the new page sliding right, according to order +case overLeftRight +/// Cover the old page sliding right or uncover the new page sliding left, according to order +case overRightLeft +/// Pretend the pages are sides of a cube and rotate that cube to the left +case rotateLeft +/// Pretend the pages are sides of a cube and rotate that cube to the right +case rotateRight +/// Pretend the pages are sides of a cube and rotate that cube to the left or right according to the children order +case rotateLeftRight public static var type: GType { - gtk_stack_transition_type_get_type() - } + gtk_stack_transition_type_get_type() +} public init(from gtkEnum: GtkStackTransitionType) { switch gtkEnum { case GTK_STACK_TRANSITION_TYPE_NONE: - self = .none - case GTK_STACK_TRANSITION_TYPE_CROSSFADE: - self = .crossfade - case GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT: - self = .slideRight - case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT: - self = .slideLeft - case GTK_STACK_TRANSITION_TYPE_SLIDE_UP: - self = .slideUp - case GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN: - self = .slideDown - case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT: - self = .slideLeftRight - case GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN: - self = .slideUpDown - case GTK_STACK_TRANSITION_TYPE_OVER_UP: - self = .overUp - case GTK_STACK_TRANSITION_TYPE_OVER_DOWN: - self = .overDown - case GTK_STACK_TRANSITION_TYPE_OVER_LEFT: - self = .overLeft - case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT: - self = .overRight - case GTK_STACK_TRANSITION_TYPE_UNDER_UP: - self = .underUp - case GTK_STACK_TRANSITION_TYPE_UNDER_DOWN: - self = .underDown - case GTK_STACK_TRANSITION_TYPE_UNDER_LEFT: - self = .underLeft - case GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT: - self = .underRight - case GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN: - self = .overUpDown - case GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP: - self = .overDownUp - case GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT: - self = .overLeftRight - case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT: - self = .overRightLeft - case GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT: - self = .rotateLeft - case GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT: - self = .rotateRight - case GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT: - self = .rotateLeftRight + self = .none +case GTK_STACK_TRANSITION_TYPE_CROSSFADE: + self = .crossfade +case GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT: + self = .slideRight +case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT: + self = .slideLeft +case GTK_STACK_TRANSITION_TYPE_SLIDE_UP: + self = .slideUp +case GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN: + self = .slideDown +case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT: + self = .slideLeftRight +case GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN: + self = .slideUpDown +case GTK_STACK_TRANSITION_TYPE_OVER_UP: + self = .overUp +case GTK_STACK_TRANSITION_TYPE_OVER_DOWN: + self = .overDown +case GTK_STACK_TRANSITION_TYPE_OVER_LEFT: + self = .overLeft +case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT: + self = .overRight +case GTK_STACK_TRANSITION_TYPE_UNDER_UP: + self = .underUp +case GTK_STACK_TRANSITION_TYPE_UNDER_DOWN: + self = .underDown +case GTK_STACK_TRANSITION_TYPE_UNDER_LEFT: + self = .underLeft +case GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT: + self = .underRight +case GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN: + self = .overUpDown +case GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP: + self = .overDownUp +case GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT: + self = .overLeftRight +case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT: + self = .overRightLeft +case GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT: + self = .rotateLeft +case GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT: + self = .rotateRight +case GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT: + self = .rotateLeftRight default: fatalError("Unsupported GtkStackTransitionType enum value: \(gtkEnum.rawValue)") } @@ -113,51 +113,51 @@ public enum StackTransitionType: GValueRepresentableEnum { public func toGtk() -> GtkStackTransitionType { switch self { case .none: - return GTK_STACK_TRANSITION_TYPE_NONE - case .crossfade: - return GTK_STACK_TRANSITION_TYPE_CROSSFADE - case .slideRight: - return GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT - case .slideLeft: - return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT - case .slideUp: - return GTK_STACK_TRANSITION_TYPE_SLIDE_UP - case .slideDown: - return GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN - case .slideLeftRight: - return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT - case .slideUpDown: - return GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN - case .overUp: - return GTK_STACK_TRANSITION_TYPE_OVER_UP - case .overDown: - return GTK_STACK_TRANSITION_TYPE_OVER_DOWN - case .overLeft: - return GTK_STACK_TRANSITION_TYPE_OVER_LEFT - case .overRight: - return GTK_STACK_TRANSITION_TYPE_OVER_RIGHT - case .underUp: - return GTK_STACK_TRANSITION_TYPE_UNDER_UP - case .underDown: - return GTK_STACK_TRANSITION_TYPE_UNDER_DOWN - case .underLeft: - return GTK_STACK_TRANSITION_TYPE_UNDER_LEFT - case .underRight: - return GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT - case .overUpDown: - return GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN - case .overDownUp: - return GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP - case .overLeftRight: - return GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT - case .overRightLeft: - return GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT - case .rotateLeft: - return GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT - case .rotateRight: - return GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT - case .rotateLeftRight: - return GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT + return GTK_STACK_TRANSITION_TYPE_NONE +case .crossfade: + return GTK_STACK_TRANSITION_TYPE_CROSSFADE +case .slideRight: + return GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT +case .slideLeft: + return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT +case .slideUp: + return GTK_STACK_TRANSITION_TYPE_SLIDE_UP +case .slideDown: + return GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN +case .slideLeftRight: + return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT +case .slideUpDown: + return GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN +case .overUp: + return GTK_STACK_TRANSITION_TYPE_OVER_UP +case .overDown: + return GTK_STACK_TRANSITION_TYPE_OVER_DOWN +case .overLeft: + return GTK_STACK_TRANSITION_TYPE_OVER_LEFT +case .overRight: + return GTK_STACK_TRANSITION_TYPE_OVER_RIGHT +case .underUp: + return GTK_STACK_TRANSITION_TYPE_UNDER_UP +case .underDown: + return GTK_STACK_TRANSITION_TYPE_UNDER_DOWN +case .underLeft: + return GTK_STACK_TRANSITION_TYPE_UNDER_LEFT +case .underRight: + return GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT +case .overUpDown: + return GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN +case .overDownUp: + return GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP +case .overLeftRight: + return GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT +case .overRightLeft: + return GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT +case .rotateLeft: + return GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT +case .rotateRight: + return GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT +case .rotateLeftRight: + return GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/StringFilterMatchMode.swift b/Sources/Gtk/Generated/StringFilterMatchMode.swift index c0b77f93d6..97dcadcf51 100644 --- a/Sources/Gtk/Generated/StringFilterMatchMode.swift +++ b/Sources/Gtk/Generated/StringFilterMatchMode.swift @@ -5,27 +5,27 @@ public enum StringFilterMatchMode: GValueRepresentableEnum { public typealias GtkEnum = GtkStringFilterMatchMode /// The search string and - /// text must match exactly - case exact - /// The search string - /// must be contained as a substring inside the text - case substring - /// The text must begin - /// with the search string - case prefix +/// text must match exactly +case exact +/// The search string +/// must be contained as a substring inside the text +case substring +/// The text must begin +/// with the search string +case prefix public static var type: GType { - gtk_string_filter_match_mode_get_type() - } + gtk_string_filter_match_mode_get_type() +} public init(from gtkEnum: GtkStringFilterMatchMode) { switch gtkEnum { case GTK_STRING_FILTER_MATCH_MODE_EXACT: - self = .exact - case GTK_STRING_FILTER_MATCH_MODE_SUBSTRING: - self = .substring - case GTK_STRING_FILTER_MATCH_MODE_PREFIX: - self = .prefix + self = .exact +case GTK_STRING_FILTER_MATCH_MODE_SUBSTRING: + self = .substring +case GTK_STRING_FILTER_MATCH_MODE_PREFIX: + self = .prefix default: fatalError("Unsupported GtkStringFilterMatchMode enum value: \(gtkEnum.rawValue)") } @@ -34,11 +34,11 @@ public enum StringFilterMatchMode: GValueRepresentableEnum { public func toGtk() -> GtkStringFilterMatchMode { switch self { case .exact: - return GTK_STRING_FILTER_MATCH_MODE_EXACT - case .substring: - return GTK_STRING_FILTER_MATCH_MODE_SUBSTRING - case .prefix: - return GTK_STRING_FILTER_MATCH_MODE_PREFIX + return GTK_STRING_FILTER_MATCH_MODE_EXACT +case .substring: + return GTK_STRING_FILTER_MATCH_MODE_SUBSTRING +case .prefix: + return GTK_STRING_FILTER_MATCH_MODE_PREFIX } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/StyleProvider.swift b/Sources/Gtk/Generated/StyleProvider.swift index d5587188a7..9318cb5a4b 100644 --- a/Sources/Gtk/Generated/StyleProvider.swift +++ b/Sources/Gtk/Generated/StyleProvider.swift @@ -1,14 +1,16 @@ import CGtk /// An interface for style information used by [class@Gtk.StyleContext]. -/// +/// /// See [method@Gtk.StyleContext.add_provider] and /// [func@Gtk.StyleContext.add_provider_for_display] for /// adding `GtkStyleProviders`. -/// +/// /// GTK uses the `GtkStyleProvider` implementation for CSS in /// [class@Gtk.CssProvider]. public protocol StyleProvider: GObjectRepresentable { + - var gtkPrivateChanged: ((Self) -> Void)? { get set } -} + +var gtkPrivateChanged: ((Self) -> Void)? { get set } +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Switch.swift b/Sources/Gtk/Generated/Switch.swift index e4145d8e1e..00b294198a 100644 --- a/Sources/Gtk/Generated/Switch.swift +++ b/Sources/Gtk/Generated/Switch.swift @@ -1,157 +1,152 @@ import CGtk /// Shows a "light switch" that has two states: on or off. -/// +/// /// An example GtkSwitch -/// +/// /// The user can control which state should be active by clicking the /// empty area, or by dragging the slider. -/// +/// /// `GtkSwitch` can also express situations where the underlying state changes /// with a delay. In this case, the slider position indicates the user's recent /// change (represented by the [property@Gtk.Switch:active] property), while the /// trough color indicates the present underlying state (represented by the /// [property@Gtk.Switch:state] property). -/// +/// /// GtkSwitch with delayed state change -/// +/// /// See [signal@Gtk.Switch::state-set] for details. -/// +/// /// # Shortcuts and Gestures -/// +/// /// `GtkSwitch` supports pan and drag gestures to move the slider. -/// +/// /// # CSS nodes -/// +/// /// ``` /// switch /// ├── image /// ├── image /// ╰── slider /// ``` -/// +/// /// `GtkSwitch` has four css nodes, the main node with the name switch and /// subnodes for the slider and the on and off images. Neither of them is /// using any style classes. -/// +/// /// # Accessibility -/// +/// /// `GtkSwitch` uses the [enum@Gtk.AccessibleRole.switch] role. open class Switch: Widget, Actionable { /// Creates a new `GtkSwitch` widget. - public convenience init() { - self.init( - gtk_switch_new() - ) +public convenience init() { + self.init( + gtk_switch_new() + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, Bool, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, Bool, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "state-set", handler: gCallback(handler1)) { [weak self] (param0: Bool) in - guard let self = self else { return } - self.stateSet?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::active", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActive?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::state", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyState?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::action-name", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionName?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::action-target", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionTarget?(self, param0) - } +addSignal(name: "state-set", handler: gCallback(handler1)) { [weak self] (param0: Bool) in + guard let self = self else { return } + self.stateSet?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Whether the `GtkSwitch` widget is in its on or off state. - @GObjectProperty(named: "active") public var active: Bool - - /// The backend state that is controlled by the switch. - /// - /// Applications should usually set the [property@Gtk.Switch:active] property, - /// except when indicating a change to the backend state which occurs - /// separately from the user's interaction. - /// - /// See [signal@Gtk.Switch::state-set] for details. - @GObjectProperty(named: "state") public var state: Bool - - /// The name of the action with which this widget should be associated. - @GObjectProperty(named: "action-name") public var actionName: String? - - /// Emitted to animate the switch. - /// - /// Applications should never connect to this signal, - /// but use the [property@Gtk.Switch:active] property. - public var activate: ((Switch) -> Void)? - - /// Emitted to change the underlying state. - /// - /// The ::state-set signal is emitted when the user changes the switch - /// position. The default handler calls [method@Gtk.Switch.set_state] with the - /// value of @state. - /// - /// To implement delayed state change, applications can connect to this - /// signal, initiate the change of the underlying state, and call - /// [method@Gtk.Switch.set_state] when the underlying state change is - /// complete. The signal handler should return %TRUE to prevent the - /// default handler from running. - public var stateSet: ((Switch, Bool) -> Void)? - - public var notifyActive: ((Switch, OpaquePointer) -> Void)? - - public var notifyState: ((Switch, OpaquePointer) -> Void)? - - public var notifyActionName: ((Switch, OpaquePointer) -> Void)? - - public var notifyActionTarget: ((Switch, OpaquePointer) -> Void)? +addSignal(name: "notify::active", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActive?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::state", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyState?(self, param0) } + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::action-name", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionName?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::action-target", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionTarget?(self, param0) +} +} + + /// Whether the `GtkSwitch` widget is in its on or off state. +@GObjectProperty(named: "active") public var active: Bool + +/// The backend state that is controlled by the switch. +/// +/// Applications should usually set the [property@Gtk.Switch:active] property, +/// except when indicating a change to the backend state which occurs +/// separately from the user's interaction. +/// +/// See [signal@Gtk.Switch::state-set] for details. +@GObjectProperty(named: "state") public var state: Bool + +/// The name of the action with which this widget should be associated. +@GObjectProperty(named: "action-name") public var actionName: String? + +/// Emitted to animate the switch. +/// +/// Applications should never connect to this signal, +/// but use the [property@Gtk.Switch:active] property. +public var activate: ((Switch) -> Void)? + +/// Emitted to change the underlying state. +/// +/// The ::state-set signal is emitted when the user changes the switch +/// position. The default handler calls [method@Gtk.Switch.set_state] with the +/// value of @state. +/// +/// To implement delayed state change, applications can connect to this +/// signal, initiate the change of the underlying state, and call +/// [method@Gtk.Switch.set_state] when the underlying state change is +/// complete. The signal handler should return %TRUE to prevent the +/// default handler from running. +public var stateSet: ((Switch, Bool) -> Void)? + + +public var notifyActive: ((Switch, OpaquePointer) -> Void)? + + +public var notifyState: ((Switch, OpaquePointer) -> Void)? + + +public var notifyActionName: ((Switch, OpaquePointer) -> Void)? + + +public var notifyActionTarget: ((Switch, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/SystemSetting.swift b/Sources/Gtk/Generated/SystemSetting.swift index ca7b9b4d36..69a3b88a13 100644 --- a/Sources/Gtk/Generated/SystemSetting.swift +++ b/Sources/Gtk/Generated/SystemSetting.swift @@ -2,50 +2,50 @@ import CGtk /// Values that can be passed to the [vfunc@Gtk.Widget.system_setting_changed] /// vfunc. -/// +/// /// The values indicate which system setting has changed. /// Widgets may need to drop caches, or react otherwise. -/// +/// /// Most of the values correspond to [class@Settings] properties. -/// +/// /// More values may be added over time. public enum SystemSetting: GValueRepresentableEnum { public typealias GtkEnum = GtkSystemSetting /// The [property@Gtk.Settings:gtk-xft-dpi] setting has changed - case dpi - /// The [property@Gtk.Settings:gtk-font-name] setting has changed - case fontName - /// The font configuration has changed in a way that - /// requires text to be redrawn. This can be any of the - /// [property@Gtk.Settings:gtk-xft-antialias], - /// [property@Gtk.Settings:gtk-xft-hinting], - /// [property@Gtk.Settings:gtk-xft-hintstyle], - /// [property@Gtk.Settings:gtk-xft-rgba] or - /// [property@Gtk.Settings:gtk-fontconfig-timestamp] settings - case fontConfig - /// The display has changed - case display - /// The icon theme has changed in a way that requires - /// icons to be looked up again - case iconTheme +case dpi +/// The [property@Gtk.Settings:gtk-font-name] setting has changed +case fontName +/// The font configuration has changed in a way that +/// requires text to be redrawn. This can be any of the +/// [property@Gtk.Settings:gtk-xft-antialias], +/// [property@Gtk.Settings:gtk-xft-hinting], +/// [property@Gtk.Settings:gtk-xft-hintstyle], +/// [property@Gtk.Settings:gtk-xft-rgba] or +/// [property@Gtk.Settings:gtk-fontconfig-timestamp] settings +case fontConfig +/// The display has changed +case display +/// The icon theme has changed in a way that requires +/// icons to be looked up again +case iconTheme public static var type: GType { - gtk_system_setting_get_type() - } + gtk_system_setting_get_type() +} public init(from gtkEnum: GtkSystemSetting) { switch gtkEnum { case GTK_SYSTEM_SETTING_DPI: - self = .dpi - case GTK_SYSTEM_SETTING_FONT_NAME: - self = .fontName - case GTK_SYSTEM_SETTING_FONT_CONFIG: - self = .fontConfig - case GTK_SYSTEM_SETTING_DISPLAY: - self = .display - case GTK_SYSTEM_SETTING_ICON_THEME: - self = .iconTheme + self = .dpi +case GTK_SYSTEM_SETTING_FONT_NAME: + self = .fontName +case GTK_SYSTEM_SETTING_FONT_CONFIG: + self = .fontConfig +case GTK_SYSTEM_SETTING_DISPLAY: + self = .display +case GTK_SYSTEM_SETTING_ICON_THEME: + self = .iconTheme default: fatalError("Unsupported GtkSystemSetting enum value: \(gtkEnum.rawValue)") } @@ -54,15 +54,15 @@ public enum SystemSetting: GValueRepresentableEnum { public func toGtk() -> GtkSystemSetting { switch self { case .dpi: - return GTK_SYSTEM_SETTING_DPI - case .fontName: - return GTK_SYSTEM_SETTING_FONT_NAME - case .fontConfig: - return GTK_SYSTEM_SETTING_FONT_CONFIG - case .display: - return GTK_SYSTEM_SETTING_DISPLAY - case .iconTheme: - return GTK_SYSTEM_SETTING_ICON_THEME + return GTK_SYSTEM_SETTING_DPI +case .fontName: + return GTK_SYSTEM_SETTING_FONT_NAME +case .fontConfig: + return GTK_SYSTEM_SETTING_FONT_CONFIG +case .display: + return GTK_SYSTEM_SETTING_DISPLAY +case .iconTheme: + return GTK_SYSTEM_SETTING_ICON_THEME } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TextDirection.swift b/Sources/Gtk/Generated/TextDirection.swift index 1ab684b607..8c3b951114 100644 --- a/Sources/Gtk/Generated/TextDirection.swift +++ b/Sources/Gtk/Generated/TextDirection.swift @@ -5,24 +5,24 @@ public enum TextDirection: GValueRepresentableEnum { public typealias GtkEnum = GtkTextDirection /// No direction. - case none - /// Left to right text direction. - case ltr - /// Right to left text direction. - case rtl +case none +/// Left to right text direction. +case ltr +/// Right to left text direction. +case rtl public static var type: GType { - gtk_text_direction_get_type() - } + gtk_text_direction_get_type() +} public init(from gtkEnum: GtkTextDirection) { switch gtkEnum { case GTK_TEXT_DIR_NONE: - self = .none - case GTK_TEXT_DIR_LTR: - self = .ltr - case GTK_TEXT_DIR_RTL: - self = .rtl + self = .none +case GTK_TEXT_DIR_LTR: + self = .ltr +case GTK_TEXT_DIR_RTL: + self = .rtl default: fatalError("Unsupported GtkTextDirection enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ public enum TextDirection: GValueRepresentableEnum { public func toGtk() -> GtkTextDirection { switch self { case .none: - return GTK_TEXT_DIR_NONE - case .ltr: - return GTK_TEXT_DIR_LTR - case .rtl: - return GTK_TEXT_DIR_RTL + return GTK_TEXT_DIR_NONE +case .ltr: + return GTK_TEXT_DIR_LTR +case .rtl: + return GTK_TEXT_DIR_RTL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TextExtendSelection.swift b/Sources/Gtk/Generated/TextExtendSelection.swift index c83f57ecec..9883a0b27e 100644 --- a/Sources/Gtk/Generated/TextExtendSelection.swift +++ b/Sources/Gtk/Generated/TextExtendSelection.swift @@ -6,22 +6,22 @@ public enum TextExtendSelection: GValueRepresentableEnum { public typealias GtkEnum = GtkTextExtendSelection /// Selects the current word. It is triggered by - /// a double-click for example. - case word - /// Selects the current line. It is triggered by - /// a triple-click for example. - case line +/// a double-click for example. +case word +/// Selects the current line. It is triggered by +/// a triple-click for example. +case line public static var type: GType { - gtk_text_extend_selection_get_type() - } + gtk_text_extend_selection_get_type() +} public init(from gtkEnum: GtkTextExtendSelection) { switch gtkEnum { case GTK_TEXT_EXTEND_SELECTION_WORD: - self = .word - case GTK_TEXT_EXTEND_SELECTION_LINE: - self = .line + self = .word +case GTK_TEXT_EXTEND_SELECTION_LINE: + self = .line default: fatalError("Unsupported GtkTextExtendSelection enum value: \(gtkEnum.rawValue)") } @@ -30,9 +30,9 @@ public enum TextExtendSelection: GValueRepresentableEnum { public func toGtk() -> GtkTextExtendSelection { switch self { case .word: - return GTK_TEXT_EXTEND_SELECTION_WORD - case .line: - return GTK_TEXT_EXTEND_SELECTION_LINE + return GTK_TEXT_EXTEND_SELECTION_WORD +case .line: + return GTK_TEXT_EXTEND_SELECTION_LINE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TextViewLayer.swift b/Sources/Gtk/Generated/TextViewLayer.swift index bd391ea8bd..ee137729f9 100644 --- a/Sources/Gtk/Generated/TextViewLayer.swift +++ b/Sources/Gtk/Generated/TextViewLayer.swift @@ -6,20 +6,20 @@ public enum TextViewLayer: GValueRepresentableEnum { public typealias GtkEnum = GtkTextViewLayer /// The layer rendered below the text (but above the background). - case belowText - /// The layer rendered above the text. - case aboveText +case belowText +/// The layer rendered above the text. +case aboveText public static var type: GType { - gtk_text_view_layer_get_type() - } + gtk_text_view_layer_get_type() +} public init(from gtkEnum: GtkTextViewLayer) { switch gtkEnum { case GTK_TEXT_VIEW_LAYER_BELOW_TEXT: - self = .belowText - case GTK_TEXT_VIEW_LAYER_ABOVE_TEXT: - self = .aboveText + self = .belowText +case GTK_TEXT_VIEW_LAYER_ABOVE_TEXT: + self = .aboveText default: fatalError("Unsupported GtkTextViewLayer enum value: \(gtkEnum.rawValue)") } @@ -28,9 +28,9 @@ public enum TextViewLayer: GValueRepresentableEnum { public func toGtk() -> GtkTextViewLayer { switch self { case .belowText: - return GTK_TEXT_VIEW_LAYER_BELOW_TEXT - case .aboveText: - return GTK_TEXT_VIEW_LAYER_ABOVE_TEXT + return GTK_TEXT_VIEW_LAYER_BELOW_TEXT +case .aboveText: + return GTK_TEXT_VIEW_LAYER_ABOVE_TEXT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TextWindowType.swift b/Sources/Gtk/Generated/TextWindowType.swift index 2457d73e97..96fbb93dfa 100644 --- a/Sources/Gtk/Generated/TextWindowType.swift +++ b/Sources/Gtk/Generated/TextWindowType.swift @@ -5,36 +5,36 @@ public enum TextWindowType: GValueRepresentableEnum { public typealias GtkEnum = GtkTextWindowType /// Window that floats over scrolling areas. - case widget - /// Scrollable text window. - case text - /// Left side border window. - case left - /// Right side border window. - case right - /// Top border window. - case top - /// Bottom border window. - case bottom +case widget +/// Scrollable text window. +case text +/// Left side border window. +case left +/// Right side border window. +case right +/// Top border window. +case top +/// Bottom border window. +case bottom public static var type: GType { - gtk_text_window_type_get_type() - } + gtk_text_window_type_get_type() +} public init(from gtkEnum: GtkTextWindowType) { switch gtkEnum { case GTK_TEXT_WINDOW_WIDGET: - self = .widget - case GTK_TEXT_WINDOW_TEXT: - self = .text - case GTK_TEXT_WINDOW_LEFT: - self = .left - case GTK_TEXT_WINDOW_RIGHT: - self = .right - case GTK_TEXT_WINDOW_TOP: - self = .top - case GTK_TEXT_WINDOW_BOTTOM: - self = .bottom + self = .widget +case GTK_TEXT_WINDOW_TEXT: + self = .text +case GTK_TEXT_WINDOW_LEFT: + self = .left +case GTK_TEXT_WINDOW_RIGHT: + self = .right +case GTK_TEXT_WINDOW_TOP: + self = .top +case GTK_TEXT_WINDOW_BOTTOM: + self = .bottom default: fatalError("Unsupported GtkTextWindowType enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ public enum TextWindowType: GValueRepresentableEnum { public func toGtk() -> GtkTextWindowType { switch self { case .widget: - return GTK_TEXT_WINDOW_WIDGET - case .text: - return GTK_TEXT_WINDOW_TEXT - case .left: - return GTK_TEXT_WINDOW_LEFT - case .right: - return GTK_TEXT_WINDOW_RIGHT - case .top: - return GTK_TEXT_WINDOW_TOP - case .bottom: - return GTK_TEXT_WINDOW_BOTTOM + return GTK_TEXT_WINDOW_WIDGET +case .text: + return GTK_TEXT_WINDOW_TEXT +case .left: + return GTK_TEXT_WINDOW_LEFT +case .right: + return GTK_TEXT_WINDOW_RIGHT +case .top: + return GTK_TEXT_WINDOW_TOP +case .bottom: + return GTK_TEXT_WINDOW_BOTTOM } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TreeDragDest.swift b/Sources/Gtk/Generated/TreeDragDest.swift index c10b696543..f7da7eae8f 100644 --- a/Sources/Gtk/Generated/TreeDragDest.swift +++ b/Sources/Gtk/Generated/TreeDragDest.swift @@ -2,5 +2,7 @@ import CGtk /// Interface for Drag-and-Drop destinations in `GtkTreeView`. public protocol TreeDragDest: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TreeDragSource.swift b/Sources/Gtk/Generated/TreeDragSource.swift index 6541757be8..4176d40441 100644 --- a/Sources/Gtk/Generated/TreeDragSource.swift +++ b/Sources/Gtk/Generated/TreeDragSource.swift @@ -2,5 +2,7 @@ import CGtk /// Interface for Drag-and-Drop destinations in `GtkTreeView`. public protocol TreeDragSource: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TreeSortable.swift b/Sources/Gtk/Generated/TreeSortable.swift index 289b07112c..3f202bafd4 100644 --- a/Sources/Gtk/Generated/TreeSortable.swift +++ b/Sources/Gtk/Generated/TreeSortable.swift @@ -1,14 +1,15 @@ import CGtk /// The interface for sortable models used by GtkTreeView -/// +/// /// `GtkTreeSortable` is an interface to be implemented by tree models which /// support sorting. The `GtkTreeView` uses the methods provided by this interface /// to sort the model. public protocol TreeSortable: GObjectRepresentable { + /// The ::sort-column-changed signal is emitted when the sort column - /// or sort order of @sortable is changed. The signal is emitted before - /// the contents of @sortable are resorted. - var sortColumnChanged: ((Self) -> Void)? { get set } -} +/// or sort order of @sortable is changed. The signal is emitted before +/// the contents of @sortable are resorted. +var sortColumnChanged: ((Self) -> Void)? { get set } +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TreeViewColumnSizing.swift b/Sources/Gtk/Generated/TreeViewColumnSizing.swift index 05b581761f..325e951105 100644 --- a/Sources/Gtk/Generated/TreeViewColumnSizing.swift +++ b/Sources/Gtk/Generated/TreeViewColumnSizing.swift @@ -7,24 +7,24 @@ public enum TreeViewColumnSizing: GValueRepresentableEnum { public typealias GtkEnum = GtkTreeViewColumnSizing /// Columns only get bigger in reaction to changes in the model - case growOnly - /// Columns resize to be the optimal size every time the model changes. - case autosize - /// Columns are a fixed numbers of pixels wide. - case fixed +case growOnly +/// Columns resize to be the optimal size every time the model changes. +case autosize +/// Columns are a fixed numbers of pixels wide. +case fixed public static var type: GType { - gtk_tree_view_column_sizing_get_type() - } + gtk_tree_view_column_sizing_get_type() +} public init(from gtkEnum: GtkTreeViewColumnSizing) { switch gtkEnum { case GTK_TREE_VIEW_COLUMN_GROW_ONLY: - self = .growOnly - case GTK_TREE_VIEW_COLUMN_AUTOSIZE: - self = .autosize - case GTK_TREE_VIEW_COLUMN_FIXED: - self = .fixed + self = .growOnly +case GTK_TREE_VIEW_COLUMN_AUTOSIZE: + self = .autosize +case GTK_TREE_VIEW_COLUMN_FIXED: + self = .fixed default: fatalError("Unsupported GtkTreeViewColumnSizing enum value: \(gtkEnum.rawValue)") } @@ -33,11 +33,11 @@ public enum TreeViewColumnSizing: GValueRepresentableEnum { public func toGtk() -> GtkTreeViewColumnSizing { switch self { case .growOnly: - return GTK_TREE_VIEW_COLUMN_GROW_ONLY - case .autosize: - return GTK_TREE_VIEW_COLUMN_AUTOSIZE - case .fixed: - return GTK_TREE_VIEW_COLUMN_FIXED + return GTK_TREE_VIEW_COLUMN_GROW_ONLY +case .autosize: + return GTK_TREE_VIEW_COLUMN_AUTOSIZE +case .fixed: + return GTK_TREE_VIEW_COLUMN_FIXED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TreeViewDropPosition.swift b/Sources/Gtk/Generated/TreeViewDropPosition.swift index d86aa2ce20..24b116d9ae 100644 --- a/Sources/Gtk/Generated/TreeViewDropPosition.swift +++ b/Sources/Gtk/Generated/TreeViewDropPosition.swift @@ -5,28 +5,28 @@ public enum TreeViewDropPosition: GValueRepresentableEnum { public typealias GtkEnum = GtkTreeViewDropPosition /// Dropped row is inserted before - case before - /// Dropped row is inserted after - case after - /// Dropped row becomes a child or is inserted before - case intoOrBefore - /// Dropped row becomes a child or is inserted after - case intoOrAfter +case before +/// Dropped row is inserted after +case after +/// Dropped row becomes a child or is inserted before +case intoOrBefore +/// Dropped row becomes a child or is inserted after +case intoOrAfter public static var type: GType { - gtk_tree_view_drop_position_get_type() - } + gtk_tree_view_drop_position_get_type() +} public init(from gtkEnum: GtkTreeViewDropPosition) { switch gtkEnum { case GTK_TREE_VIEW_DROP_BEFORE: - self = .before - case GTK_TREE_VIEW_DROP_AFTER: - self = .after - case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: - self = .intoOrBefore - case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: - self = .intoOrAfter + self = .before +case GTK_TREE_VIEW_DROP_AFTER: + self = .after +case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: + self = .intoOrBefore +case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: + self = .intoOrAfter default: fatalError("Unsupported GtkTreeViewDropPosition enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum TreeViewDropPosition: GValueRepresentableEnum { public func toGtk() -> GtkTreeViewDropPosition { switch self { case .before: - return GTK_TREE_VIEW_DROP_BEFORE - case .after: - return GTK_TREE_VIEW_DROP_AFTER - case .intoOrBefore: - return GTK_TREE_VIEW_DROP_INTO_OR_BEFORE - case .intoOrAfter: - return GTK_TREE_VIEW_DROP_INTO_OR_AFTER + return GTK_TREE_VIEW_DROP_BEFORE +case .after: + return GTK_TREE_VIEW_DROP_AFTER +case .intoOrBefore: + return GTK_TREE_VIEW_DROP_INTO_OR_BEFORE +case .intoOrAfter: + return GTK_TREE_VIEW_DROP_INTO_OR_AFTER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/TreeViewGridLines.swift b/Sources/Gtk/Generated/TreeViewGridLines.swift index 7c03e8ce3e..e6a64dee59 100644 --- a/Sources/Gtk/Generated/TreeViewGridLines.swift +++ b/Sources/Gtk/Generated/TreeViewGridLines.swift @@ -5,28 +5,28 @@ public enum TreeViewGridLines: GValueRepresentableEnum { public typealias GtkEnum = GtkTreeViewGridLines /// No grid lines. - case none - /// Horizontal grid lines. - case horizontal - /// Vertical grid lines. - case vertical - /// Horizontal and vertical grid lines. - case both +case none +/// Horizontal grid lines. +case horizontal +/// Vertical grid lines. +case vertical +/// Horizontal and vertical grid lines. +case both public static var type: GType { - gtk_tree_view_grid_lines_get_type() - } + gtk_tree_view_grid_lines_get_type() +} public init(from gtkEnum: GtkTreeViewGridLines) { switch gtkEnum { case GTK_TREE_VIEW_GRID_LINES_NONE: - self = .none - case GTK_TREE_VIEW_GRID_LINES_HORIZONTAL: - self = .horizontal - case GTK_TREE_VIEW_GRID_LINES_VERTICAL: - self = .vertical - case GTK_TREE_VIEW_GRID_LINES_BOTH: - self = .both + self = .none +case GTK_TREE_VIEW_GRID_LINES_HORIZONTAL: + self = .horizontal +case GTK_TREE_VIEW_GRID_LINES_VERTICAL: + self = .vertical +case GTK_TREE_VIEW_GRID_LINES_BOTH: + self = .both default: fatalError("Unsupported GtkTreeViewGridLines enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum TreeViewGridLines: GValueRepresentableEnum { public func toGtk() -> GtkTreeViewGridLines { switch self { case .none: - return GTK_TREE_VIEW_GRID_LINES_NONE - case .horizontal: - return GTK_TREE_VIEW_GRID_LINES_HORIZONTAL - case .vertical: - return GTK_TREE_VIEW_GRID_LINES_VERTICAL - case .both: - return GTK_TREE_VIEW_GRID_LINES_BOTH + return GTK_TREE_VIEW_GRID_LINES_NONE +case .horizontal: + return GTK_TREE_VIEW_GRID_LINES_HORIZONTAL +case .vertical: + return GTK_TREE_VIEW_GRID_LINES_VERTICAL +case .both: + return GTK_TREE_VIEW_GRID_LINES_BOTH } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/Unit.swift b/Sources/Gtk/Generated/Unit.swift index f67046e8f4..4d301c3f0f 100644 --- a/Sources/Gtk/Generated/Unit.swift +++ b/Sources/Gtk/Generated/Unit.swift @@ -5,28 +5,28 @@ public enum Unit: GValueRepresentableEnum { public typealias GtkEnum = GtkUnit /// No units. - case none - /// Dimensions in points. - case points - /// Dimensions in inches. - case inch - /// Dimensions in millimeters - case mm +case none +/// Dimensions in points. +case points +/// Dimensions in inches. +case inch +/// Dimensions in millimeters +case mm public static var type: GType { - gtk_unit_get_type() - } + gtk_unit_get_type() +} public init(from gtkEnum: GtkUnit) { switch gtkEnum { case GTK_UNIT_NONE: - self = .none - case GTK_UNIT_POINTS: - self = .points - case GTK_UNIT_INCH: - self = .inch - case GTK_UNIT_MM: - self = .mm + self = .none +case GTK_UNIT_POINTS: + self = .points +case GTK_UNIT_INCH: + self = .inch +case GTK_UNIT_MM: + self = .mm default: fatalError("Unsupported GtkUnit enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum Unit: GValueRepresentableEnum { public func toGtk() -> GtkUnit { switch self { case .none: - return GTK_UNIT_NONE - case .points: - return GTK_UNIT_POINTS - case .inch: - return GTK_UNIT_INCH - case .mm: - return GTK_UNIT_MM + return GTK_UNIT_NONE +case .points: + return GTK_UNIT_POINTS +case .inch: + return GTK_UNIT_INCH +case .mm: + return GTK_UNIT_MM } } -} +} \ No newline at end of file diff --git a/Sources/Gtk/Generated/WrapMode.swift b/Sources/Gtk/Generated/WrapMode.swift index 2c48a3a945..130400c5f3 100644 --- a/Sources/Gtk/Generated/WrapMode.swift +++ b/Sources/Gtk/Generated/WrapMode.swift @@ -5,31 +5,31 @@ public enum WrapMode: GValueRepresentableEnum { public typealias GtkEnum = GtkWrapMode /// Do not wrap lines; just make the text area wider - case none - /// Wrap text, breaking lines anywhere the cursor can - /// appear (between characters, usually - if you want to be technical, - /// between graphemes, see pango_get_log_attrs()) - case character - /// Wrap text, breaking lines in between words - case word - /// Wrap text, breaking lines in between words, or if - /// that is not enough, also between graphemes - case wordCharacter +case none +/// Wrap text, breaking lines anywhere the cursor can +/// appear (between characters, usually - if you want to be technical, +/// between graphemes, see pango_get_log_attrs()) +case character +/// Wrap text, breaking lines in between words +case word +/// Wrap text, breaking lines in between words, or if +/// that is not enough, also between graphemes +case wordCharacter public static var type: GType { - gtk_wrap_mode_get_type() - } + gtk_wrap_mode_get_type() +} public init(from gtkEnum: GtkWrapMode) { switch gtkEnum { case GTK_WRAP_NONE: - self = .none - case GTK_WRAP_CHAR: - self = .character - case GTK_WRAP_WORD: - self = .word - case GTK_WRAP_WORD_CHAR: - self = .wordCharacter + self = .none +case GTK_WRAP_CHAR: + self = .character +case GTK_WRAP_WORD: + self = .word +case GTK_WRAP_WORD_CHAR: + self = .wordCharacter default: fatalError("Unsupported GtkWrapMode enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ public enum WrapMode: GValueRepresentableEnum { public func toGtk() -> GtkWrapMode { switch self { case .none: - return GTK_WRAP_NONE - case .character: - return GTK_WRAP_CHAR - case .word: - return GTK_WRAP_WORD - case .wordCharacter: - return GTK_WRAP_WORD_CHAR + return GTK_WRAP_NONE +case .character: + return GTK_WRAP_CHAR +case .word: + return GTK_WRAP_WORD +case .wordCharacter: + return GTK_WRAP_WORD_CHAR } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/Activatable.swift b/Sources/Gtk3/Generated/Activatable.swift index 0a0f5fa24b..30d78be929 100644 --- a/Sources/Gtk3/Generated/Activatable.swift +++ b/Sources/Gtk3/Generated/Activatable.swift @@ -4,9 +4,9 @@ import CGtk3 /// the state of its action. A #GtkActivatable can also provide feedback /// through its action, as they are responsible for activating their /// related actions. -/// +/// /// # Implementing GtkActivatable -/// +/// /// When extending a class that is already #GtkActivatable; it is only /// necessary to implement the #GtkActivatable->sync_action_properties() /// and #GtkActivatable->update() methods and chain up to the parent @@ -17,29 +17,29 @@ import CGtk3 /// the action pointer and boolean flag on your instance, and calling /// gtk_activatable_do_set_related_action() and /// gtk_activatable_sync_action_properties() at the appropriate times. -/// +/// /// ## A class fragment implementing #GtkActivatable -/// +/// /// |[ -/// +/// /// enum { /// ... -/// +/// /// PROP_ACTIVATABLE_RELATED_ACTION, /// PROP_ACTIVATABLE_USE_ACTION_APPEARANCE /// } -/// +/// /// struct _FooBarPrivate /// { -/// +/// /// ... -/// +/// /// GtkAction *action; /// gboolean use_action_appearance; /// }; -/// +/// /// ... -/// +/// /// static void foo_bar_activatable_interface_init (GtkActivatableIface *iface); /// static void foo_bar_activatable_update (GtkActivatable *activatable, /// GtkAction *action, @@ -47,38 +47,38 @@ import CGtk3 /// static void foo_bar_activatable_sync_action_properties (GtkActivatable *activatable, /// GtkAction *action); /// ... -/// -/// +/// +/// /// static void /// foo_bar_class_init (FooBarClass *klass) /// { -/// +/// /// ... -/// +/// /// g_object_class_override_property (gobject_class, PROP_ACTIVATABLE_RELATED_ACTION, "related-action"); /// g_object_class_override_property (gobject_class, PROP_ACTIVATABLE_USE_ACTION_APPEARANCE, "use-action-appearance"); -/// +/// /// ... /// } -/// -/// +/// +/// /// static void /// foo_bar_activatable_interface_init (GtkActivatableIface *iface) /// { /// iface->update = foo_bar_activatable_update; /// iface->sync_action_properties = foo_bar_activatable_sync_action_properties; /// } -/// +/// /// ... Break the reference using gtk_activatable_do_set_related_action()... -/// +/// /// static void /// foo_bar_dispose (GObject *object) /// { /// FooBar *bar = FOO_BAR (object); /// FooBarPrivate *priv = FOO_BAR_GET_PRIVATE (bar); -/// +/// /// ... -/// +/// /// if (priv->action) /// { /// gtk_activatable_do_set_related_action (GTK_ACTIVATABLE (bar), NULL); @@ -86,9 +86,9 @@ import CGtk3 /// } /// G_OBJECT_CLASS (foo_bar_parent_class)->dispose (object); /// } -/// +/// /// ... Handle the “related-action” and “use-action-appearance” properties ... -/// +/// /// static void /// foo_bar_set_property (GObject *object, /// guint prop_id, @@ -97,12 +97,12 @@ import CGtk3 /// { /// FooBar *bar = FOO_BAR (object); /// FooBarPrivate *priv = FOO_BAR_GET_PRIVATE (bar); -/// +/// /// switch (prop_id) /// { -/// +/// /// ... -/// +/// /// case PROP_ACTIVATABLE_RELATED_ACTION: /// foo_bar_set_related_action (bar, g_value_get_object (value)); /// break; @@ -114,7 +114,7 @@ import CGtk3 /// break; /// } /// } -/// +/// /// static void /// foo_bar_get_property (GObject *object, /// guint prop_id, @@ -123,12 +123,12 @@ import CGtk3 /// { /// FooBar *bar = FOO_BAR (object); /// FooBarPrivate *priv = FOO_BAR_GET_PRIVATE (bar); -/// +/// /// switch (prop_id) /// { -/// +/// /// ... -/// +/// /// case PROP_ACTIVATABLE_RELATED_ACTION: /// g_value_set_object (value, priv->action); /// break; @@ -140,22 +140,22 @@ import CGtk3 /// break; /// } /// } -/// -/// +/// +/// /// static void /// foo_bar_set_use_action_appearance (FooBar *bar, /// gboolean use_appearance) /// { /// FooBarPrivate *priv = FOO_BAR_GET_PRIVATE (bar); -/// +/// /// if (priv->use_action_appearance != use_appearance) /// { /// priv->use_action_appearance = use_appearance; -/// +/// /// gtk_activatable_sync_action_properties (GTK_ACTIVATABLE (bar), priv->action); /// } /// } -/// +/// /// ... call gtk_activatable_do_set_related_action() and then assign the action pointer, /// no need to reference the action here since gtk_activatable_do_set_related_action() already /// holds a reference here for you... @@ -164,53 +164,53 @@ import CGtk3 /// GtkAction *action) /// { /// FooBarPrivate *priv = FOO_BAR_GET_PRIVATE (bar); -/// +/// /// if (priv->action == action) /// return; -/// +/// /// gtk_activatable_do_set_related_action (GTK_ACTIVATABLE (bar), action); -/// +/// /// priv->action = action; /// } -/// +/// /// ... Selectively reset and update activatable depending on the use-action-appearance property ... /// static void /// gtk_button_activatable_sync_action_properties (GtkActivatable *activatable, /// GtkAction *action) /// { /// GtkButtonPrivate *priv = GTK_BUTTON_GET_PRIVATE (activatable); -/// +/// /// if (!action) /// return; -/// +/// /// if (gtk_action_is_visible (action)) /// gtk_widget_show (GTK_WIDGET (activatable)); /// else /// gtk_widget_hide (GTK_WIDGET (activatable)); -/// +/// /// gtk_widget_set_sensitive (GTK_WIDGET (activatable), gtk_action_is_sensitive (action)); -/// +/// /// ... -/// +/// /// if (priv->use_action_appearance) /// { /// if (gtk_action_get_stock_id (action)) /// foo_bar_set_stock (button, gtk_action_get_stock_id (action)); /// else if (gtk_action_get_label (action)) /// foo_bar_set_label (button, gtk_action_get_label (action)); -/// +/// /// ... -/// +/// /// } /// } -/// +/// /// static void /// foo_bar_activatable_update (GtkActivatable *activatable, /// GtkAction *action, /// const gchar *property_name) /// { /// FooBarPrivate *priv = FOO_BAR_GET_PRIVATE (activatable); -/// +/// /// if (strcmp (property_name, "visible") == 0) /// { /// if (gtk_action_is_visible (action)) @@ -220,20 +220,22 @@ import CGtk3 /// } /// else if (strcmp (property_name, "sensitive") == 0) /// gtk_widget_set_sensitive (GTK_WIDGET (activatable), gtk_action_is_sensitive (action)); -/// +/// /// ... -/// +/// /// if (!priv->use_action_appearance) /// return; -/// +/// /// if (strcmp (property_name, "stock-id") == 0) /// foo_bar_set_stock (button, gtk_action_get_stock_id (action)); /// else if (strcmp (property_name, "label") == 0) /// foo_bar_set_label (button, gtk_action_get_label (action)); -/// +/// /// ... /// } /// ]| public protocol Activatable: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/Align.swift b/Sources/Gtk3/Generated/Align.swift index 770c4eed6a..91e31bd57b 100644 --- a/Sources/Gtk3/Generated/Align.swift +++ b/Sources/Gtk3/Generated/Align.swift @@ -2,17 +2,17 @@ import CGtk3 /// Controls how a widget deals with extra space in a single (x or y) /// dimension. -/// +/// /// Alignment only matters if the widget receives a “too large” allocation, /// for example if you packed the widget with the #GtkWidget:expand /// flag inside a #GtkBox, then the widget might get extra space. If /// you have for example a 16x16 icon inside a 32x32 space, the icon /// could be scaled and stretched, it could be centered, or it could be /// positioned to one side of the space. -/// +/// /// Note that in horizontal context @GTK_ALIGN_START and @GTK_ALIGN_END /// are interpreted relative to text direction. -/// +/// /// GTK_ALIGN_BASELINE support for it is optional for containers and widgets, and /// it is only supported for vertical alignment. When its not supported by /// a child or a container it is treated as @GTK_ALIGN_FILL. @@ -20,32 +20,32 @@ public enum Align: GValueRepresentableEnum { public typealias GtkEnum = GtkAlign /// Stretch to fill all space if possible, center if - /// no meaningful way to stretch - case fill - /// Snap to left or top side, leaving space on right - /// or bottom - case start - /// Snap to right or bottom side, leaving space on left - /// or top - case end - /// Center natural width of widget inside the - /// allocation - case center +/// no meaningful way to stretch +case fill +/// Snap to left or top side, leaving space on right +/// or bottom +case start +/// Snap to right or bottom side, leaving space on left +/// or top +case end +/// Center natural width of widget inside the +/// allocation +case center public static var type: GType { - gtk_align_get_type() - } + gtk_align_get_type() +} public init(from gtkEnum: GtkAlign) { switch gtkEnum { case GTK_ALIGN_FILL: - self = .fill - case GTK_ALIGN_START: - self = .start - case GTK_ALIGN_END: - self = .end - case GTK_ALIGN_CENTER: - self = .center + self = .fill +case GTK_ALIGN_START: + self = .start +case GTK_ALIGN_END: + self = .end +case GTK_ALIGN_CENTER: + self = .center default: fatalError("Unsupported GtkAlign enum value: \(gtkEnum.rawValue)") } @@ -54,13 +54,13 @@ public enum Align: GValueRepresentableEnum { public func toGtk() -> GtkAlign { switch self { case .fill: - return GTK_ALIGN_FILL - case .start: - return GTK_ALIGN_START - case .end: - return GTK_ALIGN_END - case .center: - return GTK_ALIGN_CENTER + return GTK_ALIGN_FILL +case .start: + return GTK_ALIGN_START +case .end: + return GTK_ALIGN_END +case .center: + return GTK_ALIGN_CENTER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/AppChooser.swift b/Sources/Gtk3/Generated/AppChooser.swift index a0fdc1fe31..f3001c334c 100644 --- a/Sources/Gtk3/Generated/AppChooser.swift +++ b/Sources/Gtk3/Generated/AppChooser.swift @@ -4,7 +4,7 @@ import CGtk3 /// allow the user to choose an application (typically for the purpose of /// opening a file). The main objects that implement this interface are /// #GtkAppChooserWidget, #GtkAppChooserDialog and #GtkAppChooserButton. -/// +/// /// Applications are represented by GIO #GAppInfo objects here. /// GIO has a concept of recommended and fallback applications for a /// given content type. Recommended applications are those that claim @@ -14,14 +14,15 @@ import CGtk3 /// type. The #GtkAppChooserWidget provides detailed control over /// whether the shown list of applications should include default, /// recommended or fallback applications. -/// +/// /// To obtain the application that has been selected in a #GtkAppChooser, /// use gtk_app_chooser_get_app_info(). public protocol AppChooser: GObjectRepresentable { /// The content type of the #GtkAppChooser object. - /// - /// See [GContentType][gio-GContentType] - /// for more information about content types. - var contentType: String { get set } +/// +/// See [GContentType][gio-GContentType] +/// for more information about content types. +var contentType: String { get set } -} + +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ArrowPlacement.swift b/Sources/Gtk3/Generated/ArrowPlacement.swift index ac390d8a7d..5c7a1cd61f 100644 --- a/Sources/Gtk3/Generated/ArrowPlacement.swift +++ b/Sources/Gtk3/Generated/ArrowPlacement.swift @@ -5,24 +5,24 @@ public enum ArrowPlacement: GValueRepresentableEnum { public typealias GtkEnum = GtkArrowPlacement /// Place one arrow on each end of the menu. - case both - /// Place both arrows at the top of the menu. - case start - /// Place both arrows at the bottom of the menu. - case end +case both +/// Place both arrows at the top of the menu. +case start +/// Place both arrows at the bottom of the menu. +case end public static var type: GType { - gtk_arrow_placement_get_type() - } + gtk_arrow_placement_get_type() +} public init(from gtkEnum: GtkArrowPlacement) { switch gtkEnum { case GTK_ARROWS_BOTH: - self = .both - case GTK_ARROWS_START: - self = .start - case GTK_ARROWS_END: - self = .end + self = .both +case GTK_ARROWS_START: + self = .start +case GTK_ARROWS_END: + self = .end default: fatalError("Unsupported GtkArrowPlacement enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ public enum ArrowPlacement: GValueRepresentableEnum { public func toGtk() -> GtkArrowPlacement { switch self { case .both: - return GTK_ARROWS_BOTH - case .start: - return GTK_ARROWS_START - case .end: - return GTK_ARROWS_END + return GTK_ARROWS_BOTH +case .start: + return GTK_ARROWS_START +case .end: + return GTK_ARROWS_END } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ArrowType.swift b/Sources/Gtk3/Generated/ArrowType.swift index 5f09e23030..f0d1ee7180 100644 --- a/Sources/Gtk3/Generated/ArrowType.swift +++ b/Sources/Gtk3/Generated/ArrowType.swift @@ -5,28 +5,28 @@ public enum ArrowType: GValueRepresentableEnum { public typealias GtkEnum = GtkArrowType /// Represents an upward pointing arrow. - case up - /// Represents a downward pointing arrow. - case down - /// Represents a left pointing arrow. - case left - /// Represents a right pointing arrow. - case right +case up +/// Represents a downward pointing arrow. +case down +/// Represents a left pointing arrow. +case left +/// Represents a right pointing arrow. +case right public static var type: GType { - gtk_arrow_type_get_type() - } + gtk_arrow_type_get_type() +} public init(from gtkEnum: GtkArrowType) { switch gtkEnum { case GTK_ARROW_UP: - self = .up - case GTK_ARROW_DOWN: - self = .down - case GTK_ARROW_LEFT: - self = .left - case GTK_ARROW_RIGHT: - self = .right + self = .up +case GTK_ARROW_DOWN: + self = .down +case GTK_ARROW_LEFT: + self = .left +case GTK_ARROW_RIGHT: + self = .right default: fatalError("Unsupported GtkArrowType enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum ArrowType: GValueRepresentableEnum { public func toGtk() -> GtkArrowType { switch self { case .up: - return GTK_ARROW_UP - case .down: - return GTK_ARROW_DOWN - case .left: - return GTK_ARROW_LEFT - case .right: - return GTK_ARROW_RIGHT + return GTK_ARROW_UP +case .down: + return GTK_ARROW_DOWN +case .left: + return GTK_ARROW_LEFT +case .right: + return GTK_ARROW_RIGHT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/AssistantPageType.swift b/Sources/Gtk3/Generated/AssistantPageType.swift index 2d4ffb924b..ce95f8d607 100644 --- a/Sources/Gtk3/Generated/AssistantPageType.swift +++ b/Sources/Gtk3/Generated/AssistantPageType.swift @@ -2,56 +2,56 @@ import CGtk3 /// An enum for determining the page role inside the #GtkAssistant. It's /// used to handle buttons sensitivity and visibility. -/// +/// /// Note that an assistant needs to end its page flow with a page of type /// %GTK_ASSISTANT_PAGE_CONFIRM, %GTK_ASSISTANT_PAGE_SUMMARY or /// %GTK_ASSISTANT_PAGE_PROGRESS to be correct. -/// +/// /// The Cancel button will only be shown if the page isn’t “committed”. /// See gtk_assistant_commit() for details. public enum AssistantPageType: GValueRepresentableEnum { public typealias GtkEnum = GtkAssistantPageType /// The page has regular contents. Both the - /// Back and forward buttons will be shown. - case content - /// The page contains an introduction to the - /// assistant task. Only the Forward button will be shown if there is a - /// next page. - case intro - /// The page lets the user confirm or deny the - /// changes. The Back and Apply buttons will be shown. - case confirm - /// The page informs the user of the changes - /// done. Only the Close button will be shown. - case summary - /// Used for tasks that take a long time to - /// complete, blocks the assistant until the page is marked as complete. - /// Only the back button will be shown. - case progress - /// Used for when other page types are not - /// appropriate. No buttons will be shown, and the application must - /// add its own buttons through gtk_assistant_add_action_widget(). - case custom +/// Back and forward buttons will be shown. +case content +/// The page contains an introduction to the +/// assistant task. Only the Forward button will be shown if there is a +/// next page. +case intro +/// The page lets the user confirm or deny the +/// changes. The Back and Apply buttons will be shown. +case confirm +/// The page informs the user of the changes +/// done. Only the Close button will be shown. +case summary +/// Used for tasks that take a long time to +/// complete, blocks the assistant until the page is marked as complete. +/// Only the back button will be shown. +case progress +/// Used for when other page types are not +/// appropriate. No buttons will be shown, and the application must +/// add its own buttons through gtk_assistant_add_action_widget(). +case custom public static var type: GType { - gtk_assistant_page_type_get_type() - } + gtk_assistant_page_type_get_type() +} public init(from gtkEnum: GtkAssistantPageType) { switch gtkEnum { case GTK_ASSISTANT_PAGE_CONTENT: - self = .content - case GTK_ASSISTANT_PAGE_INTRO: - self = .intro - case GTK_ASSISTANT_PAGE_CONFIRM: - self = .confirm - case GTK_ASSISTANT_PAGE_SUMMARY: - self = .summary - case GTK_ASSISTANT_PAGE_PROGRESS: - self = .progress - case GTK_ASSISTANT_PAGE_CUSTOM: - self = .custom + self = .content +case GTK_ASSISTANT_PAGE_INTRO: + self = .intro +case GTK_ASSISTANT_PAGE_CONFIRM: + self = .confirm +case GTK_ASSISTANT_PAGE_SUMMARY: + self = .summary +case GTK_ASSISTANT_PAGE_PROGRESS: + self = .progress +case GTK_ASSISTANT_PAGE_CUSTOM: + self = .custom default: fatalError("Unsupported GtkAssistantPageType enum value: \(gtkEnum.rawValue)") } @@ -60,17 +60,17 @@ public enum AssistantPageType: GValueRepresentableEnum { public func toGtk() -> GtkAssistantPageType { switch self { case .content: - return GTK_ASSISTANT_PAGE_CONTENT - case .intro: - return GTK_ASSISTANT_PAGE_INTRO - case .confirm: - return GTK_ASSISTANT_PAGE_CONFIRM - case .summary: - return GTK_ASSISTANT_PAGE_SUMMARY - case .progress: - return GTK_ASSISTANT_PAGE_PROGRESS - case .custom: - return GTK_ASSISTANT_PAGE_CUSTOM + return GTK_ASSISTANT_PAGE_CONTENT +case .intro: + return GTK_ASSISTANT_PAGE_INTRO +case .confirm: + return GTK_ASSISTANT_PAGE_CONFIRM +case .summary: + return GTK_ASSISTANT_PAGE_SUMMARY +case .progress: + return GTK_ASSISTANT_PAGE_PROGRESS +case .custom: + return GTK_ASSISTANT_PAGE_CUSTOM } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/BorderStyle.swift b/Sources/Gtk3/Generated/BorderStyle.swift index f936509138..44d5061148 100644 --- a/Sources/Gtk3/Generated/BorderStyle.swift +++ b/Sources/Gtk3/Generated/BorderStyle.swift @@ -5,52 +5,52 @@ public enum BorderStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkBorderStyle /// No visible border - case none - /// A single line segment - case solid - /// Looks as if the content is sunken into the canvas - case inset - /// Looks as if the content is coming out of the canvas - case outset - /// Same as @GTK_BORDER_STYLE_NONE - case hidden - /// A series of round dots - case dotted - /// A series of square-ended dashes - case dashed - /// Two parallel lines with some space between them - case double - /// Looks as if it were carved in the canvas - case groove - /// Looks as if it were coming out of the canvas - case ridge +case none +/// A single line segment +case solid +/// Looks as if the content is sunken into the canvas +case inset +/// Looks as if the content is coming out of the canvas +case outset +/// Same as @GTK_BORDER_STYLE_NONE +case hidden +/// A series of round dots +case dotted +/// A series of square-ended dashes +case dashed +/// Two parallel lines with some space between them +case double +/// Looks as if it were carved in the canvas +case groove +/// Looks as if it were coming out of the canvas +case ridge public static var type: GType { - gtk_border_style_get_type() - } + gtk_border_style_get_type() +} public init(from gtkEnum: GtkBorderStyle) { switch gtkEnum { case GTK_BORDER_STYLE_NONE: - self = .none - case GTK_BORDER_STYLE_SOLID: - self = .solid - case GTK_BORDER_STYLE_INSET: - self = .inset - case GTK_BORDER_STYLE_OUTSET: - self = .outset - case GTK_BORDER_STYLE_HIDDEN: - self = .hidden - case GTK_BORDER_STYLE_DOTTED: - self = .dotted - case GTK_BORDER_STYLE_DASHED: - self = .dashed - case GTK_BORDER_STYLE_DOUBLE: - self = .double - case GTK_BORDER_STYLE_GROOVE: - self = .groove - case GTK_BORDER_STYLE_RIDGE: - self = .ridge + self = .none +case GTK_BORDER_STYLE_SOLID: + self = .solid +case GTK_BORDER_STYLE_INSET: + self = .inset +case GTK_BORDER_STYLE_OUTSET: + self = .outset +case GTK_BORDER_STYLE_HIDDEN: + self = .hidden +case GTK_BORDER_STYLE_DOTTED: + self = .dotted +case GTK_BORDER_STYLE_DASHED: + self = .dashed +case GTK_BORDER_STYLE_DOUBLE: + self = .double +case GTK_BORDER_STYLE_GROOVE: + self = .groove +case GTK_BORDER_STYLE_RIDGE: + self = .ridge default: fatalError("Unsupported GtkBorderStyle enum value: \(gtkEnum.rawValue)") } @@ -59,25 +59,25 @@ public enum BorderStyle: GValueRepresentableEnum { public func toGtk() -> GtkBorderStyle { switch self { case .none: - return GTK_BORDER_STYLE_NONE - case .solid: - return GTK_BORDER_STYLE_SOLID - case .inset: - return GTK_BORDER_STYLE_INSET - case .outset: - return GTK_BORDER_STYLE_OUTSET - case .hidden: - return GTK_BORDER_STYLE_HIDDEN - case .dotted: - return GTK_BORDER_STYLE_DOTTED - case .dashed: - return GTK_BORDER_STYLE_DASHED - case .double: - return GTK_BORDER_STYLE_DOUBLE - case .groove: - return GTK_BORDER_STYLE_GROOVE - case .ridge: - return GTK_BORDER_STYLE_RIDGE + return GTK_BORDER_STYLE_NONE +case .solid: + return GTK_BORDER_STYLE_SOLID +case .inset: + return GTK_BORDER_STYLE_INSET +case .outset: + return GTK_BORDER_STYLE_OUTSET +case .hidden: + return GTK_BORDER_STYLE_HIDDEN +case .dotted: + return GTK_BORDER_STYLE_DOTTED +case .dashed: + return GTK_BORDER_STYLE_DASHED +case .double: + return GTK_BORDER_STYLE_DOUBLE +case .groove: + return GTK_BORDER_STYLE_GROOVE +case .ridge: + return GTK_BORDER_STYLE_RIDGE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/Buildable.swift b/Sources/Gtk3/Generated/Buildable.swift index a5b23b8147..d182346df3 100644 --- a/Sources/Gtk3/Generated/Buildable.swift +++ b/Sources/Gtk3/Generated/Buildable.swift @@ -4,14 +4,16 @@ import CGtk3 /// from [GtkBuilder UI descriptions][BUILDER-UI]. /// The interface includes methods for setting names and properties of objects, /// parsing custom tags and constructing child objects. -/// +/// /// The GtkBuildable interface is implemented by all widgets and /// many of the non-widget objects that are provided by GTK+. The /// main user of this interface is #GtkBuilder. There should be /// very little need for applications to call any of these functions directly. -/// +/// /// An object only needs to implement this interface if it needs to extend the /// #GtkBuilder format or run any extra routines at deserialization time. public protocol Buildable: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/BuilderError.swift b/Sources/Gtk3/Generated/BuilderError.swift index 75f34e2ec0..eac88a005d 100644 --- a/Sources/Gtk3/Generated/BuilderError.swift +++ b/Sources/Gtk3/Generated/BuilderError.swift @@ -6,77 +6,77 @@ public enum BuilderError: GValueRepresentableEnum { public typealias GtkEnum = GtkBuilderError /// A type-func attribute didn’t name - /// a function that returns a #GType. - case invalidTypeFunction - /// The input contained a tag that #GtkBuilder - /// can’t handle. - case unhandledTag - /// An attribute that is required by - /// #GtkBuilder was missing. - case missingAttribute - /// #GtkBuilder found an attribute that - /// it doesn’t understand. - case invalidAttribute - /// #GtkBuilder found a tag that - /// it doesn’t understand. - case invalidTag - /// A required property value was - /// missing. - case missingPropertyValue - /// #GtkBuilder couldn’t parse - /// some attribute value. - case invalidValue - /// The input file requires a newer version - /// of GTK+. - case versionMismatch - /// An object id occurred twice. - case duplicateId - /// A specified object type is of the same type or - /// derived from the type of the composite class being extended with builder XML. - case objectTypeRefused - /// The wrong type was specified in a composite class’s template XML - case templateMismatch - /// The specified property is unknown for the object class. - case invalidProperty - /// The specified signal is unknown for the object class. - case invalidSignal - /// An object id is unknown - case invalidId +/// a function that returns a #GType. +case invalidTypeFunction +/// The input contained a tag that #GtkBuilder +/// can’t handle. +case unhandledTag +/// An attribute that is required by +/// #GtkBuilder was missing. +case missingAttribute +/// #GtkBuilder found an attribute that +/// it doesn’t understand. +case invalidAttribute +/// #GtkBuilder found a tag that +/// it doesn’t understand. +case invalidTag +/// A required property value was +/// missing. +case missingPropertyValue +/// #GtkBuilder couldn’t parse +/// some attribute value. +case invalidValue +/// The input file requires a newer version +/// of GTK+. +case versionMismatch +/// An object id occurred twice. +case duplicateId +/// A specified object type is of the same type or +/// derived from the type of the composite class being extended with builder XML. +case objectTypeRefused +/// The wrong type was specified in a composite class’s template XML +case templateMismatch +/// The specified property is unknown for the object class. +case invalidProperty +/// The specified signal is unknown for the object class. +case invalidSignal +/// An object id is unknown +case invalidId public static var type: GType { - gtk_builder_error_get_type() - } + gtk_builder_error_get_type() +} public init(from gtkEnum: GtkBuilderError) { switch gtkEnum { case GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION: - self = .invalidTypeFunction - case GTK_BUILDER_ERROR_UNHANDLED_TAG: - self = .unhandledTag - case GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: - self = .missingAttribute - case GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: - self = .invalidAttribute - case GTK_BUILDER_ERROR_INVALID_TAG: - self = .invalidTag - case GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: - self = .missingPropertyValue - case GTK_BUILDER_ERROR_INVALID_VALUE: - self = .invalidValue - case GTK_BUILDER_ERROR_VERSION_MISMATCH: - self = .versionMismatch - case GTK_BUILDER_ERROR_DUPLICATE_ID: - self = .duplicateId - case GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED: - self = .objectTypeRefused - case GTK_BUILDER_ERROR_TEMPLATE_MISMATCH: - self = .templateMismatch - case GTK_BUILDER_ERROR_INVALID_PROPERTY: - self = .invalidProperty - case GTK_BUILDER_ERROR_INVALID_SIGNAL: - self = .invalidSignal - case GTK_BUILDER_ERROR_INVALID_ID: - self = .invalidId + self = .invalidTypeFunction +case GTK_BUILDER_ERROR_UNHANDLED_TAG: + self = .unhandledTag +case GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: + self = .missingAttribute +case GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: + self = .invalidAttribute +case GTK_BUILDER_ERROR_INVALID_TAG: + self = .invalidTag +case GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: + self = .missingPropertyValue +case GTK_BUILDER_ERROR_INVALID_VALUE: + self = .invalidValue +case GTK_BUILDER_ERROR_VERSION_MISMATCH: + self = .versionMismatch +case GTK_BUILDER_ERROR_DUPLICATE_ID: + self = .duplicateId +case GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED: + self = .objectTypeRefused +case GTK_BUILDER_ERROR_TEMPLATE_MISMATCH: + self = .templateMismatch +case GTK_BUILDER_ERROR_INVALID_PROPERTY: + self = .invalidProperty +case GTK_BUILDER_ERROR_INVALID_SIGNAL: + self = .invalidSignal +case GTK_BUILDER_ERROR_INVALID_ID: + self = .invalidId default: fatalError("Unsupported GtkBuilderError enum value: \(gtkEnum.rawValue)") } @@ -85,33 +85,33 @@ public enum BuilderError: GValueRepresentableEnum { public func toGtk() -> GtkBuilderError { switch self { case .invalidTypeFunction: - return GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION - case .unhandledTag: - return GTK_BUILDER_ERROR_UNHANDLED_TAG - case .missingAttribute: - return GTK_BUILDER_ERROR_MISSING_ATTRIBUTE - case .invalidAttribute: - return GTK_BUILDER_ERROR_INVALID_ATTRIBUTE - case .invalidTag: - return GTK_BUILDER_ERROR_INVALID_TAG - case .missingPropertyValue: - return GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE - case .invalidValue: - return GTK_BUILDER_ERROR_INVALID_VALUE - case .versionMismatch: - return GTK_BUILDER_ERROR_VERSION_MISMATCH - case .duplicateId: - return GTK_BUILDER_ERROR_DUPLICATE_ID - case .objectTypeRefused: - return GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED - case .templateMismatch: - return GTK_BUILDER_ERROR_TEMPLATE_MISMATCH - case .invalidProperty: - return GTK_BUILDER_ERROR_INVALID_PROPERTY - case .invalidSignal: - return GTK_BUILDER_ERROR_INVALID_SIGNAL - case .invalidId: - return GTK_BUILDER_ERROR_INVALID_ID + return GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION +case .unhandledTag: + return GTK_BUILDER_ERROR_UNHANDLED_TAG +case .missingAttribute: + return GTK_BUILDER_ERROR_MISSING_ATTRIBUTE +case .invalidAttribute: + return GTK_BUILDER_ERROR_INVALID_ATTRIBUTE +case .invalidTag: + return GTK_BUILDER_ERROR_INVALID_TAG +case .missingPropertyValue: + return GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE +case .invalidValue: + return GTK_BUILDER_ERROR_INVALID_VALUE +case .versionMismatch: + return GTK_BUILDER_ERROR_VERSION_MISMATCH +case .duplicateId: + return GTK_BUILDER_ERROR_DUPLICATE_ID +case .objectTypeRefused: + return GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED +case .templateMismatch: + return GTK_BUILDER_ERROR_TEMPLATE_MISMATCH +case .invalidProperty: + return GTK_BUILDER_ERROR_INVALID_PROPERTY +case .invalidSignal: + return GTK_BUILDER_ERROR_INVALID_SIGNAL +case .invalidId: + return GTK_BUILDER_ERROR_INVALID_ID } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/Button.swift b/Sources/Gtk3/Generated/Button.swift index 59a967469c..37bfd15f4d 100644 --- a/Sources/Gtk3/Generated/Button.swift +++ b/Sources/Gtk3/Generated/Button.swift @@ -3,282 +3,275 @@ import CGtk3 /// The #GtkButton widget is generally used to trigger a callback function that is /// called when the button is pressed. The various signals and how to use them /// are outlined below. -/// +/// /// The #GtkButton widget can hold any valid child widget. That is, it can hold /// almost any other standard #GtkWidget. The most commonly used child is the /// #GtkLabel. -/// +/// /// # CSS nodes -/// +/// /// GtkButton has a single CSS node with name button. The node will get the /// style classes .image-button or .text-button, if the content is just an /// image or label, respectively. It may also receive the .flat style class. -/// +/// /// Other style classes that are commonly used with GtkButton include /// .suggested-action and .destructive-action. In special cases, buttons /// can be made round by adding the .circular style class. -/// +/// /// Button-like widgets like #GtkToggleButton, #GtkMenuButton, #GtkVolumeButton, /// #GtkLockButton, #GtkColorButton, #GtkFontButton or #GtkFileChooserButton use /// style classes such as .toggle, .popup, .scale, .lock, .color, .font, .file /// to differentiate themselves from a plain GtkButton. open class Button: Bin, Activatable { /// Creates a new #GtkButton widget. To add a child widget to the button, - /// use gtk_container_add(). - public convenience init() { - self.init( - gtk_button_new() - ) +/// use gtk_container_add(). +public convenience init() { + self.init( + gtk_button_new() + ) +} + +/// Creates a new button containing an icon from the current icon theme. +/// +/// If the icon name isn’t known, a “broken image” icon will be +/// displayed instead. If the current icon theme is changed, the icon +/// will be updated appropriately. +/// +/// This function is a convenience wrapper around gtk_button_new() and +/// gtk_button_set_image(). +public convenience init(iconName: String, size: GtkIconSize) { + self.init( + gtk_button_new_from_icon_name(iconName, size) + ) +} + +/// Creates a #GtkButton widget with a #GtkLabel child containing the given +/// text. +public convenience init(label: String) { + self.init( + gtk_button_new_with_label(label) + ) +} + +/// Creates a new #GtkButton containing a label. +/// If characters in @label are preceded by an underscore, they are underlined. +/// If you need a literal underscore character in a label, use “__” (two +/// underscores). The first underlined character represents a keyboard +/// accelerator called a mnemonic. +/// Pressing Alt and that key activates the button. +public convenience init(mnemonic label: String) { + self.init( + gtk_button_new_with_mnemonic(label) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) +} + +addSignal(name: "clicked") { [weak self] () in + guard let self = self else { return } + self.clicked?(self) +} + +addSignal(name: "enter") { [weak self] () in + guard let self = self else { return } + self.enter?(self) +} + +addSignal(name: "leave") { [weak self] () in + guard let self = self else { return } + self.leave?(self) +} + +addSignal(name: "pressed") { [weak self] () in + guard let self = self else { return } + self.pressed?(self) +} + +addSignal(name: "released") { [weak self] () in + guard let self = self else { return } + self.released?(self) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new button containing an icon from the current icon theme. - /// - /// If the icon name isn’t known, a “broken image” icon will be - /// displayed instead. If the current icon theme is changed, the icon - /// will be updated appropriately. - /// - /// This function is a convenience wrapper around gtk_button_new() and - /// gtk_button_set_image(). - public convenience init(iconName: String, size: GtkIconSize) { - self.init( - gtk_button_new_from_icon_name(iconName, size) - ) +addSignal(name: "notify::always-show-image", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAlwaysShowImage?(self, param0) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a #GtkButton widget with a #GtkLabel child containing the given - /// text. - public convenience init(label: String) { - self.init( - gtk_button_new_with_label(label) - ) +addSignal(name: "notify::image", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyImage?(self, param0) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new #GtkButton containing a label. - /// If characters in @label are preceded by an underscore, they are underlined. - /// If you need a literal underscore character in a label, use “__” (two - /// underscores). The first underlined character represents a keyboard - /// accelerator called a mnemonic. - /// Pressing Alt and that key activates the button. - public convenience init(mnemonic label: String) { - self.init( - gtk_button_new_with_mnemonic(label) - ) +addSignal(name: "notify::image-position", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyImagePosition?(self, param0) +} + +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) - } - - addSignal(name: "clicked") { [weak self] () in - guard let self = self else { return } - self.clicked?(self) - } - - addSignal(name: "enter") { [weak self] () in - guard let self = self else { return } - self.enter?(self) - } - - addSignal(name: "leave") { [weak self] () in - guard let self = self else { return } - self.leave?(self) - } - - addSignal(name: "pressed") { [weak self] () in - guard let self = self else { return } - self.pressed?(self) - } - - addSignal(name: "released") { [weak self] () in - guard let self = self else { return } - self.released?(self) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::always-show-image", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAlwaysShowImage?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::image", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyImage?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::image-position", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyImagePosition?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::label", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLabel?(self, param0) - } - - let handler10: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::relief", handler: gCallback(handler10)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyRelief?(self, param0) - } - - let handler11: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-stock", handler: gCallback(handler11)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseStock?(self, param0) - } - - let handler12: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-underline", handler: gCallback(handler12)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseUnderline?(self, param0) - } - - let handler13: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::xalign", handler: gCallback(handler13)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyXalign?(self, param0) - } - - let handler14: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::yalign", handler: gCallback(handler14)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyYalign?(self, param0) - } - - let handler15: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::related-action", handler: gCallback(handler15)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyRelatedAction?(self, param0) - } - - let handler16: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-action-appearance", handler: gCallback(handler16)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseActionAppearance?(self, param0) - } +addSignal(name: "notify::label", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLabel?(self, param0) +} + +let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - @GObjectProperty(named: "label") public var label: String +addSignal(name: "notify::relief", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyRelief?(self, param0) +} - @GObjectProperty(named: "relief") public var relief: ReliefStyle +let handler11: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - @GObjectProperty(named: "use-stock") public var useStock: Bool +addSignal(name: "notify::use-stock", handler: gCallback(handler11)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseStock?(self, param0) +} - @GObjectProperty(named: "use-underline") public var useUnderline: Bool +let handler12: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// The ::activate signal on GtkButton is an action signal and - /// emitting it causes the button to animate press then release. - /// Applications should never connect to this signal, but use the - /// #GtkButton::clicked signal. - public var activate: ((Button) -> Void)? +addSignal(name: "notify::use-underline", handler: gCallback(handler12)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseUnderline?(self, param0) +} - /// Emitted when the button has been activated (pressed and released). - public var clicked: ((Button) -> Void)? +let handler13: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Emitted when the pointer enters the button. - public var enter: ((Button) -> Void)? +addSignal(name: "notify::xalign", handler: gCallback(handler13)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyXalign?(self, param0) +} - /// Emitted when the pointer leaves the button. - public var leave: ((Button) -> Void)? +let handler14: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Emitted when the button is pressed. - public var pressed: ((Button) -> Void)? +addSignal(name: "notify::yalign", handler: gCallback(handler14)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyYalign?(self, param0) +} - /// Emitted when the button is released. - public var released: ((Button) -> Void)? +let handler15: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyAlwaysShowImage: ((Button, OpaquePointer) -> Void)? +addSignal(name: "notify::related-action", handler: gCallback(handler15)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyRelatedAction?(self, param0) +} - public var notifyImage: ((Button, OpaquePointer) -> Void)? +let handler16: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyImagePosition: ((Button, OpaquePointer) -> Void)? +addSignal(name: "notify::use-action-appearance", handler: gCallback(handler16)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseActionAppearance?(self, param0) +} +} - public var notifyLabel: ((Button, OpaquePointer) -> Void)? + +@GObjectProperty(named: "label") public var label: String - public var notifyRelief: ((Button, OpaquePointer) -> Void)? - public var notifyUseStock: ((Button, OpaquePointer) -> Void)? +@GObjectProperty(named: "relief") public var relief: ReliefStyle - public var notifyUseUnderline: ((Button, OpaquePointer) -> Void)? - public var notifyXalign: ((Button, OpaquePointer) -> Void)? +@GObjectProperty(named: "use-stock") public var useStock: Bool - public var notifyYalign: ((Button, OpaquePointer) -> Void)? - public var notifyRelatedAction: ((Button, OpaquePointer) -> Void)? +@GObjectProperty(named: "use-underline") public var useUnderline: Bool - public var notifyUseActionAppearance: ((Button, OpaquePointer) -> Void)? -} +/// The ::activate signal on GtkButton is an action signal and +/// emitting it causes the button to animate press then release. +/// Applications should never connect to this signal, but use the +/// #GtkButton::clicked signal. +public var activate: ((Button) -> Void)? + +/// Emitted when the button has been activated (pressed and released). +public var clicked: ((Button) -> Void)? + +/// Emitted when the pointer enters the button. +public var enter: ((Button) -> Void)? + +/// Emitted when the pointer leaves the button. +public var leave: ((Button) -> Void)? + +/// Emitted when the button is pressed. +public var pressed: ((Button) -> Void)? + +/// Emitted when the button is released. +public var released: ((Button) -> Void)? + + +public var notifyAlwaysShowImage: ((Button, OpaquePointer) -> Void)? + + +public var notifyImage: ((Button, OpaquePointer) -> Void)? + + +public var notifyImagePosition: ((Button, OpaquePointer) -> Void)? + + +public var notifyLabel: ((Button, OpaquePointer) -> Void)? + + +public var notifyRelief: ((Button, OpaquePointer) -> Void)? + + +public var notifyUseStock: ((Button, OpaquePointer) -> Void)? + + +public var notifyUseUnderline: ((Button, OpaquePointer) -> Void)? + + +public var notifyXalign: ((Button, OpaquePointer) -> Void)? + + +public var notifyYalign: ((Button, OpaquePointer) -> Void)? + + +public var notifyRelatedAction: ((Button, OpaquePointer) -> Void)? + + +public var notifyUseActionAppearance: ((Button, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ButtonBoxStyle.swift b/Sources/Gtk3/Generated/ButtonBoxStyle.swift index 5eb0a30447..77fc269bea 100644 --- a/Sources/Gtk3/Generated/ButtonBoxStyle.swift +++ b/Sources/Gtk3/Generated/ButtonBoxStyle.swift @@ -6,30 +6,30 @@ public enum ButtonBoxStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkButtonBoxStyle /// Buttons are evenly spread across the box. - case spread - /// Buttons are placed at the edges of the box. - case edge - /// Buttons are grouped towards the start of the box, - /// (on the left for a HBox, or the top for a VBox). - case start - /// Buttons are grouped towards the end of the box, - /// (on the right for a HBox, or the bottom for a VBox). - case end +case spread +/// Buttons are placed at the edges of the box. +case edge +/// Buttons are grouped towards the start of the box, +/// (on the left for a HBox, or the top for a VBox). +case start +/// Buttons are grouped towards the end of the box, +/// (on the right for a HBox, or the bottom for a VBox). +case end public static var type: GType { - gtk_button_box_style_get_type() - } + gtk_button_box_style_get_type() +} public init(from gtkEnum: GtkButtonBoxStyle) { switch gtkEnum { case GTK_BUTTONBOX_SPREAD: - self = .spread - case GTK_BUTTONBOX_EDGE: - self = .edge - case GTK_BUTTONBOX_START: - self = .start - case GTK_BUTTONBOX_END: - self = .end + self = .spread +case GTK_BUTTONBOX_EDGE: + self = .edge +case GTK_BUTTONBOX_START: + self = .start +case GTK_BUTTONBOX_END: + self = .end default: fatalError("Unsupported GtkButtonBoxStyle enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ public enum ButtonBoxStyle: GValueRepresentableEnum { public func toGtk() -> GtkButtonBoxStyle { switch self { case .spread: - return GTK_BUTTONBOX_SPREAD - case .edge: - return GTK_BUTTONBOX_EDGE - case .start: - return GTK_BUTTONBOX_START - case .end: - return GTK_BUTTONBOX_END + return GTK_BUTTONBOX_SPREAD +case .edge: + return GTK_BUTTONBOX_EDGE +case .start: + return GTK_BUTTONBOX_START +case .end: + return GTK_BUTTONBOX_END } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ButtonRole.swift b/Sources/Gtk3/Generated/ButtonRole.swift index 7250dfdc76..587cb7b181 100644 --- a/Sources/Gtk3/Generated/ButtonRole.swift +++ b/Sources/Gtk3/Generated/ButtonRole.swift @@ -5,24 +5,24 @@ public enum ButtonRole: GValueRepresentableEnum { public typealias GtkEnum = GtkButtonRole /// A plain button - case normal - /// A check button - case check - /// A radio button - case radio +case normal +/// A check button +case check +/// A radio button +case radio public static var type: GType { - gtk_button_role_get_type() - } + gtk_button_role_get_type() +} public init(from gtkEnum: GtkButtonRole) { switch gtkEnum { case GTK_BUTTON_ROLE_NORMAL: - self = .normal - case GTK_BUTTON_ROLE_CHECK: - self = .check - case GTK_BUTTON_ROLE_RADIO: - self = .radio + self = .normal +case GTK_BUTTON_ROLE_CHECK: + self = .check +case GTK_BUTTON_ROLE_RADIO: + self = .radio default: fatalError("Unsupported GtkButtonRole enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ public enum ButtonRole: GValueRepresentableEnum { public func toGtk() -> GtkButtonRole { switch self { case .normal: - return GTK_BUTTON_ROLE_NORMAL - case .check: - return GTK_BUTTON_ROLE_CHECK - case .radio: - return GTK_BUTTON_ROLE_RADIO + return GTK_BUTTON_ROLE_NORMAL +case .check: + return GTK_BUTTON_ROLE_CHECK +case .radio: + return GTK_BUTTON_ROLE_RADIO } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ButtonsType.swift b/Sources/Gtk3/Generated/ButtonsType.swift index e32ccf9b4e..84ed314282 100644 --- a/Sources/Gtk3/Generated/ButtonsType.swift +++ b/Sources/Gtk3/Generated/ButtonsType.swift @@ -3,7 +3,7 @@ import CGtk3 /// Prebuilt sets of buttons for the dialog. If /// none of these choices are appropriate, simply use %GTK_BUTTONS_NONE /// then call gtk_dialog_add_buttons(). -/// +/// /// > Please note that %GTK_BUTTONS_OK, %GTK_BUTTONS_YES_NO /// > and %GTK_BUTTONS_OK_CANCEL are discouraged by the /// > [GNOME Human Interface Guidelines](http://library.gnome.org/devel/hig-book/stable/). @@ -11,36 +11,36 @@ public enum ButtonsType: GValueRepresentableEnum { public typealias GtkEnum = GtkButtonsType /// No buttons at all - case none - /// An OK button - case ok - /// A Close button - case close - /// A Cancel button - case cancel - /// Yes and No buttons - case yesNo - /// OK and Cancel buttons - case okCancel +case none +/// An OK button +case ok +/// A Close button +case close +/// A Cancel button +case cancel +/// Yes and No buttons +case yesNo +/// OK and Cancel buttons +case okCancel public static var type: GType { - gtk_buttons_type_get_type() - } + gtk_buttons_type_get_type() +} public init(from gtkEnum: GtkButtonsType) { switch gtkEnum { case GTK_BUTTONS_NONE: - self = .none - case GTK_BUTTONS_OK: - self = .ok - case GTK_BUTTONS_CLOSE: - self = .close - case GTK_BUTTONS_CANCEL: - self = .cancel - case GTK_BUTTONS_YES_NO: - self = .yesNo - case GTK_BUTTONS_OK_CANCEL: - self = .okCancel + self = .none +case GTK_BUTTONS_OK: + self = .ok +case GTK_BUTTONS_CLOSE: + self = .close +case GTK_BUTTONS_CANCEL: + self = .cancel +case GTK_BUTTONS_YES_NO: + self = .yesNo +case GTK_BUTTONS_OK_CANCEL: + self = .okCancel default: fatalError("Unsupported GtkButtonsType enum value: \(gtkEnum.rawValue)") } @@ -49,17 +49,17 @@ public enum ButtonsType: GValueRepresentableEnum { public func toGtk() -> GtkButtonsType { switch self { case .none: - return GTK_BUTTONS_NONE - case .ok: - return GTK_BUTTONS_OK - case .close: - return GTK_BUTTONS_CLOSE - case .cancel: - return GTK_BUTTONS_CANCEL - case .yesNo: - return GTK_BUTTONS_YES_NO - case .okCancel: - return GTK_BUTTONS_OK_CANCEL + return GTK_BUTTONS_NONE +case .ok: + return GTK_BUTTONS_OK +case .close: + return GTK_BUTTONS_CLOSE +case .cancel: + return GTK_BUTTONS_CANCEL +case .yesNo: + return GTK_BUTTONS_YES_NO +case .okCancel: + return GTK_BUTTONS_OK_CANCEL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/CellAccessibleParent.swift b/Sources/Gtk3/Generated/CellAccessibleParent.swift index 527bde9245..8f72277f87 100644 --- a/Sources/Gtk3/Generated/CellAccessibleParent.swift +++ b/Sources/Gtk3/Generated/CellAccessibleParent.swift @@ -1,5 +1,8 @@ import CGtk3 + public protocol CellAccessibleParent: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/CellEditable.swift b/Sources/Gtk3/Generated/CellEditable.swift index 182b69007f..6bcd43497c 100644 --- a/Sources/Gtk3/Generated/CellEditable.swift +++ b/Sources/Gtk3/Generated/CellEditable.swift @@ -4,31 +4,32 @@ import CGtk3 /// to edit the contents of a #GtkTreeView cell. It provides a way to specify how /// temporary widgets should be configured for editing, get the new value, etc. public protocol CellEditable: GObjectRepresentable { + /// This signal is a sign for the cell renderer to update its - /// value from the @cell_editable. - /// - /// Implementations of #GtkCellEditable are responsible for - /// emitting this signal when they are done editing, e.g. - /// #GtkEntry emits this signal when the user presses Enter. Typical things to - /// do in a handler for ::editing-done are to capture the edited value, - /// disconnect the @cell_editable from signals on the #GtkCellRenderer, etc. - /// - /// gtk_cell_editable_editing_done() is a convenience method - /// for emitting #GtkCellEditable::editing-done. - var editingDone: ((Self) -> Void)? { get set } +/// value from the @cell_editable. +/// +/// Implementations of #GtkCellEditable are responsible for +/// emitting this signal when they are done editing, e.g. +/// #GtkEntry emits this signal when the user presses Enter. Typical things to +/// do in a handler for ::editing-done are to capture the edited value, +/// disconnect the @cell_editable from signals on the #GtkCellRenderer, etc. +/// +/// gtk_cell_editable_editing_done() is a convenience method +/// for emitting #GtkCellEditable::editing-done. +var editingDone: ((Self) -> Void)? { get set } - /// This signal is meant to indicate that the cell is finished - /// editing, and the @cell_editable widget is being removed and may - /// subsequently be destroyed. - /// - /// Implementations of #GtkCellEditable are responsible for - /// emitting this signal when they are done editing. It must - /// be emitted after the #GtkCellEditable::editing-done signal, - /// to give the cell renderer a chance to update the cell's value - /// before the widget is removed. - /// - /// gtk_cell_editable_remove_widget() is a convenience method - /// for emitting #GtkCellEditable::remove-widget. - var removeWidget: ((Self) -> Void)? { get set } -} +/// This signal is meant to indicate that the cell is finished +/// editing, and the @cell_editable widget is being removed and may +/// subsequently be destroyed. +/// +/// Implementations of #GtkCellEditable are responsible for +/// emitting this signal when they are done editing. It must +/// be emitted after the #GtkCellEditable::editing-done signal, +/// to give the cell renderer a chance to update the cell's value +/// before the widget is removed. +/// +/// gtk_cell_editable_remove_widget() is a convenience method +/// for emitting #GtkCellEditable::remove-widget. +var removeWidget: ((Self) -> Void)? { get set } +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/CellLayout.swift b/Sources/Gtk3/Generated/CellLayout.swift index fafc2455c0..3befa11280 100644 --- a/Sources/Gtk3/Generated/CellLayout.swift +++ b/Sources/Gtk3/Generated/CellLayout.swift @@ -3,7 +3,7 @@ import CGtk3 /// #GtkCellLayout is an interface to be implemented by all objects which /// want to provide a #GtkTreeViewColumn like API for packing cells, /// setting attributes and data funcs. -/// +/// /// One of the notable features provided by implementations of /// GtkCellLayout are attributes. Attributes let you set the properties /// in flexible ways. They can just be set to constant values like regular @@ -13,9 +13,9 @@ import CGtk3 /// the cell renderer. Finally, it is possible to specify a function with /// gtk_cell_layout_set_cell_data_func() that is called to determine the /// value of the attribute for each cell that is rendered. -/// +/// /// # GtkCellLayouts as GtkBuildable -/// +/// /// Implementations of GtkCellLayout which also implement the GtkBuildable /// interface (#GtkCellView, #GtkIconView, #GtkComboBox, /// #GtkEntryCompletion, #GtkTreeViewColumn) accept GtkCellRenderer objects @@ -24,35 +24,35 @@ import CGtk3 /// elements. Each `` element has a name attribute which specifies /// a property of the cell renderer; the content of the element is the /// attribute value. -/// +/// /// This is an example of a UI definition fragment specifying attributes: -/// +/// /// |[0 /// ]| -/// +/// /// Furthermore for implementations of GtkCellLayout that use a #GtkCellArea /// to lay out cells (all GtkCellLayouts in GTK+ use a GtkCellArea) /// [cell properties][cell-properties] can also be defined in the format by /// specifying the custom `` attribute which can contain multiple /// `` elements defined in the normal way. -/// +/// /// Here is a UI definition fragment specifying cell properties: -/// +/// /// |[TrueFalse /// ]| -/// +/// /// # Subclassing GtkCellLayout implementations -/// +/// /// When subclassing a widget that implements #GtkCellLayout like /// #GtkIconView or #GtkComboBox, there are some considerations related /// to the fact that these widgets internally use a #GtkCellArea. /// The cell area is exposed as a construct-only property by these /// widgets. This means that it is possible to e.g. do -/// +/// /// |[ /// combo = g_object_new (GTK_TYPE_COMBO_BOX, "cell-area", my_cell_area, NULL); /// ]| -/// +/// /// to use a custom cell area with a combo box. But construct properties /// are only initialized after instance init() /// functions have run, which means that using functions which rely on @@ -60,20 +60,20 @@ import CGtk3 /// cause the default cell area to be instantiated. In this case, a provided /// construct property value will be ignored (with a warning, to alert /// you to the problem). -/// +/// /// |[ /// static void /// my_combo_box_init (MyComboBox *b) /// { /// GtkCellRenderer *cell; -/// +/// /// cell = gtk_cell_renderer_pixbuf_new (); /// // The following call causes the default cell area for combo boxes, /// // a GtkCellAreaBox, to be instantiated /// gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (b), cell, FALSE); /// ... /// } -/// +/// /// GtkWidget * /// my_combo_box_new (GtkCellArea *area) /// { @@ -81,12 +81,14 @@ import CGtk3 /// return g_object_new (MY_TYPE_COMBO_BOX, "cell-area", area, NULL); /// } /// ]| -/// +/// /// If supporting alternative cell areas with your derived widget is /// not important, then this does not have to concern you. If you want /// to support alternative cell areas, you can do so by moving the /// problematic calls out of init() and into a constructor() /// for your class. public protocol CellLayout: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/CellRendererAccelMode.swift b/Sources/Gtk3/Generated/CellRendererAccelMode.swift index 8ed09566d0..194fa232b4 100644 --- a/Sources/Gtk3/Generated/CellRendererAccelMode.swift +++ b/Sources/Gtk3/Generated/CellRendererAccelMode.swift @@ -8,20 +8,20 @@ public enum CellRendererAccelMode: GValueRepresentableEnum { public typealias GtkEnum = GtkCellRendererAccelMode /// GTK+ accelerators mode - case gtk - /// Other accelerator mode - case other +case gtk +/// Other accelerator mode +case other public static var type: GType { - gtk_cell_renderer_accel_mode_get_type() - } + gtk_cell_renderer_accel_mode_get_type() +} public init(from gtkEnum: GtkCellRendererAccelMode) { switch gtkEnum { case GTK_CELL_RENDERER_ACCEL_MODE_GTK: - self = .gtk - case GTK_CELL_RENDERER_ACCEL_MODE_OTHER: - self = .other + self = .gtk +case GTK_CELL_RENDERER_ACCEL_MODE_OTHER: + self = .other default: fatalError("Unsupported GtkCellRendererAccelMode enum value: \(gtkEnum.rawValue)") } @@ -30,9 +30,9 @@ public enum CellRendererAccelMode: GValueRepresentableEnum { public func toGtk() -> GtkCellRendererAccelMode { switch self { case .gtk: - return GTK_CELL_RENDERER_ACCEL_MODE_GTK - case .other: - return GTK_CELL_RENDERER_ACCEL_MODE_OTHER + return GTK_CELL_RENDERER_ACCEL_MODE_GTK +case .other: + return GTK_CELL_RENDERER_ACCEL_MODE_OTHER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/CellRendererMode.swift b/Sources/Gtk3/Generated/CellRendererMode.swift index 3b62bd4d9a..283a6c69a3 100644 --- a/Sources/Gtk3/Generated/CellRendererMode.swift +++ b/Sources/Gtk3/Generated/CellRendererMode.swift @@ -5,27 +5,27 @@ public enum CellRendererMode: GValueRepresentableEnum { public typealias GtkEnum = GtkCellRendererMode /// The cell is just for display - /// and cannot be interacted with. Note that this doesn’t mean that eg. the - /// row being drawn can’t be selected -- just that a particular element of - /// it cannot be individually modified. - case inert - /// The cell can be clicked. - case activatable - /// The cell can be edited or otherwise modified. - case editable +/// and cannot be interacted with. Note that this doesn’t mean that eg. the +/// row being drawn can’t be selected -- just that a particular element of +/// it cannot be individually modified. +case inert +/// The cell can be clicked. +case activatable +/// The cell can be edited or otherwise modified. +case editable public static var type: GType { - gtk_cell_renderer_mode_get_type() - } + gtk_cell_renderer_mode_get_type() +} public init(from gtkEnum: GtkCellRendererMode) { switch gtkEnum { case GTK_CELL_RENDERER_MODE_INERT: - self = .inert - case GTK_CELL_RENDERER_MODE_ACTIVATABLE: - self = .activatable - case GTK_CELL_RENDERER_MODE_EDITABLE: - self = .editable + self = .inert +case GTK_CELL_RENDERER_MODE_ACTIVATABLE: + self = .activatable +case GTK_CELL_RENDERER_MODE_EDITABLE: + self = .editable default: fatalError("Unsupported GtkCellRendererMode enum value: \(gtkEnum.rawValue)") } @@ -34,11 +34,11 @@ public enum CellRendererMode: GValueRepresentableEnum { public func toGtk() -> GtkCellRendererMode { switch self { case .inert: - return GTK_CELL_RENDERER_MODE_INERT - case .activatable: - return GTK_CELL_RENDERER_MODE_ACTIVATABLE - case .editable: - return GTK_CELL_RENDERER_MODE_EDITABLE + return GTK_CELL_RENDERER_MODE_INERT +case .activatable: + return GTK_CELL_RENDERER_MODE_ACTIVATABLE +case .editable: + return GTK_CELL_RENDERER_MODE_EDITABLE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/CheckButton.swift b/Sources/Gtk3/Generated/CheckButton.swift index 98396f79d2..c28bc0088e 100644 --- a/Sources/Gtk3/Generated/CheckButton.swift +++ b/Sources/Gtk3/Generated/CheckButton.swift @@ -3,52 +3,55 @@ import CGtk3 /// A #GtkCheckButton places a discrete #GtkToggleButton next to a widget, /// (usually a #GtkLabel). See the section on #GtkToggleButton widgets for /// more information about toggle/check buttons. -/// +/// /// The important signal ( #GtkToggleButton::toggled ) is also inherited from /// #GtkToggleButton. -/// +/// /// # CSS nodes -/// +/// /// |[ /// checkbutton /// ├── check /// ╰── /// ]| -/// +/// /// A GtkCheckButton with indicator (see gtk_toggle_button_set_mode()) has a /// main CSS node with name checkbutton and a subnode with name check. -/// +/// /// |[ /// button.check /// ├── check /// ╰── /// ]| -/// +/// /// A GtkCheckButton without indicator changes the name of its main node /// to button and adds a .check style class to it. The subnode is invisible /// in this case. open class CheckButton: ToggleButton { /// Creates a new #GtkCheckButton. - public convenience init() { - self.init( - gtk_check_button_new() - ) - } - - /// Creates a new #GtkCheckButton with a #GtkLabel to the right of it. - public convenience init(label: String) { - self.init( - gtk_check_button_new_with_label(label) - ) - } +public convenience init() { + self.init( + gtk_check_button_new() + ) +} - /// Creates a new #GtkCheckButton containing a label. The label - /// will be created using gtk_label_new_with_mnemonic(), so underscores - /// in @label indicate the mnemonic for the check button. - public convenience init(mnemonic label: String) { - self.init( - gtk_check_button_new_with_mnemonic(label) - ) - } +/// Creates a new #GtkCheckButton with a #GtkLabel to the right of it. +public convenience init(label: String) { + self.init( + gtk_check_button_new_with_label(label) + ) +} +/// Creates a new #GtkCheckButton containing a label. The label +/// will be created using gtk_label_new_with_mnemonic(), so underscores +/// in @label indicate the mnemonic for the check button. +public convenience init(mnemonic label: String) { + self.init( + gtk_check_button_new_with_mnemonic(label) + ) } + + + + +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/CornerType.swift b/Sources/Gtk3/Generated/CornerType.swift index 8056218574..c83783b38c 100644 --- a/Sources/Gtk3/Generated/CornerType.swift +++ b/Sources/Gtk3/Generated/CornerType.swift @@ -7,32 +7,32 @@ public enum CornerType: GValueRepresentableEnum { public typealias GtkEnum = GtkCornerType /// Place the scrollbars on the right and bottom of the - /// widget (default behaviour). - case topLeft - /// Place the scrollbars on the top and right of the - /// widget. - case bottomLeft - /// Place the scrollbars on the left and bottom of the - /// widget. - case topRight - /// Place the scrollbars on the top and left of the - /// widget. - case bottomRight +/// widget (default behaviour). +case topLeft +/// Place the scrollbars on the top and right of the +/// widget. +case bottomLeft +/// Place the scrollbars on the left and bottom of the +/// widget. +case topRight +/// Place the scrollbars on the top and left of the +/// widget. +case bottomRight public static var type: GType { - gtk_corner_type_get_type() - } + gtk_corner_type_get_type() +} public init(from gtkEnum: GtkCornerType) { switch gtkEnum { case GTK_CORNER_TOP_LEFT: - self = .topLeft - case GTK_CORNER_BOTTOM_LEFT: - self = .bottomLeft - case GTK_CORNER_TOP_RIGHT: - self = .topRight - case GTK_CORNER_BOTTOM_RIGHT: - self = .bottomRight + self = .topLeft +case GTK_CORNER_BOTTOM_LEFT: + self = .bottomLeft +case GTK_CORNER_TOP_RIGHT: + self = .topRight +case GTK_CORNER_BOTTOM_RIGHT: + self = .bottomRight default: fatalError("Unsupported GtkCornerType enum value: \(gtkEnum.rawValue)") } @@ -41,13 +41,13 @@ public enum CornerType: GValueRepresentableEnum { public func toGtk() -> GtkCornerType { switch self { case .topLeft: - return GTK_CORNER_TOP_LEFT - case .bottomLeft: - return GTK_CORNER_BOTTOM_LEFT - case .topRight: - return GTK_CORNER_TOP_RIGHT - case .bottomRight: - return GTK_CORNER_BOTTOM_RIGHT + return GTK_CORNER_TOP_LEFT +case .bottomLeft: + return GTK_CORNER_BOTTOM_LEFT +case .topRight: + return GTK_CORNER_TOP_RIGHT +case .bottomRight: + return GTK_CORNER_BOTTOM_RIGHT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/CssProviderError.swift b/Sources/Gtk3/Generated/CssProviderError.swift index 4f23f53a6a..52ec74bdc0 100644 --- a/Sources/Gtk3/Generated/CssProviderError.swift +++ b/Sources/Gtk3/Generated/CssProviderError.swift @@ -5,36 +5,36 @@ public enum CssProviderError: GValueRepresentableEnum { public typealias GtkEnum = GtkCssProviderError /// Failed. - case failed - /// Syntax error. - case syntax - /// Import error. - case import_ - /// Name error. - case name - /// Deprecation error. - case deprecated - /// Unknown value. - case unknownValue +case failed +/// Syntax error. +case syntax +/// Import error. +case import_ +/// Name error. +case name +/// Deprecation error. +case deprecated +/// Unknown value. +case unknownValue public static var type: GType { - gtk_css_provider_error_get_type() - } + gtk_css_provider_error_get_type() +} public init(from gtkEnum: GtkCssProviderError) { switch gtkEnum { case GTK_CSS_PROVIDER_ERROR_FAILED: - self = .failed - case GTK_CSS_PROVIDER_ERROR_SYNTAX: - self = .syntax - case GTK_CSS_PROVIDER_ERROR_IMPORT: - self = .import_ - case GTK_CSS_PROVIDER_ERROR_NAME: - self = .name - case GTK_CSS_PROVIDER_ERROR_DEPRECATED: - self = .deprecated - case GTK_CSS_PROVIDER_ERROR_UNKNOWN_VALUE: - self = .unknownValue + self = .failed +case GTK_CSS_PROVIDER_ERROR_SYNTAX: + self = .syntax +case GTK_CSS_PROVIDER_ERROR_IMPORT: + self = .import_ +case GTK_CSS_PROVIDER_ERROR_NAME: + self = .name +case GTK_CSS_PROVIDER_ERROR_DEPRECATED: + self = .deprecated +case GTK_CSS_PROVIDER_ERROR_UNKNOWN_VALUE: + self = .unknownValue default: fatalError("Unsupported GtkCssProviderError enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ public enum CssProviderError: GValueRepresentableEnum { public func toGtk() -> GtkCssProviderError { switch self { case .failed: - return GTK_CSS_PROVIDER_ERROR_FAILED - case .syntax: - return GTK_CSS_PROVIDER_ERROR_SYNTAX - case .import_: - return GTK_CSS_PROVIDER_ERROR_IMPORT - case .name: - return GTK_CSS_PROVIDER_ERROR_NAME - case .deprecated: - return GTK_CSS_PROVIDER_ERROR_DEPRECATED - case .unknownValue: - return GTK_CSS_PROVIDER_ERROR_UNKNOWN_VALUE + return GTK_CSS_PROVIDER_ERROR_FAILED +case .syntax: + return GTK_CSS_PROVIDER_ERROR_SYNTAX +case .import_: + return GTK_CSS_PROVIDER_ERROR_IMPORT +case .name: + return GTK_CSS_PROVIDER_ERROR_NAME +case .deprecated: + return GTK_CSS_PROVIDER_ERROR_DEPRECATED +case .unknownValue: + return GTK_CSS_PROVIDER_ERROR_UNKNOWN_VALUE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/DeleteType.swift b/Sources/Gtk3/Generated/DeleteType.swift index 451beff854..0cefb98518 100644 --- a/Sources/Gtk3/Generated/DeleteType.swift +++ b/Sources/Gtk3/Generated/DeleteType.swift @@ -5,50 +5,50 @@ public enum DeleteType: GValueRepresentableEnum { public typealias GtkEnum = GtkDeleteType /// Delete characters. - case chars - /// Delete only the portion of the word to the - /// left/right of cursor if we’re in the middle of a word. - case wordEnds - /// Delete words. - case words - /// Delete display-lines. Display-lines - /// refers to the visible lines, with respect to to the current line - /// breaks. As opposed to paragraphs, which are defined by line - /// breaks in the input. - case displayLines - /// Delete only the portion of the - /// display-line to the left/right of cursor. - case displayLineEnds - /// Delete to the end of the - /// paragraph. Like C-k in Emacs (or its reverse). - case paragraphEnds - /// Delete entire line. Like C-k in pico. - case paragraphs - /// Delete only whitespace. Like M-\ in Emacs. - case whitespace +case chars +/// Delete only the portion of the word to the +/// left/right of cursor if we’re in the middle of a word. +case wordEnds +/// Delete words. +case words +/// Delete display-lines. Display-lines +/// refers to the visible lines, with respect to to the current line +/// breaks. As opposed to paragraphs, which are defined by line +/// breaks in the input. +case displayLines +/// Delete only the portion of the +/// display-line to the left/right of cursor. +case displayLineEnds +/// Delete to the end of the +/// paragraph. Like C-k in Emacs (or its reverse). +case paragraphEnds +/// Delete entire line. Like C-k in pico. +case paragraphs +/// Delete only whitespace. Like M-\ in Emacs. +case whitespace public static var type: GType { - gtk_delete_type_get_type() - } + gtk_delete_type_get_type() +} public init(from gtkEnum: GtkDeleteType) { switch gtkEnum { case GTK_DELETE_CHARS: - self = .chars - case GTK_DELETE_WORD_ENDS: - self = .wordEnds - case GTK_DELETE_WORDS: - self = .words - case GTK_DELETE_DISPLAY_LINES: - self = .displayLines - case GTK_DELETE_DISPLAY_LINE_ENDS: - self = .displayLineEnds - case GTK_DELETE_PARAGRAPH_ENDS: - self = .paragraphEnds - case GTK_DELETE_PARAGRAPHS: - self = .paragraphs - case GTK_DELETE_WHITESPACE: - self = .whitespace + self = .chars +case GTK_DELETE_WORD_ENDS: + self = .wordEnds +case GTK_DELETE_WORDS: + self = .words +case GTK_DELETE_DISPLAY_LINES: + self = .displayLines +case GTK_DELETE_DISPLAY_LINE_ENDS: + self = .displayLineEnds +case GTK_DELETE_PARAGRAPH_ENDS: + self = .paragraphEnds +case GTK_DELETE_PARAGRAPHS: + self = .paragraphs +case GTK_DELETE_WHITESPACE: + self = .whitespace default: fatalError("Unsupported GtkDeleteType enum value: \(gtkEnum.rawValue)") } @@ -57,21 +57,21 @@ public enum DeleteType: GValueRepresentableEnum { public func toGtk() -> GtkDeleteType { switch self { case .chars: - return GTK_DELETE_CHARS - case .wordEnds: - return GTK_DELETE_WORD_ENDS - case .words: - return GTK_DELETE_WORDS - case .displayLines: - return GTK_DELETE_DISPLAY_LINES - case .displayLineEnds: - return GTK_DELETE_DISPLAY_LINE_ENDS - case .paragraphEnds: - return GTK_DELETE_PARAGRAPH_ENDS - case .paragraphs: - return GTK_DELETE_PARAGRAPHS - case .whitespace: - return GTK_DELETE_WHITESPACE + return GTK_DELETE_CHARS +case .wordEnds: + return GTK_DELETE_WORD_ENDS +case .words: + return GTK_DELETE_WORDS +case .displayLines: + return GTK_DELETE_DISPLAY_LINES +case .displayLineEnds: + return GTK_DELETE_DISPLAY_LINE_ENDS +case .paragraphEnds: + return GTK_DELETE_PARAGRAPH_ENDS +case .paragraphs: + return GTK_DELETE_PARAGRAPHS +case .whitespace: + return GTK_DELETE_WHITESPACE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/DirectionType.swift b/Sources/Gtk3/Generated/DirectionType.swift index 52d43e259b..9a6dbe2c33 100644 --- a/Sources/Gtk3/Generated/DirectionType.swift +++ b/Sources/Gtk3/Generated/DirectionType.swift @@ -5,36 +5,36 @@ public enum DirectionType: GValueRepresentableEnum { public typealias GtkEnum = GtkDirectionType /// Move forward. - case tabForward - /// Move backward. - case tabBackward - /// Move up. - case up - /// Move down. - case down - /// Move left. - case left - /// Move right. - case right +case tabForward +/// Move backward. +case tabBackward +/// Move up. +case up +/// Move down. +case down +/// Move left. +case left +/// Move right. +case right public static var type: GType { - gtk_direction_type_get_type() - } + gtk_direction_type_get_type() +} public init(from gtkEnum: GtkDirectionType) { switch gtkEnum { case GTK_DIR_TAB_FORWARD: - self = .tabForward - case GTK_DIR_TAB_BACKWARD: - self = .tabBackward - case GTK_DIR_UP: - self = .up - case GTK_DIR_DOWN: - self = .down - case GTK_DIR_LEFT: - self = .left - case GTK_DIR_RIGHT: - self = .right + self = .tabForward +case GTK_DIR_TAB_BACKWARD: + self = .tabBackward +case GTK_DIR_UP: + self = .up +case GTK_DIR_DOWN: + self = .down +case GTK_DIR_LEFT: + self = .left +case GTK_DIR_RIGHT: + self = .right default: fatalError("Unsupported GtkDirectionType enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ public enum DirectionType: GValueRepresentableEnum { public func toGtk() -> GtkDirectionType { switch self { case .tabForward: - return GTK_DIR_TAB_FORWARD - case .tabBackward: - return GTK_DIR_TAB_BACKWARD - case .up: - return GTK_DIR_UP - case .down: - return GTK_DIR_DOWN - case .left: - return GTK_DIR_LEFT - case .right: - return GTK_DIR_RIGHT + return GTK_DIR_TAB_FORWARD +case .tabBackward: + return GTK_DIR_TAB_BACKWARD +case .up: + return GTK_DIR_UP +case .down: + return GTK_DIR_DOWN +case .left: + return GTK_DIR_LEFT +case .right: + return GTK_DIR_RIGHT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/DragResult.swift b/Sources/Gtk3/Generated/DragResult.swift index 5ac3c50d52..52c685dd86 100644 --- a/Sources/Gtk3/Generated/DragResult.swift +++ b/Sources/Gtk3/Generated/DragResult.swift @@ -7,38 +7,38 @@ public enum DragResult: GValueRepresentableEnum { public typealias GtkEnum = GtkDragResult /// The drag operation was successful. - case success - /// No suitable drag target. - case noTarget - /// The user cancelled the drag operation. - case userCancelled - /// The drag operation timed out. - case timeoutExpired - /// The pointer or keyboard grab used - /// for the drag operation was broken. - case grabBroken - /// The drag operation failed due to some - /// unspecified error. - case error +case success +/// No suitable drag target. +case noTarget +/// The user cancelled the drag operation. +case userCancelled +/// The drag operation timed out. +case timeoutExpired +/// The pointer or keyboard grab used +/// for the drag operation was broken. +case grabBroken +/// The drag operation failed due to some +/// unspecified error. +case error public static var type: GType { - gtk_drag_result_get_type() - } + gtk_drag_result_get_type() +} public init(from gtkEnum: GtkDragResult) { switch gtkEnum { case GTK_DRAG_RESULT_SUCCESS: - self = .success - case GTK_DRAG_RESULT_NO_TARGET: - self = .noTarget - case GTK_DRAG_RESULT_USER_CANCELLED: - self = .userCancelled - case GTK_DRAG_RESULT_TIMEOUT_EXPIRED: - self = .timeoutExpired - case GTK_DRAG_RESULT_GRAB_BROKEN: - self = .grabBroken - case GTK_DRAG_RESULT_ERROR: - self = .error + self = .success +case GTK_DRAG_RESULT_NO_TARGET: + self = .noTarget +case GTK_DRAG_RESULT_USER_CANCELLED: + self = .userCancelled +case GTK_DRAG_RESULT_TIMEOUT_EXPIRED: + self = .timeoutExpired +case GTK_DRAG_RESULT_GRAB_BROKEN: + self = .grabBroken +case GTK_DRAG_RESULT_ERROR: + self = .error default: fatalError("Unsupported GtkDragResult enum value: \(gtkEnum.rawValue)") } @@ -47,17 +47,17 @@ public enum DragResult: GValueRepresentableEnum { public func toGtk() -> GtkDragResult { switch self { case .success: - return GTK_DRAG_RESULT_SUCCESS - case .noTarget: - return GTK_DRAG_RESULT_NO_TARGET - case .userCancelled: - return GTK_DRAG_RESULT_USER_CANCELLED - case .timeoutExpired: - return GTK_DRAG_RESULT_TIMEOUT_EXPIRED - case .grabBroken: - return GTK_DRAG_RESULT_GRAB_BROKEN - case .error: - return GTK_DRAG_RESULT_ERROR + return GTK_DRAG_RESULT_SUCCESS +case .noTarget: + return GTK_DRAG_RESULT_NO_TARGET +case .userCancelled: + return GTK_DRAG_RESULT_USER_CANCELLED +case .timeoutExpired: + return GTK_DRAG_RESULT_TIMEOUT_EXPIRED +case .grabBroken: + return GTK_DRAG_RESULT_GRAB_BROKEN +case .error: + return GTK_DRAG_RESULT_ERROR } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/DrawingArea.swift b/Sources/Gtk3/Generated/DrawingArea.swift index 83fcce1090..e9897c0eab 100644 --- a/Sources/Gtk3/Generated/DrawingArea.swift +++ b/Sources/Gtk3/Generated/DrawingArea.swift @@ -3,32 +3,32 @@ import CGtk3 /// The #GtkDrawingArea widget is used for creating custom user interface /// elements. It’s essentially a blank widget; you can draw on it. After /// creating a drawing area, the application may want to connect to: -/// +/// /// - Mouse and button press signals to respond to input from /// the user. (Use gtk_widget_add_events() to enable events /// you wish to receive.) -/// +/// /// - The #GtkWidget::realize signal to take any necessary actions /// when the widget is instantiated on a particular display. /// (Create GDK resources in response to this signal.) -/// +/// /// - The #GtkWidget::size-allocate signal to take any necessary /// actions when the widget changes size. -/// +/// /// - The #GtkWidget::draw signal to handle redrawing the /// contents of the widget. -/// +/// /// The following code portion demonstrates using a drawing /// area to display a circle in the normal widget foreground /// color. -/// +/// /// Note that GDK automatically clears the exposed area before sending /// the expose event, and that drawing is implicitly clipped to the exposed /// area. If you want to have a theme-provided background, you need /// to call gtk_render_background() in your ::draw method. -/// +/// /// ## Simple GtkDrawingArea usage -/// +/// /// |[ /// gboolean /// draw_callback (GtkWidget *widget, cairo_t *cr, gpointer data) @@ -36,26 +36,26 @@ import CGtk3 /// guint width, height; /// GdkRGBA color; /// GtkStyleContext *context; -/// +/// /// context = gtk_widget_get_style_context (widget); -/// +/// /// width = gtk_widget_get_allocated_width (widget); /// height = gtk_widget_get_allocated_height (widget); -/// +/// /// gtk_render_background (context, cr, 0, 0, width, height); -/// +/// /// cairo_arc (cr, /// width / 2.0, height / 2.0, /// MIN (width, height) / 2.0, /// 0, 2 * G_PI); -/// +/// /// gtk_style_context_get_color (context, /// gtk_style_context_get_state (context), /// &color); /// gdk_cairo_set_source_rgba (cr, &color); -/// +/// /// cairo_fill (cr); -/// +/// /// return FALSE; /// } /// [...] @@ -64,18 +64,18 @@ import CGtk3 /// g_signal_connect (G_OBJECT (drawing_area), "draw", /// G_CALLBACK (draw_callback), NULL); /// ]| -/// +/// /// Draw signals are normally delivered when a drawing area first comes /// onscreen, or when it’s covered by another window and then uncovered. /// You can also force an expose event by adding to the “damage region” /// of the drawing area’s window; gtk_widget_queue_draw_area() and /// gdk_window_invalidate_rect() are equally good ways to do this. /// You’ll then get a draw signal for the invalid region. -/// +/// /// The available routines for drawing are documented on the /// [GDK Drawing Primitives][gdk3-Cairo-Interaction] page /// and the cairo documentation. -/// +/// /// To receive mouse events on a drawing area, you will need to enable /// them with gtk_widget_add_events(). To receive keyboard events, you /// will need to set the “can-focus” property on the drawing area, and you @@ -85,10 +85,13 @@ import CGtk3 /// gtk_render_focus() for one way to draw focus. open class DrawingArea: Widget { /// Creates a new drawing area. - public convenience init() { - self.init( - gtk_drawing_area_new() - ) - } - +public convenience init() { + self.init( + gtk_drawing_area_new() + ) } + + + + +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/Editable.swift b/Sources/Gtk3/Generated/Editable.swift index b7370b77e5..52eb6dbbd4 100644 --- a/Sources/Gtk3/Generated/Editable.swift +++ b/Sources/Gtk3/Generated/Editable.swift @@ -5,16 +5,16 @@ import CGtk3 /// for generically manipulating an editable widget, a large number of action /// signals used for key bindings, and several signals that an application can /// connect to to modify the behavior of a widget. -/// +/// /// As an example of the latter usage, by connecting /// the following handler to #GtkEditable::insert-text, an application /// can convert all entry into a widget into uppercase. -/// +/// /// ## Forcing entry to uppercase. -/// +/// /// |[ /// #include ; -/// +/// /// void /// insert_text_handler (GtkEditable *editable, /// const gchar *text, @@ -23,47 +23,48 @@ import CGtk3 /// gpointer data) /// { /// gchar *result = g_utf8_strup (text, length); -/// +/// /// g_signal_handlers_block_by_func (editable, /// (gpointer) insert_text_handler, data); /// gtk_editable_insert_text (editable, result, length, position); /// g_signal_handlers_unblock_by_func (editable, /// (gpointer) insert_text_handler, data); -/// +/// /// g_signal_stop_emission_by_name (editable, "insert_text"); -/// +/// /// g_free (result); /// } /// ]| public protocol Editable: GObjectRepresentable { + /// The ::changed signal is emitted at the end of a single - /// user-visible operation on the contents of the #GtkEditable. - /// - /// E.g., a paste operation that replaces the contents of the - /// selection will cause only one signal emission (even though it - /// is implemented by first deleting the selection, then inserting - /// the new content, and may cause multiple ::notify::text signals - /// to be emitted). - var changed: ((Self) -> Void)? { get set } +/// user-visible operation on the contents of the #GtkEditable. +/// +/// E.g., a paste operation that replaces the contents of the +/// selection will cause only one signal emission (even though it +/// is implemented by first deleting the selection, then inserting +/// the new content, and may cause multiple ::notify::text signals +/// to be emitted). +var changed: ((Self) -> Void)? { get set } - /// This signal is emitted when text is deleted from - /// the widget by the user. The default handler for - /// this signal will normally be responsible for deleting - /// the text, so by connecting to this signal and then - /// stopping the signal with g_signal_stop_emission(), it - /// is possible to modify the range of deleted text, or - /// prevent it from being deleted entirely. The @start_pos - /// and @end_pos parameters are interpreted as for - /// gtk_editable_delete_text(). - var deleteText: ((Self, Int, Int) -> Void)? { get set } +/// This signal is emitted when text is deleted from +/// the widget by the user. The default handler for +/// this signal will normally be responsible for deleting +/// the text, so by connecting to this signal and then +/// stopping the signal with g_signal_stop_emission(), it +/// is possible to modify the range of deleted text, or +/// prevent it from being deleted entirely. The @start_pos +/// and @end_pos parameters are interpreted as for +/// gtk_editable_delete_text(). +var deleteText: ((Self, Int, Int) -> Void)? { get set } - /// This signal is emitted when text is inserted into - /// the widget by the user. The default handler for - /// this signal will normally be responsible for inserting - /// the text, so by connecting to this signal and then - /// stopping the signal with g_signal_stop_emission(), it - /// is possible to modify the inserted text, or prevent - /// it from being inserted entirely. - var insertText: ((Self, UnsafePointer, Int, gpointer) -> Void)? { get set } -} +/// This signal is emitted when text is inserted into +/// the widget by the user. The default handler for +/// this signal will normally be responsible for inserting +/// the text, so by connecting to this signal and then +/// stopping the signal with g_signal_stop_emission(), it +/// is possible to modify the inserted text, or prevent +/// it from being inserted entirely. +var insertText: ((Self, UnsafePointer, Int, gpointer) -> Void)? { get set } +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/Entry.swift b/Sources/Gtk3/Generated/Entry.swift index c76a025c13..44b4343c77 100644 --- a/Sources/Gtk3/Generated/Entry.swift +++ b/Sources/Gtk3/Generated/Entry.swift @@ -5,7 +5,7 @@ import CGtk3 /// by default. If the entered text is longer than the allocation /// of the widget, the widget will scroll so that the cursor /// position is visible. -/// +/// /// When using an entry for passwords and other sensitive information, /// it can be put into “password mode” using gtk_entry_set_visibility(). /// In this mode, entered text is displayed using a “invisible” character. @@ -15,11 +15,11 @@ import CGtk3 /// when Caps Lock or input methods might interfere with entering text in /// a password entry. The warning can be turned off with the /// #GtkEntry:caps-lock-warning property. -/// +/// /// Since 2.16, GtkEntry has the ability to display progress or activity /// information behind the text. To make an entry display such information, /// use gtk_entry_set_progress_fraction() or gtk_entry_set_progress_pulse_step(). -/// +/// /// Additionally, GtkEntry can show icons at either side of the entry. These /// icons can be activatable by clicking, can be set up as drag source and /// can have tooltips. To add an icon, use gtk_entry_set_icon_from_gicon() or @@ -29,15 +29,15 @@ import CGtk3 /// from an icon, use gtk_entry_set_icon_drag_source(). To set a tooltip on /// an icon, use gtk_entry_set_icon_tooltip_text() or the corresponding function /// for markup. -/// +/// /// Note that functionality or information that is only available by clicking /// on an icon in an entry may not be accessible at all to users which are not /// able to use a mouse or other pointing device. It is therefore recommended /// that any such functionality should also be available by other means, e.g. /// via the context menu of the entry. -/// +/// /// # CSS nodes -/// +/// /// |[ /// entry[.read-only][.flat][.warning][.error] /// ├── image.left @@ -48,25 +48,25 @@ import CGtk3 /// ├── [progress[.pulse]] /// ╰── [window.popup] /// ]| -/// +/// /// GtkEntry has a main node with the name entry. Depending on the properties /// of the entry, the style classes .read-only and .flat may appear. The style /// classes .warning and .error may also be used with entries. -/// +/// /// When the entry shows icons, it adds subnodes with the name image and the /// style class .left or .right, depending on where the icon appears. -/// +/// /// When the entry has a selection, it adds a subnode with the name selection. -/// +/// /// When the entry shows progress, it adds a subnode with the name progress. /// The node has the style class .pulse when the shown progress is pulsing. -/// +/// /// The CSS node for a context menu is added as a subnode below entry as well. -/// +/// /// The undershoot nodes are used to draw the underflow indication when content /// is scrolled out of view. These nodes get the .left and .right style classes /// added depending on where the indication is drawn. -/// +/// /// When touch is used and touch selection handles are shown, they are using /// CSS nodes with name cursor-handle. They get the .top or .bottom style class /// depending on where they are shown in relation to the selection. If there is @@ -74,1091 +74,1024 @@ import CGtk3 /// .insertion-cursor. open class Entry: Widget, CellEditable, Editable { /// Creates a new entry. - public convenience init() { - self.init( - gtk_entry_new() - ) +public convenience init() { + self.init( + gtk_entry_new() + ) +} + +/// Creates a new entry with the specified text buffer. +public convenience init(buffer: UnsafeMutablePointer!) { + self.init( + gtk_entry_new_with_buffer(buffer) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) +} + +addSignal(name: "backspace") { [weak self] () in + guard let self = self else { return } + self.backspace?(self) +} + +addSignal(name: "copy-clipboard") { [weak self] () in + guard let self = self else { return } + self.copyClipboard?(self) +} + +addSignal(name: "cut-clipboard") { [weak self] () in + guard let self = self else { return } + self.cutClipboard?(self) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, GtkDeleteType, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + +addSignal(name: "delete-from-cursor", handler: gCallback(handler4)) { [weak self] (param0: GtkDeleteType, param1: Int) in + guard let self = self else { return } + self.deleteFromCursor?(self, param0, param1) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, GdkEvent, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + +addSignal(name: "icon-press", handler: gCallback(handler5)) { [weak self] (param0: GtkEntryIconPosition, param1: GdkEvent) in + guard let self = self else { return } + self.iconPress?(self, param0, param1) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, GdkEvent, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + +addSignal(name: "icon-release", handler: gCallback(handler6)) { [weak self] (param0: GtkEntryIconPosition, param1: GdkEvent) in + guard let self = self else { return } + self.iconRelease?(self, param0, param1) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1>.run(data, value1) + } + +addSignal(name: "insert-at-cursor", handler: gCallback(handler7)) { [weak self] (param0: UnsafePointer) in + guard let self = self else { return } + self.insertAtCursor?(self, param0) +} + +addSignal(name: "insert-emoji") { [weak self] () in + guard let self = self else { return } + self.insertEmoji?(self) +} + +let handler9: @convention(c) (UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, value3, data in + SignalBox3.run(data, value1, value2, value3) + } + +addSignal(name: "move-cursor", handler: gCallback(handler9)) { [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool) in + guard let self = self else { return } + self.moveCursor?(self, param0, param1, param2) +} + +addSignal(name: "paste-clipboard") { [weak self] () in + guard let self = self else { return } + self.pasteClipboard?(self) +} + +let handler11: @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1>.run(data, value1) + } + +addSignal(name: "preedit-changed", handler: gCallback(handler11)) { [weak self] (param0: UnsafePointer) in + guard let self = self else { return } + self.preeditChanged?(self, param0) +} + +addSignal(name: "toggle-direction") { [weak self] () in + guard let self = self else { return } + self.toggleDirection?(self) +} + +addSignal(name: "toggle-overwrite") { [weak self] () in + guard let self = self else { return } + self.toggleOverwrite?(self) +} + +addSignal(name: "editing-done") { [weak self] () in + guard let self = self else { return } + self.editingDone?(self) +} + +addSignal(name: "remove-widget") { [weak self] () in + guard let self = self else { return } + self.removeWidget?(self) +} + +addSignal(name: "changed") { [weak self] () in + guard let self = self else { return } + self.changed?(self) +} + +let handler17: @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + +addSignal(name: "delete-text", handler: gCallback(handler17)) { [weak self] (param0: Int, param1: Int) in + guard let self = self else { return } + self.deleteText?(self, param0, param1) +} + +let handler18: @convention(c) (UnsafeMutableRawPointer, UnsafePointer, Int, gpointer, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, value3, data in + SignalBox3, Int, gpointer>.run(data, value1, value2, value3) + } + +addSignal(name: "insert-text", handler: gCallback(handler18)) { [weak self] (param0: UnsafePointer, param1: Int, param2: gpointer) in + guard let self = self else { return } + self.insertText?(self, param0, param1, param2) +} + +let handler19: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::activates-default", handler: gCallback(handler19)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActivatesDefault?(self, param0) +} + +let handler20: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::attributes", handler: gCallback(handler20)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAttributes?(self, param0) +} + +let handler21: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::buffer", handler: gCallback(handler21)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyBuffer?(self, param0) +} + +let handler22: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::caps-lock-warning", handler: gCallback(handler22)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCapsLockWarning?(self, param0) +} + +let handler23: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::completion", handler: gCallback(handler23)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCompletion?(self, param0) +} + +let handler24: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new entry with the specified text buffer. - public convenience init(buffer: UnsafeMutablePointer!) { - self.init( - gtk_entry_new_with_buffer(buffer) - ) +addSignal(name: "notify::cursor-position", handler: gCallback(handler24)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCursorPosition?(self, param0) +} + +let handler25: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) - } - - addSignal(name: "backspace") { [weak self] () in - guard let self = self else { return } - self.backspace?(self) - } - - addSignal(name: "copy-clipboard") { [weak self] () in - guard let self = self else { return } - self.copyClipboard?(self) - } - - addSignal(name: "cut-clipboard") { [weak self] () in - guard let self = self else { return } - self.cutClipboard?(self) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, GtkDeleteType, Int, UnsafeMutableRawPointer) -> - Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "delete-from-cursor", handler: gCallback(handler4)) { - [weak self] (param0: GtkDeleteType, param1: Int) in - guard let self = self else { return } - self.deleteFromCursor?(self, param0, param1) - } - - let handler5: - @convention(c) ( - UnsafeMutableRawPointer, GtkEntryIconPosition, GdkEvent, UnsafeMutableRawPointer - ) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "icon-press", handler: gCallback(handler5)) { - [weak self] (param0: GtkEntryIconPosition, param1: GdkEvent) in - guard let self = self else { return } - self.iconPress?(self, param0, param1) - } - - let handler6: - @convention(c) ( - UnsafeMutableRawPointer, GtkEntryIconPosition, GdkEvent, UnsafeMutableRawPointer - ) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "icon-release", handler: gCallback(handler6)) { - [weak self] (param0: GtkEntryIconPosition, param1: GdkEvent) in - guard let self = self else { return } - self.iconRelease?(self, param0, param1) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) - -> Void = - { _, value1, data in - SignalBox1>.run(data, value1) - } - - addSignal(name: "insert-at-cursor", handler: gCallback(handler7)) { - [weak self] (param0: UnsafePointer) in - guard let self = self else { return } - self.insertAtCursor?(self, param0) - } - - addSignal(name: "insert-emoji") { [weak self] () in - guard let self = self else { return } - self.insertEmoji?(self) - } - - let handler9: - @convention(c) ( - UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, UnsafeMutableRawPointer - ) -> Void = - { _, value1, value2, value3, data in - SignalBox3.run(data, value1, value2, value3) - } - - addSignal(name: "move-cursor", handler: gCallback(handler9)) { - [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool) in - guard let self = self else { return } - self.moveCursor?(self, param0, param1, param2) - } - - addSignal(name: "paste-clipboard") { [weak self] () in - guard let self = self else { return } - self.pasteClipboard?(self) - } - - let handler11: - @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) - -> Void = - { _, value1, data in - SignalBox1>.run(data, value1) - } - - addSignal(name: "preedit-changed", handler: gCallback(handler11)) { - [weak self] (param0: UnsafePointer) in - guard let self = self else { return } - self.preeditChanged?(self, param0) - } - - addSignal(name: "toggle-overwrite") { [weak self] () in - guard let self = self else { return } - self.toggleOverwrite?(self) - } - - addSignal(name: "editing-done") { [weak self] () in - guard let self = self else { return } - self.editingDone?(self) - } - - addSignal(name: "remove-widget") { [weak self] () in - guard let self = self else { return } - self.removeWidget?(self) - } - - addSignal(name: "changed") { [weak self] () in - guard let self = self else { return } - self.changed?(self) - } - - let handler16: - @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "delete-text", handler: gCallback(handler16)) { - [weak self] (param0: Int, param1: Int) in - guard let self = self else { return } - self.deleteText?(self, param0, param1) - } - - let handler17: - @convention(c) ( - UnsafeMutableRawPointer, UnsafePointer, Int, gpointer, - UnsafeMutableRawPointer - ) -> Void = - { _, value1, value2, value3, data in - SignalBox3, Int, gpointer>.run( - data, value1, value2, value3) - } - - addSignal(name: "insert-text", handler: gCallback(handler17)) { - [weak self] (param0: UnsafePointer, param1: Int, param2: gpointer) in - guard let self = self else { return } - self.insertText?(self, param0, param1, param2) - } - - let handler18: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::activates-default", handler: gCallback(handler18)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActivatesDefault?(self, param0) - } - - let handler19: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::attributes", handler: gCallback(handler19)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAttributes?(self, param0) - } - - let handler20: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::buffer", handler: gCallback(handler20)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyBuffer?(self, param0) - } - - let handler21: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::caps-lock-warning", handler: gCallback(handler21)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCapsLockWarning?(self, param0) - } - - let handler22: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::completion", handler: gCallback(handler22)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCompletion?(self, param0) - } - - let handler23: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::cursor-position", handler: gCallback(handler23)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCursorPosition?(self, param0) - } - - let handler24: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::editable", handler: gCallback(handler24)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEditable?(self, param0) - } - - let handler25: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::enable-emoji-completion", handler: gCallback(handler25)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEnableEmojiCompletion?(self, param0) - } - - let handler26: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::has-frame", handler: gCallback(handler26)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasFrame?(self, param0) - } - - let handler27: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::im-module", handler: gCallback(handler27)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyImModule?(self, param0) - } - - let handler28: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::inner-border", handler: gCallback(handler28)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInnerBorder?(self, param0) - } - - let handler29: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::input-hints", handler: gCallback(handler29)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInputHints?(self, param0) - } - - let handler30: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::input-purpose", handler: gCallback(handler30)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInputPurpose?(self, param0) - } - - let handler31: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::invisible-char", handler: gCallback(handler31)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInvisibleCharacter?(self, param0) - } - - let handler32: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::invisible-char-set", handler: gCallback(handler32)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInvisibleCharacterSet?(self, param0) - } - - let handler33: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::max-length", handler: gCallback(handler33)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMaxLength?(self, param0) - } - - let handler34: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::max-width-chars", handler: gCallback(handler34)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMaxWidthChars?(self, param0) - } - - let handler35: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::overwrite-mode", handler: gCallback(handler35)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyOverwriteMode?(self, param0) - } - - let handler36: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::placeholder-text", handler: gCallback(handler36)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPlaceholderText?(self, param0) - } - - let handler37: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::populate-all", handler: gCallback(handler37)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPopulateAll?(self, param0) - } - - let handler38: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-activatable", handler: gCallback(handler38)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconActivatable?(self, param0) - } - - let handler39: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-gicon", handler: gCallback(handler39)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconGicon?(self, param0) - } - - let handler40: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-name", handler: gCallback(handler40)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconName?(self, param0) - } - - let handler41: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-pixbuf", handler: gCallback(handler41)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconPixbuf?(self, param0) - } - - let handler42: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-sensitive", handler: gCallback(handler42)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconSensitive?(self, param0) - } - - let handler43: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-stock", handler: gCallback(handler43)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconStock?(self, param0) - } - - let handler44: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-storage-type", handler: gCallback(handler44)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconStorageType?(self, param0) - } - - let handler45: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-tooltip-markup", handler: gCallback(handler45)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconTooltipMarkup?(self, param0) - } - - let handler46: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::primary-icon-tooltip-text", handler: gCallback(handler46)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconTooltipText?(self, param0) - } - - let handler47: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::progress-fraction", handler: gCallback(handler47)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyProgressFraction?(self, param0) - } - - let handler48: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::progress-pulse-step", handler: gCallback(handler48)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyProgressPulseStep?(self, param0) - } - - let handler49: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::scroll-offset", handler: gCallback(handler49)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyScrollOffset?(self, param0) - } - - let handler50: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-activatable", handler: gCallback(handler50)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconActivatable?(self, param0) - } - - let handler51: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-gicon", handler: gCallback(handler51)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconGicon?(self, param0) - } - - let handler52: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-name", handler: gCallback(handler52)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconName?(self, param0) - } - - let handler53: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-pixbuf", handler: gCallback(handler53)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconPixbuf?(self, param0) - } - - let handler54: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-sensitive", handler: gCallback(handler54)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconSensitive?(self, param0) - } - - let handler55: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-stock", handler: gCallback(handler55)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconStock?(self, param0) - } - - let handler56: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-storage-type", handler: gCallback(handler56)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconStorageType?(self, param0) - } - - let handler57: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-tooltip-markup", handler: gCallback(handler57)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconTooltipMarkup?(self, param0) - } - - let handler58: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::secondary-icon-tooltip-text", handler: gCallback(handler58)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconTooltipText?(self, param0) - } - - let handler59: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::selection-bound", handler: gCallback(handler59)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectionBound?(self, param0) - } - - let handler60: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::shadow-type", handler: gCallback(handler60)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShadowType?(self, param0) - } - - let handler61: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::show-emoji-icon", handler: gCallback(handler61)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowEmojiIcon?(self, param0) - } - - let handler62: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::tabs", handler: gCallback(handler62)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTabs?(self, param0) - } - - let handler63: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::text", handler: gCallback(handler63)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyText?(self, param0) - } - - let handler64: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::text-length", handler: gCallback(handler64)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTextLength?(self, param0) - } - - let handler65: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::truncate-multiline", handler: gCallback(handler65)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTruncateMultiline?(self, param0) - } - - let handler66: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::visibility", handler: gCallback(handler66)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyVisibility?(self, param0) - } - - let handler67: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::width-chars", handler: gCallback(handler67)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWidthChars?(self, param0) - } - - let handler68: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::xalign", handler: gCallback(handler68)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyXalign?(self, param0) - } - - let handler69: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::editing-canceled", handler: gCallback(handler69)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEditingCanceled?(self, param0) - } +addSignal(name: "notify::editable", handler: gCallback(handler25)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEditable?(self, param0) +} + +let handler26: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - @GObjectProperty(named: "activates-default") public var activatesDefault: Bool - - @GObjectProperty(named: "has-frame") public var hasFrame: Bool - - @GObjectProperty(named: "max-length") public var maxLength: Int - - /// The text that will be displayed in the #GtkEntry when it is empty - /// and unfocused. - @GObjectProperty(named: "placeholder-text") public var placeholderText: String - - @GObjectProperty(named: "text") public var text: String - - @GObjectProperty(named: "visibility") public var visibility: Bool - - @GObjectProperty(named: "width-chars") public var widthChars: Int - - /// The ::activate signal is emitted when the user hits - /// the Enter key. - /// - /// While this signal is used as a - /// [keybinding signal][GtkBindingSignal], - /// it is also commonly used by applications to intercept - /// activation of entries. - /// - /// The default bindings for this signal are all forms of the Enter key. - public var activate: ((Entry) -> Void)? - - /// The ::backspace signal is a - /// [keybinding signal][GtkBindingSignal] - /// which gets emitted when the user asks for it. - /// - /// The default bindings for this signal are - /// Backspace and Shift-Backspace. - public var backspace: ((Entry) -> Void)? - - /// The ::copy-clipboard signal is a - /// [keybinding signal][GtkBindingSignal] - /// which gets emitted to copy the selection to the clipboard. - /// - /// The default bindings for this signal are - /// Ctrl-c and Ctrl-Insert. - public var copyClipboard: ((Entry) -> Void)? - - /// The ::cut-clipboard signal is a - /// [keybinding signal][GtkBindingSignal] - /// which gets emitted to cut the selection to the clipboard. - /// - /// The default bindings for this signal are - /// Ctrl-x and Shift-Delete. - public var cutClipboard: ((Entry) -> Void)? - - /// The ::delete-from-cursor signal is a - /// [keybinding signal][GtkBindingSignal] - /// which gets emitted when the user initiates a text deletion. - /// - /// If the @type is %GTK_DELETE_CHARS, GTK+ deletes the selection - /// if there is one, otherwise it deletes the requested number - /// of characters. - /// - /// The default bindings for this signal are - /// Delete for deleting a character and Ctrl-Delete for - /// deleting a word. - public var deleteFromCursor: ((Entry, GtkDeleteType, Int) -> Void)? - - /// The ::icon-press signal is emitted when an activatable icon - /// is clicked. - public var iconPress: ((Entry, GtkEntryIconPosition, GdkEvent) -> Void)? - - /// The ::icon-release signal is emitted on the button release from a - /// mouse click over an activatable icon. - public var iconRelease: ((Entry, GtkEntryIconPosition, GdkEvent) -> Void)? - - /// The ::insert-at-cursor signal is a - /// [keybinding signal][GtkBindingSignal] - /// which gets emitted when the user initiates the insertion of a - /// fixed string at the cursor. - /// - /// This signal has no default bindings. - public var insertAtCursor: ((Entry, UnsafePointer) -> Void)? - - /// The ::insert-emoji signal is a - /// [keybinding signal][GtkBindingSignal] - /// which gets emitted to present the Emoji chooser for the @entry. - /// - /// The default bindings for this signal are Ctrl-. and Ctrl-; - public var insertEmoji: ((Entry) -> Void)? - - /// The ::move-cursor signal is a - /// [keybinding signal][GtkBindingSignal] - /// which gets emitted when the user initiates a cursor movement. - /// If the cursor is not visible in @entry, this signal causes - /// the viewport to be moved instead. - /// - /// Applications should not connect to it, but may emit it with - /// g_signal_emit_by_name() if they need to control the cursor - /// programmatically. - /// - /// The default bindings for this signal come in two variants, - /// the variant with the Shift modifier extends the selection, - /// the variant without the Shift modifer does not. - /// There are too many key combinations to list them all here. - /// - Arrow keys move by individual characters/lines - /// - Ctrl-arrow key combinations move by words/paragraphs - /// - Home/End keys move to the ends of the buffer - public var moveCursor: ((Entry, GtkMovementStep, Int, Bool) -> Void)? - - /// The ::paste-clipboard signal is a - /// [keybinding signal][GtkBindingSignal] - /// which gets emitted to paste the contents of the clipboard - /// into the text view. - /// - /// The default bindings for this signal are - /// Ctrl-v and Shift-Insert. - public var pasteClipboard: ((Entry) -> Void)? - - /// If an input method is used, the typed text will not immediately - /// be committed to the buffer. So if you are interested in the text, - /// connect to this signal. - public var preeditChanged: ((Entry, UnsafePointer) -> Void)? - - /// The ::toggle-overwrite signal is a - /// [keybinding signal][GtkBindingSignal] - /// which gets emitted to toggle the overwrite mode of the entry. - /// - /// The default bindings for this signal is Insert. - public var toggleOverwrite: ((Entry) -> Void)? - - /// This signal is a sign for the cell renderer to update its - /// value from the @cell_editable. - /// - /// Implementations of #GtkCellEditable are responsible for - /// emitting this signal when they are done editing, e.g. - /// #GtkEntry emits this signal when the user presses Enter. Typical things to - /// do in a handler for ::editing-done are to capture the edited value, - /// disconnect the @cell_editable from signals on the #GtkCellRenderer, etc. - /// - /// gtk_cell_editable_editing_done() is a convenience method - /// for emitting #GtkCellEditable::editing-done. - public var editingDone: ((Entry) -> Void)? - - /// This signal is meant to indicate that the cell is finished - /// editing, and the @cell_editable widget is being removed and may - /// subsequently be destroyed. - /// - /// Implementations of #GtkCellEditable are responsible for - /// emitting this signal when they are done editing. It must - /// be emitted after the #GtkCellEditable::editing-done signal, - /// to give the cell renderer a chance to update the cell's value - /// before the widget is removed. - /// - /// gtk_cell_editable_remove_widget() is a convenience method - /// for emitting #GtkCellEditable::remove-widget. - public var removeWidget: ((Entry) -> Void)? - - /// The ::changed signal is emitted at the end of a single - /// user-visible operation on the contents of the #GtkEditable. - /// - /// E.g., a paste operation that replaces the contents of the - /// selection will cause only one signal emission (even though it - /// is implemented by first deleting the selection, then inserting - /// the new content, and may cause multiple ::notify::text signals - /// to be emitted). - public var changed: ((Entry) -> Void)? +addSignal(name: "notify::enable-emoji-completion", handler: gCallback(handler26)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEnableEmojiCompletion?(self, param0) +} - /// This signal is emitted when text is deleted from - /// the widget by the user. The default handler for - /// this signal will normally be responsible for deleting - /// the text, so by connecting to this signal and then - /// stopping the signal with g_signal_stop_emission(), it - /// is possible to modify the range of deleted text, or - /// prevent it from being deleted entirely. The @start_pos - /// and @end_pos parameters are interpreted as for - /// gtk_editable_delete_text(). - public var deleteText: ((Entry, Int, Int) -> Void)? +let handler27: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// This signal is emitted when text is inserted into - /// the widget by the user. The default handler for - /// this signal will normally be responsible for inserting - /// the text, so by connecting to this signal and then - /// stopping the signal with g_signal_stop_emission(), it - /// is possible to modify the inserted text, or prevent - /// it from being inserted entirely. - public var insertText: ((Entry, UnsafePointer, Int, gpointer) -> Void)? +addSignal(name: "notify::has-frame", handler: gCallback(handler27)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasFrame?(self, param0) +} - public var notifyActivatesDefault: ((Entry, OpaquePointer) -> Void)? +let handler28: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyAttributes: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::im-module", handler: gCallback(handler28)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyImModule?(self, param0) +} - public var notifyBuffer: ((Entry, OpaquePointer) -> Void)? +let handler29: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyCapsLockWarning: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::inner-border", handler: gCallback(handler29)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInnerBorder?(self, param0) +} - public var notifyCompletion: ((Entry, OpaquePointer) -> Void)? +let handler30: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyCursorPosition: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::input-hints", handler: gCallback(handler30)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInputHints?(self, param0) +} - public var notifyEditable: ((Entry, OpaquePointer) -> Void)? +let handler31: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyEnableEmojiCompletion: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::input-purpose", handler: gCallback(handler31)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInputPurpose?(self, param0) +} - public var notifyHasFrame: ((Entry, OpaquePointer) -> Void)? +let handler32: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyImModule: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::invisible-char", handler: gCallback(handler32)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInvisibleCharacter?(self, param0) +} - public var notifyInnerBorder: ((Entry, OpaquePointer) -> Void)? +let handler33: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyInputHints: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::invisible-char-set", handler: gCallback(handler33)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInvisibleCharacterSet?(self, param0) +} - public var notifyInputPurpose: ((Entry, OpaquePointer) -> Void)? +let handler34: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyInvisibleCharacter: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::max-length", handler: gCallback(handler34)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMaxLength?(self, param0) +} - public var notifyInvisibleCharacterSet: ((Entry, OpaquePointer) -> Void)? +let handler35: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyMaxLength: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::max-width-chars", handler: gCallback(handler35)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMaxWidthChars?(self, param0) +} - public var notifyMaxWidthChars: ((Entry, OpaquePointer) -> Void)? +let handler36: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyOverwriteMode: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::overwrite-mode", handler: gCallback(handler36)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyOverwriteMode?(self, param0) +} - public var notifyPlaceholderText: ((Entry, OpaquePointer) -> Void)? +let handler37: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyPopulateAll: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::placeholder-text", handler: gCallback(handler37)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPlaceholderText?(self, param0) +} - public var notifyPrimaryIconActivatable: ((Entry, OpaquePointer) -> Void)? +let handler38: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyPrimaryIconGicon: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::populate-all", handler: gCallback(handler38)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPopulateAll?(self, param0) +} - public var notifyPrimaryIconName: ((Entry, OpaquePointer) -> Void)? +let handler39: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyPrimaryIconPixbuf: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-activatable", handler: gCallback(handler39)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconActivatable?(self, param0) +} - public var notifyPrimaryIconSensitive: ((Entry, OpaquePointer) -> Void)? +let handler40: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyPrimaryIconStock: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-gicon", handler: gCallback(handler40)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconGicon?(self, param0) +} - public var notifyPrimaryIconStorageType: ((Entry, OpaquePointer) -> Void)? +let handler41: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyPrimaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-name", handler: gCallback(handler41)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconName?(self, param0) +} - public var notifyPrimaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? +let handler42: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyProgressFraction: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-pixbuf", handler: gCallback(handler42)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconPixbuf?(self, param0) +} - public var notifyProgressPulseStep: ((Entry, OpaquePointer) -> Void)? +let handler43: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyScrollOffset: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-sensitive", handler: gCallback(handler43)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconSensitive?(self, param0) +} - public var notifySecondaryIconActivatable: ((Entry, OpaquePointer) -> Void)? +let handler44: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySecondaryIconGicon: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-stock", handler: gCallback(handler44)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconStock?(self, param0) +} - public var notifySecondaryIconName: ((Entry, OpaquePointer) -> Void)? +let handler45: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySecondaryIconPixbuf: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-storage-type", handler: gCallback(handler45)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconStorageType?(self, param0) +} - public var notifySecondaryIconSensitive: ((Entry, OpaquePointer) -> Void)? +let handler46: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySecondaryIconStock: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-tooltip-markup", handler: gCallback(handler46)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconTooltipMarkup?(self, param0) +} - public var notifySecondaryIconStorageType: ((Entry, OpaquePointer) -> Void)? +let handler47: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySecondaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::primary-icon-tooltip-text", handler: gCallback(handler47)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconTooltipText?(self, param0) +} - public var notifySecondaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? +let handler48: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySelectionBound: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::progress-fraction", handler: gCallback(handler48)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyProgressFraction?(self, param0) +} - public var notifyShadowType: ((Entry, OpaquePointer) -> Void)? +let handler49: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyShowEmojiIcon: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::progress-pulse-step", handler: gCallback(handler49)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyProgressPulseStep?(self, param0) +} - public var notifyTabs: ((Entry, OpaquePointer) -> Void)? +let handler50: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyText: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::scroll-offset", handler: gCallback(handler50)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyScrollOffset?(self, param0) +} - public var notifyTextLength: ((Entry, OpaquePointer) -> Void)? +let handler51: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyTruncateMultiline: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::secondary-icon-activatable", handler: gCallback(handler51)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconActivatable?(self, param0) +} - public var notifyVisibility: ((Entry, OpaquePointer) -> Void)? +let handler52: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyWidthChars: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::secondary-icon-gicon", handler: gCallback(handler52)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconGicon?(self, param0) +} - public var notifyXalign: ((Entry, OpaquePointer) -> Void)? +let handler53: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyEditingCanceled: ((Entry, OpaquePointer) -> Void)? +addSignal(name: "notify::secondary-icon-name", handler: gCallback(handler53)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconName?(self, param0) } + +let handler54: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::secondary-icon-pixbuf", handler: gCallback(handler54)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconPixbuf?(self, param0) +} + +let handler55: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::secondary-icon-sensitive", handler: gCallback(handler55)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconSensitive?(self, param0) +} + +let handler56: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::secondary-icon-stock", handler: gCallback(handler56)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconStock?(self, param0) +} + +let handler57: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::secondary-icon-storage-type", handler: gCallback(handler57)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconStorageType?(self, param0) +} + +let handler58: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::secondary-icon-tooltip-markup", handler: gCallback(handler58)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconTooltipMarkup?(self, param0) +} + +let handler59: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::secondary-icon-tooltip-text", handler: gCallback(handler59)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconTooltipText?(self, param0) +} + +let handler60: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::selection-bound", handler: gCallback(handler60)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectionBound?(self, param0) +} + +let handler61: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::shadow-type", handler: gCallback(handler61)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShadowType?(self, param0) +} + +let handler62: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::show-emoji-icon", handler: gCallback(handler62)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowEmojiIcon?(self, param0) +} + +let handler63: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::tabs", handler: gCallback(handler63)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTabs?(self, param0) +} + +let handler64: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::text", handler: gCallback(handler64)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyText?(self, param0) +} + +let handler65: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::text-length", handler: gCallback(handler65)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTextLength?(self, param0) +} + +let handler66: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::truncate-multiline", handler: gCallback(handler66)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTruncateMultiline?(self, param0) +} + +let handler67: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::visibility", handler: gCallback(handler67)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyVisibility?(self, param0) +} + +let handler68: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::width-chars", handler: gCallback(handler68)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWidthChars?(self, param0) +} + +let handler69: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::xalign", handler: gCallback(handler69)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyXalign?(self, param0) +} + +let handler70: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::editing-canceled", handler: gCallback(handler70)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEditingCanceled?(self, param0) +} +} + + +@GObjectProperty(named: "activates-default") public var activatesDefault: Bool + + +@GObjectProperty(named: "has-frame") public var hasFrame: Bool + + +@GObjectProperty(named: "max-length") public var maxLength: Int + +/// The text that will be displayed in the #GtkEntry when it is empty +/// and unfocused. +@GObjectProperty(named: "placeholder-text") public var placeholderText: String + + +@GObjectProperty(named: "text") public var text: String + + +@GObjectProperty(named: "visibility") public var visibility: Bool + + +@GObjectProperty(named: "width-chars") public var widthChars: Int + +/// The ::activate signal is emitted when the user hits +/// the Enter key. +/// +/// While this signal is used as a +/// [keybinding signal][GtkBindingSignal], +/// it is also commonly used by applications to intercept +/// activation of entries. +/// +/// The default bindings for this signal are all forms of the Enter key. +public var activate: ((Entry) -> Void)? + +/// The ::backspace signal is a +/// [keybinding signal][GtkBindingSignal] +/// which gets emitted when the user asks for it. +/// +/// The default bindings for this signal are +/// Backspace and Shift-Backspace. +public var backspace: ((Entry) -> Void)? + +/// The ::copy-clipboard signal is a +/// [keybinding signal][GtkBindingSignal] +/// which gets emitted to copy the selection to the clipboard. +/// +/// The default bindings for this signal are +/// Ctrl-c and Ctrl-Insert. +public var copyClipboard: ((Entry) -> Void)? + +/// The ::cut-clipboard signal is a +/// [keybinding signal][GtkBindingSignal] +/// which gets emitted to cut the selection to the clipboard. +/// +/// The default bindings for this signal are +/// Ctrl-x and Shift-Delete. +public var cutClipboard: ((Entry) -> Void)? + +/// The ::delete-from-cursor signal is a +/// [keybinding signal][GtkBindingSignal] +/// which gets emitted when the user initiates a text deletion. +/// +/// If the @type is %GTK_DELETE_CHARS, GTK+ deletes the selection +/// if there is one, otherwise it deletes the requested number +/// of characters. +/// +/// The default bindings for this signal are +/// Delete for deleting a character and Ctrl-Delete for +/// deleting a word. +public var deleteFromCursor: ((Entry, GtkDeleteType, Int) -> Void)? + +/// The ::icon-press signal is emitted when an activatable icon +/// is clicked. +public var iconPress: ((Entry, GtkEntryIconPosition, GdkEvent) -> Void)? + +/// The ::icon-release signal is emitted on the button release from a +/// mouse click over an activatable icon. +public var iconRelease: ((Entry, GtkEntryIconPosition, GdkEvent) -> Void)? + +/// The ::insert-at-cursor signal is a +/// [keybinding signal][GtkBindingSignal] +/// which gets emitted when the user initiates the insertion of a +/// fixed string at the cursor. +/// +/// This signal has no default bindings. +public var insertAtCursor: ((Entry, UnsafePointer) -> Void)? + +/// The ::insert-emoji signal is a +/// [keybinding signal][GtkBindingSignal] +/// which gets emitted to present the Emoji chooser for the @entry. +/// +/// The default bindings for this signal are Ctrl-. and Ctrl-; +public var insertEmoji: ((Entry) -> Void)? + +/// The ::move-cursor signal is a +/// [keybinding signal][GtkBindingSignal] +/// which gets emitted when the user initiates a cursor movement. +/// If the cursor is not visible in @entry, this signal causes +/// the viewport to be moved instead. +/// +/// Applications should not connect to it, but may emit it with +/// g_signal_emit_by_name() if they need to control the cursor +/// programmatically. +/// +/// The default bindings for this signal come in two variants, +/// the variant with the Shift modifier extends the selection, +/// the variant without the Shift modifer does not. +/// There are too many key combinations to list them all here. +/// - Arrow keys move by individual characters/lines +/// - Ctrl-arrow key combinations move by words/paragraphs +/// - Home/End keys move to the ends of the buffer +public var moveCursor: ((Entry, GtkMovementStep, Int, Bool) -> Void)? + +/// The ::paste-clipboard signal is a +/// [keybinding signal][GtkBindingSignal] +/// which gets emitted to paste the contents of the clipboard +/// into the text view. +/// +/// The default bindings for this signal are +/// Ctrl-v and Shift-Insert. +public var pasteClipboard: ((Entry) -> Void)? + +/// If an input method is used, the typed text will not immediately +/// be committed to the buffer. So if you are interested in the text, +/// connect to this signal. +public var preeditChanged: ((Entry, UnsafePointer) -> Void)? + + +public var toggleDirection: ((Entry) -> Void)? + +/// The ::toggle-overwrite signal is a +/// [keybinding signal][GtkBindingSignal] +/// which gets emitted to toggle the overwrite mode of the entry. +/// +/// The default bindings for this signal is Insert. +public var toggleOverwrite: ((Entry) -> Void)? + +/// This signal is a sign for the cell renderer to update its +/// value from the @cell_editable. +/// +/// Implementations of #GtkCellEditable are responsible for +/// emitting this signal when they are done editing, e.g. +/// #GtkEntry emits this signal when the user presses Enter. Typical things to +/// do in a handler for ::editing-done are to capture the edited value, +/// disconnect the @cell_editable from signals on the #GtkCellRenderer, etc. +/// +/// gtk_cell_editable_editing_done() is a convenience method +/// for emitting #GtkCellEditable::editing-done. +public var editingDone: ((Entry) -> Void)? + +/// This signal is meant to indicate that the cell is finished +/// editing, and the @cell_editable widget is being removed and may +/// subsequently be destroyed. +/// +/// Implementations of #GtkCellEditable are responsible for +/// emitting this signal when they are done editing. It must +/// be emitted after the #GtkCellEditable::editing-done signal, +/// to give the cell renderer a chance to update the cell's value +/// before the widget is removed. +/// +/// gtk_cell_editable_remove_widget() is a convenience method +/// for emitting #GtkCellEditable::remove-widget. +public var removeWidget: ((Entry) -> Void)? + +/// The ::changed signal is emitted at the end of a single +/// user-visible operation on the contents of the #GtkEditable. +/// +/// E.g., a paste operation that replaces the contents of the +/// selection will cause only one signal emission (even though it +/// is implemented by first deleting the selection, then inserting +/// the new content, and may cause multiple ::notify::text signals +/// to be emitted). +public var changed: ((Entry) -> Void)? + +/// This signal is emitted when text is deleted from +/// the widget by the user. The default handler for +/// this signal will normally be responsible for deleting +/// the text, so by connecting to this signal and then +/// stopping the signal with g_signal_stop_emission(), it +/// is possible to modify the range of deleted text, or +/// prevent it from being deleted entirely. The @start_pos +/// and @end_pos parameters are interpreted as for +/// gtk_editable_delete_text(). +public var deleteText: ((Entry, Int, Int) -> Void)? + +/// This signal is emitted when text is inserted into +/// the widget by the user. The default handler for +/// this signal will normally be responsible for inserting +/// the text, so by connecting to this signal and then +/// stopping the signal with g_signal_stop_emission(), it +/// is possible to modify the inserted text, or prevent +/// it from being inserted entirely. +public var insertText: ((Entry, UnsafePointer, Int, gpointer) -> Void)? + + +public var notifyActivatesDefault: ((Entry, OpaquePointer) -> Void)? + + +public var notifyAttributes: ((Entry, OpaquePointer) -> Void)? + + +public var notifyBuffer: ((Entry, OpaquePointer) -> Void)? + + +public var notifyCapsLockWarning: ((Entry, OpaquePointer) -> Void)? + + +public var notifyCompletion: ((Entry, OpaquePointer) -> Void)? + + +public var notifyCursorPosition: ((Entry, OpaquePointer) -> Void)? + + +public var notifyEditable: ((Entry, OpaquePointer) -> Void)? + + +public var notifyEnableEmojiCompletion: ((Entry, OpaquePointer) -> Void)? + + +public var notifyHasFrame: ((Entry, OpaquePointer) -> Void)? + + +public var notifyImModule: ((Entry, OpaquePointer) -> Void)? + + +public var notifyInnerBorder: ((Entry, OpaquePointer) -> Void)? + + +public var notifyInputHints: ((Entry, OpaquePointer) -> Void)? + + +public var notifyInputPurpose: ((Entry, OpaquePointer) -> Void)? + + +public var notifyInvisibleCharacter: ((Entry, OpaquePointer) -> Void)? + + +public var notifyInvisibleCharacterSet: ((Entry, OpaquePointer) -> Void)? + + +public var notifyMaxLength: ((Entry, OpaquePointer) -> Void)? + + +public var notifyMaxWidthChars: ((Entry, OpaquePointer) -> Void)? + + +public var notifyOverwriteMode: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPlaceholderText: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPopulateAll: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconActivatable: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconGicon: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconName: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconPixbuf: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconSensitive: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconStock: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconStorageType: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? + + +public var notifyPrimaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? + + +public var notifyProgressFraction: ((Entry, OpaquePointer) -> Void)? + + +public var notifyProgressPulseStep: ((Entry, OpaquePointer) -> Void)? + + +public var notifyScrollOffset: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconActivatable: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconGicon: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconName: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconPixbuf: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconSensitive: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconStock: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconStorageType: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? + + +public var notifySecondaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? + + +public var notifySelectionBound: ((Entry, OpaquePointer) -> Void)? + + +public var notifyShadowType: ((Entry, OpaquePointer) -> Void)? + + +public var notifyShowEmojiIcon: ((Entry, OpaquePointer) -> Void)? + + +public var notifyTabs: ((Entry, OpaquePointer) -> Void)? + + +public var notifyText: ((Entry, OpaquePointer) -> Void)? + + +public var notifyTextLength: ((Entry, OpaquePointer) -> Void)? + + +public var notifyTruncateMultiline: ((Entry, OpaquePointer) -> Void)? + + +public var notifyVisibility: ((Entry, OpaquePointer) -> Void)? + + +public var notifyWidthChars: ((Entry, OpaquePointer) -> Void)? + + +public var notifyXalign: ((Entry, OpaquePointer) -> Void)? + + +public var notifyEditingCanceled: ((Entry, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/EventBox.swift b/Sources/Gtk3/Generated/EventBox.swift index a8a6766047..762b86ec53 100644 --- a/Sources/Gtk3/Generated/EventBox.swift +++ b/Sources/Gtk3/Generated/EventBox.swift @@ -5,45 +5,45 @@ import CGtk3 /// which do not have their own window. open class EventBox: Bin { /// Creates a new #GtkEventBox. - public convenience init() { - self.init( - gtk_event_box_new() - ) +public convenience init() { + self.init( + gtk_event_box_new() + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::above-child", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAboveChild?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::visible-window", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyVisibleWindow?(self, param0) - } +addSignal(name: "notify::above-child", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAboveChild?(self, param0) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - @GObjectProperty(named: "above-child") public var aboveChild: Bool +addSignal(name: "notify::visible-window", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyVisibleWindow?(self, param0) +} +} + + +@GObjectProperty(named: "above-child") public var aboveChild: Bool - @GObjectProperty(named: "visible-window") public var visibleWindow: Bool - public var notifyAboveChild: ((EventBox, OpaquePointer) -> Void)? +@GObjectProperty(named: "visible-window") public var visibleWindow: Bool - public var notifyVisibleWindow: ((EventBox, OpaquePointer) -> Void)? -} + +public var notifyAboveChild: ((EventBox, OpaquePointer) -> Void)? + + +public var notifyVisibleWindow: ((EventBox, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/EventController.swift b/Sources/Gtk3/Generated/EventController.swift index f5897da2ab..9cbbd35142 100644 --- a/Sources/Gtk3/Generated/EventController.swift +++ b/Sources/Gtk3/Generated/EventController.swift @@ -4,36 +4,35 @@ import CGtk3 /// controllers. Those react to a series of #GdkEvents, and possibly trigger /// actions as a consequence of those. open class EventController: GObject { + public override func registerSignals() { - super.registerSignals() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::propagation-phase", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPropagationPhase?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::widget", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWidget?(self, param0) - } + super.registerSignals() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - public var notifyPropagationPhase: ((EventController, OpaquePointer) -> Void)? +addSignal(name: "notify::propagation-phase", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPropagationPhase?(self, param0) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyWidget: ((EventController, OpaquePointer) -> Void)? +addSignal(name: "notify::widget", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWidget?(self, param0) } +} + + +public var notifyPropagationPhase: ((EventController, OpaquePointer) -> Void)? + + +public var notifyWidget: ((EventController, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ExpanderStyle.swift b/Sources/Gtk3/Generated/ExpanderStyle.swift index e6b3c21f65..6a698983f1 100644 --- a/Sources/Gtk3/Generated/ExpanderStyle.swift +++ b/Sources/Gtk3/Generated/ExpanderStyle.swift @@ -5,28 +5,28 @@ public enum ExpanderStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkExpanderStyle /// The style used for a collapsed subtree. - case collapsed - /// Intermediate style used during animation. - case semiCollapsed - /// Intermediate style used during animation. - case semiExpanded - /// The style used for an expanded subtree. - case expanded +case collapsed +/// Intermediate style used during animation. +case semiCollapsed +/// Intermediate style used during animation. +case semiExpanded +/// The style used for an expanded subtree. +case expanded public static var type: GType { - gtk_expander_style_get_type() - } + gtk_expander_style_get_type() +} public init(from gtkEnum: GtkExpanderStyle) { switch gtkEnum { case GTK_EXPANDER_COLLAPSED: - self = .collapsed - case GTK_EXPANDER_SEMI_COLLAPSED: - self = .semiCollapsed - case GTK_EXPANDER_SEMI_EXPANDED: - self = .semiExpanded - case GTK_EXPANDER_EXPANDED: - self = .expanded + self = .collapsed +case GTK_EXPANDER_SEMI_COLLAPSED: + self = .semiCollapsed +case GTK_EXPANDER_SEMI_EXPANDED: + self = .semiExpanded +case GTK_EXPANDER_EXPANDED: + self = .expanded default: fatalError("Unsupported GtkExpanderStyle enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum ExpanderStyle: GValueRepresentableEnum { public func toGtk() -> GtkExpanderStyle { switch self { case .collapsed: - return GTK_EXPANDER_COLLAPSED - case .semiCollapsed: - return GTK_EXPANDER_SEMI_COLLAPSED - case .semiExpanded: - return GTK_EXPANDER_SEMI_EXPANDED - case .expanded: - return GTK_EXPANDER_EXPANDED + return GTK_EXPANDER_COLLAPSED +case .semiCollapsed: + return GTK_EXPANDER_SEMI_COLLAPSED +case .semiExpanded: + return GTK_EXPANDER_SEMI_EXPANDED +case .expanded: + return GTK_EXPANDER_EXPANDED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/FileChooser.swift b/Sources/Gtk3/Generated/FileChooser.swift index b05abdee60..d019ad473f 100644 --- a/Sources/Gtk3/Generated/FileChooser.swift +++ b/Sources/Gtk3/Generated/FileChooser.swift @@ -7,25 +7,25 @@ import CGtk3 /// implements the #GtkFileChooser interface unless you are trying to /// adapt an existing file selector to expose a standard programming /// interface. -/// +/// /// #GtkFileChooser allows for shortcuts to various places in the filesystem. /// In the default implementation these are displayed in the left pane. It /// may be a bit confusing at first that these shortcuts come from various /// sources and in various flavours, so lets explain the terminology here: -/// +/// /// - Bookmarks: are created by the user, by dragging folders from the /// right pane to the left pane, or by using the “Add”. Bookmarks /// can be renamed and deleted by the user. -/// +/// /// - Shortcuts: can be provided by the application. For example, a Paint /// program may want to add a shortcut for a Clipart folder. Shortcuts /// cannot be modified by the user. -/// +/// /// - Volumes: are provided by the underlying filesystem abstraction. They are /// the “roots” of the filesystem. -/// +/// /// # File Names and Encodings -/// +/// /// When the user is finished selecting files in a /// #GtkFileChooser, your program can get the selected names /// either as filenames or as URIs. For URIs, the normal escaping @@ -35,7 +35,7 @@ import CGtk3 /// `G_FILENAME_ENCODING` environment variable. /// Please see the GLib documentation for more details about this /// variable. -/// +/// /// This means that while you can pass the result of /// gtk_file_chooser_get_filename() to g_open() or g_fopen(), /// you may not be able to directly set it as the text of a @@ -43,16 +43,16 @@ import CGtk3 /// which all GTK+ widgets expect. You should use g_filename_to_utf8() /// to convert filenames into strings that can be passed to GTK+ /// widgets. -/// +/// /// # Adding a Preview Widget -/// +/// /// You can add a custom preview widget to a file chooser and then /// get notification about when the preview needs to be updated. /// To install a preview widget, use /// gtk_file_chooser_set_preview_widget(). Then, connect to the /// #GtkFileChooser::update-preview signal to get notified when /// you need to update the contents of the preview. -/// +/// /// Your callback should use /// gtk_file_chooser_get_preview_filename() to see what needs /// previewing. Once you have generated the preview for the @@ -60,21 +60,21 @@ import CGtk3 /// gtk_file_chooser_set_preview_widget_active() with a boolean /// flag that indicates whether your callback could successfully /// generate a preview. -/// +/// /// ## Example: Using a Preview Widget ## {#gtkfilechooser-preview} /// |[ /// { /// GtkImage *preview; -/// +/// /// ... -/// +/// /// preview = gtk_image_new (); -/// +/// /// gtk_file_chooser_set_preview_widget (my_file_chooser, preview); /// g_signal_connect (my_file_chooser, "update-preview", /// G_CALLBACK (update_preview_cb), preview); /// } -/// +/// /// static void /// update_preview_cb (GtkFileChooser *file_chooser, gpointer data) /// { @@ -82,187 +82,192 @@ import CGtk3 /// char *filename; /// GdkPixbuf *pixbuf; /// gboolean have_preview; -/// +/// /// preview = GTK_WIDGET (data); /// filename = gtk_file_chooser_get_preview_filename (file_chooser); -/// +/// /// pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 128, 128, NULL); /// have_preview = (pixbuf != NULL); /// g_free (filename); -/// +/// /// gtk_image_set_from_pixbuf (GTK_IMAGE (preview), pixbuf); /// if (pixbuf) /// g_object_unref (pixbuf); -/// +/// /// gtk_file_chooser_set_preview_widget_active (file_chooser, have_preview); /// } /// ]| -/// +/// /// # Adding Extra Widgets -/// +/// /// You can add extra widgets to a file chooser to provide options /// that are not present in the default design. For example, you /// can add a toggle button to give the user the option to open a /// file in read-only mode. You can use /// gtk_file_chooser_set_extra_widget() to insert additional /// widgets in a file chooser. -/// +/// /// An example for adding extra widgets: /// |[ -/// +/// /// GtkWidget *toggle; -/// +/// /// ... -/// +/// /// toggle = gtk_check_button_new_with_label ("Open file read-only"); /// gtk_widget_show (toggle); /// gtk_file_chooser_set_extra_widget (my_file_chooser, toggle); /// } /// ]| -/// +/// /// If you want to set more than one extra widget in the file /// chooser, you can a container such as a #GtkBox or a #GtkGrid /// and include your widgets in it. Then, set the container as /// the whole extra widget. public protocol FileChooser: GObjectRepresentable { + +var action: FileChooserAction { get set } - var action: FileChooserAction { get set } - var localOnly: Bool { get set } +var localOnly: Bool { get set } - var previewWidgetActive: Bool { get set } - var selectMultiple: Bool { get set } +var previewWidgetActive: Bool { get set } - var showHidden: Bool { get set } - var usePreviewLabel: Bool { get set } +var selectMultiple: Bool { get set } + + +var showHidden: Bool { get set } + + +var usePreviewLabel: Bool { get set } /// This signal gets emitted whenever it is appropriate to present a - /// confirmation dialog when the user has selected a file name that - /// already exists. The signal only gets emitted when the file - /// chooser is in %GTK_FILE_CHOOSER_ACTION_SAVE mode. - /// - /// Most applications just need to turn on the - /// #GtkFileChooser:do-overwrite-confirmation property (or call the - /// gtk_file_chooser_set_do_overwrite_confirmation() function), and - /// they will automatically get a stock confirmation dialog. - /// Applications which need to customize this behavior should do - /// that, and also connect to the #GtkFileChooser::confirm-overwrite - /// signal. - /// - /// A signal handler for this signal must return a - /// #GtkFileChooserConfirmation value, which indicates the action to - /// take. If the handler determines that the user wants to select a - /// different filename, it should return - /// %GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN. If it determines - /// that the user is satisfied with his choice of file name, it - /// should return %GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME. - /// On the other hand, if it determines that the stock confirmation - /// dialog should be used, it should return - /// %GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM. The following example - /// illustrates this. - /// - /// ## Custom confirmation ## {#gtkfilechooser-confirmation} - /// - /// |[ - /// static GtkFileChooserConfirmation - /// confirm_overwrite_callback (GtkFileChooser *chooser, gpointer data) - /// { - /// char *uri; - /// - /// uri = gtk_file_chooser_get_uri (chooser); - /// - /// if (is_uri_read_only (uri)) - /// { - /// if (user_wants_to_replace_read_only_file (uri)) - /// return GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME; - /// else - /// return GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN; - /// } else - /// return GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM; // fall back to the default dialog - /// } - /// - /// ... - /// - /// chooser = gtk_file_chooser_dialog_new (...); - /// - /// gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); - /// g_signal_connect (chooser, "confirm-overwrite", - /// G_CALLBACK (confirm_overwrite_callback), NULL); - /// - /// if (gtk_dialog_run (chooser) == GTK_RESPONSE_ACCEPT) - /// save_to_file (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); - /// - /// gtk_widget_destroy (chooser); - /// ]| - var confirmOverwrite: ((Self) -> Void)? { get set } +/// confirmation dialog when the user has selected a file name that +/// already exists. The signal only gets emitted when the file +/// chooser is in %GTK_FILE_CHOOSER_ACTION_SAVE mode. +/// +/// Most applications just need to turn on the +/// #GtkFileChooser:do-overwrite-confirmation property (or call the +/// gtk_file_chooser_set_do_overwrite_confirmation() function), and +/// they will automatically get a stock confirmation dialog. +/// Applications which need to customize this behavior should do +/// that, and also connect to the #GtkFileChooser::confirm-overwrite +/// signal. +/// +/// A signal handler for this signal must return a +/// #GtkFileChooserConfirmation value, which indicates the action to +/// take. If the handler determines that the user wants to select a +/// different filename, it should return +/// %GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN. If it determines +/// that the user is satisfied with his choice of file name, it +/// should return %GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME. +/// On the other hand, if it determines that the stock confirmation +/// dialog should be used, it should return +/// %GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM. The following example +/// illustrates this. +/// +/// ## Custom confirmation ## {#gtkfilechooser-confirmation} +/// +/// |[ +/// static GtkFileChooserConfirmation +/// confirm_overwrite_callback (GtkFileChooser *chooser, gpointer data) +/// { +/// char *uri; +/// +/// uri = gtk_file_chooser_get_uri (chooser); +/// +/// if (is_uri_read_only (uri)) +/// { +/// if (user_wants_to_replace_read_only_file (uri)) +/// return GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME; +/// else +/// return GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN; +/// } else +/// return GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM; // fall back to the default dialog +/// } +/// +/// ... +/// +/// chooser = gtk_file_chooser_dialog_new (...); +/// +/// gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); +/// g_signal_connect (chooser, "confirm-overwrite", +/// G_CALLBACK (confirm_overwrite_callback), NULL); +/// +/// if (gtk_dialog_run (chooser) == GTK_RESPONSE_ACCEPT) +/// save_to_file (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); +/// +/// gtk_widget_destroy (chooser); +/// ]| +var confirmOverwrite: ((Self) -> Void)? { get set } - /// This signal is emitted when the current folder in a #GtkFileChooser - /// changes. This can happen due to the user performing some action that - /// changes folders, such as selecting a bookmark or visiting a folder on the - /// file list. It can also happen as a result of calling a function to - /// explicitly change the current folder in a file chooser. - /// - /// Normally you do not need to connect to this signal, unless you need to keep - /// track of which folder a file chooser is showing. - /// - /// See also: gtk_file_chooser_set_current_folder(), - /// gtk_file_chooser_get_current_folder(), - /// gtk_file_chooser_set_current_folder_uri(), - /// gtk_file_chooser_get_current_folder_uri(). - var currentFolderChanged: ((Self) -> Void)? { get set } +/// This signal is emitted when the current folder in a #GtkFileChooser +/// changes. This can happen due to the user performing some action that +/// changes folders, such as selecting a bookmark or visiting a folder on the +/// file list. It can also happen as a result of calling a function to +/// explicitly change the current folder in a file chooser. +/// +/// Normally you do not need to connect to this signal, unless you need to keep +/// track of which folder a file chooser is showing. +/// +/// See also: gtk_file_chooser_set_current_folder(), +/// gtk_file_chooser_get_current_folder(), +/// gtk_file_chooser_set_current_folder_uri(), +/// gtk_file_chooser_get_current_folder_uri(). +var currentFolderChanged: ((Self) -> Void)? { get set } - /// This signal is emitted when the user "activates" a file in the file - /// chooser. This can happen by double-clicking on a file in the file list, or - /// by pressing `Enter`. - /// - /// Normally you do not need to connect to this signal. It is used internally - /// by #GtkFileChooserDialog to know when to activate the default button in the - /// dialog. - /// - /// See also: gtk_file_chooser_get_filename(), - /// gtk_file_chooser_get_filenames(), gtk_file_chooser_get_uri(), - /// gtk_file_chooser_get_uris(). - var fileActivated: ((Self) -> Void)? { get set } +/// This signal is emitted when the user "activates" a file in the file +/// chooser. This can happen by double-clicking on a file in the file list, or +/// by pressing `Enter`. +/// +/// Normally you do not need to connect to this signal. It is used internally +/// by #GtkFileChooserDialog to know when to activate the default button in the +/// dialog. +/// +/// See also: gtk_file_chooser_get_filename(), +/// gtk_file_chooser_get_filenames(), gtk_file_chooser_get_uri(), +/// gtk_file_chooser_get_uris(). +var fileActivated: ((Self) -> Void)? { get set } - /// This signal is emitted when there is a change in the set of selected files - /// in a #GtkFileChooser. This can happen when the user modifies the selection - /// with the mouse or the keyboard, or when explicitly calling functions to - /// change the selection. - /// - /// Normally you do not need to connect to this signal, as it is easier to wait - /// for the file chooser to finish running, and then to get the list of - /// selected files using the functions mentioned below. - /// - /// See also: gtk_file_chooser_select_filename(), - /// gtk_file_chooser_unselect_filename(), gtk_file_chooser_get_filename(), - /// gtk_file_chooser_get_filenames(), gtk_file_chooser_select_uri(), - /// gtk_file_chooser_unselect_uri(), gtk_file_chooser_get_uri(), - /// gtk_file_chooser_get_uris(). - var selectionChanged: ((Self) -> Void)? { get set } +/// This signal is emitted when there is a change in the set of selected files +/// in a #GtkFileChooser. This can happen when the user modifies the selection +/// with the mouse or the keyboard, or when explicitly calling functions to +/// change the selection. +/// +/// Normally you do not need to connect to this signal, as it is easier to wait +/// for the file chooser to finish running, and then to get the list of +/// selected files using the functions mentioned below. +/// +/// See also: gtk_file_chooser_select_filename(), +/// gtk_file_chooser_unselect_filename(), gtk_file_chooser_get_filename(), +/// gtk_file_chooser_get_filenames(), gtk_file_chooser_select_uri(), +/// gtk_file_chooser_unselect_uri(), gtk_file_chooser_get_uri(), +/// gtk_file_chooser_get_uris(). +var selectionChanged: ((Self) -> Void)? { get set } - /// This signal is emitted when the preview in a file chooser should be - /// regenerated. For example, this can happen when the currently selected file - /// changes. You should use this signal if you want your file chooser to have - /// a preview widget. - /// - /// Once you have installed a preview widget with - /// gtk_file_chooser_set_preview_widget(), you should update it when this - /// signal is emitted. You can use the functions - /// gtk_file_chooser_get_preview_filename() or - /// gtk_file_chooser_get_preview_uri() to get the name of the file to preview. - /// Your widget may not be able to preview all kinds of files; your callback - /// must call gtk_file_chooser_set_preview_widget_active() to inform the file - /// chooser about whether the preview was generated successfully or not. - /// - /// Please see the example code in - /// [Using a Preview Widget][gtkfilechooser-preview]. - /// - /// See also: gtk_file_chooser_set_preview_widget(), - /// gtk_file_chooser_set_preview_widget_active(), - /// gtk_file_chooser_set_use_preview_label(), - /// gtk_file_chooser_get_preview_filename(), - /// gtk_file_chooser_get_preview_uri(). - var updatePreview: ((Self) -> Void)? { get set } -} +/// This signal is emitted when the preview in a file chooser should be +/// regenerated. For example, this can happen when the currently selected file +/// changes. You should use this signal if you want your file chooser to have +/// a preview widget. +/// +/// Once you have installed a preview widget with +/// gtk_file_chooser_set_preview_widget(), you should update it when this +/// signal is emitted. You can use the functions +/// gtk_file_chooser_get_preview_filename() or +/// gtk_file_chooser_get_preview_uri() to get the name of the file to preview. +/// Your widget may not be able to preview all kinds of files; your callback +/// must call gtk_file_chooser_set_preview_widget_active() to inform the file +/// chooser about whether the preview was generated successfully or not. +/// +/// Please see the example code in +/// [Using a Preview Widget][gtkfilechooser-preview]. +/// +/// See also: gtk_file_chooser_set_preview_widget(), +/// gtk_file_chooser_set_preview_widget_active(), +/// gtk_file_chooser_set_use_preview_label(), +/// gtk_file_chooser_get_preview_filename(), +/// gtk_file_chooser_get_preview_uri(). +var updatePreview: ((Self) -> Void)? { get set } +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/FileChooserAction.swift b/Sources/Gtk3/Generated/FileChooserAction.swift index 2b8313d5ef..af20d95f67 100644 --- a/Sources/Gtk3/Generated/FileChooserAction.swift +++ b/Sources/Gtk3/Generated/FileChooserAction.swift @@ -6,35 +6,35 @@ public enum FileChooserAction: GValueRepresentableEnum { public typealias GtkEnum = GtkFileChooserAction /// Indicates open mode. The file chooser - /// will only let the user pick an existing file. - case open - /// Indicates save mode. The file chooser - /// will let the user pick an existing file, or type in a new - /// filename. - case save - /// Indicates an Open mode for - /// selecting folders. The file chooser will let the user pick an - /// existing folder. - case selectFolder - /// Indicates a mode for creating a - /// new folder. The file chooser will let the user name an existing or - /// new folder. - case createFolder +/// will only let the user pick an existing file. +case open +/// Indicates save mode. The file chooser +/// will let the user pick an existing file, or type in a new +/// filename. +case save +/// Indicates an Open mode for +/// selecting folders. The file chooser will let the user pick an +/// existing folder. +case selectFolder +/// Indicates a mode for creating a +/// new folder. The file chooser will let the user name an existing or +/// new folder. +case createFolder public static var type: GType { - gtk_file_chooser_action_get_type() - } + gtk_file_chooser_action_get_type() +} public init(from gtkEnum: GtkFileChooserAction) { switch gtkEnum { case GTK_FILE_CHOOSER_ACTION_OPEN: - self = .open - case GTK_FILE_CHOOSER_ACTION_SAVE: - self = .save - case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER: - self = .selectFolder - case GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER: - self = .createFolder + self = .open +case GTK_FILE_CHOOSER_ACTION_SAVE: + self = .save +case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER: + self = .selectFolder +case GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER: + self = .createFolder default: fatalError("Unsupported GtkFileChooserAction enum value: \(gtkEnum.rawValue)") } @@ -43,13 +43,13 @@ public enum FileChooserAction: GValueRepresentableEnum { public func toGtk() -> GtkFileChooserAction { switch self { case .open: - return GTK_FILE_CHOOSER_ACTION_OPEN - case .save: - return GTK_FILE_CHOOSER_ACTION_SAVE - case .selectFolder: - return GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER - case .createFolder: - return GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER + return GTK_FILE_CHOOSER_ACTION_OPEN +case .save: + return GTK_FILE_CHOOSER_ACTION_SAVE +case .selectFolder: + return GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER +case .createFolder: + return GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/FileChooserError.swift b/Sources/Gtk3/Generated/FileChooserError.swift index 8c5d908361..3a82897fc2 100644 --- a/Sources/Gtk3/Generated/FileChooserError.swift +++ b/Sources/Gtk3/Generated/FileChooserError.swift @@ -6,29 +6,29 @@ public enum FileChooserError: GValueRepresentableEnum { public typealias GtkEnum = GtkFileChooserError /// Indicates that a file does not exist. - case nonexistent - /// Indicates a malformed filename. - case badFilename - /// Indicates a duplicate path (e.g. when - /// adding a bookmark). - case alreadyExists - /// Indicates an incomplete hostname (e.g. "http://foo" without a slash after that). - case incompleteHostname +case nonexistent +/// Indicates a malformed filename. +case badFilename +/// Indicates a duplicate path (e.g. when +/// adding a bookmark). +case alreadyExists +/// Indicates an incomplete hostname (e.g. "http://foo" without a slash after that). +case incompleteHostname public static var type: GType { - gtk_file_chooser_error_get_type() - } + gtk_file_chooser_error_get_type() +} public init(from gtkEnum: GtkFileChooserError) { switch gtkEnum { case GTK_FILE_CHOOSER_ERROR_NONEXISTENT: - self = .nonexistent - case GTK_FILE_CHOOSER_ERROR_BAD_FILENAME: - self = .badFilename - case GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS: - self = .alreadyExists - case GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME: - self = .incompleteHostname + self = .nonexistent +case GTK_FILE_CHOOSER_ERROR_BAD_FILENAME: + self = .badFilename +case GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS: + self = .alreadyExists +case GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME: + self = .incompleteHostname default: fatalError("Unsupported GtkFileChooserError enum value: \(gtkEnum.rawValue)") } @@ -37,13 +37,13 @@ public enum FileChooserError: GValueRepresentableEnum { public func toGtk() -> GtkFileChooserError { switch self { case .nonexistent: - return GTK_FILE_CHOOSER_ERROR_NONEXISTENT - case .badFilename: - return GTK_FILE_CHOOSER_ERROR_BAD_FILENAME - case .alreadyExists: - return GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS - case .incompleteHostname: - return GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME + return GTK_FILE_CHOOSER_ERROR_NONEXISTENT +case .badFilename: + return GTK_FILE_CHOOSER_ERROR_BAD_FILENAME +case .alreadyExists: + return GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS +case .incompleteHostname: + return GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/FileChooserNative.swift b/Sources/Gtk3/Generated/FileChooserNative.swift index afdf0862ca..350943fc97 100644 --- a/Sources/Gtk3/Generated/FileChooserNative.swift +++ b/Sources/Gtk3/Generated/FileChooserNative.swift @@ -8,28 +8,28 @@ import CGtk3 /// sandboxed environment without direct filesystem access (such as Flatpak), /// #GtkFileChooserNative may call the proper APIs (portals) to let the user /// choose a file and make it available to the application. -/// +/// /// While the API of #GtkFileChooserNative closely mirrors #GtkFileChooserDialog, the main /// difference is that there is no access to any #GtkWindow or #GtkWidget for the dialog. /// This is required, as there may not be one in the case of a platform native dialog. /// Showing, hiding and running the dialog is handled by the #GtkNativeDialog functions. -/// +/// /// ## Typical usage ## {#gtkfilechoosernative-typical-usage} -/// +/// /// In the simplest of cases, you can the following code to use /// #GtkFileChooserDialog to select a file for opening: -/// +/// /// |[ /// GtkFileChooserNative *native; /// GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN; /// gint res; -/// +/// /// native = gtk_file_chooser_native_new ("Open File", /// parent_window, /// action, /// "_Open", /// "_Cancel"); -/// +/// /// res = gtk_native_dialog_run (GTK_NATIVE_DIALOG (native)); /// if (res == GTK_RESPONSE_ACCEPT) /// { @@ -39,490 +39,480 @@ import CGtk3 /// open_file (filename); /// g_free (filename); /// } -/// +/// /// g_object_unref (native); /// ]| -/// +/// /// To use a dialog for saving, you can use this: -/// +/// /// |[ /// GtkFileChooserNative *native; /// GtkFileChooser *chooser; /// GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SAVE; /// gint res; -/// +/// /// native = gtk_file_chooser_native_new ("Save File", /// parent_window, /// action, /// "_Save", /// "_Cancel"); /// chooser = GTK_FILE_CHOOSER (native); -/// +/// /// gtk_file_chooser_set_do_overwrite_confirmation (chooser, TRUE); -/// +/// /// if (user_edited_a_new_document) /// gtk_file_chooser_set_current_name (chooser, /// _("Untitled document")); /// else /// gtk_file_chooser_set_filename (chooser, /// existing_filename); -/// +/// /// res = gtk_native_dialog_run (GTK_NATIVE_DIALOG (native)); /// if (res == GTK_RESPONSE_ACCEPT) /// { /// char *filename; -/// +/// /// filename = gtk_file_chooser_get_filename (chooser); /// save_to_file (filename); /// g_free (filename); /// } -/// +/// /// g_object_unref (native); /// ]| -/// +/// /// For more information on how to best set up a file dialog, see #GtkFileChooserDialog. -/// +/// /// ## Response Codes ## {#gtkfilechooserdialognative-responses} -/// +/// /// #GtkFileChooserNative inherits from #GtkNativeDialog, which means it /// will return #GTK_RESPONSE_ACCEPT if the user accepted, and /// #GTK_RESPONSE_CANCEL if he pressed cancel. It can also return /// #GTK_RESPONSE_DELETE_EVENT if the window was unexpectedly closed. -/// +/// /// ## Differences from #GtkFileChooserDialog ## {#gtkfilechooserdialognative-differences} -/// +/// /// There are a few things in the GtkFileChooser API that are not /// possible to use with #GtkFileChooserNative, as such use would /// prohibit the use of a native dialog. -/// +/// /// There is no support for the signals that are emitted when the user /// navigates in the dialog, including: /// * #GtkFileChooser::current-folder-changed /// * #GtkFileChooser::selection-changed /// * #GtkFileChooser::file-activated /// * #GtkFileChooser::confirm-overwrite -/// +/// /// You can also not use the methods that directly control user navigation: /// * gtk_file_chooser_unselect_filename() /// * gtk_file_chooser_select_all() /// * gtk_file_chooser_unselect_all() -/// +/// /// If you need any of the above you will have to use #GtkFileChooserDialog directly. -/// +/// /// No operations that change the the dialog work while the dialog is /// visible. Set all the properties that are required before showing the dialog. -/// +/// /// ## Win32 details ## {#gtkfilechooserdialognative-win32} -/// +/// /// On windows the IFileDialog implementation (added in Windows Vista) is /// used. It supports many of the features that #GtkFileChooserDialog /// does, but there are some things it does not handle: -/// +/// /// * Extra widgets added with gtk_file_chooser_set_extra_widget(). -/// +/// /// * Use of custom previews by connecting to #GtkFileChooser::update-preview. -/// +/// /// * Any #GtkFileFilter added using a mimetype or custom filter. -/// +/// /// If any of these features are used the regular #GtkFileChooserDialog /// will be used in place of the native one. -/// +/// /// ## Portal details ## {#gtkfilechooserdialognative-portal} -/// +/// /// When the org.freedesktop.portal.FileChooser portal is available on the /// session bus, it is used to bring up an out-of-process file chooser. Depending /// on the kind of session the application is running in, this may or may not /// be a GTK+ file chooser. In this situation, the following things are not /// supported and will be silently ignored: -/// +/// /// * Extra widgets added with gtk_file_chooser_set_extra_widget(). -/// +/// /// * Use of custom previews by connecting to #GtkFileChooser::update-preview. -/// +/// /// * Any #GtkFileFilter added with a custom filter. -/// +/// /// ## macOS details ## {#gtkfilechooserdialognative-macos} -/// +/// /// On macOS the NSSavePanel and NSOpenPanel classes are used to provide native /// file chooser dialogs. Some features provided by #GtkFileChooserDialog are /// not supported: -/// +/// /// * Extra widgets added with gtk_file_chooser_set_extra_widget(), unless the /// widget is an instance of GtkLabel, in which case the label text will be used /// to set the NSSavePanel message instance property. -/// +/// /// * Use of custom previews by connecting to #GtkFileChooser::update-preview. -/// +/// /// * Any #GtkFileFilter added with a custom filter. -/// +/// /// * Shortcut folders. open class FileChooserNative: NativeDialog, FileChooser { /// Creates a new #GtkFileChooserNative. - public convenience init( - title: String, parent: UnsafeMutablePointer!, action: GtkFileChooserAction, - acceptLabel: String, cancelLabel: String - ) { - self.init( - gtk_file_chooser_native_new(title, parent, action, acceptLabel, cancelLabel) - ) - } +public convenience init(title: String, parent: UnsafeMutablePointer!, action: GtkFileChooserAction, acceptLabel: String, cancelLabel: String) { + self.init( + gtk_file_chooser_native_new(title, parent, action, acceptLabel, cancelLabel) + ) +} public override func registerSignals() { - super.registerSignals() - - addSignal(name: "confirm-overwrite") { [weak self] () in - guard let self = self else { return } - self.confirmOverwrite?(self) - } - - addSignal(name: "current-folder-changed") { [weak self] () in - guard let self = self else { return } - self.currentFolderChanged?(self) - } - - addSignal(name: "file-activated") { [weak self] () in - guard let self = self else { return } - self.fileActivated?(self) - } - - addSignal(name: "selection-changed") { [weak self] () in - guard let self = self else { return } - self.selectionChanged?(self) - } - - addSignal(name: "update-preview") { [weak self] () in - guard let self = self else { return } - self.updatePreview?(self) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::accept-label", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAcceptLabel?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::cancel-label", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCancelLabel?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::action", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAction?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::create-folders", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCreateFolders?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::do-overwrite-confirmation", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDoOverwriteConfirmation?(self, param0) - } - - let handler10: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::extra-widget", handler: gCallback(handler10)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExtraWidget?(self, param0) - } - - let handler11: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::filter", handler: gCallback(handler11)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFilter?(self, param0) - } - - let handler12: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::local-only", handler: gCallback(handler12)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLocalOnly?(self, param0) - } - - let handler13: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::preview-widget", handler: gCallback(handler13)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPreviewWidget?(self, param0) - } - - let handler14: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::preview-widget-active", handler: gCallback(handler14)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPreviewWidgetActive?(self, param0) - } - - let handler15: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::select-multiple", handler: gCallback(handler15)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectMultiple?(self, param0) - } - - let handler16: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::show-hidden", handler: gCallback(handler16)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowHidden?(self, param0) - } - - let handler17: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-preview-label", handler: gCallback(handler17)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUsePreviewLabel?(self, param0) - } + super.registerSignals() + + addSignal(name: "confirm-overwrite") { [weak self] () in + guard let self = self else { return } + self.confirmOverwrite?(self) +} + +addSignal(name: "current-folder-changed") { [weak self] () in + guard let self = self else { return } + self.currentFolderChanged?(self) +} + +addSignal(name: "file-activated") { [weak self] () in + guard let self = self else { return } + self.fileActivated?(self) +} + +addSignal(name: "selection-changed") { [weak self] () in + guard let self = self else { return } + self.selectionChanged?(self) +} + +addSignal(name: "update-preview") { [weak self] () in + guard let self = self else { return } + self.updatePreview?(self) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// The text used for the label on the accept button in the dialog, or - /// %NULL to use the default text. - @GObjectProperty(named: "accept-label") public var acceptLabel: String? - - /// The text used for the label on the cancel button in the dialog, or - /// %NULL to use the default text. - @GObjectProperty(named: "cancel-label") public var cancelLabel: String? - - @GObjectProperty(named: "action") public var action: FileChooserAction - - @GObjectProperty(named: "local-only") public var localOnly: Bool - - @GObjectProperty(named: "preview-widget-active") public var previewWidgetActive: Bool - - @GObjectProperty(named: "select-multiple") public var selectMultiple: Bool - - @GObjectProperty(named: "show-hidden") public var showHidden: Bool - - @GObjectProperty(named: "use-preview-label") public var usePreviewLabel: Bool - - /// This signal gets emitted whenever it is appropriate to present a - /// confirmation dialog when the user has selected a file name that - /// already exists. The signal only gets emitted when the file - /// chooser is in %GTK_FILE_CHOOSER_ACTION_SAVE mode. - /// - /// Most applications just need to turn on the - /// #GtkFileChooser:do-overwrite-confirmation property (or call the - /// gtk_file_chooser_set_do_overwrite_confirmation() function), and - /// they will automatically get a stock confirmation dialog. - /// Applications which need to customize this behavior should do - /// that, and also connect to the #GtkFileChooser::confirm-overwrite - /// signal. - /// - /// A signal handler for this signal must return a - /// #GtkFileChooserConfirmation value, which indicates the action to - /// take. If the handler determines that the user wants to select a - /// different filename, it should return - /// %GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN. If it determines - /// that the user is satisfied with his choice of file name, it - /// should return %GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME. - /// On the other hand, if it determines that the stock confirmation - /// dialog should be used, it should return - /// %GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM. The following example - /// illustrates this. - /// - /// ## Custom confirmation ## {#gtkfilechooser-confirmation} - /// - /// |[ - /// static GtkFileChooserConfirmation - /// confirm_overwrite_callback (GtkFileChooser *chooser, gpointer data) - /// { - /// char *uri; - /// - /// uri = gtk_file_chooser_get_uri (chooser); - /// - /// if (is_uri_read_only (uri)) - /// { - /// if (user_wants_to_replace_read_only_file (uri)) - /// return GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME; - /// else - /// return GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN; - /// } else - /// return GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM; // fall back to the default dialog - /// } - /// - /// ... - /// - /// chooser = gtk_file_chooser_dialog_new (...); - /// - /// gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); - /// g_signal_connect (chooser, "confirm-overwrite", - /// G_CALLBACK (confirm_overwrite_callback), NULL); - /// - /// if (gtk_dialog_run (chooser) == GTK_RESPONSE_ACCEPT) - /// save_to_file (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); - /// - /// gtk_widget_destroy (chooser); - /// ]| - public var confirmOverwrite: ((FileChooserNative) -> Void)? - - /// This signal is emitted when the current folder in a #GtkFileChooser - /// changes. This can happen due to the user performing some action that - /// changes folders, such as selecting a bookmark or visiting a folder on the - /// file list. It can also happen as a result of calling a function to - /// explicitly change the current folder in a file chooser. - /// - /// Normally you do not need to connect to this signal, unless you need to keep - /// track of which folder a file chooser is showing. - /// - /// See also: gtk_file_chooser_set_current_folder(), - /// gtk_file_chooser_get_current_folder(), - /// gtk_file_chooser_set_current_folder_uri(), - /// gtk_file_chooser_get_current_folder_uri(). - public var currentFolderChanged: ((FileChooserNative) -> Void)? - - /// This signal is emitted when the user "activates" a file in the file - /// chooser. This can happen by double-clicking on a file in the file list, or - /// by pressing `Enter`. - /// - /// Normally you do not need to connect to this signal. It is used internally - /// by #GtkFileChooserDialog to know when to activate the default button in the - /// dialog. - /// - /// See also: gtk_file_chooser_get_filename(), - /// gtk_file_chooser_get_filenames(), gtk_file_chooser_get_uri(), - /// gtk_file_chooser_get_uris(). - public var fileActivated: ((FileChooserNative) -> Void)? - - /// This signal is emitted when there is a change in the set of selected files - /// in a #GtkFileChooser. This can happen when the user modifies the selection - /// with the mouse or the keyboard, or when explicitly calling functions to - /// change the selection. - /// - /// Normally you do not need to connect to this signal, as it is easier to wait - /// for the file chooser to finish running, and then to get the list of - /// selected files using the functions mentioned below. - /// - /// See also: gtk_file_chooser_select_filename(), - /// gtk_file_chooser_unselect_filename(), gtk_file_chooser_get_filename(), - /// gtk_file_chooser_get_filenames(), gtk_file_chooser_select_uri(), - /// gtk_file_chooser_unselect_uri(), gtk_file_chooser_get_uri(), - /// gtk_file_chooser_get_uris(). - public var selectionChanged: ((FileChooserNative) -> Void)? - - /// This signal is emitted when the preview in a file chooser should be - /// regenerated. For example, this can happen when the currently selected file - /// changes. You should use this signal if you want your file chooser to have - /// a preview widget. - /// - /// Once you have installed a preview widget with - /// gtk_file_chooser_set_preview_widget(), you should update it when this - /// signal is emitted. You can use the functions - /// gtk_file_chooser_get_preview_filename() or - /// gtk_file_chooser_get_preview_uri() to get the name of the file to preview. - /// Your widget may not be able to preview all kinds of files; your callback - /// must call gtk_file_chooser_set_preview_widget_active() to inform the file - /// chooser about whether the preview was generated successfully or not. - /// - /// Please see the example code in - /// [Using a Preview Widget][gtkfilechooser-preview]. - /// - /// See also: gtk_file_chooser_set_preview_widget(), - /// gtk_file_chooser_set_preview_widget_active(), - /// gtk_file_chooser_set_use_preview_label(), - /// gtk_file_chooser_get_preview_filename(), - /// gtk_file_chooser_get_preview_uri(). - public var updatePreview: ((FileChooserNative) -> Void)? - - public var notifyAcceptLabel: ((FileChooserNative, OpaquePointer) -> Void)? - - public var notifyCancelLabel: ((FileChooserNative, OpaquePointer) -> Void)? - - public var notifyAction: ((FileChooserNative, OpaquePointer) -> Void)? - - public var notifyCreateFolders: ((FileChooserNative, OpaquePointer) -> Void)? - - public var notifyDoOverwriteConfirmation: ((FileChooserNative, OpaquePointer) -> Void)? - - public var notifyExtraWidget: ((FileChooserNative, OpaquePointer) -> Void)? - - public var notifyFilter: ((FileChooserNative, OpaquePointer) -> Void)? - - public var notifyLocalOnly: ((FileChooserNative, OpaquePointer) -> Void)? - - public var notifyPreviewWidget: ((FileChooserNative, OpaquePointer) -> Void)? - - public var notifyPreviewWidgetActive: ((FileChooserNative, OpaquePointer) -> Void)? - - public var notifySelectMultiple: ((FileChooserNative, OpaquePointer) -> Void)? - - public var notifyShowHidden: ((FileChooserNative, OpaquePointer) -> Void)? - - public var notifyUsePreviewLabel: ((FileChooserNative, OpaquePointer) -> Void)? +addSignal(name: "notify::accept-label", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAcceptLabel?(self, param0) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::cancel-label", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCancelLabel?(self, param0) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::action", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAction?(self, param0) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::create-folders", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCreateFolders?(self, param0) +} + +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::do-overwrite-confirmation", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDoOverwriteConfirmation?(self, param0) +} + +let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::extra-widget", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExtraWidget?(self, param0) +} + +let handler11: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::filter", handler: gCallback(handler11)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFilter?(self, param0) +} + +let handler12: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::local-only", handler: gCallback(handler12)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLocalOnly?(self, param0) +} + +let handler13: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::preview-widget", handler: gCallback(handler13)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPreviewWidget?(self, param0) +} + +let handler14: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::preview-widget-active", handler: gCallback(handler14)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPreviewWidgetActive?(self, param0) +} + +let handler15: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::select-multiple", handler: gCallback(handler15)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectMultiple?(self, param0) +} + +let handler16: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::show-hidden", handler: gCallback(handler16)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowHidden?(self, param0) +} + +let handler17: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::use-preview-label", handler: gCallback(handler17)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUsePreviewLabel?(self, param0) +} } + + /// The text used for the label on the accept button in the dialog, or +/// %NULL to use the default text. +@GObjectProperty(named: "accept-label") public var acceptLabel: String? + +/// The text used for the label on the cancel button in the dialog, or +/// %NULL to use the default text. +@GObjectProperty(named: "cancel-label") public var cancelLabel: String? + + +@GObjectProperty(named: "action") public var action: FileChooserAction + + +@GObjectProperty(named: "local-only") public var localOnly: Bool + + +@GObjectProperty(named: "preview-widget-active") public var previewWidgetActive: Bool + + +@GObjectProperty(named: "select-multiple") public var selectMultiple: Bool + + +@GObjectProperty(named: "show-hidden") public var showHidden: Bool + + +@GObjectProperty(named: "use-preview-label") public var usePreviewLabel: Bool + +/// This signal gets emitted whenever it is appropriate to present a +/// confirmation dialog when the user has selected a file name that +/// already exists. The signal only gets emitted when the file +/// chooser is in %GTK_FILE_CHOOSER_ACTION_SAVE mode. +/// +/// Most applications just need to turn on the +/// #GtkFileChooser:do-overwrite-confirmation property (or call the +/// gtk_file_chooser_set_do_overwrite_confirmation() function), and +/// they will automatically get a stock confirmation dialog. +/// Applications which need to customize this behavior should do +/// that, and also connect to the #GtkFileChooser::confirm-overwrite +/// signal. +/// +/// A signal handler for this signal must return a +/// #GtkFileChooserConfirmation value, which indicates the action to +/// take. If the handler determines that the user wants to select a +/// different filename, it should return +/// %GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN. If it determines +/// that the user is satisfied with his choice of file name, it +/// should return %GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME. +/// On the other hand, if it determines that the stock confirmation +/// dialog should be used, it should return +/// %GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM. The following example +/// illustrates this. +/// +/// ## Custom confirmation ## {#gtkfilechooser-confirmation} +/// +/// |[ +/// static GtkFileChooserConfirmation +/// confirm_overwrite_callback (GtkFileChooser *chooser, gpointer data) +/// { +/// char *uri; +/// +/// uri = gtk_file_chooser_get_uri (chooser); +/// +/// if (is_uri_read_only (uri)) +/// { +/// if (user_wants_to_replace_read_only_file (uri)) +/// return GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME; +/// else +/// return GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN; +/// } else +/// return GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM; // fall back to the default dialog +/// } +/// +/// ... +/// +/// chooser = gtk_file_chooser_dialog_new (...); +/// +/// gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); +/// g_signal_connect (chooser, "confirm-overwrite", +/// G_CALLBACK (confirm_overwrite_callback), NULL); +/// +/// if (gtk_dialog_run (chooser) == GTK_RESPONSE_ACCEPT) +/// save_to_file (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); +/// +/// gtk_widget_destroy (chooser); +/// ]| +public var confirmOverwrite: ((FileChooserNative) -> Void)? + +/// This signal is emitted when the current folder in a #GtkFileChooser +/// changes. This can happen due to the user performing some action that +/// changes folders, such as selecting a bookmark or visiting a folder on the +/// file list. It can also happen as a result of calling a function to +/// explicitly change the current folder in a file chooser. +/// +/// Normally you do not need to connect to this signal, unless you need to keep +/// track of which folder a file chooser is showing. +/// +/// See also: gtk_file_chooser_set_current_folder(), +/// gtk_file_chooser_get_current_folder(), +/// gtk_file_chooser_set_current_folder_uri(), +/// gtk_file_chooser_get_current_folder_uri(). +public var currentFolderChanged: ((FileChooserNative) -> Void)? + +/// This signal is emitted when the user "activates" a file in the file +/// chooser. This can happen by double-clicking on a file in the file list, or +/// by pressing `Enter`. +/// +/// Normally you do not need to connect to this signal. It is used internally +/// by #GtkFileChooserDialog to know when to activate the default button in the +/// dialog. +/// +/// See also: gtk_file_chooser_get_filename(), +/// gtk_file_chooser_get_filenames(), gtk_file_chooser_get_uri(), +/// gtk_file_chooser_get_uris(). +public var fileActivated: ((FileChooserNative) -> Void)? + +/// This signal is emitted when there is a change in the set of selected files +/// in a #GtkFileChooser. This can happen when the user modifies the selection +/// with the mouse or the keyboard, or when explicitly calling functions to +/// change the selection. +/// +/// Normally you do not need to connect to this signal, as it is easier to wait +/// for the file chooser to finish running, and then to get the list of +/// selected files using the functions mentioned below. +/// +/// See also: gtk_file_chooser_select_filename(), +/// gtk_file_chooser_unselect_filename(), gtk_file_chooser_get_filename(), +/// gtk_file_chooser_get_filenames(), gtk_file_chooser_select_uri(), +/// gtk_file_chooser_unselect_uri(), gtk_file_chooser_get_uri(), +/// gtk_file_chooser_get_uris(). +public var selectionChanged: ((FileChooserNative) -> Void)? + +/// This signal is emitted when the preview in a file chooser should be +/// regenerated. For example, this can happen when the currently selected file +/// changes. You should use this signal if you want your file chooser to have +/// a preview widget. +/// +/// Once you have installed a preview widget with +/// gtk_file_chooser_set_preview_widget(), you should update it when this +/// signal is emitted. You can use the functions +/// gtk_file_chooser_get_preview_filename() or +/// gtk_file_chooser_get_preview_uri() to get the name of the file to preview. +/// Your widget may not be able to preview all kinds of files; your callback +/// must call gtk_file_chooser_set_preview_widget_active() to inform the file +/// chooser about whether the preview was generated successfully or not. +/// +/// Please see the example code in +/// [Using a Preview Widget][gtkfilechooser-preview]. +/// +/// See also: gtk_file_chooser_set_preview_widget(), +/// gtk_file_chooser_set_preview_widget_active(), +/// gtk_file_chooser_set_use_preview_label(), +/// gtk_file_chooser_get_preview_filename(), +/// gtk_file_chooser_get_preview_uri(). +public var updatePreview: ((FileChooserNative) -> Void)? + + +public var notifyAcceptLabel: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyCancelLabel: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyAction: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyCreateFolders: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyDoOverwriteConfirmation: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyExtraWidget: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyFilter: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyLocalOnly: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyPreviewWidget: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyPreviewWidgetActive: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifySelectMultiple: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyShowHidden: ((FileChooserNative, OpaquePointer) -> Void)? + + +public var notifyUsePreviewLabel: ((FileChooserNative, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/FontChooser.swift b/Sources/Gtk3/Generated/FontChooser.swift index be9cec7010..67b75b1365 100644 --- a/Sources/Gtk3/Generated/FontChooser.swift +++ b/Sources/Gtk3/Generated/FontChooser.swift @@ -7,17 +7,17 @@ import CGtk3 /// has been introducted in GTK+ 3.2. public protocol FontChooser: GObjectRepresentable { /// The font description as a string, e.g. "Sans Italic 12". - var font: String? { get set } +var font: String? { get set } - /// The string with which to preview the font. - var previewText: String { get set } +/// The string with which to preview the font. +var previewText: String { get set } - /// Whether to show an entry to change the preview text. - var showPreviewEntry: Bool { get set } +/// Whether to show an entry to change the preview text. +var showPreviewEntry: Bool { get set } /// Emitted when a font is activated. - /// This usually happens when the user double clicks an item, - /// or an item is selected and the user presses one of the keys - /// Space, Shift+Space, Return or Enter. - var fontActivated: ((Self, UnsafePointer) -> Void)? { get set } -} +/// This usually happens when the user double clicks an item, +/// or an item is selected and the user presses one of the keys +/// Space, Shift+Space, Return or Enter. +var fontActivated: ((Self, UnsafePointer) -> Void)? { get set } +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/GLArea.swift b/Sources/Gtk3/Generated/GLArea.swift index 0dec451dc6..029441b839 100644 --- a/Sources/Gtk3/Generated/GLArea.swift +++ b/Sources/Gtk3/Generated/GLArea.swift @@ -1,36 +1,36 @@ import CGtk3 /// #GtkGLArea is a widget that allows drawing with OpenGL. -/// +/// /// #GtkGLArea sets up its own #GdkGLContext for the window it creates, and /// creates a custom GL framebuffer that the widget will do GL rendering onto. /// It also ensures that this framebuffer is the default GL rendering target /// when rendering. -/// +/// /// In order to draw, you have to connect to the #GtkGLArea::render signal, /// or subclass #GtkGLArea and override the @GtkGLAreaClass.render() virtual /// function. -/// +/// /// The #GtkGLArea widget ensures that the #GdkGLContext is associated with /// the widget's drawing area, and it is kept updated when the size and /// position of the drawing area changes. -/// +/// /// ## Drawing with GtkGLArea ## -/// +/// /// The simplest way to draw using OpenGL commands in a #GtkGLArea is to /// create a widget instance and connect to the #GtkGLArea::render signal: -/// +/// /// |[ /// // create a GtkGLArea instance /// GtkWidget *gl_area = gtk_gl_area_new (); -/// +/// /// // connect to the "render" signal /// g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL); /// ]| -/// +/// /// The `render()` function will be called when the #GtkGLArea is ready /// for you to draw its content: -/// +/// /// |[ /// static gboolean /// render (GtkGLArea *area, GdkGLContext *context) @@ -39,28 +39,28 @@ import CGtk3 /// // #GdkGLContext has been made current to the drawable /// // surface used by the #GtkGLArea and the viewport has /// // already been set to be the size of the allocation -/// +/// /// // we can start by clearing the buffer /// glClearColor (0, 0, 0, 0); /// glClear (GL_COLOR_BUFFER_BIT); -/// +/// /// // draw your object /// draw_an_object (); -/// +/// /// // we completed our drawing; the draw commands will be /// // flushed at the end of the signal emission chain, and /// // the buffers will be drawn on the window /// return TRUE; /// } /// ]| -/// +/// /// If you need to initialize OpenGL state, e.g. buffer objects or /// shaders, you should use the #GtkWidget::realize signal; you /// can use the #GtkWidget::unrealize signal to clean up. Since the /// #GdkGLContext creation and initialization may fail, you will /// need to check for errors, using gtk_gl_area_get_error(). An example /// of how to safely initialize the GL state is: -/// +/// /// |[ /// static void /// on_realize (GtkGLarea *area) @@ -68,13 +68,13 @@ import CGtk3 /// // We need to make the context current if we want to /// // call GL API /// gtk_gl_area_make_current (area); -/// +/// /// // If there were errors during the initialization or /// // when trying to make the context current, this /// // function will return a #GError for you to catch /// if (gtk_gl_area_get_error (area) != NULL) /// return; -/// +/// /// // You can also use gtk_gl_area_set_error() in order /// // to show eventual initialization errors on the /// // GtkGLArea widget itself @@ -86,7 +86,7 @@ import CGtk3 /// g_error_free (error); /// return; /// } -/// +/// /// init_shaders (&error); /// if (error != NULL) /// { @@ -96,160 +96,150 @@ import CGtk3 /// } /// } /// ]| -/// +/// /// If you need to change the options for creating the #GdkGLContext /// you should use the #GtkGLArea::create-context signal. open class GLArea: Widget { /// Creates a new #GtkGLArea widget. - public convenience init() { - self.init( - gtk_gl_area_new() - ) +public convenience init() { + self.init( + gtk_gl_area_new() + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "create-context") { [weak self] () in + guard let self = self else { return } + self.createContext?(self) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "create-context") { [weak self] () in - guard let self = self else { return } - self.createContext?(self) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "render", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.render?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "resize", handler: gCallback(handler2)) { - [weak self] (param0: Int, param1: Int) in - guard let self = self else { return } - self.resize?(self, param0, param1) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::auto-render", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAutoRender?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::context", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContext?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::has-alpha", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasAlpha?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::has-depth-buffer", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasDepthBuffer?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::has-stencil-buffer", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasStencilBuffer?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-es", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseEs?(self, param0) - } +addSignal(name: "render", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.render?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) } - /// The ::create-context signal is emitted when the widget is being - /// realized, and allows you to override how the GL context is - /// created. This is useful when you want to reuse an existing GL - /// context, or if you want to try creating different kinds of GL - /// options. - /// - /// If context creation fails then the signal handler can use - /// gtk_gl_area_set_error() to register a more detailed error - /// of how the construction failed. - public var createContext: ((GLArea) -> Void)? - - /// The ::render signal is emitted every time the contents - /// of the #GtkGLArea should be redrawn. - /// - /// The @context is bound to the @area prior to emitting this function, - /// and the buffers are painted to the window once the emission terminates. - public var render: ((GLArea, OpaquePointer) -> Void)? - - /// The ::resize signal is emitted once when the widget is realized, and - /// then each time the widget is changed while realized. This is useful - /// in order to keep GL state up to date with the widget size, like for - /// instance camera properties which may depend on the width/height ratio. - /// - /// The GL context for the area is guaranteed to be current when this signal - /// is emitted. - /// - /// The default handler sets up the GL viewport. - public var resize: ((GLArea, Int, Int) -> Void)? - - public var notifyAutoRender: ((GLArea, OpaquePointer) -> Void)? - - public var notifyContext: ((GLArea, OpaquePointer) -> Void)? - - public var notifyHasAlpha: ((GLArea, OpaquePointer) -> Void)? - - public var notifyHasDepthBuffer: ((GLArea, OpaquePointer) -> Void)? - - public var notifyHasStencilBuffer: ((GLArea, OpaquePointer) -> Void)? - - public var notifyUseEs: ((GLArea, OpaquePointer) -> Void)? +addSignal(name: "resize", handler: gCallback(handler2)) { [weak self] (param0: Int, param1: Int) in + guard let self = self else { return } + self.resize?(self, param0, param1) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::auto-render", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAutoRender?(self, param0) } + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::context", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContext?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::has-alpha", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasAlpha?(self, param0) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::has-depth-buffer", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasDepthBuffer?(self, param0) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::has-stencil-buffer", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasStencilBuffer?(self, param0) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::use-es", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseEs?(self, param0) +} +} + + /// The ::create-context signal is emitted when the widget is being +/// realized, and allows you to override how the GL context is +/// created. This is useful when you want to reuse an existing GL +/// context, or if you want to try creating different kinds of GL +/// options. +/// +/// If context creation fails then the signal handler can use +/// gtk_gl_area_set_error() to register a more detailed error +/// of how the construction failed. +public var createContext: ((GLArea) -> Void)? + +/// The ::render signal is emitted every time the contents +/// of the #GtkGLArea should be redrawn. +/// +/// The @context is bound to the @area prior to emitting this function, +/// and the buffers are painted to the window once the emission terminates. +public var render: ((GLArea, OpaquePointer) -> Void)? + +/// The ::resize signal is emitted once when the widget is realized, and +/// then each time the widget is changed while realized. This is useful +/// in order to keep GL state up to date with the widget size, like for +/// instance camera properties which may depend on the width/height ratio. +/// +/// The GL context for the area is guaranteed to be current when this signal +/// is emitted. +/// +/// The default handler sets up the GL viewport. +public var resize: ((GLArea, Int, Int) -> Void)? + + +public var notifyAutoRender: ((GLArea, OpaquePointer) -> Void)? + + +public var notifyContext: ((GLArea, OpaquePointer) -> Void)? + + +public var notifyHasAlpha: ((GLArea, OpaquePointer) -> Void)? + + +public var notifyHasDepthBuffer: ((GLArea, OpaquePointer) -> Void)? + + +public var notifyHasStencilBuffer: ((GLArea, OpaquePointer) -> Void)? + + +public var notifyUseEs: ((GLArea, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/Gesture.swift b/Sources/Gtk3/Generated/Gesture.swift index fc44d23709..106ffb681d 100644 --- a/Sources/Gtk3/Generated/Gesture.swift +++ b/Sources/Gtk3/Generated/Gesture.swift @@ -4,64 +4,64 @@ import CGtk3 /// object is quite generalized to serve as a base for multi-touch gestures, /// it is suitable to implement single-touch and pointer-based gestures (using /// the special %NULL #GdkEventSequence value for these). -/// +/// /// The number of touches that a #GtkGesture need to be recognized is controlled /// by the #GtkGesture:n-points property, if a gesture is keeping track of less /// or more than that number of sequences, it won't check wether the gesture /// is recognized. -/// +/// /// As soon as the gesture has the expected number of touches, the gesture will /// run the #GtkGesture::check signal regularly on input events until the gesture /// is recognized, the criteria to consider a gesture as "recognized" is left to /// #GtkGesture subclasses. -/// +/// /// A recognized gesture will then emit the following signals: /// - #GtkGesture::begin when the gesture is recognized. /// - A number of #GtkGesture::update, whenever an input event is processed. /// - #GtkGesture::end when the gesture is no longer recognized. -/// +/// /// ## Event propagation -/// +/// /// In order to receive events, a gesture needs to either set a propagation phase /// through gtk_event_controller_set_propagation_phase(), or feed those manually /// through gtk_event_controller_handle_event(). -/// +/// /// In the capture phase, events are propagated from the toplevel down to the /// target widget, and gestures that are attached to containers above the widget /// get a chance to interact with the event before it reaches the target. -/// +/// /// After the capture phase, GTK+ emits the traditional #GtkWidget::button-press-event, /// #GtkWidget::button-release-event, #GtkWidget::touch-event, etc signals. Gestures /// with the %GTK_PHASE_TARGET phase are fed events from the default #GtkWidget::event /// handlers. -/// +/// /// In the bubble phase, events are propagated up from the target widget to the /// toplevel, and gestures that are attached to containers above the widget get /// a chance to interact with events that have not been handled yet. -/// +/// /// ## States of a sequence # {#touch-sequence-states} -/// +/// /// Whenever input interaction happens, a single event may trigger a cascade of /// #GtkGestures, both across the parents of the widget receiving the event and /// in parallel within an individual widget. It is a responsibility of the /// widgets using those gestures to set the state of touch sequences accordingly /// in order to enable cooperation of gestures around the #GdkEventSequences /// triggering those. -/// +/// /// Within a widget, gestures can be grouped through gtk_gesture_group(), /// grouped gestures synchronize the state of sequences, so calling /// gtk_gesture_set_sequence_state() on one will effectively propagate /// the state throughout the group. -/// +/// /// By default, all sequences start out in the #GTK_EVENT_SEQUENCE_NONE state, /// sequences in this state trigger the gesture event handler, but event /// propagation will continue unstopped by gestures. -/// +/// /// If a sequence enters into the #GTK_EVENT_SEQUENCE_DENIED state, the gesture /// group will effectively ignore the sequence, letting events go unstopped /// through the gesture, but the "slot" will still remain occupied while /// the touch is active. -/// +/// /// If a sequence enters in the #GTK_EVENT_SEQUENCE_CLAIMED state, the gesture /// group will grab all interaction on the sequence, by: /// - Setting the same sequence to #GTK_EVENT_SEQUENCE_DENIED on every other gesture @@ -70,19 +70,19 @@ import CGtk3 /// - calling #GtkGesture::cancel on every gesture in widgets underneath in the /// propagation chain. /// - Stopping event propagation after the gesture group handles the event. -/// +/// /// Note: if a sequence is set early to #GTK_EVENT_SEQUENCE_CLAIMED on /// #GDK_TOUCH_BEGIN/#GDK_BUTTON_PRESS (so those events are captured before /// reaching the event widget, this implies #GTK_PHASE_CAPTURE), one similar /// event will emulated if the sequence changes to #GTK_EVENT_SEQUENCE_DENIED. /// This way event coherence is preserved before event propagation is unstopped /// again. -/// +/// /// Sequence states can't be changed freely, see gtk_gesture_set_sequence_state() /// to know about the possible lifetimes of a #GdkEventSequence. -/// +/// /// ## Touchpad gestures -/// +/// /// On the platforms that support it, #GtkGesture will handle transparently /// touchpad gesture events. The only precautions users of #GtkGesture should do /// to enable this support are: @@ -90,136 +90,122 @@ import CGtk3 /// - If the gesture has %GTK_PHASE_NONE, ensuring events of type /// %GDK_TOUCHPAD_SWIPE and %GDK_TOUCHPAD_PINCH are handled by the #GtkGesture open class Gesture: EventController { + public override func registerSignals() { - super.registerSignals() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "begin", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.begin?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "cancel", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.cancel?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "end", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.end?(self, param0) - } - - let handler3: - @convention(c) ( - UnsafeMutableRawPointer, OpaquePointer, GtkEventSequenceState, - UnsafeMutableRawPointer - ) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "sequence-state-changed", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer, param1: GtkEventSequenceState) in - guard let self = self else { return } - self.sequenceStateChanged?(self, param0, param1) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "update", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.update?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::n-points", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyNPoints?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::window", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWindow?(self, param0) - } + super.registerSignals() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// This signal is emitted when the gesture is recognized. This means the - /// number of touch sequences matches #GtkGesture:n-points, and the #GtkGesture::check - /// handler(s) returned #TRUE. - /// - /// Note: These conditions may also happen when an extra touch (eg. a third touch - /// on a 2-touches gesture) is lifted, in that situation @sequence won't pertain - /// to the current set of active touches, so don't rely on this being true. - public var begin: ((Gesture, OpaquePointer) -> Void)? - - /// This signal is emitted whenever a sequence is cancelled. This usually - /// happens on active touches when gtk_event_controller_reset() is called - /// on @gesture (manually, due to grabs...), or the individual @sequence - /// was claimed by parent widgets' controllers (see gtk_gesture_set_sequence_state()). - /// - /// @gesture must forget everything about @sequence as a reaction to this signal. - public var cancel: ((Gesture, OpaquePointer) -> Void)? - - /// This signal is emitted when @gesture either stopped recognizing the event - /// sequences as something to be handled (the #GtkGesture::check handler returned - /// %FALSE), or the number of touch sequences became higher or lower than - /// #GtkGesture:n-points. - /// - /// Note: @sequence might not pertain to the group of sequences that were - /// previously triggering recognition on @gesture (ie. a just pressed touch - /// sequence that exceeds #GtkGesture:n-points). This situation may be detected - /// by checking through gtk_gesture_handles_sequence(). - public var end: ((Gesture, OpaquePointer) -> Void)? - - /// This signal is emitted whenever a sequence state changes. See - /// gtk_gesture_set_sequence_state() to know more about the expectable - /// sequence lifetimes. - public var sequenceStateChanged: ((Gesture, OpaquePointer, GtkEventSequenceState) -> Void)? - - /// This signal is emitted whenever an event is handled while the gesture is - /// recognized. @sequence is guaranteed to pertain to the set of active touches. - public var update: ((Gesture, OpaquePointer) -> Void)? - - public var notifyNPoints: ((Gesture, OpaquePointer) -> Void)? - - public var notifyWindow: ((Gesture, OpaquePointer) -> Void)? +addSignal(name: "begin", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.begin?(self, param0) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "cancel", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.cancel?(self, param0) } + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "end", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.end?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, GtkEventSequenceState, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + +addSignal(name: "sequence-state-changed", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer, param1: GtkEventSequenceState) in + guard let self = self else { return } + self.sequenceStateChanged?(self, param0, param1) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "update", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.update?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::n-points", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyNPoints?(self, param0) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::window", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWindow?(self, param0) +} +} + + /// This signal is emitted when the gesture is recognized. This means the +/// number of touch sequences matches #GtkGesture:n-points, and the #GtkGesture::check +/// handler(s) returned #TRUE. +/// +/// Note: These conditions may also happen when an extra touch (eg. a third touch +/// on a 2-touches gesture) is lifted, in that situation @sequence won't pertain +/// to the current set of active touches, so don't rely on this being true. +public var begin: ((Gesture, OpaquePointer) -> Void)? + +/// This signal is emitted whenever a sequence is cancelled. This usually +/// happens on active touches when gtk_event_controller_reset() is called +/// on @gesture (manually, due to grabs...), or the individual @sequence +/// was claimed by parent widgets' controllers (see gtk_gesture_set_sequence_state()). +/// +/// @gesture must forget everything about @sequence as a reaction to this signal. +public var cancel: ((Gesture, OpaquePointer) -> Void)? + +/// This signal is emitted when @gesture either stopped recognizing the event +/// sequences as something to be handled (the #GtkGesture::check handler returned +/// %FALSE), or the number of touch sequences became higher or lower than +/// #GtkGesture:n-points. +/// +/// Note: @sequence might not pertain to the group of sequences that were +/// previously triggering recognition on @gesture (ie. a just pressed touch +/// sequence that exceeds #GtkGesture:n-points). This situation may be detected +/// by checking through gtk_gesture_handles_sequence(). +public var end: ((Gesture, OpaquePointer) -> Void)? + +/// This signal is emitted whenever a sequence state changes. See +/// gtk_gesture_set_sequence_state() to know more about the expectable +/// sequence lifetimes. +public var sequenceStateChanged: ((Gesture, OpaquePointer, GtkEventSequenceState) -> Void)? + +/// This signal is emitted whenever an event is handled while the gesture is +/// recognized. @sequence is guaranteed to pertain to the set of active touches. +public var update: ((Gesture, OpaquePointer) -> Void)? + + +public var notifyNPoints: ((Gesture, OpaquePointer) -> Void)? + + +public var notifyWindow: ((Gesture, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/GestureLongPress.swift b/Sources/Gtk3/Generated/GestureLongPress.swift index 2a975cae63..0b01a0996b 100644 --- a/Sources/Gtk3/Generated/GestureLongPress.swift +++ b/Sources/Gtk3/Generated/GestureLongPress.swift @@ -3,59 +3,55 @@ import CGtk3 /// #GtkGestureLongPress is a #GtkGesture implementation able to recognize /// long presses, triggering the #GtkGestureLongPress::pressed after the /// timeout is exceeded. -/// +/// /// If the touchpoint is lifted before the timeout passes, or if it drifts /// too far of the initial press point, the #GtkGestureLongPress::cancelled /// signal will be emitted. open class GestureLongPress: GestureSingle { /// Returns a newly created #GtkGesture that recognizes long presses. - public convenience init(widget: UnsafeMutablePointer!) { - self.init( - gtk_gesture_long_press_new(widget) - ) - } +public convenience init(widget: UnsafeMutablePointer!) { + self.init( + gtk_gesture_long_press_new(widget) + ) +} public override func registerSignals() { - super.registerSignals() - - addSignal(name: "cancelled") { [weak self] () in - guard let self = self else { return } - self.cancelled?(self) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> - Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "pressed", handler: gCallback(handler1)) { - [weak self] (param0: Double, param1: Double) in - guard let self = self else { return } - self.pressed?(self, param0, param1) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::delay-factor", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDelayFactor?(self, param0) - } + super.registerSignals() + + addSignal(name: "cancelled") { [weak self] () in + guard let self = self else { return } + self.cancelled?(self) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) } - /// This signal is emitted whenever a press moved too far, or was released - /// before #GtkGestureLongPress::pressed happened. - public var cancelled: ((GestureLongPress) -> Void)? +addSignal(name: "pressed", handler: gCallback(handler1)) { [weak self] (param0: Double, param1: Double) in + guard let self = self else { return } + self.pressed?(self, param0, param1) +} - /// This signal is emitted whenever a press goes unmoved/unreleased longer than - /// what the GTK+ defaults tell. - public var pressed: ((GestureLongPress, Double, Double) -> Void)? +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyDelayFactor: ((GestureLongPress, OpaquePointer) -> Void)? +addSignal(name: "notify::delay-factor", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDelayFactor?(self, param0) +} } + + /// This signal is emitted whenever a press moved too far, or was released +/// before #GtkGestureLongPress::pressed happened. +public var cancelled: ((GestureLongPress) -> Void)? + +/// This signal is emitted whenever a press goes unmoved/unreleased longer than +/// what the GTK+ defaults tell. +public var pressed: ((GestureLongPress, Double, Double) -> Void)? + + +public var notifyDelayFactor: ((GestureLongPress, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/GestureSingle.swift b/Sources/Gtk3/Generated/GestureSingle.swift index f51f30dc77..2240ef391c 100644 --- a/Sources/Gtk3/Generated/GestureSingle.swift +++ b/Sources/Gtk3/Generated/GestureSingle.swift @@ -5,7 +5,7 @@ import CGtk3 /// interaction, these gestures stick to the first interacting sequence, which /// is accessible through gtk_gesture_single_get_current_sequence() while the /// gesture is being interacted with. -/// +/// /// By default gestures react to both %GDK_BUTTON_PRIMARY and touch /// events, gtk_gesture_single_set_touch_only() can be used to change the /// touch behavior. Callers may also specify a different mouse button number @@ -13,50 +13,48 @@ import CGtk3 /// mouse button by setting 0. While the gesture is active, the button being /// currently pressed can be known through gtk_gesture_single_get_current_button(). open class GestureSingle: Gesture { + public override func registerSignals() { - super.registerSignals() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::button", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyButton?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::exclusive", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExclusive?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::touch-only", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTouchOnly?(self, param0) - } + super.registerSignals() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - public var notifyButton: ((GestureSingle, OpaquePointer) -> Void)? +addSignal(name: "notify::button", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyButton?(self, param0) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyExclusive: ((GestureSingle, OpaquePointer) -> Void)? +addSignal(name: "notify::exclusive", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExclusive?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyTouchOnly: ((GestureSingle, OpaquePointer) -> Void)? +addSignal(name: "notify::touch-only", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTouchOnly?(self, param0) } +} + + +public var notifyButton: ((GestureSingle, OpaquePointer) -> Void)? + + +public var notifyExclusive: ((GestureSingle, OpaquePointer) -> Void)? + + +public var notifyTouchOnly: ((GestureSingle, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/IMPreeditStyle.swift b/Sources/Gtk3/Generated/IMPreeditStyle.swift index adc3ddfa79..96ca8cd13f 100644 --- a/Sources/Gtk3/Generated/IMPreeditStyle.swift +++ b/Sources/Gtk3/Generated/IMPreeditStyle.swift @@ -6,24 +6,24 @@ public enum IMPreeditStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkIMPreeditStyle /// Deprecated - case nothing - /// Deprecated - case callback - /// Deprecated - case none +case nothing +/// Deprecated +case callback +/// Deprecated +case none public static var type: GType { - gtk_im_preedit_style_get_type() - } + gtk_im_preedit_style_get_type() +} public init(from gtkEnum: GtkIMPreeditStyle) { switch gtkEnum { case GTK_IM_PREEDIT_NOTHING: - self = .nothing - case GTK_IM_PREEDIT_CALLBACK: - self = .callback - case GTK_IM_PREEDIT_NONE: - self = .none + self = .nothing +case GTK_IM_PREEDIT_CALLBACK: + self = .callback +case GTK_IM_PREEDIT_NONE: + self = .none default: fatalError("Unsupported GtkIMPreeditStyle enum value: \(gtkEnum.rawValue)") } @@ -32,11 +32,11 @@ public enum IMPreeditStyle: GValueRepresentableEnum { public func toGtk() -> GtkIMPreeditStyle { switch self { case .nothing: - return GTK_IM_PREEDIT_NOTHING - case .callback: - return GTK_IM_PREEDIT_CALLBACK - case .none: - return GTK_IM_PREEDIT_NONE + return GTK_IM_PREEDIT_NOTHING +case .callback: + return GTK_IM_PREEDIT_CALLBACK +case .none: + return GTK_IM_PREEDIT_NONE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/IMStatusStyle.swift b/Sources/Gtk3/Generated/IMStatusStyle.swift index 3fb252c4d4..daf7e4012f 100644 --- a/Sources/Gtk3/Generated/IMStatusStyle.swift +++ b/Sources/Gtk3/Generated/IMStatusStyle.swift @@ -6,24 +6,24 @@ public enum IMStatusStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkIMStatusStyle /// Deprecated - case nothing - /// Deprecated - case callback - /// Deprecated - case none +case nothing +/// Deprecated +case callback +/// Deprecated +case none public static var type: GType { - gtk_im_status_style_get_type() - } + gtk_im_status_style_get_type() +} public init(from gtkEnum: GtkIMStatusStyle) { switch gtkEnum { case GTK_IM_STATUS_NOTHING: - self = .nothing - case GTK_IM_STATUS_CALLBACK: - self = .callback - case GTK_IM_STATUS_NONE: - self = .none + self = .nothing +case GTK_IM_STATUS_CALLBACK: + self = .callback +case GTK_IM_STATUS_NONE: + self = .none default: fatalError("Unsupported GtkIMStatusStyle enum value: \(gtkEnum.rawValue)") } @@ -32,11 +32,11 @@ public enum IMStatusStyle: GValueRepresentableEnum { public func toGtk() -> GtkIMStatusStyle { switch self { case .nothing: - return GTK_IM_STATUS_NOTHING - case .callback: - return GTK_IM_STATUS_CALLBACK - case .none: - return GTK_IM_STATUS_NONE + return GTK_IM_STATUS_NOTHING +case .callback: + return GTK_IM_STATUS_CALLBACK +case .none: + return GTK_IM_STATUS_NONE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/IconSize.swift b/Sources/Gtk3/Generated/IconSize.swift index 7abab1a378..4b2cc2bf5d 100644 --- a/Sources/Gtk3/Generated/IconSize.swift +++ b/Sources/Gtk3/Generated/IconSize.swift @@ -5,40 +5,40 @@ public enum IconSize: GValueRepresentableEnum { public typealias GtkEnum = GtkIconSize /// Invalid size. - case invalid - /// Size appropriate for menus (16px). - case menu - /// Size appropriate for small toolbars (16px). - case smallToolbar - /// Size appropriate for large toolbars (24px) - case largeToolbar - /// Size appropriate for buttons (16px) - case button - /// Size appropriate for drag and drop (32px) - case dnd - /// Size appropriate for dialogs (48px) - case dialog +case invalid +/// Size appropriate for menus (16px). +case menu +/// Size appropriate for small toolbars (16px). +case smallToolbar +/// Size appropriate for large toolbars (24px) +case largeToolbar +/// Size appropriate for buttons (16px) +case button +/// Size appropriate for drag and drop (32px) +case dnd +/// Size appropriate for dialogs (48px) +case dialog public static var type: GType { - gtk_icon_size_get_type() - } + gtk_icon_size_get_type() +} public init(from gtkEnum: GtkIconSize) { switch gtkEnum { case GTK_ICON_SIZE_INVALID: - self = .invalid - case GTK_ICON_SIZE_MENU: - self = .menu - case GTK_ICON_SIZE_SMALL_TOOLBAR: - self = .smallToolbar - case GTK_ICON_SIZE_LARGE_TOOLBAR: - self = .largeToolbar - case GTK_ICON_SIZE_BUTTON: - self = .button - case GTK_ICON_SIZE_DND: - self = .dnd - case GTK_ICON_SIZE_DIALOG: - self = .dialog + self = .invalid +case GTK_ICON_SIZE_MENU: + self = .menu +case GTK_ICON_SIZE_SMALL_TOOLBAR: + self = .smallToolbar +case GTK_ICON_SIZE_LARGE_TOOLBAR: + self = .largeToolbar +case GTK_ICON_SIZE_BUTTON: + self = .button +case GTK_ICON_SIZE_DND: + self = .dnd +case GTK_ICON_SIZE_DIALOG: + self = .dialog default: fatalError("Unsupported GtkIconSize enum value: \(gtkEnum.rawValue)") } @@ -47,19 +47,19 @@ public enum IconSize: GValueRepresentableEnum { public func toGtk() -> GtkIconSize { switch self { case .invalid: - return GTK_ICON_SIZE_INVALID - case .menu: - return GTK_ICON_SIZE_MENU - case .smallToolbar: - return GTK_ICON_SIZE_SMALL_TOOLBAR - case .largeToolbar: - return GTK_ICON_SIZE_LARGE_TOOLBAR - case .button: - return GTK_ICON_SIZE_BUTTON - case .dnd: - return GTK_ICON_SIZE_DND - case .dialog: - return GTK_ICON_SIZE_DIALOG + return GTK_ICON_SIZE_INVALID +case .menu: + return GTK_ICON_SIZE_MENU +case .smallToolbar: + return GTK_ICON_SIZE_SMALL_TOOLBAR +case .largeToolbar: + return GTK_ICON_SIZE_LARGE_TOOLBAR +case .button: + return GTK_ICON_SIZE_BUTTON +case .dnd: + return GTK_ICON_SIZE_DND +case .dialog: + return GTK_ICON_SIZE_DIALOG } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/IconThemeError.swift b/Sources/Gtk3/Generated/IconThemeError.swift index c26e9f5703..14ef2fd915 100644 --- a/Sources/Gtk3/Generated/IconThemeError.swift +++ b/Sources/Gtk3/Generated/IconThemeError.swift @@ -5,20 +5,20 @@ public enum IconThemeError: GValueRepresentableEnum { public typealias GtkEnum = GtkIconThemeError /// The icon specified does not exist in the theme - case notFound - /// An unspecified error occurred. - case failed +case notFound +/// An unspecified error occurred. +case failed public static var type: GType { - gtk_icon_theme_error_get_type() - } + gtk_icon_theme_error_get_type() +} public init(from gtkEnum: GtkIconThemeError) { switch gtkEnum { case GTK_ICON_THEME_NOT_FOUND: - self = .notFound - case GTK_ICON_THEME_FAILED: - self = .failed + self = .notFound +case GTK_ICON_THEME_FAILED: + self = .failed default: fatalError("Unsupported GtkIconThemeError enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ public enum IconThemeError: GValueRepresentableEnum { public func toGtk() -> GtkIconThemeError { switch self { case .notFound: - return GTK_ICON_THEME_NOT_FOUND - case .failed: - return GTK_ICON_THEME_FAILED + return GTK_ICON_THEME_NOT_FOUND +case .failed: + return GTK_ICON_THEME_FAILED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/IconViewDropPosition.swift b/Sources/Gtk3/Generated/IconViewDropPosition.swift index 4d3258affe..0c06738f27 100644 --- a/Sources/Gtk3/Generated/IconViewDropPosition.swift +++ b/Sources/Gtk3/Generated/IconViewDropPosition.swift @@ -5,36 +5,36 @@ public enum IconViewDropPosition: GValueRepresentableEnum { public typealias GtkEnum = GtkIconViewDropPosition /// No drop possible - case noDrop - /// Dropped item replaces the item - case dropInto - /// Droppped item is inserted to the left - case dropLeft - /// Dropped item is inserted to the right - case dropRight - /// Dropped item is inserted above - case dropAbove - /// Dropped item is inserted below - case dropBelow +case noDrop +/// Dropped item replaces the item +case dropInto +/// Droppped item is inserted to the left +case dropLeft +/// Dropped item is inserted to the right +case dropRight +/// Dropped item is inserted above +case dropAbove +/// Dropped item is inserted below +case dropBelow public static var type: GType { - gtk_icon_view_drop_position_get_type() - } + gtk_icon_view_drop_position_get_type() +} public init(from gtkEnum: GtkIconViewDropPosition) { switch gtkEnum { case GTK_ICON_VIEW_NO_DROP: - self = .noDrop - case GTK_ICON_VIEW_DROP_INTO: - self = .dropInto - case GTK_ICON_VIEW_DROP_LEFT: - self = .dropLeft - case GTK_ICON_VIEW_DROP_RIGHT: - self = .dropRight - case GTK_ICON_VIEW_DROP_ABOVE: - self = .dropAbove - case GTK_ICON_VIEW_DROP_BELOW: - self = .dropBelow + self = .noDrop +case GTK_ICON_VIEW_DROP_INTO: + self = .dropInto +case GTK_ICON_VIEW_DROP_LEFT: + self = .dropLeft +case GTK_ICON_VIEW_DROP_RIGHT: + self = .dropRight +case GTK_ICON_VIEW_DROP_ABOVE: + self = .dropAbove +case GTK_ICON_VIEW_DROP_BELOW: + self = .dropBelow default: fatalError("Unsupported GtkIconViewDropPosition enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ public enum IconViewDropPosition: GValueRepresentableEnum { public func toGtk() -> GtkIconViewDropPosition { switch self { case .noDrop: - return GTK_ICON_VIEW_NO_DROP - case .dropInto: - return GTK_ICON_VIEW_DROP_INTO - case .dropLeft: - return GTK_ICON_VIEW_DROP_LEFT - case .dropRight: - return GTK_ICON_VIEW_DROP_RIGHT - case .dropAbove: - return GTK_ICON_VIEW_DROP_ABOVE - case .dropBelow: - return GTK_ICON_VIEW_DROP_BELOW + return GTK_ICON_VIEW_NO_DROP +case .dropInto: + return GTK_ICON_VIEW_DROP_INTO +case .dropLeft: + return GTK_ICON_VIEW_DROP_LEFT +case .dropRight: + return GTK_ICON_VIEW_DROP_RIGHT +case .dropAbove: + return GTK_ICON_VIEW_DROP_ABOVE +case .dropBelow: + return GTK_ICON_VIEW_DROP_BELOW } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/Image.swift b/Sources/Gtk3/Generated/Image.swift index f9570e9959..f97bce7ea9 100644 --- a/Sources/Gtk3/Generated/Image.swift +++ b/Sources/Gtk3/Generated/Image.swift @@ -15,21 +15,21 @@ import CGtk3 /// for example by displaying an error message, then load the image with /// gdk_pixbuf_new_from_file(), then create the #GtkImage with /// gtk_image_new_from_pixbuf(). -/// +/// /// The image file may contain an animation, if so the #GtkImage will /// display an animation (#GdkPixbufAnimation) instead of a static image. -/// +/// /// #GtkImage is a subclass of #GtkMisc, which implies that you can /// align it (center, left, right) and add padding to it, using /// #GtkMisc methods. -/// +/// /// #GtkImage is a “no window” widget (has no #GdkWindow of its own), /// so by default does not receive events. If you want to receive events /// on the image, such as button clicks, place the image inside a /// #GtkEventBox, then connect to the event signals on the event box. -/// +/// /// ## Handling button press events on a #GtkImage. -/// +/// /// |[ /// static gboolean /// button_press_callback (GtkWidget *event_box, @@ -38,311 +38,300 @@ import CGtk3 /// { /// g_print ("Event box clicked at coordinates %f,%f\n", /// event->x, event->y); -/// +/// /// // Returning TRUE means we handled the event, so the signal /// // emission should be stopped (don’t call any further callbacks /// // that may be connected). Return FALSE to continue invoking callbacks. /// return TRUE; /// } -/// +/// /// static GtkWidget* /// create_image (void) /// { /// GtkWidget *image; /// GtkWidget *event_box; -/// +/// /// image = gtk_image_new_from_file ("myfile.png"); -/// +/// /// event_box = gtk_event_box_new (); -/// +/// /// gtk_container_add (GTK_CONTAINER (event_box), image); -/// +/// /// g_signal_connect (G_OBJECT (event_box), /// "button_press_event", /// G_CALLBACK (button_press_callback), /// image); -/// +/// /// return image; /// } /// ]| -/// +/// /// When handling events on the event box, keep in mind that coordinates /// in the image may be different from event box coordinates due to /// the alignment and padding settings on the image (see #GtkMisc). /// The simplest way to solve this is to set the alignment to 0.0 /// (left/top), and set the padding to zero. Then the origin of /// the image will be the same as the origin of the event box. -/// +/// /// Sometimes an application will want to avoid depending on external data /// files, such as image files. GTK+ comes with a program to avoid this, /// called “gdk-pixbuf-csource”. This library /// allows you to convert an image into a C variable declaration, which /// can then be loaded into a #GdkPixbuf using /// gdk_pixbuf_new_from_inline(). -/// +/// /// # CSS nodes -/// +/// /// GtkImage has a single CSS node with the name image. The style classes /// may appear on image CSS nodes: .icon-dropshadow, .lowres-icon. open class Image: Misc { /// Creates a new empty #GtkImage widget. - public convenience init() { - self.init( - gtk_image_new() - ) +public convenience init() { + self.init( + gtk_image_new() + ) +} + +/// Creates a new #GtkImage displaying the file @filename. If the file +/// isn’t found or can’t be loaded, the resulting #GtkImage will +/// display a “broken image” icon. This function never returns %NULL, +/// it always returns a valid #GtkImage widget. +/// +/// If the file contains an animation, the image will contain an +/// animation. +/// +/// If you need to detect failures to load the file, use +/// gdk_pixbuf_new_from_file() to load the file yourself, then create +/// the #GtkImage from the pixbuf. (Or for animations, use +/// gdk_pixbuf_animation_new_from_file()). +/// +/// The storage type (gtk_image_get_storage_type()) of the returned +/// image is not defined, it will be whatever is appropriate for +/// displaying the file. +public convenience init(filename: String) { + self.init( + gtk_image_new_from_file(filename) + ) +} + +/// Creates a #GtkImage displaying an icon from the current icon theme. +/// If the icon name isn’t known, a “broken image” icon will be +/// displayed instead. If the current icon theme is changed, the icon +/// will be updated appropriately. +public convenience init(icon: OpaquePointer, size: GtkIconSize) { + self.init( + gtk_image_new_from_gicon(icon, size) + ) +} + +/// Creates a #GtkImage displaying an icon from the current icon theme. +/// If the icon name isn’t known, a “broken image” icon will be +/// displayed instead. If the current icon theme is changed, the icon +/// will be updated appropriately. +public convenience init(iconName: String, size: GtkIconSize) { + self.init( + gtk_image_new_from_icon_name(iconName, size) + ) +} + +/// Creates a new #GtkImage displaying the resource file @resource_path. If the file +/// isn’t found or can’t be loaded, the resulting #GtkImage will +/// display a “broken image” icon. This function never returns %NULL, +/// it always returns a valid #GtkImage widget. +/// +/// If the file contains an animation, the image will contain an +/// animation. +/// +/// If you need to detect failures to load the file, use +/// gdk_pixbuf_new_from_file() to load the file yourself, then create +/// the #GtkImage from the pixbuf. (Or for animations, use +/// gdk_pixbuf_animation_new_from_file()). +/// +/// The storage type (gtk_image_get_storage_type()) of the returned +/// image is not defined, it will be whatever is appropriate for +/// displaying the file. +public convenience init(resourcePath: String) { + self.init( + gtk_image_new_from_resource(resourcePath) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new #GtkImage displaying the file @filename. If the file - /// isn’t found or can’t be loaded, the resulting #GtkImage will - /// display a “broken image” icon. This function never returns %NULL, - /// it always returns a valid #GtkImage widget. - /// - /// If the file contains an animation, the image will contain an - /// animation. - /// - /// If you need to detect failures to load the file, use - /// gdk_pixbuf_new_from_file() to load the file yourself, then create - /// the #GtkImage from the pixbuf. (Or for animations, use - /// gdk_pixbuf_animation_new_from_file()). - /// - /// The storage type (gtk_image_get_storage_type()) of the returned - /// image is not defined, it will be whatever is appropriate for - /// displaying the file. - public convenience init(filename: String) { - self.init( - gtk_image_new_from_file(filename) - ) +addSignal(name: "notify::file", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFile?(self, param0) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a #GtkImage displaying an icon from the current icon theme. - /// If the icon name isn’t known, a “broken image” icon will be - /// displayed instead. If the current icon theme is changed, the icon - /// will be updated appropriately. - public convenience init(icon: OpaquePointer, size: GtkIconSize) { - self.init( - gtk_image_new_from_gicon(icon, size) - ) +addSignal(name: "notify::gicon", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyGicon?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a #GtkImage displaying an icon from the current icon theme. - /// If the icon name isn’t known, a “broken image” icon will be - /// displayed instead. If the current icon theme is changed, the icon - /// will be updated appropriately. - public convenience init(iconName: String, size: GtkIconSize) { - self.init( - gtk_image_new_from_icon_name(iconName, size) - ) +addSignal(name: "notify::icon-name", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIconName?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new #GtkImage displaying the resource file @resource_path. If the file - /// isn’t found or can’t be loaded, the resulting #GtkImage will - /// display a “broken image” icon. This function never returns %NULL, - /// it always returns a valid #GtkImage widget. - /// - /// If the file contains an animation, the image will contain an - /// animation. - /// - /// If you need to detect failures to load the file, use - /// gdk_pixbuf_new_from_file() to load the file yourself, then create - /// the #GtkImage from the pixbuf. (Or for animations, use - /// gdk_pixbuf_animation_new_from_file()). - /// - /// The storage type (gtk_image_get_storage_type()) of the returned - /// image is not defined, it will be whatever is appropriate for - /// displaying the file. - public convenience init(resourcePath: String) { - self.init( - gtk_image_new_from_resource(resourcePath) - ) +addSignal(name: "notify::icon-set", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIconSet?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::file", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFile?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::gicon", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyGicon?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::icon-name", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIconName?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::icon-set", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIconSet?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::icon-size", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIconSize?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::pixbuf", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPixbuf?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::pixbuf-animation", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPixbufAnimation?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::pixel-size", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPixelSize?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::resource", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyResource?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::stock", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyStock?(self, param0) - } - - let handler10: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::storage-type", handler: gCallback(handler10)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyStorageType?(self, param0) - } - - let handler11: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::surface", handler: gCallback(handler11)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySurface?(self, param0) - } - - let handler12: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-fallback", handler: gCallback(handler12)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseFallback?(self, param0) - } +addSignal(name: "notify::icon-size", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIconSize?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - @GObjectProperty(named: "stock") public var stock: String +addSignal(name: "notify::pixbuf", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPixbuf?(self, param0) +} - @GObjectProperty(named: "storage-type") public var storageType: ImageType +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyFile: ((Image, OpaquePointer) -> Void)? +addSignal(name: "notify::pixbuf-animation", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPixbufAnimation?(self, param0) +} - public var notifyGicon: ((Image, OpaquePointer) -> Void)? +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyIconName: ((Image, OpaquePointer) -> Void)? +addSignal(name: "notify::pixel-size", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPixelSize?(self, param0) +} - public var notifyIconSet: ((Image, OpaquePointer) -> Void)? +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyIconSize: ((Image, OpaquePointer) -> Void)? +addSignal(name: "notify::resource", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyResource?(self, param0) +} - public var notifyPixbuf: ((Image, OpaquePointer) -> Void)? +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyPixbufAnimation: ((Image, OpaquePointer) -> Void)? +addSignal(name: "notify::stock", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyStock?(self, param0) +} - public var notifyPixelSize: ((Image, OpaquePointer) -> Void)? +let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyResource: ((Image, OpaquePointer) -> Void)? +addSignal(name: "notify::storage-type", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyStorageType?(self, param0) +} - public var notifyStock: ((Image, OpaquePointer) -> Void)? +let handler11: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyStorageType: ((Image, OpaquePointer) -> Void)? +addSignal(name: "notify::surface", handler: gCallback(handler11)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySurface?(self, param0) +} - public var notifySurface: ((Image, OpaquePointer) -> Void)? +let handler12: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyUseFallback: ((Image, OpaquePointer) -> Void)? +addSignal(name: "notify::use-fallback", handler: gCallback(handler12)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseFallback?(self, param0) } +} + + +@GObjectProperty(named: "stock") public var stock: String + + +@GObjectProperty(named: "storage-type") public var storageType: ImageType + + +public var notifyFile: ((Image, OpaquePointer) -> Void)? + + +public var notifyGicon: ((Image, OpaquePointer) -> Void)? + + +public var notifyIconName: ((Image, OpaquePointer) -> Void)? + + +public var notifyIconSet: ((Image, OpaquePointer) -> Void)? + + +public var notifyIconSize: ((Image, OpaquePointer) -> Void)? + + +public var notifyPixbuf: ((Image, OpaquePointer) -> Void)? + + +public var notifyPixbufAnimation: ((Image, OpaquePointer) -> Void)? + + +public var notifyPixelSize: ((Image, OpaquePointer) -> Void)? + + +public var notifyResource: ((Image, OpaquePointer) -> Void)? + + +public var notifyStock: ((Image, OpaquePointer) -> Void)? + + +public var notifyStorageType: ((Image, OpaquePointer) -> Void)? + + +public var notifySurface: ((Image, OpaquePointer) -> Void)? + + +public var notifyUseFallback: ((Image, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ImageType.swift b/Sources/Gtk3/Generated/ImageType.swift index 6689fda8e3..235d635baa 100644 --- a/Sources/Gtk3/Generated/ImageType.swift +++ b/Sources/Gtk3/Generated/ImageType.swift @@ -11,47 +11,47 @@ public enum ImageType: GValueRepresentableEnum { public typealias GtkEnum = GtkImageType /// There is no image displayed by the widget - case empty - /// The widget contains a #GdkPixbuf - case pixbuf - /// The widget contains a [stock item name][gtkstock] - case stock - /// The widget contains a #GtkIconSet - case iconSet - /// The widget contains a #GdkPixbufAnimation - case animation - /// The widget contains a named icon. - /// This image type was added in GTK+ 2.6 - case iconName - /// The widget contains a #GIcon. - /// This image type was added in GTK+ 2.14 - case gicon - /// The widget contains a #cairo_surface_t. - /// This image type was added in GTK+ 3.10 - case surface +case empty +/// The widget contains a #GdkPixbuf +case pixbuf +/// The widget contains a [stock item name][gtkstock] +case stock +/// The widget contains a #GtkIconSet +case iconSet +/// The widget contains a #GdkPixbufAnimation +case animation +/// The widget contains a named icon. +/// This image type was added in GTK+ 2.6 +case iconName +/// The widget contains a #GIcon. +/// This image type was added in GTK+ 2.14 +case gicon +/// The widget contains a #cairo_surface_t. +/// This image type was added in GTK+ 3.10 +case surface public static var type: GType { - gtk_image_type_get_type() - } + gtk_image_type_get_type() +} public init(from gtkEnum: GtkImageType) { switch gtkEnum { case GTK_IMAGE_EMPTY: - self = .empty - case GTK_IMAGE_PIXBUF: - self = .pixbuf - case GTK_IMAGE_STOCK: - self = .stock - case GTK_IMAGE_ICON_SET: - self = .iconSet - case GTK_IMAGE_ANIMATION: - self = .animation - case GTK_IMAGE_ICON_NAME: - self = .iconName - case GTK_IMAGE_GICON: - self = .gicon - case GTK_IMAGE_SURFACE: - self = .surface + self = .empty +case GTK_IMAGE_PIXBUF: + self = .pixbuf +case GTK_IMAGE_STOCK: + self = .stock +case GTK_IMAGE_ICON_SET: + self = .iconSet +case GTK_IMAGE_ANIMATION: + self = .animation +case GTK_IMAGE_ICON_NAME: + self = .iconName +case GTK_IMAGE_GICON: + self = .gicon +case GTK_IMAGE_SURFACE: + self = .surface default: fatalError("Unsupported GtkImageType enum value: \(gtkEnum.rawValue)") } @@ -60,21 +60,21 @@ public enum ImageType: GValueRepresentableEnum { public func toGtk() -> GtkImageType { switch self { case .empty: - return GTK_IMAGE_EMPTY - case .pixbuf: - return GTK_IMAGE_PIXBUF - case .stock: - return GTK_IMAGE_STOCK - case .iconSet: - return GTK_IMAGE_ICON_SET - case .animation: - return GTK_IMAGE_ANIMATION - case .iconName: - return GTK_IMAGE_ICON_NAME - case .gicon: - return GTK_IMAGE_GICON - case .surface: - return GTK_IMAGE_SURFACE + return GTK_IMAGE_EMPTY +case .pixbuf: + return GTK_IMAGE_PIXBUF +case .stock: + return GTK_IMAGE_STOCK +case .iconSet: + return GTK_IMAGE_ICON_SET +case .animation: + return GTK_IMAGE_ANIMATION +case .iconName: + return GTK_IMAGE_ICON_NAME +case .gicon: + return GTK_IMAGE_GICON +case .surface: + return GTK_IMAGE_SURFACE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/Justification.swift b/Sources/Gtk3/Generated/Justification.swift index e9ea30c615..8da8a9b5b8 100644 --- a/Sources/Gtk3/Generated/Justification.swift +++ b/Sources/Gtk3/Generated/Justification.swift @@ -6,28 +6,28 @@ public enum Justification: GValueRepresentableEnum { public typealias GtkEnum = GtkJustification /// The text is placed at the left edge of the label. - case left - /// The text is placed at the right edge of the label. - case right - /// The text is placed in the center of the label. - case center - /// The text is placed is distributed across the label. - case fill +case left +/// The text is placed at the right edge of the label. +case right +/// The text is placed in the center of the label. +case center +/// The text is placed is distributed across the label. +case fill public static var type: GType { - gtk_justification_get_type() - } + gtk_justification_get_type() +} public init(from gtkEnum: GtkJustification) { switch gtkEnum { case GTK_JUSTIFY_LEFT: - self = .left - case GTK_JUSTIFY_RIGHT: - self = .right - case GTK_JUSTIFY_CENTER: - self = .center - case GTK_JUSTIFY_FILL: - self = .fill + self = .left +case GTK_JUSTIFY_RIGHT: + self = .right +case GTK_JUSTIFY_CENTER: + self = .center +case GTK_JUSTIFY_FILL: + self = .fill default: fatalError("Unsupported GtkJustification enum value: \(gtkEnum.rawValue)") } @@ -36,13 +36,13 @@ public enum Justification: GValueRepresentableEnum { public func toGtk() -> GtkJustification { switch self { case .left: - return GTK_JUSTIFY_LEFT - case .right: - return GTK_JUSTIFY_RIGHT - case .center: - return GTK_JUSTIFY_CENTER - case .fill: - return GTK_JUSTIFY_FILL + return GTK_JUSTIFY_LEFT +case .right: + return GTK_JUSTIFY_RIGHT +case .center: + return GTK_JUSTIFY_CENTER +case .fill: + return GTK_JUSTIFY_FILL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/Label.swift b/Sources/Gtk3/Generated/Label.swift index fbb6155cd5..0d9e2f542c 100644 --- a/Sources/Gtk3/Generated/Label.swift +++ b/Sources/Gtk3/Generated/Label.swift @@ -3,9 +3,9 @@ import CGtk3 /// The #GtkLabel widget displays a small amount of text. As the name /// implies, most labels are used to label another widget such as a /// #GtkButton, a #GtkMenuItem, or a #GtkComboBox. -/// +/// /// # CSS nodes -/// +/// /// |[ /// label /// ├── [selection] @@ -13,99 +13,99 @@ import CGtk3 /// ┊ /// ╰── [link] /// ]| -/// +/// /// GtkLabel has a single CSS node with the name label. A wide variety /// of style classes may be applied to labels, such as .title, .subtitle, /// .dim-label, etc. In the #GtkShortcutsWindow, labels are used wth the /// .keycap style class. -/// +/// /// If the label has a selection, it gets a subnode with name selection. -/// +/// /// If the label has links, there is one subnode per link. These subnodes /// carry the link or visited state depending on whether they have been /// visited. -/// +/// /// # GtkLabel as GtkBuildable -/// +/// /// The GtkLabel implementation of the GtkBuildable interface supports a /// custom `` element, which supports any number of `` /// elements. The `` element has attributes named “name“, “value“, /// “start“ and “end“ and allows you to specify #PangoAttribute values for /// this label. -/// +/// /// An example of a UI definition fragment specifying Pango attributes: -/// +/// /// |[ /// ]| -/// +/// /// The start and end attributes specify the range of characters to which the /// Pango attribute applies. If start and end are not specified, the attribute is /// applied to the whole text. Note that specifying ranges does not make much /// sense with translatable attributes. Use markup embedded in the translatable /// content instead. -/// +/// /// # Mnemonics -/// +/// /// Labels may contain “mnemonics”. Mnemonics are /// underlined characters in the label, used for keyboard navigation. /// Mnemonics are created by providing a string with an underscore before /// the mnemonic character, such as `"_File"`, to the /// functions gtk_label_new_with_mnemonic() or /// gtk_label_set_text_with_mnemonic(). -/// +/// /// Mnemonics automatically activate any activatable widget the label is /// inside, such as a #GtkButton; if the label is not inside the /// mnemonic’s target widget, you have to tell the label about the target /// using gtk_label_set_mnemonic_widget(). Here’s a simple example where /// the label is inside a button: -/// +/// /// |[ /// // Pressing Alt+H will activate this button /// GtkWidget *button = gtk_button_new (); /// GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello"); /// gtk_container_add (GTK_CONTAINER (button), label); /// ]| -/// +/// /// There’s a convenience function to create buttons with a mnemonic label /// already inside: -/// +/// /// |[ /// // Pressing Alt+H will activate this button /// GtkWidget *button = gtk_button_new_with_mnemonic ("_Hello"); /// ]| -/// +/// /// To create a mnemonic for a widget alongside the label, such as a /// #GtkEntry, you have to point the label at the entry with /// gtk_label_set_mnemonic_widget(): -/// +/// /// |[ /// // Pressing Alt+H will focus the entry /// GtkWidget *entry = gtk_entry_new (); /// GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello"); /// gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry); /// ]| -/// +/// /// # Markup (styled text) -/// +/// /// To make it easy to format text in a label (changing colors, /// fonts, etc.), label text can be provided in a simple /// [markup format][PangoMarkupFormat]. -/// +/// /// Here’s how to create a label with a small font: /// |[ /// GtkWidget *label = gtk_label_new (NULL); /// gtk_label_set_markup (GTK_LABEL (label), "Small text"); /// ]| -/// +/// /// (See [complete documentation][PangoMarkupFormat] of available /// tags in the Pango manual.) -/// +/// /// The markup passed to gtk_label_set_markup() must be valid; for example, /// literal <, > and & characters must be escaped as <, >, and &. /// If you pass text obtained from the user, file, or a network to /// gtk_label_set_markup(), you’ll want to escape it with /// g_markup_escape_text() or g_markup_printf_escaped(). -/// +/// /// Markup strings are just a convenient way to set the #PangoAttrList on /// a label; gtk_label_set_attributes() may be a simpler way to set /// attributes in some cases. Be careful though; #PangoAttrList tends to @@ -114,29 +114,29 @@ import CGtk3 /// to [0, %G_MAXINT)). The reason is that specifying the start_index and /// end_index for a #PangoAttribute requires knowledge of the exact string /// being displayed, so translations will cause problems. -/// +/// /// # Selectable labels -/// +/// /// Labels can be made selectable with gtk_label_set_selectable(). /// Selectable labels allow the user to copy the label contents to /// the clipboard. Only labels that contain useful-to-copy information /// — such as error messages — should be made selectable. -/// +/// /// # Text layout # {#label-text-layout} -/// +/// /// A label can contain any number of paragraphs, but will have /// performance problems if it contains more than a small number. /// Paragraphs are separated by newlines or other paragraph separators /// understood by Pango. -/// +/// /// Labels can automatically wrap text if you call /// gtk_label_set_line_wrap(). -/// +/// /// gtk_label_set_justify() sets how the lines in a label align /// with one another. If you want to set how the label as a whole /// aligns in its available space, see the #GtkWidget:halign and /// #GtkWidget:valign properties. -/// +/// /// The #GtkLabel:width-chars and #GtkLabel:max-width-chars properties /// can be used to control the size allocation of ellipsized or wrapped /// labels. For ellipsizing labels, if either is specified (and less @@ -145,21 +145,21 @@ import CGtk3 /// width-chars is used as the minimum width, if specified, and max-width-chars /// is used as the natural width. Even if max-width-chars specified, wrapping /// labels will be rewrapped to use all of the available width. -/// +/// /// Note that the interpretation of #GtkLabel:width-chars and /// #GtkLabel:max-width-chars has changed a bit with the introduction of /// [width-for-height geometry management.][geometry-management] -/// +/// /// # Links -/// +/// /// Since 2.18, GTK+ supports markup for clickable hyperlinks in addition /// to regular Pango markup. The markup for links is borrowed from HTML, /// using the `` with “href“ and “title“ attributes. GTK+ renders links /// similar to the way they appear in web browsers, with colored, underlined /// text. The “title“ attribute is displayed as a tooltip on the link. -/// +/// /// An example looks like this: -/// +/// /// |[ /// const gchar *text = /// "Go to the" @@ -168,433 +168,410 @@ import CGtk3 /// GtkWidget *label = gtk_label_new (NULL); /// gtk_label_set_markup (GTK_LABEL (label), text); /// ]| -/// +/// /// It is possible to implement custom handling for links and their tooltips with /// the #GtkLabel::activate-link signal and the gtk_label_get_current_uri() function. open class Label: Misc { /// Creates a new label with the given text inside it. You can - /// pass %NULL to get an empty label widget. - public convenience init(string: String) { - self.init( - gtk_label_new(string) - ) +/// pass %NULL to get an empty label widget. +public convenience init(string: String) { + self.init( + gtk_label_new(string) + ) +} + +/// Creates a new #GtkLabel, containing the text in @str. +/// +/// If characters in @str are preceded by an underscore, they are +/// underlined. If you need a literal underscore character in a label, use +/// '__' (two underscores). The first underlined character represents a +/// keyboard accelerator called a mnemonic. The mnemonic key can be used +/// to activate another widget, chosen automatically, or explicitly using +/// gtk_label_set_mnemonic_widget(). +/// +/// If gtk_label_set_mnemonic_widget() is not called, then the first +/// activatable ancestor of the #GtkLabel will be chosen as the mnemonic +/// widget. For instance, if the label is inside a button or menu item, +/// the button or menu item will automatically become the mnemonic widget +/// and be activated by the mnemonic. +public convenience init(mnemonic string: String) { + self.init( + gtk_label_new_with_mnemonic(string) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate-current-link") { [weak self] () in + guard let self = self else { return } + self.activateCurrentLink?(self) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1>.run(data, value1) + } + +addSignal(name: "activate-link", handler: gCallback(handler1)) { [weak self] (param0: UnsafePointer) in + guard let self = self else { return } + self.activateLink?(self, param0) +} + +addSignal(name: "copy-clipboard") { [weak self] () in + guard let self = self else { return } + self.copyClipboard?(self) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, value3, data in + SignalBox3.run(data, value1, value2, value3) + } + +addSignal(name: "move-cursor", handler: gCallback(handler3)) { [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool) in + guard let self = self else { return } + self.moveCursor?(self, param0, param1, param2) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::angle", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAngle?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new #GtkLabel, containing the text in @str. - /// - /// If characters in @str are preceded by an underscore, they are - /// underlined. If you need a literal underscore character in a label, use - /// '__' (two underscores). The first underlined character represents a - /// keyboard accelerator called a mnemonic. The mnemonic key can be used - /// to activate another widget, chosen automatically, or explicitly using - /// gtk_label_set_mnemonic_widget(). - /// - /// If gtk_label_set_mnemonic_widget() is not called, then the first - /// activatable ancestor of the #GtkLabel will be chosen as the mnemonic - /// widget. For instance, if the label is inside a button or menu item, - /// the button or menu item will automatically become the mnemonic widget - /// and be activated by the mnemonic. - public convenience init(mnemonic string: String) { - self.init( - gtk_label_new_with_mnemonic(string) - ) +addSignal(name: "notify::attributes", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAttributes?(self, param0) +} + +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::cursor-position", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCursorPosition?(self, param0) +} + +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::ellipsize", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEllipsize?(self, param0) +} + +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate-current-link") { [weak self] () in - guard let self = self else { return } - self.activateCurrentLink?(self) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) - -> Void = - { _, value1, data in - SignalBox1>.run(data, value1) - } - - addSignal(name: "activate-link", handler: gCallback(handler1)) { - [weak self] (param0: UnsafePointer) in - guard let self = self else { return } - self.activateLink?(self, param0) - } - - addSignal(name: "copy-clipboard") { [weak self] () in - guard let self = self else { return } - self.copyClipboard?(self) - } - - let handler3: - @convention(c) ( - UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, UnsafeMutableRawPointer - ) -> Void = - { _, value1, value2, value3, data in - SignalBox3.run(data, value1, value2, value3) - } - - addSignal(name: "move-cursor", handler: gCallback(handler3)) { - [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool) in - guard let self = self else { return } - self.moveCursor?(self, param0, param1, param2) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::angle", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAngle?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::attributes", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAttributes?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::cursor-position", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCursorPosition?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::ellipsize", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEllipsize?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::justify", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyJustify?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::label", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLabel?(self, param0) - } - - let handler10: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::lines", handler: gCallback(handler10)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLines?(self, param0) - } - - let handler11: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::max-width-chars", handler: gCallback(handler11)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMaxWidthChars?(self, param0) - } - - let handler12: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::mnemonic-keyval", handler: gCallback(handler12)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMnemonicKeyval?(self, param0) - } - - let handler13: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::pattern", handler: gCallback(handler13)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPattern?(self, param0) - } - - let handler14: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::selectable", handler: gCallback(handler14)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectable?(self, param0) - } - - let handler15: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::selection-bound", handler: gCallback(handler15)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectionBound?(self, param0) - } - - let handler16: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::single-line-mode", handler: gCallback(handler16)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySingleLineMode?(self, param0) - } - - let handler17: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::track-visited-links", handler: gCallback(handler17)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTrackVisitedLinks?(self, param0) - } - - let handler18: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-markup", handler: gCallback(handler18)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseMarkup?(self, param0) - } - - let handler19: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-underline", handler: gCallback(handler19)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseUnderline?(self, param0) - } - - let handler20: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::width-chars", handler: gCallback(handler20)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWidthChars?(self, param0) - } - - let handler21: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::wrap", handler: gCallback(handler21)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWrap?(self, param0) - } - - let handler22: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::wrap-mode", handler: gCallback(handler22)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWrapMode?(self, param0) - } - - let handler23: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::xalign", handler: gCallback(handler23)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyXalign?(self, param0) - } - - let handler24: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::yalign", handler: gCallback(handler24)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyYalign?(self, param0) - } +addSignal(name: "notify::justify", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyJustify?(self, param0) +} + +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - @GObjectProperty(named: "justify") public var justify: Justification +addSignal(name: "notify::label", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLabel?(self, param0) +} - /// The contents of the label. - /// - /// If the string contains [Pango XML markup][PangoMarkupFormat], you will - /// have to set the #GtkLabel:use-markup property to %TRUE in order for the - /// label to display the markup attributes. See also gtk_label_set_markup() - /// for a convenience function that sets both this property and the - /// #GtkLabel:use-markup property at the same time. - /// - /// If the string contains underlines acting as mnemonics, you will have to - /// set the #GtkLabel:use-underline property to %TRUE in order for the label - /// to display them. - @GObjectProperty(named: "label") public var label: String +let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - @GObjectProperty(named: "mnemonic-keyval") public var mnemonicKeyval: UInt +addSignal(name: "notify::lines", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLines?(self, param0) +} - @GObjectProperty(named: "selectable") public var selectable: Bool +let handler11: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - @GObjectProperty(named: "use-markup") public var useMarkup: Bool +addSignal(name: "notify::max-width-chars", handler: gCallback(handler11)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMaxWidthChars?(self, param0) +} - @GObjectProperty(named: "use-underline") public var useUnderline: Bool +let handler12: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// A [keybinding signal][GtkBindingSignal] - /// which gets emitted when the user activates a link in the label. - /// - /// Applications may also emit the signal with g_signal_emit_by_name() - /// if they need to control activation of URIs programmatically. - /// - /// The default bindings for this signal are all forms of the Enter key. - public var activateCurrentLink: ((Label) -> Void)? +addSignal(name: "notify::mnemonic-keyval", handler: gCallback(handler12)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMnemonicKeyval?(self, param0) +} - /// The signal which gets emitted to activate a URI. - /// Applications may connect to it to override the default behaviour, - /// which is to call gtk_show_uri_on_window(). - public var activateLink: ((Label, UnsafePointer) -> Void)? +let handler13: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// The ::copy-clipboard signal is a - /// [keybinding signal][GtkBindingSignal] - /// which gets emitted to copy the selection to the clipboard. - /// - /// The default binding for this signal is Ctrl-c. - public var copyClipboard: ((Label) -> Void)? +addSignal(name: "notify::pattern", handler: gCallback(handler13)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPattern?(self, param0) +} - /// The ::move-cursor signal is a - /// [keybinding signal][GtkBindingSignal] - /// which gets emitted when the user initiates a cursor movement. - /// If the cursor is not visible in @entry, this signal causes - /// the viewport to be moved instead. - /// - /// Applications should not connect to it, but may emit it with - /// g_signal_emit_by_name() if they need to control the cursor - /// programmatically. - /// - /// The default bindings for this signal come in two variants, - /// the variant with the Shift modifier extends the selection, - /// the variant without the Shift modifer does not. - /// There are too many key combinations to list them all here. - /// - Arrow keys move by individual characters/lines - /// - Ctrl-arrow key combinations move by words/paragraphs - /// - Home/End keys move to the ends of the buffer - public var moveCursor: ((Label, GtkMovementStep, Int, Bool) -> Void)? +let handler14: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyAngle: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::selectable", handler: gCallback(handler14)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectable?(self, param0) +} - public var notifyAttributes: ((Label, OpaquePointer) -> Void)? +let handler15: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyCursorPosition: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::selection-bound", handler: gCallback(handler15)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectionBound?(self, param0) +} - public var notifyEllipsize: ((Label, OpaquePointer) -> Void)? +let handler16: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyJustify: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::single-line-mode", handler: gCallback(handler16)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySingleLineMode?(self, param0) +} - public var notifyLabel: ((Label, OpaquePointer) -> Void)? +let handler17: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyLines: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::track-visited-links", handler: gCallback(handler17)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTrackVisitedLinks?(self, param0) +} - public var notifyMaxWidthChars: ((Label, OpaquePointer) -> Void)? +let handler18: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyMnemonicKeyval: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::use-markup", handler: gCallback(handler18)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseMarkup?(self, param0) +} - public var notifyPattern: ((Label, OpaquePointer) -> Void)? +let handler19: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySelectable: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::use-underline", handler: gCallback(handler19)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseUnderline?(self, param0) +} - public var notifySelectionBound: ((Label, OpaquePointer) -> Void)? +let handler20: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifySingleLineMode: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::width-chars", handler: gCallback(handler20)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWidthChars?(self, param0) +} - public var notifyTrackVisitedLinks: ((Label, OpaquePointer) -> Void)? +let handler21: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyUseMarkup: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::wrap", handler: gCallback(handler21)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWrap?(self, param0) +} - public var notifyUseUnderline: ((Label, OpaquePointer) -> Void)? +let handler22: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyWidthChars: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::wrap-mode", handler: gCallback(handler22)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWrapMode?(self, param0) +} - public var notifyWrap: ((Label, OpaquePointer) -> Void)? +let handler23: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyWrapMode: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::xalign", handler: gCallback(handler23)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyXalign?(self, param0) +} - public var notifyXalign: ((Label, OpaquePointer) -> Void)? +let handler24: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyYalign: ((Label, OpaquePointer) -> Void)? +addSignal(name: "notify::yalign", handler: gCallback(handler24)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyYalign?(self, param0) +} } + + +@GObjectProperty(named: "justify") public var justify: Justification + +/// The contents of the label. +/// +/// If the string contains [Pango XML markup][PangoMarkupFormat], you will +/// have to set the #GtkLabel:use-markup property to %TRUE in order for the +/// label to display the markup attributes. See also gtk_label_set_markup() +/// for a convenience function that sets both this property and the +/// #GtkLabel:use-markup property at the same time. +/// +/// If the string contains underlines acting as mnemonics, you will have to +/// set the #GtkLabel:use-underline property to %TRUE in order for the label +/// to display them. +@GObjectProperty(named: "label") public var label: String + + +@GObjectProperty(named: "mnemonic-keyval") public var mnemonicKeyval: UInt + + +@GObjectProperty(named: "selectable") public var selectable: Bool + + +@GObjectProperty(named: "use-markup") public var useMarkup: Bool + + +@GObjectProperty(named: "use-underline") public var useUnderline: Bool + +/// A [keybinding signal][GtkBindingSignal] +/// which gets emitted when the user activates a link in the label. +/// +/// Applications may also emit the signal with g_signal_emit_by_name() +/// if they need to control activation of URIs programmatically. +/// +/// The default bindings for this signal are all forms of the Enter key. +public var activateCurrentLink: ((Label) -> Void)? + +/// The signal which gets emitted to activate a URI. +/// Applications may connect to it to override the default behaviour, +/// which is to call gtk_show_uri_on_window(). +public var activateLink: ((Label, UnsafePointer) -> Void)? + +/// The ::copy-clipboard signal is a +/// [keybinding signal][GtkBindingSignal] +/// which gets emitted to copy the selection to the clipboard. +/// +/// The default binding for this signal is Ctrl-c. +public var copyClipboard: ((Label) -> Void)? + +/// The ::move-cursor signal is a +/// [keybinding signal][GtkBindingSignal] +/// which gets emitted when the user initiates a cursor movement. +/// If the cursor is not visible in @entry, this signal causes +/// the viewport to be moved instead. +/// +/// Applications should not connect to it, but may emit it with +/// g_signal_emit_by_name() if they need to control the cursor +/// programmatically. +/// +/// The default bindings for this signal come in two variants, +/// the variant with the Shift modifier extends the selection, +/// the variant without the Shift modifer does not. +/// There are too many key combinations to list them all here. +/// - Arrow keys move by individual characters/lines +/// - Ctrl-arrow key combinations move by words/paragraphs +/// - Home/End keys move to the ends of the buffer +public var moveCursor: ((Label, GtkMovementStep, Int, Bool) -> Void)? + + +public var notifyAngle: ((Label, OpaquePointer) -> Void)? + + +public var notifyAttributes: ((Label, OpaquePointer) -> Void)? + + +public var notifyCursorPosition: ((Label, OpaquePointer) -> Void)? + + +public var notifyEllipsize: ((Label, OpaquePointer) -> Void)? + + +public var notifyJustify: ((Label, OpaquePointer) -> Void)? + + +public var notifyLabel: ((Label, OpaquePointer) -> Void)? + + +public var notifyLines: ((Label, OpaquePointer) -> Void)? + + +public var notifyMaxWidthChars: ((Label, OpaquePointer) -> Void)? + + +public var notifyMnemonicKeyval: ((Label, OpaquePointer) -> Void)? + + +public var notifyPattern: ((Label, OpaquePointer) -> Void)? + + +public var notifySelectable: ((Label, OpaquePointer) -> Void)? + + +public var notifySelectionBound: ((Label, OpaquePointer) -> Void)? + + +public var notifySingleLineMode: ((Label, OpaquePointer) -> Void)? + + +public var notifyTrackVisitedLinks: ((Label, OpaquePointer) -> Void)? + + +public var notifyUseMarkup: ((Label, OpaquePointer) -> Void)? + + +public var notifyUseUnderline: ((Label, OpaquePointer) -> Void)? + + +public var notifyWidthChars: ((Label, OpaquePointer) -> Void)? + + +public var notifyWrap: ((Label, OpaquePointer) -> Void)? + + +public var notifyWrapMode: ((Label, OpaquePointer) -> Void)? + + +public var notifyXalign: ((Label, OpaquePointer) -> Void)? + + +public var notifyYalign: ((Label, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/MenuDirectionType.swift b/Sources/Gtk3/Generated/MenuDirectionType.swift index d1b1f2987f..687532a897 100644 --- a/Sources/Gtk3/Generated/MenuDirectionType.swift +++ b/Sources/Gtk3/Generated/MenuDirectionType.swift @@ -5,28 +5,28 @@ public enum MenuDirectionType: GValueRepresentableEnum { public typealias GtkEnum = GtkMenuDirectionType /// To the parent menu shell - case parent - /// To the submenu, if any, associated with the item - case child - /// To the next menu item - case next - /// To the previous menu item - case prev +case parent +/// To the submenu, if any, associated with the item +case child +/// To the next menu item +case next +/// To the previous menu item +case prev public static var type: GType { - gtk_menu_direction_type_get_type() - } + gtk_menu_direction_type_get_type() +} public init(from gtkEnum: GtkMenuDirectionType) { switch gtkEnum { case GTK_MENU_DIR_PARENT: - self = .parent - case GTK_MENU_DIR_CHILD: - self = .child - case GTK_MENU_DIR_NEXT: - self = .next - case GTK_MENU_DIR_PREV: - self = .prev + self = .parent +case GTK_MENU_DIR_CHILD: + self = .child +case GTK_MENU_DIR_NEXT: + self = .next +case GTK_MENU_DIR_PREV: + self = .prev default: fatalError("Unsupported GtkMenuDirectionType enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum MenuDirectionType: GValueRepresentableEnum { public func toGtk() -> GtkMenuDirectionType { switch self { case .parent: - return GTK_MENU_DIR_PARENT - case .child: - return GTK_MENU_DIR_CHILD - case .next: - return GTK_MENU_DIR_NEXT - case .prev: - return GTK_MENU_DIR_PREV + return GTK_MENU_DIR_PARENT +case .child: + return GTK_MENU_DIR_CHILD +case .next: + return GTK_MENU_DIR_NEXT +case .prev: + return GTK_MENU_DIR_PREV } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/MenuShell.swift b/Sources/Gtk3/Generated/MenuShell.swift index 1fb3f71e87..ccde9294b5 100644 --- a/Sources/Gtk3/Generated/MenuShell.swift +++ b/Sources/Gtk3/Generated/MenuShell.swift @@ -2,23 +2,23 @@ import CGtk3 /// A #GtkMenuShell is the abstract base class used to derive the /// #GtkMenu and #GtkMenuBar subclasses. -/// +/// /// A #GtkMenuShell is a container of #GtkMenuItem objects arranged /// in a list which can be navigated, selected, and activated by the /// user to perform application functions. A #GtkMenuItem can have a /// submenu associated with it, allowing for nested hierarchical menus. -/// +/// /// # Terminology -/// +/// /// A menu item can be “selected”, this means that it is displayed /// in the prelight state, and if it has a submenu, that submenu /// will be popped up. -/// +/// /// A menu is “active” when it is visible onscreen and the user /// is selecting from it. A menubar is not active until the user /// clicks on one of its menuitems. When a menu is active, /// passing the mouse over a submenu will pop it up. -/// +/// /// There is also is a concept of the current menu and a current /// menu item. The current menu item is the selected menu item /// that is furthest down in the hierarchy. (Every active menu shell @@ -28,135 +28,122 @@ import CGtk3 /// contains the current menu item. It will always have a GTK /// grab and receive all key presses. open class MenuShell: Container { + - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, Bool, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "activate-current", handler: gCallback(handler0)) { - [weak self] (param0: Bool) in - guard let self = self else { return } - self.activateCurrent?(self, param0) - } - - addSignal(name: "cancel") { [weak self] () in - guard let self = self else { return } - self.cancel?(self) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, GtkDirectionType, UnsafeMutableRawPointer) -> - Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "cycle-focus", handler: gCallback(handler2)) { - [weak self] (param0: GtkDirectionType) in - guard let self = self else { return } - self.cycleFocus?(self, param0) - } - - addSignal(name: "deactivate") { [weak self] () in - guard let self = self else { return } - self.deactivate?(self) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, GtkWidget, Int, UnsafeMutableRawPointer) -> - Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "insert", handler: gCallback(handler4)) { - [weak self] (param0: GtkWidget, param1: Int) in - guard let self = self else { return } - self.insert?(self, param0, param1) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, GtkMenuDirectionType, UnsafeMutableRawPointer) - -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "move-current", handler: gCallback(handler5)) { - [weak self] (param0: GtkMenuDirectionType) in - guard let self = self else { return } - self.moveCurrent?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "move-selected", handler: gCallback(handler6)) { - [weak self] (param0: Int) in - guard let self = self else { return } - self.moveSelected?(self, param0) - } - - addSignal(name: "selection-done") { [weak self] () in - guard let self = self else { return } - self.selectionDone?(self) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::take-focus", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTakeFocus?(self, param0) - } + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: @convention(c) (UnsafeMutableRawPointer, Bool, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// An action signal that activates the current menu item within - /// the menu shell. - public var activateCurrent: ((MenuShell, Bool) -> Void)? +addSignal(name: "activate-current", handler: gCallback(handler0)) { [weak self] (param0: Bool) in + guard let self = self else { return } + self.activateCurrent?(self, param0) +} + +addSignal(name: "cancel") { [weak self] () in + guard let self = self else { return } + self.cancel?(self) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, GtkDirectionType, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "cycle-focus", handler: gCallback(handler2)) { [weak self] (param0: GtkDirectionType) in + guard let self = self else { return } + self.cycleFocus?(self, param0) +} + +addSignal(name: "deactivate") { [weak self] () in + guard let self = self else { return } + self.deactivate?(self) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, GtkWidget, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } - /// An action signal which cancels the selection within the menu shell. - /// Causes the #GtkMenuShell::selection-done signal to be emitted. - public var cancel: ((MenuShell) -> Void)? +addSignal(name: "insert", handler: gCallback(handler4)) { [weak self] (param0: GtkWidget, param1: Int) in + guard let self = self else { return } + self.insert?(self, param0, param1) +} - /// A keybinding signal which moves the focus in the - /// given @direction. - public var cycleFocus: ((MenuShell, GtkDirectionType) -> Void)? +let handler5: @convention(c) (UnsafeMutableRawPointer, GtkMenuDirectionType, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// This signal is emitted when a menu shell is deactivated. - public var deactivate: ((MenuShell) -> Void)? +addSignal(name: "move-current", handler: gCallback(handler5)) { [weak self] (param0: GtkMenuDirectionType) in + guard let self = self else { return } + self.moveCurrent?(self, param0) +} - /// The ::insert signal is emitted when a new #GtkMenuItem is added to - /// a #GtkMenuShell. A separate signal is used instead of - /// GtkContainer::add because of the need for an additional position - /// parameter. - /// - /// The inverse of this signal is the GtkContainer::removed signal. - public var insert: ((MenuShell, GtkWidget, Int) -> Void)? +let handler6: @convention(c) (UnsafeMutableRawPointer, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// An keybinding signal which moves the current menu item - /// in the direction specified by @direction. - public var moveCurrent: ((MenuShell, GtkMenuDirectionType) -> Void)? +addSignal(name: "move-selected", handler: gCallback(handler6)) { [weak self] (param0: Int) in + guard let self = self else { return } + self.moveSelected?(self, param0) +} - /// The ::move-selected signal is emitted to move the selection to - /// another item. - public var moveSelected: ((MenuShell, Int) -> Void)? +addSignal(name: "selection-done") { [weak self] () in + guard let self = self else { return } + self.selectionDone?(self) +} - /// This signal is emitted when a selection has been - /// completed within a menu shell. - public var selectionDone: ((MenuShell) -> Void)? +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyTakeFocus: ((MenuShell, OpaquePointer) -> Void)? +addSignal(name: "notify::take-focus", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTakeFocus?(self, param0) } +} + + /// An action signal that activates the current menu item within +/// the menu shell. +public var activateCurrent: ((MenuShell, Bool) -> Void)? + +/// An action signal which cancels the selection within the menu shell. +/// Causes the #GtkMenuShell::selection-done signal to be emitted. +public var cancel: ((MenuShell) -> Void)? + +/// A keybinding signal which moves the focus in the +/// given @direction. +public var cycleFocus: ((MenuShell, GtkDirectionType) -> Void)? + +/// This signal is emitted when a menu shell is deactivated. +public var deactivate: ((MenuShell) -> Void)? + +/// The ::insert signal is emitted when a new #GtkMenuItem is added to +/// a #GtkMenuShell. A separate signal is used instead of +/// GtkContainer::add because of the need for an additional position +/// parameter. +/// +/// The inverse of this signal is the GtkContainer::removed signal. +public var insert: ((MenuShell, GtkWidget, Int) -> Void)? + +/// An keybinding signal which moves the current menu item +/// in the direction specified by @direction. +public var moveCurrent: ((MenuShell, GtkMenuDirectionType) -> Void)? + +/// The ::move-selected signal is emitted to move the selection to +/// another item. +public var moveSelected: ((MenuShell, Int) -> Void)? + +/// This signal is emitted when a selection has been +/// completed within a menu shell. +public var selectionDone: ((MenuShell) -> Void)? + + +public var notifyTakeFocus: ((MenuShell, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/MessageType.swift b/Sources/Gtk3/Generated/MessageType.swift index 0cb741a551..9a0ba5da7e 100644 --- a/Sources/Gtk3/Generated/MessageType.swift +++ b/Sources/Gtk3/Generated/MessageType.swift @@ -5,32 +5,32 @@ public enum MessageType: GValueRepresentableEnum { public typealias GtkEnum = GtkMessageType /// Informational message - case info - /// Non-fatal warning message - case warning - /// Question requiring a choice - case question - /// Fatal error message - case error - /// None of the above - case other +case info +/// Non-fatal warning message +case warning +/// Question requiring a choice +case question +/// Fatal error message +case error +/// None of the above +case other public static var type: GType { - gtk_message_type_get_type() - } + gtk_message_type_get_type() +} public init(from gtkEnum: GtkMessageType) { switch gtkEnum { case GTK_MESSAGE_INFO: - self = .info - case GTK_MESSAGE_WARNING: - self = .warning - case GTK_MESSAGE_QUESTION: - self = .question - case GTK_MESSAGE_ERROR: - self = .error - case GTK_MESSAGE_OTHER: - self = .other + self = .info +case GTK_MESSAGE_WARNING: + self = .warning +case GTK_MESSAGE_QUESTION: + self = .question +case GTK_MESSAGE_ERROR: + self = .error +case GTK_MESSAGE_OTHER: + self = .other default: fatalError("Unsupported GtkMessageType enum value: \(gtkEnum.rawValue)") } @@ -39,15 +39,15 @@ public enum MessageType: GValueRepresentableEnum { public func toGtk() -> GtkMessageType { switch self { case .info: - return GTK_MESSAGE_INFO - case .warning: - return GTK_MESSAGE_WARNING - case .question: - return GTK_MESSAGE_QUESTION - case .error: - return GTK_MESSAGE_ERROR - case .other: - return GTK_MESSAGE_OTHER + return GTK_MESSAGE_INFO +case .warning: + return GTK_MESSAGE_WARNING +case .question: + return GTK_MESSAGE_QUESTION +case .error: + return GTK_MESSAGE_ERROR +case .other: + return GTK_MESSAGE_OTHER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/MovementStep.swift b/Sources/Gtk3/Generated/MovementStep.swift index 9aff73c2bd..ee4799adc3 100644 --- a/Sources/Gtk3/Generated/MovementStep.swift +++ b/Sources/Gtk3/Generated/MovementStep.swift @@ -1,55 +1,56 @@ import CGtk3 + public enum MovementStep: GValueRepresentableEnum { public typealias GtkEnum = GtkMovementStep /// Move forward or back by graphemes - case logicalPositions - /// Move left or right by graphemes - case visualPositions - /// Move forward or back by words - case words - /// Move up or down lines (wrapped lines) - case displayLines - /// Move to either end of a line - case displayLineEnds - /// Move up or down paragraphs (newline-ended lines) - case paragraphs - /// Move to either end of a paragraph - case paragraphEnds - /// Move by pages - case pages - /// Move to ends of the buffer - case bufferEnds - /// Move horizontally by pages - case horizontalPages +case logicalPositions +/// Move left or right by graphemes +case visualPositions +/// Move forward or back by words +case words +/// Move up or down lines (wrapped lines) +case displayLines +/// Move to either end of a line +case displayLineEnds +/// Move up or down paragraphs (newline-ended lines) +case paragraphs +/// Move to either end of a paragraph +case paragraphEnds +/// Move by pages +case pages +/// Move to ends of the buffer +case bufferEnds +/// Move horizontally by pages +case horizontalPages public static var type: GType { - gtk_movement_step_get_type() - } + gtk_movement_step_get_type() +} public init(from gtkEnum: GtkMovementStep) { switch gtkEnum { case GTK_MOVEMENT_LOGICAL_POSITIONS: - self = .logicalPositions - case GTK_MOVEMENT_VISUAL_POSITIONS: - self = .visualPositions - case GTK_MOVEMENT_WORDS: - self = .words - case GTK_MOVEMENT_DISPLAY_LINES: - self = .displayLines - case GTK_MOVEMENT_DISPLAY_LINE_ENDS: - self = .displayLineEnds - case GTK_MOVEMENT_PARAGRAPHS: - self = .paragraphs - case GTK_MOVEMENT_PARAGRAPH_ENDS: - self = .paragraphEnds - case GTK_MOVEMENT_PAGES: - self = .pages - case GTK_MOVEMENT_BUFFER_ENDS: - self = .bufferEnds - case GTK_MOVEMENT_HORIZONTAL_PAGES: - self = .horizontalPages + self = .logicalPositions +case GTK_MOVEMENT_VISUAL_POSITIONS: + self = .visualPositions +case GTK_MOVEMENT_WORDS: + self = .words +case GTK_MOVEMENT_DISPLAY_LINES: + self = .displayLines +case GTK_MOVEMENT_DISPLAY_LINE_ENDS: + self = .displayLineEnds +case GTK_MOVEMENT_PARAGRAPHS: + self = .paragraphs +case GTK_MOVEMENT_PARAGRAPH_ENDS: + self = .paragraphEnds +case GTK_MOVEMENT_PAGES: + self = .pages +case GTK_MOVEMENT_BUFFER_ENDS: + self = .bufferEnds +case GTK_MOVEMENT_HORIZONTAL_PAGES: + self = .horizontalPages default: fatalError("Unsupported GtkMovementStep enum value: \(gtkEnum.rawValue)") } @@ -58,25 +59,25 @@ public enum MovementStep: GValueRepresentableEnum { public func toGtk() -> GtkMovementStep { switch self { case .logicalPositions: - return GTK_MOVEMENT_LOGICAL_POSITIONS - case .visualPositions: - return GTK_MOVEMENT_VISUAL_POSITIONS - case .words: - return GTK_MOVEMENT_WORDS - case .displayLines: - return GTK_MOVEMENT_DISPLAY_LINES - case .displayLineEnds: - return GTK_MOVEMENT_DISPLAY_LINE_ENDS - case .paragraphs: - return GTK_MOVEMENT_PARAGRAPHS - case .paragraphEnds: - return GTK_MOVEMENT_PARAGRAPH_ENDS - case .pages: - return GTK_MOVEMENT_PAGES - case .bufferEnds: - return GTK_MOVEMENT_BUFFER_ENDS - case .horizontalPages: - return GTK_MOVEMENT_HORIZONTAL_PAGES + return GTK_MOVEMENT_LOGICAL_POSITIONS +case .visualPositions: + return GTK_MOVEMENT_VISUAL_POSITIONS +case .words: + return GTK_MOVEMENT_WORDS +case .displayLines: + return GTK_MOVEMENT_DISPLAY_LINES +case .displayLineEnds: + return GTK_MOVEMENT_DISPLAY_LINE_ENDS +case .paragraphs: + return GTK_MOVEMENT_PARAGRAPHS +case .paragraphEnds: + return GTK_MOVEMENT_PARAGRAPH_ENDS +case .pages: + return GTK_MOVEMENT_PAGES +case .bufferEnds: + return GTK_MOVEMENT_BUFFER_ENDS +case .horizontalPages: + return GTK_MOVEMENT_HORIZONTAL_PAGES } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/NativeDialog.swift b/Sources/Gtk3/Generated/NativeDialog.swift index df63a37b59..42d26db61f 100644 --- a/Sources/Gtk3/Generated/NativeDialog.swift +++ b/Sources/Gtk3/Generated/NativeDialog.swift @@ -4,95 +4,91 @@ import CGtk3 /// #GtkWindow. They are used in order to integrate better with a /// platform, by looking the same as other native applications and /// supporting platform specific features. -/// +/// /// The #GtkDialog functions cannot be used on such objects, but we /// need a similar API in order to drive them. The #GtkNativeDialog /// object is an API that allows you to do this. It allows you to set /// various common properties on the dialog, as well as show and hide /// it and get a #GtkNativeDialog::response signal when the user finished /// with the dialog. -/// +/// /// There is also a gtk_native_dialog_run() helper that makes it easy /// to run any native dialog in a modal way with a recursive mainloop, /// similar to gtk_dialog_run(). open class NativeDialog: GObject { + public override func registerSignals() { - super.registerSignals() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "response", handler: gCallback(handler0)) { [weak self] (param0: Int) in - guard let self = self else { return } - self.response?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::modal", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyModal?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::title", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTitle?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::transient-for", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTransientFor?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::visible", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyVisible?(self, param0) - } + super.registerSignals() + + let handler0: @convention(c) (UnsafeMutableRawPointer, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Emitted when the user responds to the dialog. - /// - /// When this is called the dialog has been hidden. - /// - /// If you call gtk_native_dialog_hide() before the user responds to - /// the dialog this signal will not be emitted. - public var response: ((NativeDialog, Int) -> Void)? +addSignal(name: "response", handler: gCallback(handler0)) { [weak self] (param0: Int) in + guard let self = self else { return } + self.response?(self, param0) +} - public var notifyModal: ((NativeDialog, OpaquePointer) -> Void)? +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyTitle: ((NativeDialog, OpaquePointer) -> Void)? +addSignal(name: "notify::modal", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyModal?(self, param0) +} - public var notifyTransientFor: ((NativeDialog, OpaquePointer) -> Void)? +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyVisible: ((NativeDialog, OpaquePointer) -> Void)? +addSignal(name: "notify::title", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTitle?(self, param0) } + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::transient-for", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTransientFor?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::visible", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyVisible?(self, param0) +} +} + + /// Emitted when the user responds to the dialog. +/// +/// When this is called the dialog has been hidden. +/// +/// If you call gtk_native_dialog_hide() before the user responds to +/// the dialog this signal will not be emitted. +public var response: ((NativeDialog, Int) -> Void)? + + +public var notifyModal: ((NativeDialog, OpaquePointer) -> Void)? + + +public var notifyTitle: ((NativeDialog, OpaquePointer) -> Void)? + + +public var notifyTransientFor: ((NativeDialog, OpaquePointer) -> Void)? + + +public var notifyVisible: ((NativeDialog, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/NotebookTab.swift b/Sources/Gtk3/Generated/NotebookTab.swift index 576b2fae1c..4ce8febbb9 100644 --- a/Sources/Gtk3/Generated/NotebookTab.swift +++ b/Sources/Gtk3/Generated/NotebookTab.swift @@ -1,22 +1,24 @@ import CGtk3 + public enum NotebookTab: GValueRepresentableEnum { public typealias GtkEnum = GtkNotebookTab - case first + +case first - case last +case last public static var type: GType { - gtk_notebook_tab_get_type() - } + gtk_notebook_tab_get_type() +} public init(from gtkEnum: GtkNotebookTab) { switch gtkEnum { case GTK_NOTEBOOK_TAB_FIRST: - self = .first - case GTK_NOTEBOOK_TAB_LAST: - self = .last + self = .first +case GTK_NOTEBOOK_TAB_LAST: + self = .last default: fatalError("Unsupported GtkNotebookTab enum value: \(gtkEnum.rawValue)") } @@ -25,9 +27,9 @@ public enum NotebookTab: GValueRepresentableEnum { public func toGtk() -> GtkNotebookTab { switch self { case .first: - return GTK_NOTEBOOK_TAB_FIRST - case .last: - return GTK_NOTEBOOK_TAB_LAST + return GTK_NOTEBOOK_TAB_FIRST +case .last: + return GTK_NOTEBOOK_TAB_LAST } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/NumberUpLayout.swift b/Sources/Gtk3/Generated/NumberUpLayout.swift index e4d5258a24..ac377e017e 100644 --- a/Sources/Gtk3/Generated/NumberUpLayout.swift +++ b/Sources/Gtk3/Generated/NumberUpLayout.swift @@ -6,44 +6,44 @@ public enum NumberUpLayout: GValueRepresentableEnum { public typealias GtkEnum = GtkNumberUpLayout /// ![](layout-lrtb.png) - case lrtb - /// ![](layout-lrbt.png) - case lrbt - /// ![](layout-rltb.png) - case rltb - /// ![](layout-rlbt.png) - case rlbt - /// ![](layout-tblr.png) - case tblr - /// ![](layout-tbrl.png) - case tbrl - /// ![](layout-btlr.png) - case btlr - /// ![](layout-btrl.png) - case btrl +case lrtb +/// ![](layout-lrbt.png) +case lrbt +/// ![](layout-rltb.png) +case rltb +/// ![](layout-rlbt.png) +case rlbt +/// ![](layout-tblr.png) +case tblr +/// ![](layout-tbrl.png) +case tbrl +/// ![](layout-btlr.png) +case btlr +/// ![](layout-btrl.png) +case btrl public static var type: GType { - gtk_number_up_layout_get_type() - } + gtk_number_up_layout_get_type() +} public init(from gtkEnum: GtkNumberUpLayout) { switch gtkEnum { case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM: - self = .lrtb - case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP: - self = .lrbt - case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM: - self = .rltb - case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP: - self = .rlbt - case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT: - self = .tblr - case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT: - self = .tbrl - case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT: - self = .btlr - case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT: - self = .btrl + self = .lrtb +case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP: + self = .lrbt +case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM: + self = .rltb +case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP: + self = .rlbt +case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT: + self = .tblr +case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT: + self = .tbrl +case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT: + self = .btlr +case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT: + self = .btrl default: fatalError("Unsupported GtkNumberUpLayout enum value: \(gtkEnum.rawValue)") } @@ -52,21 +52,21 @@ public enum NumberUpLayout: GValueRepresentableEnum { public func toGtk() -> GtkNumberUpLayout { switch self { case .lrtb: - return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM - case .lrbt: - return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP - case .rltb: - return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM - case .rlbt: - return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP - case .tblr: - return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT - case .tbrl: - return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT - case .btlr: - return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT - case .btrl: - return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT + return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM +case .lrbt: + return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP +case .rltb: + return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM +case .rlbt: + return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP +case .tblr: + return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT +case .tbrl: + return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT +case .btlr: + return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT +case .btrl: + return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/Orientation.swift b/Sources/Gtk3/Generated/Orientation.swift index 8f472be5dc..79dbb9ae38 100644 --- a/Sources/Gtk3/Generated/Orientation.swift +++ b/Sources/Gtk3/Generated/Orientation.swift @@ -7,20 +7,20 @@ public enum Orientation: GValueRepresentableEnum { public typealias GtkEnum = GtkOrientation /// The element is in horizontal orientation. - case horizontal - /// The element is in vertical orientation. - case vertical +case horizontal +/// The element is in vertical orientation. +case vertical public static var type: GType { - gtk_orientation_get_type() - } + gtk_orientation_get_type() +} public init(from gtkEnum: GtkOrientation) { switch gtkEnum { case GTK_ORIENTATION_HORIZONTAL: - self = .horizontal - case GTK_ORIENTATION_VERTICAL: - self = .vertical + self = .horizontal +case GTK_ORIENTATION_VERTICAL: + self = .vertical default: fatalError("Unsupported GtkOrientation enum value: \(gtkEnum.rawValue)") } @@ -29,9 +29,9 @@ public enum Orientation: GValueRepresentableEnum { public func toGtk() -> GtkOrientation { switch self { case .horizontal: - return GTK_ORIENTATION_HORIZONTAL - case .vertical: - return GTK_ORIENTATION_VERTICAL + return GTK_ORIENTATION_HORIZONTAL +case .vertical: + return GTK_ORIENTATION_VERTICAL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/PackDirection.swift b/Sources/Gtk3/Generated/PackDirection.swift index 94613fcbef..a3a80f7ffa 100644 --- a/Sources/Gtk3/Generated/PackDirection.swift +++ b/Sources/Gtk3/Generated/PackDirection.swift @@ -6,28 +6,28 @@ public enum PackDirection: GValueRepresentableEnum { public typealias GtkEnum = GtkPackDirection /// Widgets are packed left-to-right - case ltr - /// Widgets are packed right-to-left - case rtl - /// Widgets are packed top-to-bottom - case ttb - /// Widgets are packed bottom-to-top - case btt +case ltr +/// Widgets are packed right-to-left +case rtl +/// Widgets are packed top-to-bottom +case ttb +/// Widgets are packed bottom-to-top +case btt public static var type: GType { - gtk_pack_direction_get_type() - } + gtk_pack_direction_get_type() +} public init(from gtkEnum: GtkPackDirection) { switch gtkEnum { case GTK_PACK_DIRECTION_LTR: - self = .ltr - case GTK_PACK_DIRECTION_RTL: - self = .rtl - case GTK_PACK_DIRECTION_TTB: - self = .ttb - case GTK_PACK_DIRECTION_BTT: - self = .btt + self = .ltr +case GTK_PACK_DIRECTION_RTL: + self = .rtl +case GTK_PACK_DIRECTION_TTB: + self = .ttb +case GTK_PACK_DIRECTION_BTT: + self = .btt default: fatalError("Unsupported GtkPackDirection enum value: \(gtkEnum.rawValue)") } @@ -36,13 +36,13 @@ public enum PackDirection: GValueRepresentableEnum { public func toGtk() -> GtkPackDirection { switch self { case .ltr: - return GTK_PACK_DIRECTION_LTR - case .rtl: - return GTK_PACK_DIRECTION_RTL - case .ttb: - return GTK_PACK_DIRECTION_TTB - case .btt: - return GTK_PACK_DIRECTION_BTT + return GTK_PACK_DIRECTION_LTR +case .rtl: + return GTK_PACK_DIRECTION_RTL +case .ttb: + return GTK_PACK_DIRECTION_TTB +case .btt: + return GTK_PACK_DIRECTION_BTT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/PackType.swift b/Sources/Gtk3/Generated/PackType.swift index 910f8cd940..a4c48d3163 100644 --- a/Sources/Gtk3/Generated/PackType.swift +++ b/Sources/Gtk3/Generated/PackType.swift @@ -6,20 +6,20 @@ public enum PackType: GValueRepresentableEnum { public typealias GtkEnum = GtkPackType /// The child is packed into the start of the box - case start - /// The child is packed into the end of the box - case end +case start +/// The child is packed into the end of the box +case end public static var type: GType { - gtk_pack_type_get_type() - } + gtk_pack_type_get_type() +} public init(from gtkEnum: GtkPackType) { switch gtkEnum { case GTK_PACK_START: - self = .start - case GTK_PACK_END: - self = .end + self = .start +case GTK_PACK_END: + self = .end default: fatalError("Unsupported GtkPackType enum value: \(gtkEnum.rawValue)") } @@ -28,9 +28,9 @@ public enum PackType: GValueRepresentableEnum { public func toGtk() -> GtkPackType { switch self { case .start: - return GTK_PACK_START - case .end: - return GTK_PACK_END + return GTK_PACK_START +case .end: + return GTK_PACK_END } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/PadActionType.swift b/Sources/Gtk3/Generated/PadActionType.swift index 50518d70c8..c626946160 100644 --- a/Sources/Gtk3/Generated/PadActionType.swift +++ b/Sources/Gtk3/Generated/PadActionType.swift @@ -5,24 +5,24 @@ public enum PadActionType: GValueRepresentableEnum { public typealias GtkEnum = GtkPadActionType /// Action is triggered by a pad button - case button - /// Action is triggered by a pad ring - case ring - /// Action is triggered by a pad strip - case strip +case button +/// Action is triggered by a pad ring +case ring +/// Action is triggered by a pad strip +case strip public static var type: GType { - gtk_pad_action_type_get_type() - } + gtk_pad_action_type_get_type() +} public init(from gtkEnum: GtkPadActionType) { switch gtkEnum { case GTK_PAD_ACTION_BUTTON: - self = .button - case GTK_PAD_ACTION_RING: - self = .ring - case GTK_PAD_ACTION_STRIP: - self = .strip + self = .button +case GTK_PAD_ACTION_RING: + self = .ring +case GTK_PAD_ACTION_STRIP: + self = .strip default: fatalError("Unsupported GtkPadActionType enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ public enum PadActionType: GValueRepresentableEnum { public func toGtk() -> GtkPadActionType { switch self { case .button: - return GTK_PAD_ACTION_BUTTON - case .ring: - return GTK_PAD_ACTION_RING - case .strip: - return GTK_PAD_ACTION_STRIP + return GTK_PAD_ACTION_BUTTON +case .ring: + return GTK_PAD_ACTION_RING +case .strip: + return GTK_PAD_ACTION_STRIP } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/PageOrientation.swift b/Sources/Gtk3/Generated/PageOrientation.swift index 352aa8c1a8..6e18d24d1e 100644 --- a/Sources/Gtk3/Generated/PageOrientation.swift +++ b/Sources/Gtk3/Generated/PageOrientation.swift @@ -5,28 +5,28 @@ public enum PageOrientation: GValueRepresentableEnum { public typealias GtkEnum = GtkPageOrientation /// Portrait mode. - case portrait - /// Landscape mode. - case landscape - /// Reverse portrait mode. - case reversePortrait - /// Reverse landscape mode. - case reverseLandscape +case portrait +/// Landscape mode. +case landscape +/// Reverse portrait mode. +case reversePortrait +/// Reverse landscape mode. +case reverseLandscape public static var type: GType { - gtk_page_orientation_get_type() - } + gtk_page_orientation_get_type() +} public init(from gtkEnum: GtkPageOrientation) { switch gtkEnum { case GTK_PAGE_ORIENTATION_PORTRAIT: - self = .portrait - case GTK_PAGE_ORIENTATION_LANDSCAPE: - self = .landscape - case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT: - self = .reversePortrait - case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE: - self = .reverseLandscape + self = .portrait +case GTK_PAGE_ORIENTATION_LANDSCAPE: + self = .landscape +case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT: + self = .reversePortrait +case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE: + self = .reverseLandscape default: fatalError("Unsupported GtkPageOrientation enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum PageOrientation: GValueRepresentableEnum { public func toGtk() -> GtkPageOrientation { switch self { case .portrait: - return GTK_PAGE_ORIENTATION_PORTRAIT - case .landscape: - return GTK_PAGE_ORIENTATION_LANDSCAPE - case .reversePortrait: - return GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT - case .reverseLandscape: - return GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE + return GTK_PAGE_ORIENTATION_PORTRAIT +case .landscape: + return GTK_PAGE_ORIENTATION_LANDSCAPE +case .reversePortrait: + return GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT +case .reverseLandscape: + return GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/PageSet.swift b/Sources/Gtk3/Generated/PageSet.swift index 771ba9aebf..b12b708cd7 100644 --- a/Sources/Gtk3/Generated/PageSet.swift +++ b/Sources/Gtk3/Generated/PageSet.swift @@ -5,24 +5,24 @@ public enum PageSet: GValueRepresentableEnum { public typealias GtkEnum = GtkPageSet /// All pages. - case all - /// Even pages. - case even - /// Odd pages. - case odd +case all +/// Even pages. +case even +/// Odd pages. +case odd public static var type: GType { - gtk_page_set_get_type() - } + gtk_page_set_get_type() +} public init(from gtkEnum: GtkPageSet) { switch gtkEnum { case GTK_PAGE_SET_ALL: - self = .all - case GTK_PAGE_SET_EVEN: - self = .even - case GTK_PAGE_SET_ODD: - self = .odd + self = .all +case GTK_PAGE_SET_EVEN: + self = .even +case GTK_PAGE_SET_ODD: + self = .odd default: fatalError("Unsupported GtkPageSet enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ public enum PageSet: GValueRepresentableEnum { public func toGtk() -> GtkPageSet { switch self { case .all: - return GTK_PAGE_SET_ALL - case .even: - return GTK_PAGE_SET_EVEN - case .odd: - return GTK_PAGE_SET_ODD + return GTK_PAGE_SET_ALL +case .even: + return GTK_PAGE_SET_EVEN +case .odd: + return GTK_PAGE_SET_ODD } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/PathPriorityType.swift b/Sources/Gtk3/Generated/PathPriorityType.swift index d4fba1a4e3..ea3b474ab4 100644 --- a/Sources/Gtk3/Generated/PathPriorityType.swift +++ b/Sources/Gtk3/Generated/PathPriorityType.swift @@ -6,36 +6,36 @@ public enum PathPriorityType: GValueRepresentableEnum { public typealias GtkEnum = GtkPathPriorityType /// Deprecated - case lowest - /// Deprecated - case gtk - /// Deprecated - case application - /// Deprecated - case theme - /// Deprecated - case rc - /// Deprecated - case highest +case lowest +/// Deprecated +case gtk +/// Deprecated +case application +/// Deprecated +case theme +/// Deprecated +case rc +/// Deprecated +case highest public static var type: GType { - gtk_path_priority_type_get_type() - } + gtk_path_priority_type_get_type() +} public init(from gtkEnum: GtkPathPriorityType) { switch gtkEnum { case GTK_PATH_PRIO_LOWEST: - self = .lowest - case GTK_PATH_PRIO_GTK: - self = .gtk - case GTK_PATH_PRIO_APPLICATION: - self = .application - case GTK_PATH_PRIO_THEME: - self = .theme - case GTK_PATH_PRIO_RC: - self = .rc - case GTK_PATH_PRIO_HIGHEST: - self = .highest + self = .lowest +case GTK_PATH_PRIO_GTK: + self = .gtk +case GTK_PATH_PRIO_APPLICATION: + self = .application +case GTK_PATH_PRIO_THEME: + self = .theme +case GTK_PATH_PRIO_RC: + self = .rc +case GTK_PATH_PRIO_HIGHEST: + self = .highest default: fatalError("Unsupported GtkPathPriorityType enum value: \(gtkEnum.rawValue)") } @@ -44,17 +44,17 @@ public enum PathPriorityType: GValueRepresentableEnum { public func toGtk() -> GtkPathPriorityType { switch self { case .lowest: - return GTK_PATH_PRIO_LOWEST - case .gtk: - return GTK_PATH_PRIO_GTK - case .application: - return GTK_PATH_PRIO_APPLICATION - case .theme: - return GTK_PATH_PRIO_THEME - case .rc: - return GTK_PATH_PRIO_RC - case .highest: - return GTK_PATH_PRIO_HIGHEST + return GTK_PATH_PRIO_LOWEST +case .gtk: + return GTK_PATH_PRIO_GTK +case .application: + return GTK_PATH_PRIO_APPLICATION +case .theme: + return GTK_PATH_PRIO_THEME +case .rc: + return GTK_PATH_PRIO_RC +case .highest: + return GTK_PATH_PRIO_HIGHEST } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/PathType.swift b/Sources/Gtk3/Generated/PathType.swift index e25c90ecee..f7b42fa55a 100644 --- a/Sources/Gtk3/Generated/PathType.swift +++ b/Sources/Gtk3/Generated/PathType.swift @@ -6,24 +6,24 @@ public enum PathType: GValueRepresentableEnum { public typealias GtkEnum = GtkPathType /// Deprecated - case widget - /// Deprecated - case widgetClass - /// Deprecated - case class_ +case widget +/// Deprecated +case widgetClass +/// Deprecated +case class_ public static var type: GType { - gtk_path_type_get_type() - } + gtk_path_type_get_type() +} public init(from gtkEnum: GtkPathType) { switch gtkEnum { case GTK_PATH_WIDGET: - self = .widget - case GTK_PATH_WIDGET_CLASS: - self = .widgetClass - case GTK_PATH_CLASS: - self = .class_ + self = .widget +case GTK_PATH_WIDGET_CLASS: + self = .widgetClass +case GTK_PATH_CLASS: + self = .class_ default: fatalError("Unsupported GtkPathType enum value: \(gtkEnum.rawValue)") } @@ -32,11 +32,11 @@ public enum PathType: GValueRepresentableEnum { public func toGtk() -> GtkPathType { switch self { case .widget: - return GTK_PATH_WIDGET - case .widgetClass: - return GTK_PATH_WIDGET_CLASS - case .class_: - return GTK_PATH_CLASS + return GTK_PATH_WIDGET +case .widgetClass: + return GTK_PATH_WIDGET_CLASS +case .class_: + return GTK_PATH_CLASS } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/PolicyType.swift b/Sources/Gtk3/Generated/PolicyType.swift index ba363adbcd..3d9c4e6f86 100644 --- a/Sources/Gtk3/Generated/PolicyType.swift +++ b/Sources/Gtk3/Generated/PolicyType.swift @@ -6,27 +6,27 @@ public enum PolicyType: GValueRepresentableEnum { public typealias GtkEnum = GtkPolicyType /// The scrollbar is always visible. The view size is - /// independent of the content. - case always - /// The scrollbar will appear and disappear as necessary. - /// For example, when all of a #GtkTreeView can not be seen. - case automatic - /// The scrollbar should never appear. In this mode the - /// content determines the size. - case never +/// independent of the content. +case always +/// The scrollbar will appear and disappear as necessary. +/// For example, when all of a #GtkTreeView can not be seen. +case automatic +/// The scrollbar should never appear. In this mode the +/// content determines the size. +case never public static var type: GType { - gtk_policy_type_get_type() - } + gtk_policy_type_get_type() +} public init(from gtkEnum: GtkPolicyType) { switch gtkEnum { case GTK_POLICY_ALWAYS: - self = .always - case GTK_POLICY_AUTOMATIC: - self = .automatic - case GTK_POLICY_NEVER: - self = .never + self = .always +case GTK_POLICY_AUTOMATIC: + self = .automatic +case GTK_POLICY_NEVER: + self = .never default: fatalError("Unsupported GtkPolicyType enum value: \(gtkEnum.rawValue)") } @@ -35,11 +35,11 @@ public enum PolicyType: GValueRepresentableEnum { public func toGtk() -> GtkPolicyType { switch self { case .always: - return GTK_POLICY_ALWAYS - case .automatic: - return GTK_POLICY_AUTOMATIC - case .never: - return GTK_POLICY_NEVER + return GTK_POLICY_ALWAYS +case .automatic: + return GTK_POLICY_AUTOMATIC +case .never: + return GTK_POLICY_NEVER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/PositionType.swift b/Sources/Gtk3/Generated/PositionType.swift index 1e37a29311..e3b336b90f 100644 --- a/Sources/Gtk3/Generated/PositionType.swift +++ b/Sources/Gtk3/Generated/PositionType.swift @@ -7,28 +7,28 @@ public enum PositionType: GValueRepresentableEnum { public typealias GtkEnum = GtkPositionType /// The feature is at the left edge. - case left - /// The feature is at the right edge. - case right - /// The feature is at the top edge. - case top - /// The feature is at the bottom edge. - case bottom +case left +/// The feature is at the right edge. +case right +/// The feature is at the top edge. +case top +/// The feature is at the bottom edge. +case bottom public static var type: GType { - gtk_position_type_get_type() - } + gtk_position_type_get_type() +} public init(from gtkEnum: GtkPositionType) { switch gtkEnum { case GTK_POS_LEFT: - self = .left - case GTK_POS_RIGHT: - self = .right - case GTK_POS_TOP: - self = .top - case GTK_POS_BOTTOM: - self = .bottom + self = .left +case GTK_POS_RIGHT: + self = .right +case GTK_POS_TOP: + self = .top +case GTK_POS_BOTTOM: + self = .bottom default: fatalError("Unsupported GtkPositionType enum value: \(gtkEnum.rawValue)") } @@ -37,13 +37,13 @@ public enum PositionType: GValueRepresentableEnum { public func toGtk() -> GtkPositionType { switch self { case .left: - return GTK_POS_LEFT - case .right: - return GTK_POS_RIGHT - case .top: - return GTK_POS_TOP - case .bottom: - return GTK_POS_BOTTOM + return GTK_POS_LEFT +case .right: + return GTK_POS_RIGHT +case .top: + return GTK_POS_TOP +case .bottom: + return GTK_POS_BOTTOM } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/PrintDuplex.swift b/Sources/Gtk3/Generated/PrintDuplex.swift index 60506773d8..1a3922903d 100644 --- a/Sources/Gtk3/Generated/PrintDuplex.swift +++ b/Sources/Gtk3/Generated/PrintDuplex.swift @@ -5,24 +5,24 @@ public enum PrintDuplex: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintDuplex /// No duplex. - case simplex - /// Horizontal duplex. - case horizontal - /// Vertical duplex. - case vertical +case simplex +/// Horizontal duplex. +case horizontal +/// Vertical duplex. +case vertical public static var type: GType { - gtk_print_duplex_get_type() - } + gtk_print_duplex_get_type() +} public init(from gtkEnum: GtkPrintDuplex) { switch gtkEnum { case GTK_PRINT_DUPLEX_SIMPLEX: - self = .simplex - case GTK_PRINT_DUPLEX_HORIZONTAL: - self = .horizontal - case GTK_PRINT_DUPLEX_VERTICAL: - self = .vertical + self = .simplex +case GTK_PRINT_DUPLEX_HORIZONTAL: + self = .horizontal +case GTK_PRINT_DUPLEX_VERTICAL: + self = .vertical default: fatalError("Unsupported GtkPrintDuplex enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ public enum PrintDuplex: GValueRepresentableEnum { public func toGtk() -> GtkPrintDuplex { switch self { case .simplex: - return GTK_PRINT_DUPLEX_SIMPLEX - case .horizontal: - return GTK_PRINT_DUPLEX_HORIZONTAL - case .vertical: - return GTK_PRINT_DUPLEX_VERTICAL + return GTK_PRINT_DUPLEX_SIMPLEX +case .horizontal: + return GTK_PRINT_DUPLEX_HORIZONTAL +case .vertical: + return GTK_PRINT_DUPLEX_VERTICAL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/PrintError.swift b/Sources/Gtk3/Generated/PrintError.swift index d7b2497763..98f82b5e43 100644 --- a/Sources/Gtk3/Generated/PrintError.swift +++ b/Sources/Gtk3/Generated/PrintError.swift @@ -6,29 +6,29 @@ public enum PrintError: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintError /// An unspecified error occurred. - case general - /// An internal error occurred. - case internalError - /// A memory allocation failed. - case nomem - /// An error occurred while loading a page setup - /// or paper size from a key file. - case invalidFile +case general +/// An internal error occurred. +case internalError +/// A memory allocation failed. +case nomem +/// An error occurred while loading a page setup +/// or paper size from a key file. +case invalidFile public static var type: GType { - gtk_print_error_get_type() - } + gtk_print_error_get_type() +} public init(from gtkEnum: GtkPrintError) { switch gtkEnum { case GTK_PRINT_ERROR_GENERAL: - self = .general - case GTK_PRINT_ERROR_INTERNAL_ERROR: - self = .internalError - case GTK_PRINT_ERROR_NOMEM: - self = .nomem - case GTK_PRINT_ERROR_INVALID_FILE: - self = .invalidFile + self = .general +case GTK_PRINT_ERROR_INTERNAL_ERROR: + self = .internalError +case GTK_PRINT_ERROR_NOMEM: + self = .nomem +case GTK_PRINT_ERROR_INVALID_FILE: + self = .invalidFile default: fatalError("Unsupported GtkPrintError enum value: \(gtkEnum.rawValue)") } @@ -37,13 +37,13 @@ public enum PrintError: GValueRepresentableEnum { public func toGtk() -> GtkPrintError { switch self { case .general: - return GTK_PRINT_ERROR_GENERAL - case .internalError: - return GTK_PRINT_ERROR_INTERNAL_ERROR - case .nomem: - return GTK_PRINT_ERROR_NOMEM - case .invalidFile: - return GTK_PRINT_ERROR_INVALID_FILE + return GTK_PRINT_ERROR_GENERAL +case .internalError: + return GTK_PRINT_ERROR_INTERNAL_ERROR +case .nomem: + return GTK_PRINT_ERROR_NOMEM +case .invalidFile: + return GTK_PRINT_ERROR_INVALID_FILE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/PrintOperationAction.swift b/Sources/Gtk3/Generated/PrintOperationAction.swift index 0a349d42b8..2f1a52c706 100644 --- a/Sources/Gtk3/Generated/PrintOperationAction.swift +++ b/Sources/Gtk3/Generated/PrintOperationAction.swift @@ -6,30 +6,30 @@ public enum PrintOperationAction: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintOperationAction /// Show the print dialog. - case printDialog - /// Start to print without showing - /// the print dialog, based on the current print settings. - case print - /// Show the print preview. - case preview - /// Export to a file. This requires - /// the export-filename property to be set. - case export +case printDialog +/// Start to print without showing +/// the print dialog, based on the current print settings. +case print +/// Show the print preview. +case preview +/// Export to a file. This requires +/// the export-filename property to be set. +case export public static var type: GType { - gtk_print_operation_action_get_type() - } + gtk_print_operation_action_get_type() +} public init(from gtkEnum: GtkPrintOperationAction) { switch gtkEnum { case GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG: - self = .printDialog - case GTK_PRINT_OPERATION_ACTION_PRINT: - self = .print - case GTK_PRINT_OPERATION_ACTION_PREVIEW: - self = .preview - case GTK_PRINT_OPERATION_ACTION_EXPORT: - self = .export + self = .printDialog +case GTK_PRINT_OPERATION_ACTION_PRINT: + self = .print +case GTK_PRINT_OPERATION_ACTION_PREVIEW: + self = .preview +case GTK_PRINT_OPERATION_ACTION_EXPORT: + self = .export default: fatalError("Unsupported GtkPrintOperationAction enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ public enum PrintOperationAction: GValueRepresentableEnum { public func toGtk() -> GtkPrintOperationAction { switch self { case .printDialog: - return GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG - case .print: - return GTK_PRINT_OPERATION_ACTION_PRINT - case .preview: - return GTK_PRINT_OPERATION_ACTION_PREVIEW - case .export: - return GTK_PRINT_OPERATION_ACTION_EXPORT + return GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG +case .print: + return GTK_PRINT_OPERATION_ACTION_PRINT +case .preview: + return GTK_PRINT_OPERATION_ACTION_PREVIEW +case .export: + return GTK_PRINT_OPERATION_ACTION_EXPORT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/PrintOperationResult.swift b/Sources/Gtk3/Generated/PrintOperationResult.swift index 4604a592dc..dc42857d5b 100644 --- a/Sources/Gtk3/Generated/PrintOperationResult.swift +++ b/Sources/Gtk3/Generated/PrintOperationResult.swift @@ -5,30 +5,30 @@ public enum PrintOperationResult: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintOperationResult /// An error has occurred. - case error - /// The print settings should be stored. - case apply - /// The print operation has been canceled, - /// the print settings should not be stored. - case cancel - /// The print operation is not complete - /// yet. This value will only be returned when running asynchronously. - case inProgress +case error +/// The print settings should be stored. +case apply +/// The print operation has been canceled, +/// the print settings should not be stored. +case cancel +/// The print operation is not complete +/// yet. This value will only be returned when running asynchronously. +case inProgress public static var type: GType { - gtk_print_operation_result_get_type() - } + gtk_print_operation_result_get_type() +} public init(from gtkEnum: GtkPrintOperationResult) { switch gtkEnum { case GTK_PRINT_OPERATION_RESULT_ERROR: - self = .error - case GTK_PRINT_OPERATION_RESULT_APPLY: - self = .apply - case GTK_PRINT_OPERATION_RESULT_CANCEL: - self = .cancel - case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS: - self = .inProgress + self = .error +case GTK_PRINT_OPERATION_RESULT_APPLY: + self = .apply +case GTK_PRINT_OPERATION_RESULT_CANCEL: + self = .cancel +case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS: + self = .inProgress default: fatalError("Unsupported GtkPrintOperationResult enum value: \(gtkEnum.rawValue)") } @@ -37,13 +37,13 @@ public enum PrintOperationResult: GValueRepresentableEnum { public func toGtk() -> GtkPrintOperationResult { switch self { case .error: - return GTK_PRINT_OPERATION_RESULT_ERROR - case .apply: - return GTK_PRINT_OPERATION_RESULT_APPLY - case .cancel: - return GTK_PRINT_OPERATION_RESULT_CANCEL - case .inProgress: - return GTK_PRINT_OPERATION_RESULT_IN_PROGRESS + return GTK_PRINT_OPERATION_RESULT_ERROR +case .apply: + return GTK_PRINT_OPERATION_RESULT_APPLY +case .cancel: + return GTK_PRINT_OPERATION_RESULT_CANCEL +case .inProgress: + return GTK_PRINT_OPERATION_RESULT_IN_PROGRESS } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/PrintPages.swift b/Sources/Gtk3/Generated/PrintPages.swift index dd20901120..3b3b5d5286 100644 --- a/Sources/Gtk3/Generated/PrintPages.swift +++ b/Sources/Gtk3/Generated/PrintPages.swift @@ -5,28 +5,28 @@ public enum PrintPages: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintPages /// All pages. - case all - /// Current page. - case current - /// Range of pages. - case ranges - /// Selected pages. - case selection +case all +/// Current page. +case current +/// Range of pages. +case ranges +/// Selected pages. +case selection public static var type: GType { - gtk_print_pages_get_type() - } + gtk_print_pages_get_type() +} public init(from gtkEnum: GtkPrintPages) { switch gtkEnum { case GTK_PRINT_PAGES_ALL: - self = .all - case GTK_PRINT_PAGES_CURRENT: - self = .current - case GTK_PRINT_PAGES_RANGES: - self = .ranges - case GTK_PRINT_PAGES_SELECTION: - self = .selection + self = .all +case GTK_PRINT_PAGES_CURRENT: + self = .current +case GTK_PRINT_PAGES_RANGES: + self = .ranges +case GTK_PRINT_PAGES_SELECTION: + self = .selection default: fatalError("Unsupported GtkPrintPages enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum PrintPages: GValueRepresentableEnum { public func toGtk() -> GtkPrintPages { switch self { case .all: - return GTK_PRINT_PAGES_ALL - case .current: - return GTK_PRINT_PAGES_CURRENT - case .ranges: - return GTK_PRINT_PAGES_RANGES - case .selection: - return GTK_PRINT_PAGES_SELECTION + return GTK_PRINT_PAGES_ALL +case .current: + return GTK_PRINT_PAGES_CURRENT +case .ranges: + return GTK_PRINT_PAGES_RANGES +case .selection: + return GTK_PRINT_PAGES_SELECTION } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/PrintQuality.swift b/Sources/Gtk3/Generated/PrintQuality.swift index 49d7e527b4..f45c60948b 100644 --- a/Sources/Gtk3/Generated/PrintQuality.swift +++ b/Sources/Gtk3/Generated/PrintQuality.swift @@ -5,28 +5,28 @@ public enum PrintQuality: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintQuality /// Low quality. - case low - /// Normal quality. - case normal - /// High quality. - case high - /// Draft quality. - case draft +case low +/// Normal quality. +case normal +/// High quality. +case high +/// Draft quality. +case draft public static var type: GType { - gtk_print_quality_get_type() - } + gtk_print_quality_get_type() +} public init(from gtkEnum: GtkPrintQuality) { switch gtkEnum { case GTK_PRINT_QUALITY_LOW: - self = .low - case GTK_PRINT_QUALITY_NORMAL: - self = .normal - case GTK_PRINT_QUALITY_HIGH: - self = .high - case GTK_PRINT_QUALITY_DRAFT: - self = .draft + self = .low +case GTK_PRINT_QUALITY_NORMAL: + self = .normal +case GTK_PRINT_QUALITY_HIGH: + self = .high +case GTK_PRINT_QUALITY_DRAFT: + self = .draft default: fatalError("Unsupported GtkPrintQuality enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum PrintQuality: GValueRepresentableEnum { public func toGtk() -> GtkPrintQuality { switch self { case .low: - return GTK_PRINT_QUALITY_LOW - case .normal: - return GTK_PRINT_QUALITY_NORMAL - case .high: - return GTK_PRINT_QUALITY_HIGH - case .draft: - return GTK_PRINT_QUALITY_DRAFT + return GTK_PRINT_QUALITY_LOW +case .normal: + return GTK_PRINT_QUALITY_NORMAL +case .high: + return GTK_PRINT_QUALITY_HIGH +case .draft: + return GTK_PRINT_QUALITY_DRAFT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/PrintStatus.swift b/Sources/Gtk3/Generated/PrintStatus.swift index 363177adf1..175ba17753 100644 --- a/Sources/Gtk3/Generated/PrintStatus.swift +++ b/Sources/Gtk3/Generated/PrintStatus.swift @@ -6,54 +6,54 @@ public enum PrintStatus: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintStatus /// The printing has not started yet; this - /// status is set initially, and while the print dialog is shown. - case initial - /// This status is set while the begin-print - /// signal is emitted and during pagination. - case preparing - /// This status is set while the - /// pages are being rendered. - case generatingData - /// The print job is being sent off to the - /// printer. - case sendingData - /// The print job has been sent to the printer, - /// but is not printed for some reason, e.g. the printer may be stopped. - case pending - /// Some problem has occurred during - /// printing, e.g. a paper jam. - case pendingIssue - /// The printer is processing the print job. - case printing - /// The printing has been completed successfully. - case finished - /// The printing has been aborted. - case finishedAborted +/// status is set initially, and while the print dialog is shown. +case initial +/// This status is set while the begin-print +/// signal is emitted and during pagination. +case preparing +/// This status is set while the +/// pages are being rendered. +case generatingData +/// The print job is being sent off to the +/// printer. +case sendingData +/// The print job has been sent to the printer, +/// but is not printed for some reason, e.g. the printer may be stopped. +case pending +/// Some problem has occurred during +/// printing, e.g. a paper jam. +case pendingIssue +/// The printer is processing the print job. +case printing +/// The printing has been completed successfully. +case finished +/// The printing has been aborted. +case finishedAborted public static var type: GType { - gtk_print_status_get_type() - } + gtk_print_status_get_type() +} public init(from gtkEnum: GtkPrintStatus) { switch gtkEnum { case GTK_PRINT_STATUS_INITIAL: - self = .initial - case GTK_PRINT_STATUS_PREPARING: - self = .preparing - case GTK_PRINT_STATUS_GENERATING_DATA: - self = .generatingData - case GTK_PRINT_STATUS_SENDING_DATA: - self = .sendingData - case GTK_PRINT_STATUS_PENDING: - self = .pending - case GTK_PRINT_STATUS_PENDING_ISSUE: - self = .pendingIssue - case GTK_PRINT_STATUS_PRINTING: - self = .printing - case GTK_PRINT_STATUS_FINISHED: - self = .finished - case GTK_PRINT_STATUS_FINISHED_ABORTED: - self = .finishedAborted + self = .initial +case GTK_PRINT_STATUS_PREPARING: + self = .preparing +case GTK_PRINT_STATUS_GENERATING_DATA: + self = .generatingData +case GTK_PRINT_STATUS_SENDING_DATA: + self = .sendingData +case GTK_PRINT_STATUS_PENDING: + self = .pending +case GTK_PRINT_STATUS_PENDING_ISSUE: + self = .pendingIssue +case GTK_PRINT_STATUS_PRINTING: + self = .printing +case GTK_PRINT_STATUS_FINISHED: + self = .finished +case GTK_PRINT_STATUS_FINISHED_ABORTED: + self = .finishedAborted default: fatalError("Unsupported GtkPrintStatus enum value: \(gtkEnum.rawValue)") } @@ -62,23 +62,23 @@ public enum PrintStatus: GValueRepresentableEnum { public func toGtk() -> GtkPrintStatus { switch self { case .initial: - return GTK_PRINT_STATUS_INITIAL - case .preparing: - return GTK_PRINT_STATUS_PREPARING - case .generatingData: - return GTK_PRINT_STATUS_GENERATING_DATA - case .sendingData: - return GTK_PRINT_STATUS_SENDING_DATA - case .pending: - return GTK_PRINT_STATUS_PENDING - case .pendingIssue: - return GTK_PRINT_STATUS_PENDING_ISSUE - case .printing: - return GTK_PRINT_STATUS_PRINTING - case .finished: - return GTK_PRINT_STATUS_FINISHED - case .finishedAborted: - return GTK_PRINT_STATUS_FINISHED_ABORTED + return GTK_PRINT_STATUS_INITIAL +case .preparing: + return GTK_PRINT_STATUS_PREPARING +case .generatingData: + return GTK_PRINT_STATUS_GENERATING_DATA +case .sendingData: + return GTK_PRINT_STATUS_SENDING_DATA +case .pending: + return GTK_PRINT_STATUS_PENDING +case .pendingIssue: + return GTK_PRINT_STATUS_PENDING_ISSUE +case .printing: + return GTK_PRINT_STATUS_PRINTING +case .finished: + return GTK_PRINT_STATUS_FINISHED +case .finishedAborted: + return GTK_PRINT_STATUS_FINISHED_ABORTED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ProgressBar.swift b/Sources/Gtk3/Generated/ProgressBar.swift index 9b3eb446a4..764ede31a9 100644 --- a/Sources/Gtk3/Generated/ProgressBar.swift +++ b/Sources/Gtk3/Generated/ProgressBar.swift @@ -4,34 +4,34 @@ import CGtk3 /// running operation. It provides a visual clue that processing is underway. /// The GtkProgressBar can be used in two different modes: percentage mode /// and activity mode. -/// +/// /// When an application can determine how much work needs to take place /// (e.g. read a fixed number of bytes from a file) and can monitor its /// progress, it can use the GtkProgressBar in percentage mode and the /// user sees a growing bar indicating the percentage of the work that /// has been completed. In this mode, the application is required to call /// gtk_progress_bar_set_fraction() periodically to update the progress bar. -/// +/// /// When an application has no accurate way of knowing the amount of work /// to do, it can use the #GtkProgressBar in activity mode, which shows /// activity by a block moving back and forth within the progress area. In /// this mode, the application is required to call gtk_progress_bar_pulse() /// periodically to update the progress bar. -/// +/// /// There is quite a bit of flexibility provided to control the appearance /// of the #GtkProgressBar. Functions are provided to control the orientation /// of the bar, optional text can be displayed along with the bar, and the /// step size used in activity mode can be set. -/// +/// /// # CSS nodes -/// +/// /// |[ /// progressbar[.osd] /// ├── [text] /// ╰── trough[.empty][.full] /// ╰── progress[.pulse] /// ]| -/// +/// /// GtkProgressBar has a main CSS node with name progressbar and subnodes with /// names text and trough, of which the latter has a subnode named progress. The /// text subnode is only present if text is shown. The progress subnode has the @@ -41,119 +41,116 @@ import CGtk3 /// in overlays like the one Epiphany has for page loading progress. open class ProgressBar: Widget, Orientable { /// Creates a new #GtkProgressBar. - public convenience init() { - self.init( - gtk_progress_bar_new() - ) +public convenience init() { + self.init( + gtk_progress_bar_new() + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::ellipsize", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEllipsize?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::fraction", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFraction?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::inverted", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInverted?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::pulse-step", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPulseStep?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::show-text", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowText?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::text", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyText?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::orientation", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyOrientation?(self, param0) - } +addSignal(name: "notify::ellipsize", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEllipsize?(self, param0) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - @GObjectProperty(named: "fraction") public var fraction: Double +addSignal(name: "notify::fraction", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFraction?(self, param0) +} - @GObjectProperty(named: "inverted") public var inverted: Bool +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - @GObjectProperty(named: "pulse-step") public var pulseStep: Double +addSignal(name: "notify::inverted", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInverted?(self, param0) +} - @GObjectProperty(named: "text") public var text: String? +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyEllipsize: ((ProgressBar, OpaquePointer) -> Void)? +addSignal(name: "notify::pulse-step", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPulseStep?(self, param0) +} - public var notifyFraction: ((ProgressBar, OpaquePointer) -> Void)? +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyInverted: ((ProgressBar, OpaquePointer) -> Void)? +addSignal(name: "notify::show-text", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowText?(self, param0) +} - public var notifyPulseStep: ((ProgressBar, OpaquePointer) -> Void)? +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyShowText: ((ProgressBar, OpaquePointer) -> Void)? +addSignal(name: "notify::text", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyText?(self, param0) +} - public var notifyText: ((ProgressBar, OpaquePointer) -> Void)? +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyOrientation: ((ProgressBar, OpaquePointer) -> Void)? +addSignal(name: "notify::orientation", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyOrientation?(self, param0) } +} + + +@GObjectProperty(named: "fraction") public var fraction: Double + + +@GObjectProperty(named: "inverted") public var inverted: Bool + + +@GObjectProperty(named: "pulse-step") public var pulseStep: Double + + +@GObjectProperty(named: "text") public var text: String? + + +public var notifyEllipsize: ((ProgressBar, OpaquePointer) -> Void)? + + +public var notifyFraction: ((ProgressBar, OpaquePointer) -> Void)? + + +public var notifyInverted: ((ProgressBar, OpaquePointer) -> Void)? + + +public var notifyPulseStep: ((ProgressBar, OpaquePointer) -> Void)? + + +public var notifyShowText: ((ProgressBar, OpaquePointer) -> Void)? + + +public var notifyText: ((ProgressBar, OpaquePointer) -> Void)? + + +public var notifyOrientation: ((ProgressBar, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/Range.swift b/Sources/Gtk3/Generated/Range.swift index b93bddbbe7..e2405f6340 100644 --- a/Sources/Gtk3/Generated/Range.swift +++ b/Sources/Gtk3/Generated/Range.swift @@ -2,214 +2,200 @@ import CGtk3 /// #GtkRange is the common base class for widgets which visualize an /// adjustment, e.g #GtkScale or #GtkScrollbar. -/// +/// /// Apart from signals for monitoring the parameters of the adjustment, /// #GtkRange provides properties and methods for influencing the sensitivity /// of the “steppers”. It also provides properties and methods for setting a /// “fill level” on range widgets. See gtk_range_set_fill_level(). open class Range: Widget, Orientable { + - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "adjust-bounds", handler: gCallback(handler0)) { - [weak self] (param0: Double) in - guard let self = self else { return } - self.adjustBounds?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, GtkScrollType, Double, UnsafeMutableRawPointer) - -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - - addSignal(name: "change-value", handler: gCallback(handler1)) { - [weak self] (param0: GtkScrollType, param1: Double) in - guard let self = self else { return } - self.changeValue?(self, param0, param1) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, GtkScrollType, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "move-slider", handler: gCallback(handler2)) { - [weak self] (param0: GtkScrollType) in - guard let self = self else { return } - self.moveSlider?(self, param0) - } - - addSignal(name: "value-changed") { [weak self] () in - guard let self = self else { return } - self.valueChanged?(self) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::adjustment", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAdjustment?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::fill-level", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFillLevel?(self, param0) - } - - let handler6: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::inverted", handler: gCallback(handler6)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInverted?(self, param0) - } - - let handler7: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::lower-stepper-sensitivity", handler: gCallback(handler7)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLowerStepperSensitivity?(self, param0) - } - - let handler8: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::restrict-to-fill-level", handler: gCallback(handler8)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyRestrictToFillLevel?(self, param0) - } - - let handler9: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::round-digits", handler: gCallback(handler9)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyRoundDigits?(self, param0) - } - - let handler10: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::show-fill-level", handler: gCallback(handler10)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowFillLevel?(self, param0) - } - - let handler11: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::upper-stepper-sensitivity", handler: gCallback(handler11)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUpperStepperSensitivity?(self, param0) - } - - let handler12: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::orientation", handler: gCallback(handler12)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyOrientation?(self, param0) - } + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: @convention(c) (UnsafeMutableRawPointer, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "adjust-bounds", handler: gCallback(handler0)) { [weak self] (param0: Double) in + guard let self = self else { return } + self.adjustBounds?(self, param0) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, GtkScrollType, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + +addSignal(name: "change-value", handler: gCallback(handler1)) { [weak self] (param0: GtkScrollType, param1: Double) in + guard let self = self else { return } + self.changeValue?(self, param0, param1) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, GtkScrollType, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "move-slider", handler: gCallback(handler2)) { [weak self] (param0: GtkScrollType) in + guard let self = self else { return } + self.moveSlider?(self, param0) +} + +addSignal(name: "value-changed") { [weak self] () in + guard let self = self else { return } + self.valueChanged?(self) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - @GObjectProperty(named: "inverted") public var inverted: Bool +addSignal(name: "notify::adjustment", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAdjustment?(self, param0) +} - @GObjectProperty(named: "lower-stepper-sensitivity") public var lowerStepperSensitivity: - SensitivityType +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - @GObjectProperty(named: "upper-stepper-sensitivity") public var upperStepperSensitivity: - SensitivityType +addSignal(name: "notify::fill-level", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFillLevel?(self, param0) +} - /// Emitted before clamping a value, to give the application a - /// chance to adjust the bounds. - public var adjustBounds: ((Range, Double) -> Void)? +let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// The #GtkRange::change-value signal is emitted when a scroll action is - /// performed on a range. It allows an application to determine the - /// type of scroll event that occurred and the resultant new value. - /// The application can handle the event itself and return %TRUE to - /// prevent further processing. Or, by returning %FALSE, it can pass - /// the event to other handlers until the default GTK+ handler is - /// reached. - /// - /// The value parameter is unrounded. An application that overrides - /// the GtkRange::change-value signal is responsible for clamping the - /// value to the desired number of decimal digits; the default GTK+ - /// handler clamps the value based on #GtkRange:round-digits. - public var changeValue: ((Range, GtkScrollType, Double) -> Void)? +addSignal(name: "notify::inverted", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInverted?(self, param0) +} - /// Virtual function that moves the slider. Used for keybindings. - public var moveSlider: ((Range, GtkScrollType) -> Void)? +let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - /// Emitted when the range value changes. - public var valueChanged: ((Range) -> Void)? +addSignal(name: "notify::lower-stepper-sensitivity", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLowerStepperSensitivity?(self, param0) +} - public var notifyAdjustment: ((Range, OpaquePointer) -> Void)? +let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyFillLevel: ((Range, OpaquePointer) -> Void)? +addSignal(name: "notify::restrict-to-fill-level", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyRestrictToFillLevel?(self, param0) +} - public var notifyInverted: ((Range, OpaquePointer) -> Void)? +let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyLowerStepperSensitivity: ((Range, OpaquePointer) -> Void)? +addSignal(name: "notify::round-digits", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyRoundDigits?(self, param0) +} - public var notifyRestrictToFillLevel: ((Range, OpaquePointer) -> Void)? +let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyRoundDigits: ((Range, OpaquePointer) -> Void)? +addSignal(name: "notify::show-fill-level", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowFillLevel?(self, param0) +} + +let handler11: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyShowFillLevel: ((Range, OpaquePointer) -> Void)? +addSignal(name: "notify::upper-stepper-sensitivity", handler: gCallback(handler11)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUpperStepperSensitivity?(self, param0) +} - public var notifyUpperStepperSensitivity: ((Range, OpaquePointer) -> Void)? +let handler12: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - public var notifyOrientation: ((Range, OpaquePointer) -> Void)? +addSignal(name: "notify::orientation", handler: gCallback(handler12)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyOrientation?(self, param0) } +} + + +@GObjectProperty(named: "inverted") public var inverted: Bool + + +@GObjectProperty(named: "lower-stepper-sensitivity") public var lowerStepperSensitivity: SensitivityType + + +@GObjectProperty(named: "upper-stepper-sensitivity") public var upperStepperSensitivity: SensitivityType + +/// Emitted before clamping a value, to give the application a +/// chance to adjust the bounds. +public var adjustBounds: ((Range, Double) -> Void)? + +/// The #GtkRange::change-value signal is emitted when a scroll action is +/// performed on a range. It allows an application to determine the +/// type of scroll event that occurred and the resultant new value. +/// The application can handle the event itself and return %TRUE to +/// prevent further processing. Or, by returning %FALSE, it can pass +/// the event to other handlers until the default GTK+ handler is +/// reached. +/// +/// The value parameter is unrounded. An application that overrides +/// the GtkRange::change-value signal is responsible for clamping the +/// value to the desired number of decimal digits; the default GTK+ +/// handler clamps the value based on #GtkRange:round-digits. +public var changeValue: ((Range, GtkScrollType, Double) -> Void)? + +/// Virtual function that moves the slider. Used for keybindings. +public var moveSlider: ((Range, GtkScrollType) -> Void)? + +/// Emitted when the range value changes. +public var valueChanged: ((Range) -> Void)? + + +public var notifyAdjustment: ((Range, OpaquePointer) -> Void)? + + +public var notifyFillLevel: ((Range, OpaquePointer) -> Void)? + + +public var notifyInverted: ((Range, OpaquePointer) -> Void)? + + +public var notifyLowerStepperSensitivity: ((Range, OpaquePointer) -> Void)? + + +public var notifyRestrictToFillLevel: ((Range, OpaquePointer) -> Void)? + + +public var notifyRoundDigits: ((Range, OpaquePointer) -> Void)? + + +public var notifyShowFillLevel: ((Range, OpaquePointer) -> Void)? + + +public var notifyUpperStepperSensitivity: ((Range, OpaquePointer) -> Void)? + + +public var notifyOrientation: ((Range, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/RcTokenType.swift b/Sources/Gtk3/Generated/RcTokenType.swift index bf9b68857a..0c86451698 100644 --- a/Sources/Gtk3/Generated/RcTokenType.swift +++ b/Sources/Gtk3/Generated/RcTokenType.swift @@ -8,172 +8,172 @@ public enum RcTokenType: GValueRepresentableEnum { public typealias GtkEnum = GtkRcTokenType /// Deprecated - case invalid - /// Deprecated - case include - /// Deprecated - case normal - /// Deprecated - case active - /// Deprecated - case prelight - /// Deprecated - case selected - /// Deprecated - case insensitive - /// Deprecated - case fg - /// Deprecated - case bg - /// Deprecated - case text - /// Deprecated - case base - /// Deprecated - case xthickness - /// Deprecated - case ythickness - /// Deprecated - case font - /// Deprecated - case fontset - /// Deprecated - case fontName - /// Deprecated - case bgPixmap - /// Deprecated - case pixmapPath - /// Deprecated - case style - /// Deprecated - case binding - /// Deprecated - case bind - /// Deprecated - case widget - /// Deprecated - case widgetClass - /// Deprecated - case class_ - /// Deprecated - case lowest - /// Deprecated - case gtk - /// Deprecated - case application - /// Deprecated - case theme - /// Deprecated - case rc - /// Deprecated - case highest - /// Deprecated - case engine - /// Deprecated - case modulePath - /// Deprecated - case imModulePath - /// Deprecated - case imModuleFile - /// Deprecated - case stock - /// Deprecated - case ltr - /// Deprecated - case rtl - /// Deprecated - case color - /// Deprecated - case unbind - /// Deprecated - case last +case invalid +/// Deprecated +case include +/// Deprecated +case normal +/// Deprecated +case active +/// Deprecated +case prelight +/// Deprecated +case selected +/// Deprecated +case insensitive +/// Deprecated +case fg +/// Deprecated +case bg +/// Deprecated +case text +/// Deprecated +case base +/// Deprecated +case xthickness +/// Deprecated +case ythickness +/// Deprecated +case font +/// Deprecated +case fontset +/// Deprecated +case fontName +/// Deprecated +case bgPixmap +/// Deprecated +case pixmapPath +/// Deprecated +case style +/// Deprecated +case binding +/// Deprecated +case bind +/// Deprecated +case widget +/// Deprecated +case widgetClass +/// Deprecated +case class_ +/// Deprecated +case lowest +/// Deprecated +case gtk +/// Deprecated +case application +/// Deprecated +case theme +/// Deprecated +case rc +/// Deprecated +case highest +/// Deprecated +case engine +/// Deprecated +case modulePath +/// Deprecated +case imModulePath +/// Deprecated +case imModuleFile +/// Deprecated +case stock +/// Deprecated +case ltr +/// Deprecated +case rtl +/// Deprecated +case color +/// Deprecated +case unbind +/// Deprecated +case last public static var type: GType { - gtk_rc_token_type_get_type() - } + gtk_rc_token_type_get_type() +} public init(from gtkEnum: GtkRcTokenType) { switch gtkEnum { case GTK_RC_TOKEN_INVALID: - self = .invalid - case GTK_RC_TOKEN_INCLUDE: - self = .include - case GTK_RC_TOKEN_NORMAL: - self = .normal - case GTK_RC_TOKEN_ACTIVE: - self = .active - case GTK_RC_TOKEN_PRELIGHT: - self = .prelight - case GTK_RC_TOKEN_SELECTED: - self = .selected - case GTK_RC_TOKEN_INSENSITIVE: - self = .insensitive - case GTK_RC_TOKEN_FG: - self = .fg - case GTK_RC_TOKEN_BG: - self = .bg - case GTK_RC_TOKEN_TEXT: - self = .text - case GTK_RC_TOKEN_BASE: - self = .base - case GTK_RC_TOKEN_XTHICKNESS: - self = .xthickness - case GTK_RC_TOKEN_YTHICKNESS: - self = .ythickness - case GTK_RC_TOKEN_FONT: - self = .font - case GTK_RC_TOKEN_FONTSET: - self = .fontset - case GTK_RC_TOKEN_FONT_NAME: - self = .fontName - case GTK_RC_TOKEN_BG_PIXMAP: - self = .bgPixmap - case GTK_RC_TOKEN_PIXMAP_PATH: - self = .pixmapPath - case GTK_RC_TOKEN_STYLE: - self = .style - case GTK_RC_TOKEN_BINDING: - self = .binding - case GTK_RC_TOKEN_BIND: - self = .bind - case GTK_RC_TOKEN_WIDGET: - self = .widget - case GTK_RC_TOKEN_WIDGET_CLASS: - self = .widgetClass - case GTK_RC_TOKEN_CLASS: - self = .class_ - case GTK_RC_TOKEN_LOWEST: - self = .lowest - case GTK_RC_TOKEN_GTK: - self = .gtk - case GTK_RC_TOKEN_APPLICATION: - self = .application - case GTK_RC_TOKEN_THEME: - self = .theme - case GTK_RC_TOKEN_RC: - self = .rc - case GTK_RC_TOKEN_HIGHEST: - self = .highest - case GTK_RC_TOKEN_ENGINE: - self = .engine - case GTK_RC_TOKEN_MODULE_PATH: - self = .modulePath - case GTK_RC_TOKEN_IM_MODULE_PATH: - self = .imModulePath - case GTK_RC_TOKEN_IM_MODULE_FILE: - self = .imModuleFile - case GTK_RC_TOKEN_STOCK: - self = .stock - case GTK_RC_TOKEN_LTR: - self = .ltr - case GTK_RC_TOKEN_RTL: - self = .rtl - case GTK_RC_TOKEN_COLOR: - self = .color - case GTK_RC_TOKEN_UNBIND: - self = .unbind - case GTK_RC_TOKEN_LAST: - self = .last + self = .invalid +case GTK_RC_TOKEN_INCLUDE: + self = .include +case GTK_RC_TOKEN_NORMAL: + self = .normal +case GTK_RC_TOKEN_ACTIVE: + self = .active +case GTK_RC_TOKEN_PRELIGHT: + self = .prelight +case GTK_RC_TOKEN_SELECTED: + self = .selected +case GTK_RC_TOKEN_INSENSITIVE: + self = .insensitive +case GTK_RC_TOKEN_FG: + self = .fg +case GTK_RC_TOKEN_BG: + self = .bg +case GTK_RC_TOKEN_TEXT: + self = .text +case GTK_RC_TOKEN_BASE: + self = .base +case GTK_RC_TOKEN_XTHICKNESS: + self = .xthickness +case GTK_RC_TOKEN_YTHICKNESS: + self = .ythickness +case GTK_RC_TOKEN_FONT: + self = .font +case GTK_RC_TOKEN_FONTSET: + self = .fontset +case GTK_RC_TOKEN_FONT_NAME: + self = .fontName +case GTK_RC_TOKEN_BG_PIXMAP: + self = .bgPixmap +case GTK_RC_TOKEN_PIXMAP_PATH: + self = .pixmapPath +case GTK_RC_TOKEN_STYLE: + self = .style +case GTK_RC_TOKEN_BINDING: + self = .binding +case GTK_RC_TOKEN_BIND: + self = .bind +case GTK_RC_TOKEN_WIDGET: + self = .widget +case GTK_RC_TOKEN_WIDGET_CLASS: + self = .widgetClass +case GTK_RC_TOKEN_CLASS: + self = .class_ +case GTK_RC_TOKEN_LOWEST: + self = .lowest +case GTK_RC_TOKEN_GTK: + self = .gtk +case GTK_RC_TOKEN_APPLICATION: + self = .application +case GTK_RC_TOKEN_THEME: + self = .theme +case GTK_RC_TOKEN_RC: + self = .rc +case GTK_RC_TOKEN_HIGHEST: + self = .highest +case GTK_RC_TOKEN_ENGINE: + self = .engine +case GTK_RC_TOKEN_MODULE_PATH: + self = .modulePath +case GTK_RC_TOKEN_IM_MODULE_PATH: + self = .imModulePath +case GTK_RC_TOKEN_IM_MODULE_FILE: + self = .imModuleFile +case GTK_RC_TOKEN_STOCK: + self = .stock +case GTK_RC_TOKEN_LTR: + self = .ltr +case GTK_RC_TOKEN_RTL: + self = .rtl +case GTK_RC_TOKEN_COLOR: + self = .color +case GTK_RC_TOKEN_UNBIND: + self = .unbind +case GTK_RC_TOKEN_LAST: + self = .last default: fatalError("Unsupported GtkRcTokenType enum value: \(gtkEnum.rawValue)") } @@ -182,85 +182,85 @@ public enum RcTokenType: GValueRepresentableEnum { public func toGtk() -> GtkRcTokenType { switch self { case .invalid: - return GTK_RC_TOKEN_INVALID - case .include: - return GTK_RC_TOKEN_INCLUDE - case .normal: - return GTK_RC_TOKEN_NORMAL - case .active: - return GTK_RC_TOKEN_ACTIVE - case .prelight: - return GTK_RC_TOKEN_PRELIGHT - case .selected: - return GTK_RC_TOKEN_SELECTED - case .insensitive: - return GTK_RC_TOKEN_INSENSITIVE - case .fg: - return GTK_RC_TOKEN_FG - case .bg: - return GTK_RC_TOKEN_BG - case .text: - return GTK_RC_TOKEN_TEXT - case .base: - return GTK_RC_TOKEN_BASE - case .xthickness: - return GTK_RC_TOKEN_XTHICKNESS - case .ythickness: - return GTK_RC_TOKEN_YTHICKNESS - case .font: - return GTK_RC_TOKEN_FONT - case .fontset: - return GTK_RC_TOKEN_FONTSET - case .fontName: - return GTK_RC_TOKEN_FONT_NAME - case .bgPixmap: - return GTK_RC_TOKEN_BG_PIXMAP - case .pixmapPath: - return GTK_RC_TOKEN_PIXMAP_PATH - case .style: - return GTK_RC_TOKEN_STYLE - case .binding: - return GTK_RC_TOKEN_BINDING - case .bind: - return GTK_RC_TOKEN_BIND - case .widget: - return GTK_RC_TOKEN_WIDGET - case .widgetClass: - return GTK_RC_TOKEN_WIDGET_CLASS - case .class_: - return GTK_RC_TOKEN_CLASS - case .lowest: - return GTK_RC_TOKEN_LOWEST - case .gtk: - return GTK_RC_TOKEN_GTK - case .application: - return GTK_RC_TOKEN_APPLICATION - case .theme: - return GTK_RC_TOKEN_THEME - case .rc: - return GTK_RC_TOKEN_RC - case .highest: - return GTK_RC_TOKEN_HIGHEST - case .engine: - return GTK_RC_TOKEN_ENGINE - case .modulePath: - return GTK_RC_TOKEN_MODULE_PATH - case .imModulePath: - return GTK_RC_TOKEN_IM_MODULE_PATH - case .imModuleFile: - return GTK_RC_TOKEN_IM_MODULE_FILE - case .stock: - return GTK_RC_TOKEN_STOCK - case .ltr: - return GTK_RC_TOKEN_LTR - case .rtl: - return GTK_RC_TOKEN_RTL - case .color: - return GTK_RC_TOKEN_COLOR - case .unbind: - return GTK_RC_TOKEN_UNBIND - case .last: - return GTK_RC_TOKEN_LAST + return GTK_RC_TOKEN_INVALID +case .include: + return GTK_RC_TOKEN_INCLUDE +case .normal: + return GTK_RC_TOKEN_NORMAL +case .active: + return GTK_RC_TOKEN_ACTIVE +case .prelight: + return GTK_RC_TOKEN_PRELIGHT +case .selected: + return GTK_RC_TOKEN_SELECTED +case .insensitive: + return GTK_RC_TOKEN_INSENSITIVE +case .fg: + return GTK_RC_TOKEN_FG +case .bg: + return GTK_RC_TOKEN_BG +case .text: + return GTK_RC_TOKEN_TEXT +case .base: + return GTK_RC_TOKEN_BASE +case .xthickness: + return GTK_RC_TOKEN_XTHICKNESS +case .ythickness: + return GTK_RC_TOKEN_YTHICKNESS +case .font: + return GTK_RC_TOKEN_FONT +case .fontset: + return GTK_RC_TOKEN_FONTSET +case .fontName: + return GTK_RC_TOKEN_FONT_NAME +case .bgPixmap: + return GTK_RC_TOKEN_BG_PIXMAP +case .pixmapPath: + return GTK_RC_TOKEN_PIXMAP_PATH +case .style: + return GTK_RC_TOKEN_STYLE +case .binding: + return GTK_RC_TOKEN_BINDING +case .bind: + return GTK_RC_TOKEN_BIND +case .widget: + return GTK_RC_TOKEN_WIDGET +case .widgetClass: + return GTK_RC_TOKEN_WIDGET_CLASS +case .class_: + return GTK_RC_TOKEN_CLASS +case .lowest: + return GTK_RC_TOKEN_LOWEST +case .gtk: + return GTK_RC_TOKEN_GTK +case .application: + return GTK_RC_TOKEN_APPLICATION +case .theme: + return GTK_RC_TOKEN_THEME +case .rc: + return GTK_RC_TOKEN_RC +case .highest: + return GTK_RC_TOKEN_HIGHEST +case .engine: + return GTK_RC_TOKEN_ENGINE +case .modulePath: + return GTK_RC_TOKEN_MODULE_PATH +case .imModulePath: + return GTK_RC_TOKEN_IM_MODULE_PATH +case .imModuleFile: + return GTK_RC_TOKEN_IM_MODULE_FILE +case .stock: + return GTK_RC_TOKEN_STOCK +case .ltr: + return GTK_RC_TOKEN_LTR +case .rtl: + return GTK_RC_TOKEN_RTL +case .color: + return GTK_RC_TOKEN_COLOR +case .unbind: + return GTK_RC_TOKEN_UNBIND +case .last: + return GTK_RC_TOKEN_LAST } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/RecentChooser.swift b/Sources/Gtk3/Generated/RecentChooser.swift index c75b23fae0..f869ec0de9 100644 --- a/Sources/Gtk3/Generated/RecentChooser.swift +++ b/Sources/Gtk3/Generated/RecentChooser.swift @@ -4,21 +4,21 @@ import CGtk3 /// displaying the list of recently used files. In GTK+, the main objects /// that implement this interface are #GtkRecentChooserWidget, /// #GtkRecentChooserDialog and #GtkRecentChooserMenu. -/// +/// /// Recently used files are supported since GTK+ 2.10. public protocol RecentChooser: GObjectRepresentable { - - var showPrivate: Bool { get set } + +var showPrivate: Bool { get set } /// This signal is emitted when the user "activates" a recent item - /// in the recent chooser. This can happen by double-clicking on an item - /// in the recently used resources list, or by pressing - /// `Enter`. - var itemActivated: ((Self) -> Void)? { get set } +/// in the recent chooser. This can happen by double-clicking on an item +/// in the recently used resources list, or by pressing +/// `Enter`. +var itemActivated: ((Self) -> Void)? { get set } - /// This signal is emitted when there is a change in the set of - /// selected recently used resources. This can happen when a user - /// modifies the selection with the mouse or the keyboard, or when - /// explicitly calling functions to change the selection. - var selectionChanged: ((Self) -> Void)? { get set } -} +/// This signal is emitted when there is a change in the set of +/// selected recently used resources. This can happen when a user +/// modifies the selection with the mouse or the keyboard, or when +/// explicitly calling functions to change the selection. +var selectionChanged: ((Self) -> Void)? { get set } +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ReliefStyle.swift b/Sources/Gtk3/Generated/ReliefStyle.swift index 4949c0d1a0..b55dcc2aca 100644 --- a/Sources/Gtk3/Generated/ReliefStyle.swift +++ b/Sources/Gtk3/Generated/ReliefStyle.swift @@ -5,24 +5,24 @@ public enum ReliefStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkReliefStyle /// Draw a normal relief. - case normal - /// A half relief. Deprecated in 3.14, does the same as @GTK_RELIEF_NORMAL - case half - /// No relief. - case none +case normal +/// A half relief. Deprecated in 3.14, does the same as @GTK_RELIEF_NORMAL +case half +/// No relief. +case none public static var type: GType { - gtk_relief_style_get_type() - } + gtk_relief_style_get_type() +} public init(from gtkEnum: GtkReliefStyle) { switch gtkEnum { case GTK_RELIEF_NORMAL: - self = .normal - case GTK_RELIEF_HALF: - self = .half - case GTK_RELIEF_NONE: - self = .none + self = .normal +case GTK_RELIEF_HALF: + self = .half +case GTK_RELIEF_NONE: + self = .none default: fatalError("Unsupported GtkReliefStyle enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ public enum ReliefStyle: GValueRepresentableEnum { public func toGtk() -> GtkReliefStyle { switch self { case .normal: - return GTK_RELIEF_NORMAL - case .half: - return GTK_RELIEF_HALF - case .none: - return GTK_RELIEF_NONE + return GTK_RELIEF_NORMAL +case .half: + return GTK_RELIEF_HALF +case .none: + return GTK_RELIEF_NONE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ResizeMode.swift b/Sources/Gtk3/Generated/ResizeMode.swift index ef35892b87..689e77f609 100644 --- a/Sources/Gtk3/Generated/ResizeMode.swift +++ b/Sources/Gtk3/Generated/ResizeMode.swift @@ -1,27 +1,28 @@ import CGtk3 + public enum ResizeMode: GValueRepresentableEnum { public typealias GtkEnum = GtkResizeMode /// Pass resize request to the parent - case parent - /// Queue resizes on this widget - case queue - /// Resize immediately. Deprecated. - case immediate +case parent +/// Queue resizes on this widget +case queue +/// Resize immediately. Deprecated. +case immediate public static var type: GType { - gtk_resize_mode_get_type() - } + gtk_resize_mode_get_type() +} public init(from gtkEnum: GtkResizeMode) { switch gtkEnum { case GTK_RESIZE_PARENT: - self = .parent - case GTK_RESIZE_QUEUE: - self = .queue - case GTK_RESIZE_IMMEDIATE: - self = .immediate + self = .parent +case GTK_RESIZE_QUEUE: + self = .queue +case GTK_RESIZE_IMMEDIATE: + self = .immediate default: fatalError("Unsupported GtkResizeMode enum value: \(gtkEnum.rawValue)") } @@ -30,11 +31,11 @@ public enum ResizeMode: GValueRepresentableEnum { public func toGtk() -> GtkResizeMode { switch self { case .parent: - return GTK_RESIZE_PARENT - case .queue: - return GTK_RESIZE_QUEUE - case .immediate: - return GTK_RESIZE_IMMEDIATE + return GTK_RESIZE_PARENT +case .queue: + return GTK_RESIZE_QUEUE +case .immediate: + return GTK_RESIZE_IMMEDIATE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ResponseType.swift b/Sources/Gtk3/Generated/ResponseType.swift index 5db0b51336..73389bb527 100644 --- a/Sources/Gtk3/Generated/ResponseType.swift +++ b/Sources/Gtk3/Generated/ResponseType.swift @@ -7,57 +7,57 @@ public enum ResponseType: GValueRepresentableEnum { public typealias GtkEnum = GtkResponseType /// Returned if an action widget has no response id, - /// or if the dialog gets programmatically hidden or destroyed - case none - /// Generic response id, not used by GTK+ dialogs - case reject - /// Generic response id, not used by GTK+ dialogs - case accept - /// Returned if the dialog is deleted - case deleteEvent - /// Returned by OK buttons in GTK+ dialogs - case ok - /// Returned by Cancel buttons in GTK+ dialogs - case cancel - /// Returned by Close buttons in GTK+ dialogs - case close - /// Returned by Yes buttons in GTK+ dialogs - case yes - /// Returned by No buttons in GTK+ dialogs - case no - /// Returned by Apply buttons in GTK+ dialogs - case apply - /// Returned by Help buttons in GTK+ dialogs - case help +/// or if the dialog gets programmatically hidden or destroyed +case none +/// Generic response id, not used by GTK+ dialogs +case reject +/// Generic response id, not used by GTK+ dialogs +case accept +/// Returned if the dialog is deleted +case deleteEvent +/// Returned by OK buttons in GTK+ dialogs +case ok +/// Returned by Cancel buttons in GTK+ dialogs +case cancel +/// Returned by Close buttons in GTK+ dialogs +case close +/// Returned by Yes buttons in GTK+ dialogs +case yes +/// Returned by No buttons in GTK+ dialogs +case no +/// Returned by Apply buttons in GTK+ dialogs +case apply +/// Returned by Help buttons in GTK+ dialogs +case help public static var type: GType { - gtk_response_type_get_type() - } + gtk_response_type_get_type() +} public init(from gtkEnum: GtkResponseType) { switch gtkEnum { case GTK_RESPONSE_NONE: - self = .none - case GTK_RESPONSE_REJECT: - self = .reject - case GTK_RESPONSE_ACCEPT: - self = .accept - case GTK_RESPONSE_DELETE_EVENT: - self = .deleteEvent - case GTK_RESPONSE_OK: - self = .ok - case GTK_RESPONSE_CANCEL: - self = .cancel - case GTK_RESPONSE_CLOSE: - self = .close - case GTK_RESPONSE_YES: - self = .yes - case GTK_RESPONSE_NO: - self = .no - case GTK_RESPONSE_APPLY: - self = .apply - case GTK_RESPONSE_HELP: - self = .help + self = .none +case GTK_RESPONSE_REJECT: + self = .reject +case GTK_RESPONSE_ACCEPT: + self = .accept +case GTK_RESPONSE_DELETE_EVENT: + self = .deleteEvent +case GTK_RESPONSE_OK: + self = .ok +case GTK_RESPONSE_CANCEL: + self = .cancel +case GTK_RESPONSE_CLOSE: + self = .close +case GTK_RESPONSE_YES: + self = .yes +case GTK_RESPONSE_NO: + self = .no +case GTK_RESPONSE_APPLY: + self = .apply +case GTK_RESPONSE_HELP: + self = .help default: fatalError("Unsupported GtkResponseType enum value: \(gtkEnum.rawValue)") } @@ -66,27 +66,27 @@ public enum ResponseType: GValueRepresentableEnum { public func toGtk() -> GtkResponseType { switch self { case .none: - return GTK_RESPONSE_NONE - case .reject: - return GTK_RESPONSE_REJECT - case .accept: - return GTK_RESPONSE_ACCEPT - case .deleteEvent: - return GTK_RESPONSE_DELETE_EVENT - case .ok: - return GTK_RESPONSE_OK - case .cancel: - return GTK_RESPONSE_CANCEL - case .close: - return GTK_RESPONSE_CLOSE - case .yes: - return GTK_RESPONSE_YES - case .no: - return GTK_RESPONSE_NO - case .apply: - return GTK_RESPONSE_APPLY - case .help: - return GTK_RESPONSE_HELP + return GTK_RESPONSE_NONE +case .reject: + return GTK_RESPONSE_REJECT +case .accept: + return GTK_RESPONSE_ACCEPT +case .deleteEvent: + return GTK_RESPONSE_DELETE_EVENT +case .ok: + return GTK_RESPONSE_OK +case .cancel: + return GTK_RESPONSE_CANCEL +case .close: + return GTK_RESPONSE_CLOSE +case .yes: + return GTK_RESPONSE_YES +case .no: + return GTK_RESPONSE_NO +case .apply: + return GTK_RESPONSE_APPLY +case .help: + return GTK_RESPONSE_HELP } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/RevealerTransitionType.swift b/Sources/Gtk3/Generated/RevealerTransitionType.swift index beabd123fb..c6177e2bb4 100644 --- a/Sources/Gtk3/Generated/RevealerTransitionType.swift +++ b/Sources/Gtk3/Generated/RevealerTransitionType.swift @@ -6,36 +6,36 @@ public enum RevealerTransitionType: GValueRepresentableEnum { public typealias GtkEnum = GtkRevealerTransitionType /// No transition - case none - /// Fade in - case crossfade - /// Slide in from the left - case slideRight - /// Slide in from the right - case slideLeft - /// Slide in from the bottom - case slideUp - /// Slide in from the top - case slideDown +case none +/// Fade in +case crossfade +/// Slide in from the left +case slideRight +/// Slide in from the right +case slideLeft +/// Slide in from the bottom +case slideUp +/// Slide in from the top +case slideDown public static var type: GType { - gtk_revealer_transition_type_get_type() - } + gtk_revealer_transition_type_get_type() +} public init(from gtkEnum: GtkRevealerTransitionType) { switch gtkEnum { case GTK_REVEALER_TRANSITION_TYPE_NONE: - self = .none - case GTK_REVEALER_TRANSITION_TYPE_CROSSFADE: - self = .crossfade - case GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT: - self = .slideRight - case GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT: - self = .slideLeft - case GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP: - self = .slideUp - case GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN: - self = .slideDown + self = .none +case GTK_REVEALER_TRANSITION_TYPE_CROSSFADE: + self = .crossfade +case GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT: + self = .slideRight +case GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT: + self = .slideLeft +case GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP: + self = .slideUp +case GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN: + self = .slideDown default: fatalError("Unsupported GtkRevealerTransitionType enum value: \(gtkEnum.rawValue)") } @@ -44,17 +44,17 @@ public enum RevealerTransitionType: GValueRepresentableEnum { public func toGtk() -> GtkRevealerTransitionType { switch self { case .none: - return GTK_REVEALER_TRANSITION_TYPE_NONE - case .crossfade: - return GTK_REVEALER_TRANSITION_TYPE_CROSSFADE - case .slideRight: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT - case .slideLeft: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT - case .slideUp: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP - case .slideDown: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN + return GTK_REVEALER_TRANSITION_TYPE_NONE +case .crossfade: + return GTK_REVEALER_TRANSITION_TYPE_CROSSFADE +case .slideRight: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT +case .slideLeft: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT +case .slideUp: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP +case .slideDown: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/Scale.swift b/Sources/Gtk3/Generated/Scale.swift index b6970ca14b..4ca52e5470 100644 --- a/Sources/Gtk3/Generated/Scale.swift +++ b/Sources/Gtk3/Generated/Scale.swift @@ -6,23 +6,23 @@ import CGtk3 /// To set the value of a scale, you would normally use gtk_range_set_value(). /// To detect changes to the value, you would normally use the /// #GtkRange::value-changed signal. -/// +/// /// Note that using the same upper and lower bounds for the #GtkScale (through /// the #GtkRange methods) will hide the slider itself. This is useful for /// applications that want to show an undeterminate value on the scale, without /// changing the layout of the application (such as movie or music players). -/// +/// /// # GtkScale as GtkBuildable -/// +/// /// GtkScale supports a custom `` element, which can contain multiple /// `` elements. The “value” and “position” attributes have the same /// meaning as gtk_scale_add_mark() parameters of the same name. If the /// element is not empty, its content is taken as the markup to show at /// the mark. It can be translated with the usual ”translatable” and /// “context” attributes. -/// +/// /// # CSS nodes -/// +/// /// |[ /// scale[.fine-tune][.marks-before][.marks-after] /// ├── marks.top @@ -43,127 +43,123 @@ import CGtk3 /// ┊ ╰── [label] /// ╰── mark /// ]| -/// +/// /// GtkScale has a main CSS node with name scale and a subnode for its contents, /// with subnodes named trough and slider. -/// +/// /// The main node gets the style class .fine-tune added when the scale is in /// 'fine-tuning' mode. -/// +/// /// If the scale has an origin (see gtk_scale_set_has_origin()), there is a /// subnode with name highlight below the trough node that is used for rendering /// the highlighted part of the trough. -/// +/// /// If the scale is showing a fill level (see gtk_range_set_show_fill_level()), /// there is a subnode with name fill below the trough node that is used for /// rendering the filled in part of the trough. -/// +/// /// If marks are present, there is a marks subnode before or after the contents /// node, below which each mark gets a node with name mark. The marks nodes get /// either the .top or .bottom style class. -/// +/// /// The mark node has a subnode named indicator. If the mark has text, it also /// has a subnode named label. When the mark is either above or left of the /// scale, the label subnode is the first when present. Otherwise, the indicator /// subnode is the first. -/// +/// /// The main CSS node gets the 'marks-before' and/or 'marks-after' style classes /// added depending on what marks are present. -/// +/// /// If the scale is displaying the value (see #GtkScale:draw-value), there is /// subnode with name value. open class Scale: Range { /// Creates a new #GtkScale. - public convenience init( - orientation: GtkOrientation, adjustment: UnsafeMutablePointer! - ) { - self.init( - gtk_scale_new(orientation, adjustment) - ) +public convenience init(orientation: GtkOrientation, adjustment: UnsafeMutablePointer!) { + self.init( + gtk_scale_new(orientation, adjustment) + ) +} + +/// Creates a new scale widget with the given orientation that lets the +/// user input a number between @min and @max (including @min and @max) +/// with the increment @step. @step must be nonzero; it’s the distance +/// the slider moves when using the arrow keys to adjust the scale +/// value. +/// +/// Note that the way in which the precision is derived works best if @step +/// is a power of ten. If the resulting precision is not suitable for your +/// needs, use gtk_scale_set_digits() to correct it. +public convenience init(range orientation: GtkOrientation, min: Double, max: Double, step: Double) { + self.init( + gtk_scale_new_with_range(orientation, min, max, step) + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::digits", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDigits?(self, param0) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Creates a new scale widget with the given orientation that lets the - /// user input a number between @min and @max (including @min and @max) - /// with the increment @step. @step must be nonzero; it’s the distance - /// the slider moves when using the arrow keys to adjust the scale - /// value. - /// - /// Note that the way in which the precision is derived works best if @step - /// is a power of ten. If the resulting precision is not suitable for your - /// needs, use gtk_scale_set_digits() to correct it. - public convenience init( - range orientation: GtkOrientation, min: Double, max: Double, step: Double - ) { - self.init( - gtk_scale_new_with_range(orientation, min, max, step) - ) +addSignal(name: "notify::draw-value", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDrawValue?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::digits", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDigits?(self, param0) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::draw-value", handler: gCallback(handler1)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDrawValue?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::has-origin", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasOrigin?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::value-pos", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyValuePos?(self, param0) - } +addSignal(name: "notify::has-origin", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasOrigin?(self, param0) +} + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - @GObjectProperty(named: "digits") public var digits: Int +addSignal(name: "notify::value-pos", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyValuePos?(self, param0) +} +} + + +@GObjectProperty(named: "digits") public var digits: Int - @GObjectProperty(named: "draw-value") public var drawValue: Bool - @GObjectProperty(named: "has-origin") public var hasOrigin: Bool +@GObjectProperty(named: "draw-value") public var drawValue: Bool - @GObjectProperty(named: "value-pos") public var valuePos: PositionType - public var notifyDigits: ((Scale, OpaquePointer) -> Void)? +@GObjectProperty(named: "has-origin") public var hasOrigin: Bool - public var notifyDrawValue: ((Scale, OpaquePointer) -> Void)? - public var notifyHasOrigin: ((Scale, OpaquePointer) -> Void)? +@GObjectProperty(named: "value-pos") public var valuePos: PositionType - public var notifyValuePos: ((Scale, OpaquePointer) -> Void)? -} + +public var notifyDigits: ((Scale, OpaquePointer) -> Void)? + + +public var notifyDrawValue: ((Scale, OpaquePointer) -> Void)? + + +public var notifyHasOrigin: ((Scale, OpaquePointer) -> Void)? + + +public var notifyValuePos: ((Scale, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ScrollStep.swift b/Sources/Gtk3/Generated/ScrollStep.swift index be495a07c8..f6216a60cb 100644 --- a/Sources/Gtk3/Generated/ScrollStep.swift +++ b/Sources/Gtk3/Generated/ScrollStep.swift @@ -1,39 +1,40 @@ import CGtk3 + public enum ScrollStep: GValueRepresentableEnum { public typealias GtkEnum = GtkScrollStep /// Scroll in steps. - case steps - /// Scroll by pages. - case pages - /// Scroll to ends. - case ends - /// Scroll in horizontal steps. - case horizontalSteps - /// Scroll by horizontal pages. - case horizontalPages - /// Scroll to the horizontal ends. - case horizontalEnds +case steps +/// Scroll by pages. +case pages +/// Scroll to ends. +case ends +/// Scroll in horizontal steps. +case horizontalSteps +/// Scroll by horizontal pages. +case horizontalPages +/// Scroll to the horizontal ends. +case horizontalEnds public static var type: GType { - gtk_scroll_step_get_type() - } + gtk_scroll_step_get_type() +} public init(from gtkEnum: GtkScrollStep) { switch gtkEnum { case GTK_SCROLL_STEPS: - self = .steps - case GTK_SCROLL_PAGES: - self = .pages - case GTK_SCROLL_ENDS: - self = .ends - case GTK_SCROLL_HORIZONTAL_STEPS: - self = .horizontalSteps - case GTK_SCROLL_HORIZONTAL_PAGES: - self = .horizontalPages - case GTK_SCROLL_HORIZONTAL_ENDS: - self = .horizontalEnds + self = .steps +case GTK_SCROLL_PAGES: + self = .pages +case GTK_SCROLL_ENDS: + self = .ends +case GTK_SCROLL_HORIZONTAL_STEPS: + self = .horizontalSteps +case GTK_SCROLL_HORIZONTAL_PAGES: + self = .horizontalPages +case GTK_SCROLL_HORIZONTAL_ENDS: + self = .horizontalEnds default: fatalError("Unsupported GtkScrollStep enum value: \(gtkEnum.rawValue)") } @@ -42,17 +43,17 @@ public enum ScrollStep: GValueRepresentableEnum { public func toGtk() -> GtkScrollStep { switch self { case .steps: - return GTK_SCROLL_STEPS - case .pages: - return GTK_SCROLL_PAGES - case .ends: - return GTK_SCROLL_ENDS - case .horizontalSteps: - return GTK_SCROLL_HORIZONTAL_STEPS - case .horizontalPages: - return GTK_SCROLL_HORIZONTAL_PAGES - case .horizontalEnds: - return GTK_SCROLL_HORIZONTAL_ENDS + return GTK_SCROLL_STEPS +case .pages: + return GTK_SCROLL_PAGES +case .ends: + return GTK_SCROLL_ENDS +case .horizontalSteps: + return GTK_SCROLL_HORIZONTAL_STEPS +case .horizontalPages: + return GTK_SCROLL_HORIZONTAL_PAGES +case .horizontalEnds: + return GTK_SCROLL_HORIZONTAL_ENDS } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ScrollType.swift b/Sources/Gtk3/Generated/ScrollType.swift index 94e7335be2..412ab0685e 100644 --- a/Sources/Gtk3/Generated/ScrollType.swift +++ b/Sources/Gtk3/Generated/ScrollType.swift @@ -5,76 +5,76 @@ public enum ScrollType: GValueRepresentableEnum { public typealias GtkEnum = GtkScrollType /// No scrolling. - case none - /// Jump to new location. - case jump - /// Step backward. - case stepBackward - /// Step forward. - case stepForward - /// Page backward. - case pageBackward - /// Page forward. - case pageForward - /// Step up. - case stepUp - /// Step down. - case stepDown - /// Page up. - case pageUp - /// Page down. - case pageDown - /// Step to the left. - case stepLeft - /// Step to the right. - case stepRight - /// Page to the left. - case pageLeft - /// Page to the right. - case pageRight - /// Scroll to start. - case start - /// Scroll to end. - case end +case none +/// Jump to new location. +case jump +/// Step backward. +case stepBackward +/// Step forward. +case stepForward +/// Page backward. +case pageBackward +/// Page forward. +case pageForward +/// Step up. +case stepUp +/// Step down. +case stepDown +/// Page up. +case pageUp +/// Page down. +case pageDown +/// Step to the left. +case stepLeft +/// Step to the right. +case stepRight +/// Page to the left. +case pageLeft +/// Page to the right. +case pageRight +/// Scroll to start. +case start +/// Scroll to end. +case end public static var type: GType { - gtk_scroll_type_get_type() - } + gtk_scroll_type_get_type() +} public init(from gtkEnum: GtkScrollType) { switch gtkEnum { case GTK_SCROLL_NONE: - self = .none - case GTK_SCROLL_JUMP: - self = .jump - case GTK_SCROLL_STEP_BACKWARD: - self = .stepBackward - case GTK_SCROLL_STEP_FORWARD: - self = .stepForward - case GTK_SCROLL_PAGE_BACKWARD: - self = .pageBackward - case GTK_SCROLL_PAGE_FORWARD: - self = .pageForward - case GTK_SCROLL_STEP_UP: - self = .stepUp - case GTK_SCROLL_STEP_DOWN: - self = .stepDown - case GTK_SCROLL_PAGE_UP: - self = .pageUp - case GTK_SCROLL_PAGE_DOWN: - self = .pageDown - case GTK_SCROLL_STEP_LEFT: - self = .stepLeft - case GTK_SCROLL_STEP_RIGHT: - self = .stepRight - case GTK_SCROLL_PAGE_LEFT: - self = .pageLeft - case GTK_SCROLL_PAGE_RIGHT: - self = .pageRight - case GTK_SCROLL_START: - self = .start - case GTK_SCROLL_END: - self = .end + self = .none +case GTK_SCROLL_JUMP: + self = .jump +case GTK_SCROLL_STEP_BACKWARD: + self = .stepBackward +case GTK_SCROLL_STEP_FORWARD: + self = .stepForward +case GTK_SCROLL_PAGE_BACKWARD: + self = .pageBackward +case GTK_SCROLL_PAGE_FORWARD: + self = .pageForward +case GTK_SCROLL_STEP_UP: + self = .stepUp +case GTK_SCROLL_STEP_DOWN: + self = .stepDown +case GTK_SCROLL_PAGE_UP: + self = .pageUp +case GTK_SCROLL_PAGE_DOWN: + self = .pageDown +case GTK_SCROLL_STEP_LEFT: + self = .stepLeft +case GTK_SCROLL_STEP_RIGHT: + self = .stepRight +case GTK_SCROLL_PAGE_LEFT: + self = .pageLeft +case GTK_SCROLL_PAGE_RIGHT: + self = .pageRight +case GTK_SCROLL_START: + self = .start +case GTK_SCROLL_END: + self = .end default: fatalError("Unsupported GtkScrollType enum value: \(gtkEnum.rawValue)") } @@ -83,37 +83,37 @@ public enum ScrollType: GValueRepresentableEnum { public func toGtk() -> GtkScrollType { switch self { case .none: - return GTK_SCROLL_NONE - case .jump: - return GTK_SCROLL_JUMP - case .stepBackward: - return GTK_SCROLL_STEP_BACKWARD - case .stepForward: - return GTK_SCROLL_STEP_FORWARD - case .pageBackward: - return GTK_SCROLL_PAGE_BACKWARD - case .pageForward: - return GTK_SCROLL_PAGE_FORWARD - case .stepUp: - return GTK_SCROLL_STEP_UP - case .stepDown: - return GTK_SCROLL_STEP_DOWN - case .pageUp: - return GTK_SCROLL_PAGE_UP - case .pageDown: - return GTK_SCROLL_PAGE_DOWN - case .stepLeft: - return GTK_SCROLL_STEP_LEFT - case .stepRight: - return GTK_SCROLL_STEP_RIGHT - case .pageLeft: - return GTK_SCROLL_PAGE_LEFT - case .pageRight: - return GTK_SCROLL_PAGE_RIGHT - case .start: - return GTK_SCROLL_START - case .end: - return GTK_SCROLL_END + return GTK_SCROLL_NONE +case .jump: + return GTK_SCROLL_JUMP +case .stepBackward: + return GTK_SCROLL_STEP_BACKWARD +case .stepForward: + return GTK_SCROLL_STEP_FORWARD +case .pageBackward: + return GTK_SCROLL_PAGE_BACKWARD +case .pageForward: + return GTK_SCROLL_PAGE_FORWARD +case .stepUp: + return GTK_SCROLL_STEP_UP +case .stepDown: + return GTK_SCROLL_STEP_DOWN +case .pageUp: + return GTK_SCROLL_PAGE_UP +case .pageDown: + return GTK_SCROLL_PAGE_DOWN +case .stepLeft: + return GTK_SCROLL_STEP_LEFT +case .stepRight: + return GTK_SCROLL_STEP_RIGHT +case .pageLeft: + return GTK_SCROLL_PAGE_LEFT +case .pageRight: + return GTK_SCROLL_PAGE_RIGHT +case .start: + return GTK_SCROLL_START +case .end: + return GTK_SCROLL_END } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/Scrollable.swift b/Sources/Gtk3/Generated/Scrollable.swift index eafd72323f..8f932fb53e 100644 --- a/Sources/Gtk3/Generated/Scrollable.swift +++ b/Sources/Gtk3/Generated/Scrollable.swift @@ -2,31 +2,33 @@ import CGtk3 /// #GtkScrollable is an interface that is implemented by widgets with native /// scrolling ability. -/// +/// /// To implement this interface you should override the /// #GtkScrollable:hadjustment and #GtkScrollable:vadjustment properties. -/// +/// /// ## Creating a scrollable widget -/// +/// /// All scrollable widgets should do the following. -/// +/// /// - When a parent widget sets the scrollable child widget’s adjustments, /// the widget should populate the adjustments’ /// #GtkAdjustment:lower, #GtkAdjustment:upper, /// #GtkAdjustment:step-increment, #GtkAdjustment:page-increment and /// #GtkAdjustment:page-size properties and connect to the /// #GtkAdjustment::value-changed signal. -/// +/// /// - Because its preferred size is the size for a fully expanded widget, /// the scrollable widget must be able to cope with underallocations. /// This means that it must accept any value passed to its /// #GtkWidgetClass.size_allocate() function. -/// +/// /// - When the parent allocates space to the scrollable child widget, /// the widget should update the adjustments’ properties with new values. -/// +/// /// - When any of the adjustments emits the #GtkAdjustment::value-changed signal, /// the scrollable widget should scroll its contents. public protocol Scrollable: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ScrollablePolicy.swift b/Sources/Gtk3/Generated/ScrollablePolicy.swift index 4d1678a0cb..f8cade5c6a 100644 --- a/Sources/Gtk3/Generated/ScrollablePolicy.swift +++ b/Sources/Gtk3/Generated/ScrollablePolicy.swift @@ -6,20 +6,20 @@ public enum ScrollablePolicy: GValueRepresentableEnum { public typealias GtkEnum = GtkScrollablePolicy /// Scrollable adjustments are based on the minimum size - case minimum - /// Scrollable adjustments are based on the natural size - case natural +case minimum +/// Scrollable adjustments are based on the natural size +case natural public static var type: GType { - gtk_scrollable_policy_get_type() - } + gtk_scrollable_policy_get_type() +} public init(from gtkEnum: GtkScrollablePolicy) { switch gtkEnum { case GTK_SCROLL_MINIMUM: - self = .minimum - case GTK_SCROLL_NATURAL: - self = .natural + self = .minimum +case GTK_SCROLL_NATURAL: + self = .natural default: fatalError("Unsupported GtkScrollablePolicy enum value: \(gtkEnum.rawValue)") } @@ -28,9 +28,9 @@ public enum ScrollablePolicy: GValueRepresentableEnum { public func toGtk() -> GtkScrollablePolicy { switch self { case .minimum: - return GTK_SCROLL_MINIMUM - case .natural: - return GTK_SCROLL_NATURAL + return GTK_SCROLL_MINIMUM +case .natural: + return GTK_SCROLL_NATURAL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/SelectionMode.swift b/Sources/Gtk3/Generated/SelectionMode.swift index 6dda666993..fb0a15ff67 100644 --- a/Sources/Gtk3/Generated/SelectionMode.swift +++ b/Sources/Gtk3/Generated/SelectionMode.swift @@ -5,36 +5,36 @@ public enum SelectionMode: GValueRepresentableEnum { public typealias GtkEnum = GtkSelectionMode /// No selection is possible. - case none - /// Zero or one element may be selected. - case single - /// Exactly one element is selected. - /// In some circumstances, such as initially or during a search - /// operation, it’s possible for no element to be selected with - /// %GTK_SELECTION_BROWSE. What is really enforced is that the user - /// can’t deselect a currently selected element except by selecting - /// another element. - case browse - /// Any number of elements may be selected. - /// The Ctrl key may be used to enlarge the selection, and Shift - /// key to select between the focus and the child pointed to. - /// Some widgets may also allow Click-drag to select a range of elements. - case multiple +case none +/// Zero or one element may be selected. +case single +/// Exactly one element is selected. +/// In some circumstances, such as initially or during a search +/// operation, it’s possible for no element to be selected with +/// %GTK_SELECTION_BROWSE. What is really enforced is that the user +/// can’t deselect a currently selected element except by selecting +/// another element. +case browse +/// Any number of elements may be selected. +/// The Ctrl key may be used to enlarge the selection, and Shift +/// key to select between the focus and the child pointed to. +/// Some widgets may also allow Click-drag to select a range of elements. +case multiple public static var type: GType { - gtk_selection_mode_get_type() - } + gtk_selection_mode_get_type() +} public init(from gtkEnum: GtkSelectionMode) { switch gtkEnum { case GTK_SELECTION_NONE: - self = .none - case GTK_SELECTION_SINGLE: - self = .single - case GTK_SELECTION_BROWSE: - self = .browse - case GTK_SELECTION_MULTIPLE: - self = .multiple + self = .none +case GTK_SELECTION_SINGLE: + self = .single +case GTK_SELECTION_BROWSE: + self = .browse +case GTK_SELECTION_MULTIPLE: + self = .multiple default: fatalError("Unsupported GtkSelectionMode enum value: \(gtkEnum.rawValue)") } @@ -43,13 +43,13 @@ public enum SelectionMode: GValueRepresentableEnum { public func toGtk() -> GtkSelectionMode { switch self { case .none: - return GTK_SELECTION_NONE - case .single: - return GTK_SELECTION_SINGLE - case .browse: - return GTK_SELECTION_BROWSE - case .multiple: - return GTK_SELECTION_MULTIPLE + return GTK_SELECTION_NONE +case .single: + return GTK_SELECTION_SINGLE +case .browse: + return GTK_SELECTION_BROWSE +case .multiple: + return GTK_SELECTION_MULTIPLE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/SensitivityType.swift b/Sources/Gtk3/Generated/SensitivityType.swift index c4a6714063..c06750c9fb 100644 --- a/Sources/Gtk3/Generated/SensitivityType.swift +++ b/Sources/Gtk3/Generated/SensitivityType.swift @@ -6,25 +6,25 @@ public enum SensitivityType: GValueRepresentableEnum { public typealias GtkEnum = GtkSensitivityType /// The arrow is made insensitive if the - /// thumb is at the end - case auto - /// The arrow is always sensitive - case on - /// The arrow is always insensitive - case off +/// thumb is at the end +case auto +/// The arrow is always sensitive +case on +/// The arrow is always insensitive +case off public static var type: GType { - gtk_sensitivity_type_get_type() - } + gtk_sensitivity_type_get_type() +} public init(from gtkEnum: GtkSensitivityType) { switch gtkEnum { case GTK_SENSITIVITY_AUTO: - self = .auto - case GTK_SENSITIVITY_ON: - self = .on - case GTK_SENSITIVITY_OFF: - self = .off + self = .auto +case GTK_SENSITIVITY_ON: + self = .on +case GTK_SENSITIVITY_OFF: + self = .off default: fatalError("Unsupported GtkSensitivityType enum value: \(gtkEnum.rawValue)") } @@ -33,11 +33,11 @@ public enum SensitivityType: GValueRepresentableEnum { public func toGtk() -> GtkSensitivityType { switch self { case .auto: - return GTK_SENSITIVITY_AUTO - case .on: - return GTK_SENSITIVITY_ON - case .off: - return GTK_SENSITIVITY_OFF + return GTK_SENSITIVITY_AUTO +case .on: + return GTK_SENSITIVITY_ON +case .off: + return GTK_SENSITIVITY_OFF } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ShadowType.swift b/Sources/Gtk3/Generated/ShadowType.swift index 309bdc77b6..708a3a99b0 100644 --- a/Sources/Gtk3/Generated/ShadowType.swift +++ b/Sources/Gtk3/Generated/ShadowType.swift @@ -1,7 +1,7 @@ import CGtk3 /// Used to change the appearance of an outline typically provided by a #GtkFrame. -/// +/// /// Note that many themes do not differentiate the appearance of the /// various shadow types: Either their is no visible shadow (@GTK_SHADOW_NONE), /// or there is (any other value). @@ -9,32 +9,32 @@ public enum ShadowType: GValueRepresentableEnum { public typealias GtkEnum = GtkShadowType /// No outline. - case none - /// The outline is bevelled inwards. - case in_ - /// The outline is bevelled outwards like a button. - case out - /// The outline has a sunken 3d appearance. - case etchedIn - /// The outline has a raised 3d appearance. - case etchedOut +case none +/// The outline is bevelled inwards. +case in_ +/// The outline is bevelled outwards like a button. +case out +/// The outline has a sunken 3d appearance. +case etchedIn +/// The outline has a raised 3d appearance. +case etchedOut public static var type: GType { - gtk_shadow_type_get_type() - } + gtk_shadow_type_get_type() +} public init(from gtkEnum: GtkShadowType) { switch gtkEnum { case GTK_SHADOW_NONE: - self = .none - case GTK_SHADOW_IN: - self = .in_ - case GTK_SHADOW_OUT: - self = .out - case GTK_SHADOW_ETCHED_IN: - self = .etchedIn - case GTK_SHADOW_ETCHED_OUT: - self = .etchedOut + self = .none +case GTK_SHADOW_IN: + self = .in_ +case GTK_SHADOW_OUT: + self = .out +case GTK_SHADOW_ETCHED_IN: + self = .etchedIn +case GTK_SHADOW_ETCHED_OUT: + self = .etchedOut default: fatalError("Unsupported GtkShadowType enum value: \(gtkEnum.rawValue)") } @@ -43,15 +43,15 @@ public enum ShadowType: GValueRepresentableEnum { public func toGtk() -> GtkShadowType { switch self { case .none: - return GTK_SHADOW_NONE - case .in_: - return GTK_SHADOW_IN - case .out: - return GTK_SHADOW_OUT - case .etchedIn: - return GTK_SHADOW_ETCHED_IN - case .etchedOut: - return GTK_SHADOW_ETCHED_OUT + return GTK_SHADOW_NONE +case .in_: + return GTK_SHADOW_IN +case .out: + return GTK_SHADOW_OUT +case .etchedIn: + return GTK_SHADOW_ETCHED_IN +case .etchedOut: + return GTK_SHADOW_ETCHED_OUT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/SizeGroupMode.swift b/Sources/Gtk3/Generated/SizeGroupMode.swift index 7a61c99981..86e8580877 100644 --- a/Sources/Gtk3/Generated/SizeGroupMode.swift +++ b/Sources/Gtk3/Generated/SizeGroupMode.swift @@ -6,28 +6,28 @@ public enum SizeGroupMode: GValueRepresentableEnum { public typealias GtkEnum = GtkSizeGroupMode /// Group has no effect - case none - /// Group affects horizontal requisition - case horizontal - /// Group affects vertical requisition - case vertical - /// Group affects both horizontal and vertical requisition - case both +case none +/// Group affects horizontal requisition +case horizontal +/// Group affects vertical requisition +case vertical +/// Group affects both horizontal and vertical requisition +case both public static var type: GType { - gtk_size_group_mode_get_type() - } + gtk_size_group_mode_get_type() +} public init(from gtkEnum: GtkSizeGroupMode) { switch gtkEnum { case GTK_SIZE_GROUP_NONE: - self = .none - case GTK_SIZE_GROUP_HORIZONTAL: - self = .horizontal - case GTK_SIZE_GROUP_VERTICAL: - self = .vertical - case GTK_SIZE_GROUP_BOTH: - self = .both + self = .none +case GTK_SIZE_GROUP_HORIZONTAL: + self = .horizontal +case GTK_SIZE_GROUP_VERTICAL: + self = .vertical +case GTK_SIZE_GROUP_BOTH: + self = .both default: fatalError("Unsupported GtkSizeGroupMode enum value: \(gtkEnum.rawValue)") } @@ -36,13 +36,13 @@ public enum SizeGroupMode: GValueRepresentableEnum { public func toGtk() -> GtkSizeGroupMode { switch self { case .none: - return GTK_SIZE_GROUP_NONE - case .horizontal: - return GTK_SIZE_GROUP_HORIZONTAL - case .vertical: - return GTK_SIZE_GROUP_VERTICAL - case .both: - return GTK_SIZE_GROUP_BOTH + return GTK_SIZE_GROUP_NONE +case .horizontal: + return GTK_SIZE_GROUP_HORIZONTAL +case .vertical: + return GTK_SIZE_GROUP_VERTICAL +case .both: + return GTK_SIZE_GROUP_BOTH } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/SizeRequestMode.swift b/Sources/Gtk3/Generated/SizeRequestMode.swift index 23b8567b54..c8975faf7d 100644 --- a/Sources/Gtk3/Generated/SizeRequestMode.swift +++ b/Sources/Gtk3/Generated/SizeRequestMode.swift @@ -6,24 +6,24 @@ public enum SizeRequestMode: GValueRepresentableEnum { public typealias GtkEnum = GtkSizeRequestMode /// Prefer height-for-width geometry management - case heightForWidth - /// Prefer width-for-height geometry management - case widthForHeight - /// Don’t trade height-for-width or width-for-height - case constantSize +case heightForWidth +/// Prefer width-for-height geometry management +case widthForHeight +/// Don’t trade height-for-width or width-for-height +case constantSize public static var type: GType { - gtk_size_request_mode_get_type() - } + gtk_size_request_mode_get_type() +} public init(from gtkEnum: GtkSizeRequestMode) { switch gtkEnum { case GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH: - self = .heightForWidth - case GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT: - self = .widthForHeight - case GTK_SIZE_REQUEST_CONSTANT_SIZE: - self = .constantSize + self = .heightForWidth +case GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT: + self = .widthForHeight +case GTK_SIZE_REQUEST_CONSTANT_SIZE: + self = .constantSize default: fatalError("Unsupported GtkSizeRequestMode enum value: \(gtkEnum.rawValue)") } @@ -32,11 +32,11 @@ public enum SizeRequestMode: GValueRepresentableEnum { public func toGtk() -> GtkSizeRequestMode { switch self { case .heightForWidth: - return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH - case .widthForHeight: - return GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT - case .constantSize: - return GTK_SIZE_REQUEST_CONSTANT_SIZE + return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH +case .widthForHeight: + return GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT +case .constantSize: + return GTK_SIZE_REQUEST_CONSTANT_SIZE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/SortType.swift b/Sources/Gtk3/Generated/SortType.swift index 389f2f0f5f..3d5ab3098a 100644 --- a/Sources/Gtk3/Generated/SortType.swift +++ b/Sources/Gtk3/Generated/SortType.swift @@ -5,20 +5,20 @@ public enum SortType: GValueRepresentableEnum { public typealias GtkEnum = GtkSortType /// Sorting is in ascending order. - case ascending - /// Sorting is in descending order. - case descending +case ascending +/// Sorting is in descending order. +case descending public static var type: GType { - gtk_sort_type_get_type() - } + gtk_sort_type_get_type() +} public init(from gtkEnum: GtkSortType) { switch gtkEnum { case GTK_SORT_ASCENDING: - self = .ascending - case GTK_SORT_DESCENDING: - self = .descending + self = .ascending +case GTK_SORT_DESCENDING: + self = .descending default: fatalError("Unsupported GtkSortType enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ public enum SortType: GValueRepresentableEnum { public func toGtk() -> GtkSortType { switch self { case .ascending: - return GTK_SORT_ASCENDING - case .descending: - return GTK_SORT_DESCENDING + return GTK_SORT_ASCENDING +case .descending: + return GTK_SORT_DESCENDING } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/SpinButtonUpdatePolicy.swift b/Sources/Gtk3/Generated/SpinButtonUpdatePolicy.swift index 5bb3220776..6e963931cc 100644 --- a/Sources/Gtk3/Generated/SpinButtonUpdatePolicy.swift +++ b/Sources/Gtk3/Generated/SpinButtonUpdatePolicy.swift @@ -7,23 +7,23 @@ public enum SpinButtonUpdatePolicy: GValueRepresentableEnum { public typealias GtkEnum = GtkSpinButtonUpdatePolicy /// When refreshing your #GtkSpinButton, the value is - /// always displayed - case always - /// When refreshing your #GtkSpinButton, the value is - /// only displayed if it is valid within the bounds of the spin button's - /// adjustment - case ifValid +/// always displayed +case always +/// When refreshing your #GtkSpinButton, the value is +/// only displayed if it is valid within the bounds of the spin button's +/// adjustment +case ifValid public static var type: GType { - gtk_spin_button_update_policy_get_type() - } + gtk_spin_button_update_policy_get_type() +} public init(from gtkEnum: GtkSpinButtonUpdatePolicy) { switch gtkEnum { case GTK_UPDATE_ALWAYS: - self = .always - case GTK_UPDATE_IF_VALID: - self = .ifValid + self = .always +case GTK_UPDATE_IF_VALID: + self = .ifValid default: fatalError("Unsupported GtkSpinButtonUpdatePolicy enum value: \(gtkEnum.rawValue)") } @@ -32,9 +32,9 @@ public enum SpinButtonUpdatePolicy: GValueRepresentableEnum { public func toGtk() -> GtkSpinButtonUpdatePolicy { switch self { case .always: - return GTK_UPDATE_ALWAYS - case .ifValid: - return GTK_UPDATE_IF_VALID + return GTK_UPDATE_ALWAYS +case .ifValid: + return GTK_UPDATE_IF_VALID } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/SpinType.swift b/Sources/Gtk3/Generated/SpinType.swift index 076bd6ef5d..248fa20410 100644 --- a/Sources/Gtk3/Generated/SpinType.swift +++ b/Sources/Gtk3/Generated/SpinType.swift @@ -6,40 +6,40 @@ public enum SpinType: GValueRepresentableEnum { public typealias GtkEnum = GtkSpinType /// Increment by the adjustments step increment. - case stepForward - /// Decrement by the adjustments step increment. - case stepBackward - /// Increment by the adjustments page increment. - case pageForward - /// Decrement by the adjustments page increment. - case pageBackward - /// Go to the adjustments lower bound. - case home - /// Go to the adjustments upper bound. - case end - /// Change by a specified amount. - case userDefined +case stepForward +/// Decrement by the adjustments step increment. +case stepBackward +/// Increment by the adjustments page increment. +case pageForward +/// Decrement by the adjustments page increment. +case pageBackward +/// Go to the adjustments lower bound. +case home +/// Go to the adjustments upper bound. +case end +/// Change by a specified amount. +case userDefined public static var type: GType { - gtk_spin_type_get_type() - } + gtk_spin_type_get_type() +} public init(from gtkEnum: GtkSpinType) { switch gtkEnum { case GTK_SPIN_STEP_FORWARD: - self = .stepForward - case GTK_SPIN_STEP_BACKWARD: - self = .stepBackward - case GTK_SPIN_PAGE_FORWARD: - self = .pageForward - case GTK_SPIN_PAGE_BACKWARD: - self = .pageBackward - case GTK_SPIN_HOME: - self = .home - case GTK_SPIN_END: - self = .end - case GTK_SPIN_USER_DEFINED: - self = .userDefined + self = .stepForward +case GTK_SPIN_STEP_BACKWARD: + self = .stepBackward +case GTK_SPIN_PAGE_FORWARD: + self = .pageForward +case GTK_SPIN_PAGE_BACKWARD: + self = .pageBackward +case GTK_SPIN_HOME: + self = .home +case GTK_SPIN_END: + self = .end +case GTK_SPIN_USER_DEFINED: + self = .userDefined default: fatalError("Unsupported GtkSpinType enum value: \(gtkEnum.rawValue)") } @@ -48,19 +48,19 @@ public enum SpinType: GValueRepresentableEnum { public func toGtk() -> GtkSpinType { switch self { case .stepForward: - return GTK_SPIN_STEP_FORWARD - case .stepBackward: - return GTK_SPIN_STEP_BACKWARD - case .pageForward: - return GTK_SPIN_PAGE_FORWARD - case .pageBackward: - return GTK_SPIN_PAGE_BACKWARD - case .home: - return GTK_SPIN_HOME - case .end: - return GTK_SPIN_END - case .userDefined: - return GTK_SPIN_USER_DEFINED + return GTK_SPIN_STEP_FORWARD +case .stepBackward: + return GTK_SPIN_STEP_BACKWARD +case .pageForward: + return GTK_SPIN_PAGE_FORWARD +case .pageBackward: + return GTK_SPIN_PAGE_BACKWARD +case .home: + return GTK_SPIN_HOME +case .end: + return GTK_SPIN_END +case .userDefined: + return GTK_SPIN_USER_DEFINED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/Spinner.swift b/Sources/Gtk3/Generated/Spinner.swift index c65f02682d..f230996f87 100644 --- a/Sources/Gtk3/Generated/Spinner.swift +++ b/Sources/Gtk3/Generated/Spinner.swift @@ -3,37 +3,36 @@ import CGtk3 /// A GtkSpinner widget displays an icon-size spinning animation. /// It is often used as an alternative to a #GtkProgressBar for /// displaying indefinite activity, instead of actual progress. -/// +/// /// To start the animation, use gtk_spinner_start(), to stop it /// use gtk_spinner_stop(). -/// +/// /// # CSS nodes -/// +/// /// GtkSpinner has a single CSS node with the name spinner. When the animation is /// active, the :checked pseudoclass is added to this node. open class Spinner: Widget { /// Returns a new spinner widget. Not yet started. - public convenience init() { - self.init( - gtk_spinner_new() - ) - } - - override func didMoveToParent() { - super.didMoveToParent() +public convenience init() { + self.init( + gtk_spinner_new() + ) +} - let handler0: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + override func didMoveToParent() { + super.didMoveToParent() - addSignal(name: "notify::active", handler: gCallback(handler0)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActive?(self, param0) - } + let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - public var notifyActive: ((Spinner, OpaquePointer) -> Void)? +addSignal(name: "notify::active", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActive?(self, param0) } +} + + +public var notifyActive: ((Spinner, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/StackTransitionType.swift b/Sources/Gtk3/Generated/StackTransitionType.swift index 260d71fb44..870b50668d 100644 --- a/Sources/Gtk3/Generated/StackTransitionType.swift +++ b/Sources/Gtk3/Generated/StackTransitionType.swift @@ -2,50 +2,50 @@ import CGtk3 /// These enumeration values describe the possible transitions /// between pages in a #GtkStack widget. -/// +/// /// New values may be added to this enumeration over time. public enum StackTransitionType: GValueRepresentableEnum { public typealias GtkEnum = GtkStackTransitionType /// No transition - case none - /// A cross-fade - case crossfade - /// Slide from left to right - case slideRight - /// Slide from right to left - case slideLeft - /// Slide from bottom up - case slideUp - /// Slide from top down - case slideDown - /// Slide from left or right according to the children order - case slideLeftRight - /// Slide from top down or bottom up according to the order - case slideUpDown +case none +/// A cross-fade +case crossfade +/// Slide from left to right +case slideRight +/// Slide from right to left +case slideLeft +/// Slide from bottom up +case slideUp +/// Slide from top down +case slideDown +/// Slide from left or right according to the children order +case slideLeftRight +/// Slide from top down or bottom up according to the order +case slideUpDown public static var type: GType { - gtk_stack_transition_type_get_type() - } + gtk_stack_transition_type_get_type() +} public init(from gtkEnum: GtkStackTransitionType) { switch gtkEnum { case GTK_STACK_TRANSITION_TYPE_NONE: - self = .none - case GTK_STACK_TRANSITION_TYPE_CROSSFADE: - self = .crossfade - case GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT: - self = .slideRight - case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT: - self = .slideLeft - case GTK_STACK_TRANSITION_TYPE_SLIDE_UP: - self = .slideUp - case GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN: - self = .slideDown - case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT: - self = .slideLeftRight - case GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN: - self = .slideUpDown + self = .none +case GTK_STACK_TRANSITION_TYPE_CROSSFADE: + self = .crossfade +case GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT: + self = .slideRight +case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT: + self = .slideLeft +case GTK_STACK_TRANSITION_TYPE_SLIDE_UP: + self = .slideUp +case GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN: + self = .slideDown +case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT: + self = .slideLeftRight +case GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN: + self = .slideUpDown default: fatalError("Unsupported GtkStackTransitionType enum value: \(gtkEnum.rawValue)") } @@ -54,21 +54,21 @@ public enum StackTransitionType: GValueRepresentableEnum { public func toGtk() -> GtkStackTransitionType { switch self { case .none: - return GTK_STACK_TRANSITION_TYPE_NONE - case .crossfade: - return GTK_STACK_TRANSITION_TYPE_CROSSFADE - case .slideRight: - return GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT - case .slideLeft: - return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT - case .slideUp: - return GTK_STACK_TRANSITION_TYPE_SLIDE_UP - case .slideDown: - return GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN - case .slideLeftRight: - return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT - case .slideUpDown: - return GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN + return GTK_STACK_TRANSITION_TYPE_NONE +case .crossfade: + return GTK_STACK_TRANSITION_TYPE_CROSSFADE +case .slideRight: + return GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT +case .slideLeft: + return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT +case .slideUp: + return GTK_STACK_TRANSITION_TYPE_SLIDE_UP +case .slideDown: + return GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN +case .slideLeftRight: + return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT +case .slideUpDown: + return GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/StateType.swift b/Sources/Gtk3/Generated/StateType.swift index 10a2ea95f5..f21b1e4a0e 100644 --- a/Sources/Gtk3/Generated/StateType.swift +++ b/Sources/Gtk3/Generated/StateType.swift @@ -8,44 +8,44 @@ public enum StateType: GValueRepresentableEnum { public typealias GtkEnum = GtkStateType /// State during normal operation. - case normal - /// State of a currently active widget, such as a depressed button. - case active - /// State indicating that the mouse pointer is over - /// the widget and the widget will respond to mouse clicks. - case prelight - /// State of a selected item, such the selected row in a list. - case selected - /// State indicating that the widget is - /// unresponsive to user actions. - case insensitive - /// The widget is inconsistent, such as checkbuttons - /// or radiobuttons that aren’t either set to %TRUE nor %FALSE, - /// or buttons requiring the user attention. - case inconsistent - /// The widget has the keyboard focus. - case focused +case normal +/// State of a currently active widget, such as a depressed button. +case active +/// State indicating that the mouse pointer is over +/// the widget and the widget will respond to mouse clicks. +case prelight +/// State of a selected item, such the selected row in a list. +case selected +/// State indicating that the widget is +/// unresponsive to user actions. +case insensitive +/// The widget is inconsistent, such as checkbuttons +/// or radiobuttons that aren’t either set to %TRUE nor %FALSE, +/// or buttons requiring the user attention. +case inconsistent +/// The widget has the keyboard focus. +case focused public static var type: GType { - gtk_state_type_get_type() - } + gtk_state_type_get_type() +} public init(from gtkEnum: GtkStateType) { switch gtkEnum { case GTK_STATE_NORMAL: - self = .normal - case GTK_STATE_ACTIVE: - self = .active - case GTK_STATE_PRELIGHT: - self = .prelight - case GTK_STATE_SELECTED: - self = .selected - case GTK_STATE_INSENSITIVE: - self = .insensitive - case GTK_STATE_INCONSISTENT: - self = .inconsistent - case GTK_STATE_FOCUSED: - self = .focused + self = .normal +case GTK_STATE_ACTIVE: + self = .active +case GTK_STATE_PRELIGHT: + self = .prelight +case GTK_STATE_SELECTED: + self = .selected +case GTK_STATE_INSENSITIVE: + self = .insensitive +case GTK_STATE_INCONSISTENT: + self = .inconsistent +case GTK_STATE_FOCUSED: + self = .focused default: fatalError("Unsupported GtkStateType enum value: \(gtkEnum.rawValue)") } @@ -54,19 +54,19 @@ public enum StateType: GValueRepresentableEnum { public func toGtk() -> GtkStateType { switch self { case .normal: - return GTK_STATE_NORMAL - case .active: - return GTK_STATE_ACTIVE - case .prelight: - return GTK_STATE_PRELIGHT - case .selected: - return GTK_STATE_SELECTED - case .insensitive: - return GTK_STATE_INSENSITIVE - case .inconsistent: - return GTK_STATE_INCONSISTENT - case .focused: - return GTK_STATE_FOCUSED + return GTK_STATE_NORMAL +case .active: + return GTK_STATE_ACTIVE +case .prelight: + return GTK_STATE_PRELIGHT +case .selected: + return GTK_STATE_SELECTED +case .insensitive: + return GTK_STATE_INSENSITIVE +case .inconsistent: + return GTK_STATE_INCONSISTENT +case .focused: + return GTK_STATE_FOCUSED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/StyleProvider.swift b/Sources/Gtk3/Generated/StyleProvider.swift index 7dabf6a87d..1d7937ca7e 100644 --- a/Sources/Gtk3/Generated/StyleProvider.swift +++ b/Sources/Gtk3/Generated/StyleProvider.swift @@ -3,5 +3,7 @@ import CGtk3 /// GtkStyleProvider is an interface used to provide style information to a #GtkStyleContext. /// See gtk_style_context_add_provider() and gtk_style_context_add_provider_for_screen(). public protocol StyleProvider: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/Switch.swift b/Sources/Gtk3/Generated/Switch.swift index 3ce717d935..41fa213cad 100644 --- a/Sources/Gtk3/Generated/Switch.swift +++ b/Sources/Gtk3/Generated/Switch.swift @@ -3,124 +3,119 @@ import CGtk3 /// #GtkSwitch is a widget that has two states: on or off. The user can control /// which state should be active by clicking the empty area, or by dragging the /// handle. -/// +/// /// GtkSwitch can also handle situations where the underlying state changes with /// a delay. See #GtkSwitch::state-set for details. -/// +/// /// # CSS nodes -/// +/// /// |[ /// switch /// ╰── slider /// ]| -/// +/// /// GtkSwitch has two css nodes, the main node with the name switch and a subnode /// named slider. Neither of them is using any style classes. open class Switch: Widget, Activatable { /// Creates a new #GtkSwitch widget. - public convenience init() { - self.init( - gtk_switch_new() - ) +public convenience init() { + self.init( + gtk_switch_new() + ) +} + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) +} + +let handler1: @convention(c) (UnsafeMutableRawPointer, Bool, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) - } - - let handler1: - @convention(c) (UnsafeMutableRawPointer, Bool, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "state-set", handler: gCallback(handler1)) { [weak self] (param0: Bool) in - guard let self = self else { return } - self.stateSet?(self, param0) - } - - let handler2: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::active", handler: gCallback(handler2)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActive?(self, param0) - } - - let handler3: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::state", handler: gCallback(handler3)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyState?(self, param0) - } - - let handler4: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::related-action", handler: gCallback(handler4)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyRelatedAction?(self, param0) - } - - let handler5: - @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - - addSignal(name: "notify::use-action-appearance", handler: gCallback(handler5)) { - [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseActionAppearance?(self, param0) - } +addSignal(name: "state-set", handler: gCallback(handler1)) { [weak self] (param0: Bool) in + guard let self = self else { return } + self.stateSet?(self, param0) +} + +let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) } - /// Whether the #GtkSwitch widget is in its on or off state. - @GObjectProperty(named: "active") public var active: Bool - - /// The ::activate signal on GtkSwitch is an action signal and - /// emitting it causes the switch to animate. - /// Applications should never connect to this signal, but use the - /// notify::active signal. - public var activate: ((Switch) -> Void)? - - /// The ::state-set signal on GtkSwitch is emitted to change the underlying - /// state. It is emitted when the user changes the switch position. The - /// default handler keeps the state in sync with the #GtkSwitch:active - /// property. - /// - /// To implement delayed state change, applications can connect to this signal, - /// initiate the change of the underlying state, and call gtk_switch_set_state() - /// when the underlying state change is complete. The signal handler should - /// return %TRUE to prevent the default handler from running. - /// - /// Visually, the underlying state is represented by the trough color of - /// the switch, while the #GtkSwitch:active property is represented by the - /// position of the switch. - public var stateSet: ((Switch, Bool) -> Void)? - - public var notifyActive: ((Switch, OpaquePointer) -> Void)? - - public var notifyState: ((Switch, OpaquePointer) -> Void)? - - public var notifyRelatedAction: ((Switch, OpaquePointer) -> Void)? - - public var notifyUseActionAppearance: ((Switch, OpaquePointer) -> Void)? +addSignal(name: "notify::active", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActive?(self, param0) } + +let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::state", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyState?(self, param0) +} + +let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::related-action", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyRelatedAction?(self, param0) +} + +let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + +addSignal(name: "notify::use-action-appearance", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseActionAppearance?(self, param0) +} +} + + /// Whether the #GtkSwitch widget is in its on or off state. +@GObjectProperty(named: "active") public var active: Bool + +/// The ::activate signal on GtkSwitch is an action signal and +/// emitting it causes the switch to animate. +/// Applications should never connect to this signal, but use the +/// notify::active signal. +public var activate: ((Switch) -> Void)? + +/// The ::state-set signal on GtkSwitch is emitted to change the underlying +/// state. It is emitted when the user changes the switch position. The +/// default handler keeps the state in sync with the #GtkSwitch:active +/// property. +/// +/// To implement delayed state change, applications can connect to this signal, +/// initiate the change of the underlying state, and call gtk_switch_set_state() +/// when the underlying state change is complete. The signal handler should +/// return %TRUE to prevent the default handler from running. +/// +/// Visually, the underlying state is represented by the trough color of +/// the switch, while the #GtkSwitch:active property is represented by the +/// position of the switch. +public var stateSet: ((Switch, Bool) -> Void)? + + +public var notifyActive: ((Switch, OpaquePointer) -> Void)? + + +public var notifyState: ((Switch, OpaquePointer) -> Void)? + + +public var notifyRelatedAction: ((Switch, OpaquePointer) -> Void)? + + +public var notifyUseActionAppearance: ((Switch, OpaquePointer) -> Void)? +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/TextBufferTargetInfo.swift b/Sources/Gtk3/Generated/TextBufferTargetInfo.swift index 846425b492..28525b2075 100644 --- a/Sources/Gtk3/Generated/TextBufferTargetInfo.swift +++ b/Sources/Gtk3/Generated/TextBufferTargetInfo.swift @@ -3,31 +3,31 @@ import CGtk3 /// These values are used as “info” for the targets contained in the /// lists returned by gtk_text_buffer_get_copy_target_list() and /// gtk_text_buffer_get_paste_target_list(). -/// +/// /// The values counts down from `-1` to avoid clashes /// with application added drag destinations which usually start at 0. public enum TextBufferTargetInfo: GValueRepresentableEnum { public typealias GtkEnum = GtkTextBufferTargetInfo /// Buffer contents - case bufferContents - /// Rich text - case richText - /// Text - case text +case bufferContents +/// Rich text +case richText +/// Text +case text public static var type: GType { - gtk_text_buffer_target_info_get_type() - } + gtk_text_buffer_target_info_get_type() +} public init(from gtkEnum: GtkTextBufferTargetInfo) { switch gtkEnum { case GTK_TEXT_BUFFER_TARGET_INFO_BUFFER_CONTENTS: - self = .bufferContents - case GTK_TEXT_BUFFER_TARGET_INFO_RICH_TEXT: - self = .richText - case GTK_TEXT_BUFFER_TARGET_INFO_TEXT: - self = .text + self = .bufferContents +case GTK_TEXT_BUFFER_TARGET_INFO_RICH_TEXT: + self = .richText +case GTK_TEXT_BUFFER_TARGET_INFO_TEXT: + self = .text default: fatalError("Unsupported GtkTextBufferTargetInfo enum value: \(gtkEnum.rawValue)") } @@ -36,11 +36,11 @@ public enum TextBufferTargetInfo: GValueRepresentableEnum { public func toGtk() -> GtkTextBufferTargetInfo { switch self { case .bufferContents: - return GTK_TEXT_BUFFER_TARGET_INFO_BUFFER_CONTENTS - case .richText: - return GTK_TEXT_BUFFER_TARGET_INFO_RICH_TEXT - case .text: - return GTK_TEXT_BUFFER_TARGET_INFO_TEXT + return GTK_TEXT_BUFFER_TARGET_INFO_BUFFER_CONTENTS +case .richText: + return GTK_TEXT_BUFFER_TARGET_INFO_RICH_TEXT +case .text: + return GTK_TEXT_BUFFER_TARGET_INFO_TEXT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/TextDirection.swift b/Sources/Gtk3/Generated/TextDirection.swift index c74a0590d6..29290c2522 100644 --- a/Sources/Gtk3/Generated/TextDirection.swift +++ b/Sources/Gtk3/Generated/TextDirection.swift @@ -5,24 +5,24 @@ public enum TextDirection: GValueRepresentableEnum { public typealias GtkEnum = GtkTextDirection /// No direction. - case none - /// Left to right text direction. - case ltr - /// Right to left text direction. - case rtl +case none +/// Left to right text direction. +case ltr +/// Right to left text direction. +case rtl public static var type: GType { - gtk_text_direction_get_type() - } + gtk_text_direction_get_type() +} public init(from gtkEnum: GtkTextDirection) { switch gtkEnum { case GTK_TEXT_DIR_NONE: - self = .none - case GTK_TEXT_DIR_LTR: - self = .ltr - case GTK_TEXT_DIR_RTL: - self = .rtl + self = .none +case GTK_TEXT_DIR_LTR: + self = .ltr +case GTK_TEXT_DIR_RTL: + self = .rtl default: fatalError("Unsupported GtkTextDirection enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ public enum TextDirection: GValueRepresentableEnum { public func toGtk() -> GtkTextDirection { switch self { case .none: - return GTK_TEXT_DIR_NONE - case .ltr: - return GTK_TEXT_DIR_LTR - case .rtl: - return GTK_TEXT_DIR_RTL + return GTK_TEXT_DIR_NONE +case .ltr: + return GTK_TEXT_DIR_LTR +case .rtl: + return GTK_TEXT_DIR_RTL } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/TextViewLayer.swift b/Sources/Gtk3/Generated/TextViewLayer.swift index 9ffbe32f05..cc23ab1d92 100644 --- a/Sources/Gtk3/Generated/TextViewLayer.swift +++ b/Sources/Gtk3/Generated/TextViewLayer.swift @@ -6,20 +6,20 @@ public enum TextViewLayer: GValueRepresentableEnum { public typealias GtkEnum = GtkTextViewLayer /// Old deprecated layer, use %GTK_TEXT_VIEW_LAYER_BELOW_TEXT instead - case below - /// Old deprecated layer, use %GTK_TEXT_VIEW_LAYER_ABOVE_TEXT instead - case above +case below +/// Old deprecated layer, use %GTK_TEXT_VIEW_LAYER_ABOVE_TEXT instead +case above public static var type: GType { - gtk_text_view_layer_get_type() - } + gtk_text_view_layer_get_type() +} public init(from gtkEnum: GtkTextViewLayer) { switch gtkEnum { case GTK_TEXT_VIEW_LAYER_BELOW: - self = .below - case GTK_TEXT_VIEW_LAYER_ABOVE: - self = .above + self = .below +case GTK_TEXT_VIEW_LAYER_ABOVE: + self = .above default: fatalError("Unsupported GtkTextViewLayer enum value: \(gtkEnum.rawValue)") } @@ -28,9 +28,9 @@ public enum TextViewLayer: GValueRepresentableEnum { public func toGtk() -> GtkTextViewLayer { switch self { case .below: - return GTK_TEXT_VIEW_LAYER_BELOW - case .above: - return GTK_TEXT_VIEW_LAYER_ABOVE + return GTK_TEXT_VIEW_LAYER_BELOW +case .above: + return GTK_TEXT_VIEW_LAYER_ABOVE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/TextWindowType.swift b/Sources/Gtk3/Generated/TextWindowType.swift index 0e03d8328c..bcecb85277 100644 --- a/Sources/Gtk3/Generated/TextWindowType.swift +++ b/Sources/Gtk3/Generated/TextWindowType.swift @@ -5,40 +5,40 @@ public enum TextWindowType: GValueRepresentableEnum { public typealias GtkEnum = GtkTextWindowType /// Invalid value, used as a marker - case private_ - /// Window that floats over scrolling areas. - case widget - /// Scrollable text window. - case text - /// Left side border window. - case left - /// Right side border window. - case right - /// Top border window. - case top - /// Bottom border window. - case bottom +case private_ +/// Window that floats over scrolling areas. +case widget +/// Scrollable text window. +case text +/// Left side border window. +case left +/// Right side border window. +case right +/// Top border window. +case top +/// Bottom border window. +case bottom public static var type: GType { - gtk_text_window_type_get_type() - } + gtk_text_window_type_get_type() +} public init(from gtkEnum: GtkTextWindowType) { switch gtkEnum { case GTK_TEXT_WINDOW_PRIVATE: - self = .private_ - case GTK_TEXT_WINDOW_WIDGET: - self = .widget - case GTK_TEXT_WINDOW_TEXT: - self = .text - case GTK_TEXT_WINDOW_LEFT: - self = .left - case GTK_TEXT_WINDOW_RIGHT: - self = .right - case GTK_TEXT_WINDOW_TOP: - self = .top - case GTK_TEXT_WINDOW_BOTTOM: - self = .bottom + self = .private_ +case GTK_TEXT_WINDOW_WIDGET: + self = .widget +case GTK_TEXT_WINDOW_TEXT: + self = .text +case GTK_TEXT_WINDOW_LEFT: + self = .left +case GTK_TEXT_WINDOW_RIGHT: + self = .right +case GTK_TEXT_WINDOW_TOP: + self = .top +case GTK_TEXT_WINDOW_BOTTOM: + self = .bottom default: fatalError("Unsupported GtkTextWindowType enum value: \(gtkEnum.rawValue)") } @@ -47,19 +47,19 @@ public enum TextWindowType: GValueRepresentableEnum { public func toGtk() -> GtkTextWindowType { switch self { case .private_: - return GTK_TEXT_WINDOW_PRIVATE - case .widget: - return GTK_TEXT_WINDOW_WIDGET - case .text: - return GTK_TEXT_WINDOW_TEXT - case .left: - return GTK_TEXT_WINDOW_LEFT - case .right: - return GTK_TEXT_WINDOW_RIGHT - case .top: - return GTK_TEXT_WINDOW_TOP - case .bottom: - return GTK_TEXT_WINDOW_BOTTOM + return GTK_TEXT_WINDOW_PRIVATE +case .widget: + return GTK_TEXT_WINDOW_WIDGET +case .text: + return GTK_TEXT_WINDOW_TEXT +case .left: + return GTK_TEXT_WINDOW_LEFT +case .right: + return GTK_TEXT_WINDOW_RIGHT +case .top: + return GTK_TEXT_WINDOW_TOP +case .bottom: + return GTK_TEXT_WINDOW_BOTTOM } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ToolShell.swift b/Sources/Gtk3/Generated/ToolShell.swift index fd4e4fc0ac..1a93a30464 100644 --- a/Sources/Gtk3/Generated/ToolShell.swift +++ b/Sources/Gtk3/Generated/ToolShell.swift @@ -3,5 +3,7 @@ import CGtk3 /// The #GtkToolShell interface allows container widgets to provide additional /// information when embedding #GtkToolItem widgets. public protocol ToolShell: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ToolbarSpaceStyle.swift b/Sources/Gtk3/Generated/ToolbarSpaceStyle.swift index 8a6d192a47..09aa80805d 100644 --- a/Sources/Gtk3/Generated/ToolbarSpaceStyle.swift +++ b/Sources/Gtk3/Generated/ToolbarSpaceStyle.swift @@ -5,20 +5,20 @@ public enum ToolbarSpaceStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkToolbarSpaceStyle /// Use blank spacers. - case empty - /// Use vertical lines for spacers. - case line +case empty +/// Use vertical lines for spacers. +case line public static var type: GType { - gtk_toolbar_space_style_get_type() - } + gtk_toolbar_space_style_get_type() +} public init(from gtkEnum: GtkToolbarSpaceStyle) { switch gtkEnum { case GTK_TOOLBAR_SPACE_EMPTY: - self = .empty - case GTK_TOOLBAR_SPACE_LINE: - self = .line + self = .empty +case GTK_TOOLBAR_SPACE_LINE: + self = .line default: fatalError("Unsupported GtkToolbarSpaceStyle enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ public enum ToolbarSpaceStyle: GValueRepresentableEnum { public func toGtk() -> GtkToolbarSpaceStyle { switch self { case .empty: - return GTK_TOOLBAR_SPACE_EMPTY - case .line: - return GTK_TOOLBAR_SPACE_LINE + return GTK_TOOLBAR_SPACE_EMPTY +case .line: + return GTK_TOOLBAR_SPACE_LINE } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ToolbarStyle.swift b/Sources/Gtk3/Generated/ToolbarStyle.swift index 66ac7191ee..2ead34530b 100644 --- a/Sources/Gtk3/Generated/ToolbarStyle.swift +++ b/Sources/Gtk3/Generated/ToolbarStyle.swift @@ -9,29 +9,29 @@ public enum ToolbarStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkToolbarStyle /// Buttons display only icons in the toolbar. - case icons - /// Buttons display only text labels in the toolbar. - case text - /// Buttons display text and icons in the toolbar. - case both - /// Buttons display icons and text alongside each - /// other, rather than vertically stacked - case bothHoriz +case icons +/// Buttons display only text labels in the toolbar. +case text +/// Buttons display text and icons in the toolbar. +case both +/// Buttons display icons and text alongside each +/// other, rather than vertically stacked +case bothHoriz public static var type: GType { - gtk_toolbar_style_get_type() - } + gtk_toolbar_style_get_type() +} public init(from gtkEnum: GtkToolbarStyle) { switch gtkEnum { case GTK_TOOLBAR_ICONS: - self = .icons - case GTK_TOOLBAR_TEXT: - self = .text - case GTK_TOOLBAR_BOTH: - self = .both - case GTK_TOOLBAR_BOTH_HORIZ: - self = .bothHoriz + self = .icons +case GTK_TOOLBAR_TEXT: + self = .text +case GTK_TOOLBAR_BOTH: + self = .both +case GTK_TOOLBAR_BOTH_HORIZ: + self = .bothHoriz default: fatalError("Unsupported GtkToolbarStyle enum value: \(gtkEnum.rawValue)") } @@ -40,13 +40,13 @@ public enum ToolbarStyle: GValueRepresentableEnum { public func toGtk() -> GtkToolbarStyle { switch self { case .icons: - return GTK_TOOLBAR_ICONS - case .text: - return GTK_TOOLBAR_TEXT - case .both: - return GTK_TOOLBAR_BOTH - case .bothHoriz: - return GTK_TOOLBAR_BOTH_HORIZ + return GTK_TOOLBAR_ICONS +case .text: + return GTK_TOOLBAR_TEXT +case .both: + return GTK_TOOLBAR_BOTH +case .bothHoriz: + return GTK_TOOLBAR_BOTH_HORIZ } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/TreeDragDest.swift b/Sources/Gtk3/Generated/TreeDragDest.swift index f21493d8f0..6d1310aa9a 100644 --- a/Sources/Gtk3/Generated/TreeDragDest.swift +++ b/Sources/Gtk3/Generated/TreeDragDest.swift @@ -1,5 +1,8 @@ import CGtk3 + public protocol TreeDragDest: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/TreeDragSource.swift b/Sources/Gtk3/Generated/TreeDragSource.swift index b832c76c8d..eac0aada25 100644 --- a/Sources/Gtk3/Generated/TreeDragSource.swift +++ b/Sources/Gtk3/Generated/TreeDragSource.swift @@ -1,5 +1,8 @@ import CGtk3 + public protocol TreeDragSource: GObjectRepresentable { + -} + +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/TreeSortable.swift b/Sources/Gtk3/Generated/TreeSortable.swift index b14e224e08..3cce465397 100644 --- a/Sources/Gtk3/Generated/TreeSortable.swift +++ b/Sources/Gtk3/Generated/TreeSortable.swift @@ -4,9 +4,10 @@ import CGtk3 /// support sorting. The #GtkTreeView uses the methods provided by this interface /// to sort the model. public protocol TreeSortable: GObjectRepresentable { + /// The ::sort-column-changed signal is emitted when the sort column - /// or sort order of @sortable is changed. The signal is emitted before - /// the contents of @sortable are resorted. - var sortColumnChanged: ((Self) -> Void)? { get set } -} +/// or sort order of @sortable is changed. The signal is emitted before +/// the contents of @sortable are resorted. +var sortColumnChanged: ((Self) -> Void)? { get set } +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/TreeViewColumnSizing.swift b/Sources/Gtk3/Generated/TreeViewColumnSizing.swift index 08a284c2d5..0457c93921 100644 --- a/Sources/Gtk3/Generated/TreeViewColumnSizing.swift +++ b/Sources/Gtk3/Generated/TreeViewColumnSizing.swift @@ -7,24 +7,24 @@ public enum TreeViewColumnSizing: GValueRepresentableEnum { public typealias GtkEnum = GtkTreeViewColumnSizing /// Columns only get bigger in reaction to changes in the model - case growOnly - /// Columns resize to be the optimal size everytime the model changes. - case autosize - /// Columns are a fixed numbers of pixels wide. - case fixed +case growOnly +/// Columns resize to be the optimal size everytime the model changes. +case autosize +/// Columns are a fixed numbers of pixels wide. +case fixed public static var type: GType { - gtk_tree_view_column_sizing_get_type() - } + gtk_tree_view_column_sizing_get_type() +} public init(from gtkEnum: GtkTreeViewColumnSizing) { switch gtkEnum { case GTK_TREE_VIEW_COLUMN_GROW_ONLY: - self = .growOnly - case GTK_TREE_VIEW_COLUMN_AUTOSIZE: - self = .autosize - case GTK_TREE_VIEW_COLUMN_FIXED: - self = .fixed + self = .growOnly +case GTK_TREE_VIEW_COLUMN_AUTOSIZE: + self = .autosize +case GTK_TREE_VIEW_COLUMN_FIXED: + self = .fixed default: fatalError("Unsupported GtkTreeViewColumnSizing enum value: \(gtkEnum.rawValue)") } @@ -33,11 +33,11 @@ public enum TreeViewColumnSizing: GValueRepresentableEnum { public func toGtk() -> GtkTreeViewColumnSizing { switch self { case .growOnly: - return GTK_TREE_VIEW_COLUMN_GROW_ONLY - case .autosize: - return GTK_TREE_VIEW_COLUMN_AUTOSIZE - case .fixed: - return GTK_TREE_VIEW_COLUMN_FIXED + return GTK_TREE_VIEW_COLUMN_GROW_ONLY +case .autosize: + return GTK_TREE_VIEW_COLUMN_AUTOSIZE +case .fixed: + return GTK_TREE_VIEW_COLUMN_FIXED } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/TreeViewDropPosition.swift b/Sources/Gtk3/Generated/TreeViewDropPosition.swift index cc93464b9a..e846728b57 100644 --- a/Sources/Gtk3/Generated/TreeViewDropPosition.swift +++ b/Sources/Gtk3/Generated/TreeViewDropPosition.swift @@ -5,28 +5,28 @@ public enum TreeViewDropPosition: GValueRepresentableEnum { public typealias GtkEnum = GtkTreeViewDropPosition /// Dropped row is inserted before - case before - /// Dropped row is inserted after - case after - /// Dropped row becomes a child or is inserted before - case intoOrBefore - /// Dropped row becomes a child or is inserted after - case intoOrAfter +case before +/// Dropped row is inserted after +case after +/// Dropped row becomes a child or is inserted before +case intoOrBefore +/// Dropped row becomes a child or is inserted after +case intoOrAfter public static var type: GType { - gtk_tree_view_drop_position_get_type() - } + gtk_tree_view_drop_position_get_type() +} public init(from gtkEnum: GtkTreeViewDropPosition) { switch gtkEnum { case GTK_TREE_VIEW_DROP_BEFORE: - self = .before - case GTK_TREE_VIEW_DROP_AFTER: - self = .after - case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: - self = .intoOrBefore - case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: - self = .intoOrAfter + self = .before +case GTK_TREE_VIEW_DROP_AFTER: + self = .after +case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: + self = .intoOrBefore +case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: + self = .intoOrAfter default: fatalError("Unsupported GtkTreeViewDropPosition enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum TreeViewDropPosition: GValueRepresentableEnum { public func toGtk() -> GtkTreeViewDropPosition { switch self { case .before: - return GTK_TREE_VIEW_DROP_BEFORE - case .after: - return GTK_TREE_VIEW_DROP_AFTER - case .intoOrBefore: - return GTK_TREE_VIEW_DROP_INTO_OR_BEFORE - case .intoOrAfter: - return GTK_TREE_VIEW_DROP_INTO_OR_AFTER + return GTK_TREE_VIEW_DROP_BEFORE +case .after: + return GTK_TREE_VIEW_DROP_AFTER +case .intoOrBefore: + return GTK_TREE_VIEW_DROP_INTO_OR_BEFORE +case .intoOrAfter: + return GTK_TREE_VIEW_DROP_INTO_OR_AFTER } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/TreeViewGridLines.swift b/Sources/Gtk3/Generated/TreeViewGridLines.swift index c170f1fce7..862dc5b2d0 100644 --- a/Sources/Gtk3/Generated/TreeViewGridLines.swift +++ b/Sources/Gtk3/Generated/TreeViewGridLines.swift @@ -5,28 +5,28 @@ public enum TreeViewGridLines: GValueRepresentableEnum { public typealias GtkEnum = GtkTreeViewGridLines /// No grid lines. - case none - /// Horizontal grid lines. - case horizontal - /// Vertical grid lines. - case vertical - /// Horizontal and vertical grid lines. - case both +case none +/// Horizontal grid lines. +case horizontal +/// Vertical grid lines. +case vertical +/// Horizontal and vertical grid lines. +case both public static var type: GType { - gtk_tree_view_grid_lines_get_type() - } + gtk_tree_view_grid_lines_get_type() +} public init(from gtkEnum: GtkTreeViewGridLines) { switch gtkEnum { case GTK_TREE_VIEW_GRID_LINES_NONE: - self = .none - case GTK_TREE_VIEW_GRID_LINES_HORIZONTAL: - self = .horizontal - case GTK_TREE_VIEW_GRID_LINES_VERTICAL: - self = .vertical - case GTK_TREE_VIEW_GRID_LINES_BOTH: - self = .both + self = .none +case GTK_TREE_VIEW_GRID_LINES_HORIZONTAL: + self = .horizontal +case GTK_TREE_VIEW_GRID_LINES_VERTICAL: + self = .vertical +case GTK_TREE_VIEW_GRID_LINES_BOTH: + self = .both default: fatalError("Unsupported GtkTreeViewGridLines enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum TreeViewGridLines: GValueRepresentableEnum { public func toGtk() -> GtkTreeViewGridLines { switch self { case .none: - return GTK_TREE_VIEW_GRID_LINES_NONE - case .horizontal: - return GTK_TREE_VIEW_GRID_LINES_HORIZONTAL - case .vertical: - return GTK_TREE_VIEW_GRID_LINES_VERTICAL - case .both: - return GTK_TREE_VIEW_GRID_LINES_BOTH + return GTK_TREE_VIEW_GRID_LINES_NONE +case .horizontal: + return GTK_TREE_VIEW_GRID_LINES_HORIZONTAL +case .vertical: + return GTK_TREE_VIEW_GRID_LINES_VERTICAL +case .both: + return GTK_TREE_VIEW_GRID_LINES_BOTH } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/Unit.swift b/Sources/Gtk3/Generated/Unit.swift index be1e75203d..09e7754250 100644 --- a/Sources/Gtk3/Generated/Unit.swift +++ b/Sources/Gtk3/Generated/Unit.swift @@ -5,28 +5,28 @@ public enum Unit: GValueRepresentableEnum { public typealias GtkEnum = GtkUnit /// No units. - case none - /// Dimensions in points. - case points - /// Dimensions in inches. - case inch - /// Dimensions in millimeters - case mm +case none +/// Dimensions in points. +case points +/// Dimensions in inches. +case inch +/// Dimensions in millimeters +case mm public static var type: GType { - gtk_unit_get_type() - } + gtk_unit_get_type() +} public init(from gtkEnum: GtkUnit) { switch gtkEnum { case GTK_UNIT_NONE: - self = .none - case GTK_UNIT_POINTS: - self = .points - case GTK_UNIT_INCH: - self = .inch - case GTK_UNIT_MM: - self = .mm + self = .none +case GTK_UNIT_POINTS: + self = .points +case GTK_UNIT_INCH: + self = .inch +case GTK_UNIT_MM: + self = .mm default: fatalError("Unsupported GtkUnit enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ public enum Unit: GValueRepresentableEnum { public func toGtk() -> GtkUnit { switch self { case .none: - return GTK_UNIT_NONE - case .points: - return GTK_UNIT_POINTS - case .inch: - return GTK_UNIT_INCH - case .mm: - return GTK_UNIT_MM + return GTK_UNIT_NONE +case .points: + return GTK_UNIT_POINTS +case .inch: + return GTK_UNIT_INCH +case .mm: + return GTK_UNIT_MM } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/WidgetHelpType.swift b/Sources/Gtk3/Generated/WidgetHelpType.swift index f6ef553ae9..9c9e9cbd1f 100644 --- a/Sources/Gtk3/Generated/WidgetHelpType.swift +++ b/Sources/Gtk3/Generated/WidgetHelpType.swift @@ -5,20 +5,20 @@ public enum WidgetHelpType: GValueRepresentableEnum { public typealias GtkEnum = GtkWidgetHelpType /// Tooltip. - case tooltip - /// What’s this. - case whatsThis +case tooltip +/// What’s this. +case whatsThis public static var type: GType { - gtk_widget_help_type_get_type() - } + gtk_widget_help_type_get_type() +} public init(from gtkEnum: GtkWidgetHelpType) { switch gtkEnum { case GTK_WIDGET_HELP_TOOLTIP: - self = .tooltip - case GTK_WIDGET_HELP_WHATS_THIS: - self = .whatsThis + self = .tooltip +case GTK_WIDGET_HELP_WHATS_THIS: + self = .whatsThis default: fatalError("Unsupported GtkWidgetHelpType enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ public enum WidgetHelpType: GValueRepresentableEnum { public func toGtk() -> GtkWidgetHelpType { switch self { case .tooltip: - return GTK_WIDGET_HELP_TOOLTIP - case .whatsThis: - return GTK_WIDGET_HELP_WHATS_THIS + return GTK_WIDGET_HELP_TOOLTIP +case .whatsThis: + return GTK_WIDGET_HELP_WHATS_THIS } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/WindowPosition.swift b/Sources/Gtk3/Generated/WindowPosition.swift index 09e0248bc0..568a242bd9 100644 --- a/Sources/Gtk3/Generated/WindowPosition.swift +++ b/Sources/Gtk3/Generated/WindowPosition.swift @@ -7,33 +7,33 @@ public enum WindowPosition: GValueRepresentableEnum { public typealias GtkEnum = GtkWindowPosition /// No influence is made on placement. - case none - /// Windows should be placed in the center of the screen. - case center - /// Windows should be placed at the current mouse position. - case mouse - /// Keep window centered as it changes size, etc. - case centerAlways - /// Center the window on its transient - /// parent (see gtk_window_set_transient_for()). - case centerOnParent +case none +/// Windows should be placed in the center of the screen. +case center +/// Windows should be placed at the current mouse position. +case mouse +/// Keep window centered as it changes size, etc. +case centerAlways +/// Center the window on its transient +/// parent (see gtk_window_set_transient_for()). +case centerOnParent public static var type: GType { - gtk_window_position_get_type() - } + gtk_window_position_get_type() +} public init(from gtkEnum: GtkWindowPosition) { switch gtkEnum { case GTK_WIN_POS_NONE: - self = .none - case GTK_WIN_POS_CENTER: - self = .center - case GTK_WIN_POS_MOUSE: - self = .mouse - case GTK_WIN_POS_CENTER_ALWAYS: - self = .centerAlways - case GTK_WIN_POS_CENTER_ON_PARENT: - self = .centerOnParent + self = .none +case GTK_WIN_POS_CENTER: + self = .center +case GTK_WIN_POS_MOUSE: + self = .mouse +case GTK_WIN_POS_CENTER_ALWAYS: + self = .centerAlways +case GTK_WIN_POS_CENTER_ON_PARENT: + self = .centerOnParent default: fatalError("Unsupported GtkWindowPosition enum value: \(gtkEnum.rawValue)") } @@ -42,15 +42,15 @@ public enum WindowPosition: GValueRepresentableEnum { public func toGtk() -> GtkWindowPosition { switch self { case .none: - return GTK_WIN_POS_NONE - case .center: - return GTK_WIN_POS_CENTER - case .mouse: - return GTK_WIN_POS_MOUSE - case .centerAlways: - return GTK_WIN_POS_CENTER_ALWAYS - case .centerOnParent: - return GTK_WIN_POS_CENTER_ON_PARENT + return GTK_WIN_POS_NONE +case .center: + return GTK_WIN_POS_CENTER +case .mouse: + return GTK_WIN_POS_MOUSE +case .centerAlways: + return GTK_WIN_POS_CENTER_ALWAYS +case .centerOnParent: + return GTK_WIN_POS_CENTER_ON_PARENT } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/WindowType.swift b/Sources/Gtk3/Generated/WindowType.swift index 3a65c51864..7cbdb8c502 100644 --- a/Sources/Gtk3/Generated/WindowType.swift +++ b/Sources/Gtk3/Generated/WindowType.swift @@ -17,20 +17,20 @@ public enum WindowType: GValueRepresentableEnum { public typealias GtkEnum = GtkWindowType /// A regular window, such as a dialog. - case toplevel - /// A special window such as a tooltip. - case popup +case toplevel +/// A special window such as a tooltip. +case popup public static var type: GType { - gtk_window_type_get_type() - } + gtk_window_type_get_type() +} public init(from gtkEnum: GtkWindowType) { switch gtkEnum { case GTK_WINDOW_TOPLEVEL: - self = .toplevel - case GTK_WINDOW_POPUP: - self = .popup + self = .toplevel +case GTK_WINDOW_POPUP: + self = .popup default: fatalError("Unsupported GtkWindowType enum value: \(gtkEnum.rawValue)") } @@ -39,9 +39,9 @@ public enum WindowType: GValueRepresentableEnum { public func toGtk() -> GtkWindowType { switch self { case .toplevel: - return GTK_WINDOW_TOPLEVEL - case .popup: - return GTK_WINDOW_POPUP + return GTK_WINDOW_TOPLEVEL +case .popup: + return GTK_WINDOW_POPUP } } -} +} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/WrapMode.swift b/Sources/Gtk3/Generated/WrapMode.swift index 0e1da941eb..517cb98dc2 100644 --- a/Sources/Gtk3/Generated/WrapMode.swift +++ b/Sources/Gtk3/Generated/WrapMode.swift @@ -5,31 +5,31 @@ public enum WrapMode: GValueRepresentableEnum { public typealias GtkEnum = GtkWrapMode /// Do not wrap lines; just make the text area wider - case none - /// Wrap text, breaking lines anywhere the cursor can - /// appear (between characters, usually - if you want to be technical, - /// between graphemes, see pango_get_log_attrs()) - case character - /// Wrap text, breaking lines in between words - case word - /// Wrap text, breaking lines in between words, or if - /// that is not enough, also between graphemes - case wordCharacter +case none +/// Wrap text, breaking lines anywhere the cursor can +/// appear (between characters, usually - if you want to be technical, +/// between graphemes, see pango_get_log_attrs()) +case character +/// Wrap text, breaking lines in between words +case word +/// Wrap text, breaking lines in between words, or if +/// that is not enough, also between graphemes +case wordCharacter public static var type: GType { - gtk_wrap_mode_get_type() - } + gtk_wrap_mode_get_type() +} public init(from gtkEnum: GtkWrapMode) { switch gtkEnum { case GTK_WRAP_NONE: - self = .none - case GTK_WRAP_CHAR: - self = .character - case GTK_WRAP_WORD: - self = .word - case GTK_WRAP_WORD_CHAR: - self = .wordCharacter + self = .none +case GTK_WRAP_CHAR: + self = .character +case GTK_WRAP_WORD: + self = .word +case GTK_WRAP_WORD_CHAR: + self = .wordCharacter default: fatalError("Unsupported GtkWrapMode enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ public enum WrapMode: GValueRepresentableEnum { public func toGtk() -> GtkWrapMode { switch self { case .none: - return GTK_WRAP_NONE - case .character: - return GTK_WRAP_CHAR - case .word: - return GTK_WRAP_WORD - case .wordCharacter: - return GTK_WRAP_WORD_CHAR + return GTK_WRAP_NONE +case .character: + return GTK_WRAP_CHAR +case .word: + return GTK_WRAP_WORD +case .wordCharacter: + return GTK_WRAP_WORD_CHAR } } -} +} \ No newline at end of file diff --git a/Sources/GtkCodeGen/GtkCodeGen.swift b/Sources/GtkCodeGen/GtkCodeGen.swift index 13db5e4fc2..eb933e32a8 100644 --- a/Sources/GtkCodeGen/GtkCodeGen.swift +++ b/Sources/GtkCodeGen/GtkCodeGen.swift @@ -225,6 +225,13 @@ struct GtkCodeGen { else { return false } + + guard + member.cIdentifier != "GTK_PAD_ACTION_DIAL", + member.name != "GTK_PAD_ACTION_DIAL" + else { + return false + } if let doc = member.doc { // Why they gotta be inconsistent like that 💀 diff --git a/Sources/UIKitBackend/UIKitBackend+Control.swift b/Sources/UIKitBackend/UIKitBackend+Control.swift index 57cca0a90c..9179075d20 100644 --- a/Sources/UIKitBackend/UIKitBackend+Control.swift +++ b/Sources/UIKitBackend/UIKitBackend+Control.swift @@ -183,8 +183,6 @@ final class HoverableWidget: ContainerWidget { child.view.addGestureRecognizer(gestureRecognizer) self.hoverGestureRecognizer = gestureRecognizer } else if hoverChangesHandler == nil, let hoverGestureRecognizer { - // should be impossible at the moment of implementation - // keeping it to be save in case of later changes child.view.removeGestureRecognizer(hoverGestureRecognizer) self.hoverGestureRecognizer = nil } diff --git a/Sources/WinUIBackend/WinUIBackend.swift b/Sources/WinUIBackend/WinUIBackend.swift index fdd05d51f5..a54a1a8625 100644 --- a/Sources/WinUIBackend/WinUIBackend.swift +++ b/Sources/WinUIBackend/WinUIBackend.swift @@ -1373,8 +1373,6 @@ public final class WinUIBackend: AppBackend { } let tapGestureTarget = tapGestureTarget as! TapGestureTarget tapGestureTarget.clickHandler = environment.isEnabled ? action : {} - tapGestureTarget.width = tapGestureTarget.child!.width - tapGestureTarget.height = tapGestureTarget.child!.height } public func createHoverTarget(wrapping child: Widget) -> Widget { @@ -1408,9 +1406,6 @@ public final class WinUIBackend: AppBackend { let hoverTarget = hoverTarget as! HoverGestureTarget hoverTarget.enterHandler = environment.isEnabled ? { action(true) } : {} hoverTarget.exitHandler = environment.isEnabled ? { action(false) } : {} - - hoverTarget.width = hoverTarget.child!.width - hoverTarget.height = hoverTarget.child!.height } public func createProgressSpinner() -> Widget { From 34367559b08a166f073daca4adaddbacd8736318 Mon Sep 17 00:00:00 2001 From: Mia Koring Date: Mon, 15 Sep 2025 16:25:50 +0200 Subject: [PATCH 10/15] implemented requested changes # Conflicts: # Sources/GtkCodeGen/GtkCodeGen.swift --- Sources/GtkCodeGen/GtkCodeGen.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/GtkCodeGen/GtkCodeGen.swift b/Sources/GtkCodeGen/GtkCodeGen.swift index eb933e32a8..ee857b0001 100644 --- a/Sources/GtkCodeGen/GtkCodeGen.swift +++ b/Sources/GtkCodeGen/GtkCodeGen.swift @@ -226,6 +226,7 @@ struct GtkCodeGen { return false } + //can cause problems with gtk versions older than 4.20.0 guard member.cIdentifier != "GTK_PAD_ACTION_DIAL", member.name != "GTK_PAD_ACTION_DIAL" From 469e042cc170212ae63dc71691c4df7c98f88be6 Mon Sep 17 00:00:00 2001 From: Mia Koring Date: Mon, 15 Sep 2025 16:56:38 +0200 Subject: [PATCH 11/15] format_and_lint --- Sources/AppKitBackend/AppKitBackend.swift | 2 +- Sources/Gtk/Generated/Accessible.swift | 23 +- .../Generated/AccessibleAutocomplete.swift | 64 +- .../Generated/AccessibleInvalidState.swift | 50 +- .../Gtk/Generated/AccessibleProperty.swift | 288 +-- .../Gtk/Generated/AccessibleRelation.swift | 268 +-- Sources/Gtk/Generated/AccessibleRole.swift | 986 ++++---- Sources/Gtk/Generated/AccessibleSort.swift | 50 +- Sources/Gtk/Generated/AccessibleState.swift | 122 +- .../Gtk/Generated/AccessibleTristate.swift | 38 +- Sources/Gtk/Generated/Actionable.swift | 9 +- Sources/Gtk/Generated/Align.swift | 56 +- Sources/Gtk/Generated/AppChooser.swift | 15 +- Sources/Gtk/Generated/ArrowType.swift | 60 +- Sources/Gtk/Generated/AssistantPageType.swift | 96 +- Sources/Gtk/Generated/BaselinePosition.swift | 38 +- Sources/Gtk/Generated/BorderStyle.swift | 120 +- Sources/Gtk/Generated/Buildable.swift | 10 +- Sources/Gtk/Generated/BuilderError.swift | 202 +- Sources/Gtk/Generated/BuilderScope.swift | 14 +- Sources/Gtk/Generated/Button.swift | 350 +-- Sources/Gtk/Generated/ButtonsType.swift | 76 +- Sources/Gtk/Generated/CellEditable.swift | 53 +- Sources/Gtk/Generated/CellLayout.swift | 40 +- .../Gtk/Generated/CellRendererAccelMode.swift | 24 +- Sources/Gtk/Generated/CellRendererMode.swift | 42 +- Sources/Gtk/Generated/CheckButton.swift | 354 +-- .../Gtk/Generated/ConstraintAttribute.swift | 162 +- .../Gtk/Generated/ConstraintRelation.swift | 36 +- .../Gtk/Generated/ConstraintStrength.swift | 50 +- Sources/Gtk/Generated/ConstraintTarget.swift | 6 +- .../Generated/ConstraintVflParserError.swift | 75 +- Sources/Gtk/Generated/CornerType.swift | 58 +- Sources/Gtk/Generated/CssParserError.swift | 62 +- Sources/Gtk/Generated/CssParserWarning.swift | 42 +- Sources/Gtk/Generated/DeleteType.swift | 108 +- Sources/Gtk/Generated/DirectionType.swift | 72 +- Sources/Gtk/Generated/DrawingArea.swift | 130 +- Sources/Gtk/Generated/DropDown.swift | 343 +-- Sources/Gtk/Generated/Editable.swift | 130 +- .../Gtk/Generated/EditableProperties.swift | 110 +- Sources/Gtk/Generated/Entry.swift | 1704 +++++++------- Sources/Gtk/Generated/EntryIconPosition.swift | 24 +- Sources/Gtk/Generated/EventController.swift | 121 +- .../Gtk/Generated/EventControllerMotion.swift | 178 +- .../Gtk/Generated/EventSequenceState.swift | 36 +- Sources/Gtk/Generated/FileChooser.swift | 59 +- Sources/Gtk/Generated/FileChooserAction.swift | 46 +- Sources/Gtk/Generated/FileChooserError.swift | 52 +- Sources/Gtk/Generated/FileChooserNative.swift | 339 +-- Sources/Gtk/Generated/FilterChange.swift | 50 +- Sources/Gtk/Generated/FilterMatch.swift | 44 +- Sources/Gtk/Generated/FontChooser.swift | 38 +- Sources/Gtk/Generated/GLArea.swift | 427 ++-- Sources/Gtk/Generated/Gesture.swift | 273 +-- Sources/Gtk/Generated/GestureClick.swift | 122 +- Sources/Gtk/Generated/GestureLongPress.swift | 86 +- Sources/Gtk/Generated/GestureSingle.swift | 98 +- Sources/Gtk/Generated/IconSize.swift | 40 +- Sources/Gtk/Generated/IconThemeError.swift | 24 +- .../Gtk/Generated/IconViewDropPosition.swift | 72 +- Sources/Gtk/Generated/Image.swift | 433 ++-- Sources/Gtk/Generated/ImageType.swift | 52 +- Sources/Gtk/Generated/InputPurpose.swift | 140 +- Sources/Gtk/Generated/Justification.swift | 48 +- Sources/Gtk/Generated/Label.swift | 980 ++++---- Sources/Gtk/Generated/LevelBarMode.swift | 26 +- Sources/Gtk/Generated/ListBox.swift | 348 +-- Sources/Gtk/Generated/MessageType.swift | 60 +- Sources/Gtk/Generated/MovementStep.swift | 120 +- Sources/Gtk/Generated/Native.swift | 12 +- Sources/Gtk/Generated/NativeDialog.swift | 156 +- Sources/Gtk/Generated/NotebookTab.swift | 24 +- Sources/Gtk/Generated/NumberUpLayout.swift | 96 +- Sources/Gtk/Generated/Ordering.swift | 38 +- Sources/Gtk/Generated/Orientation.swift | 26 +- Sources/Gtk/Generated/Overflow.swift | 30 +- Sources/Gtk/Generated/PackType.swift | 26 +- Sources/Gtk/Generated/PadActionType.swift | 36 +- Sources/Gtk/Generated/PageOrientation.swift | 48 +- Sources/Gtk/Generated/PageSet.swift | 36 +- Sources/Gtk/Generated/PanDirection.swift | 48 +- Sources/Gtk/Generated/Picture.swift | 252 +- Sources/Gtk/Generated/PolicyType.swift | 58 +- Sources/Gtk/Generated/Popover.swift | 308 +-- Sources/Gtk/Generated/PositionType.swift | 50 +- Sources/Gtk/Generated/PrintDuplex.swift | 36 +- Sources/Gtk/Generated/PrintError.swift | 50 +- .../Gtk/Generated/PrintOperationAction.swift | 56 +- .../Gtk/Generated/PrintOperationResult.swift | 54 +- Sources/Gtk/Generated/PrintPages.swift | 48 +- Sources/Gtk/Generated/PrintQuality.swift | 48 +- Sources/Gtk/Generated/PrintStatus.swift | 120 +- Sources/Gtk/Generated/ProgressBar.swift | 249 +- Sources/Gtk/Generated/PropagationLimit.swift | 32 +- Sources/Gtk/Generated/PropagationPhase.swift | 62 +- Sources/Gtk/Generated/Range.swift | 343 +-- .../Gtk/Generated/RecentManagerError.swift | 94 +- Sources/Gtk/Generated/ResponseType.swift | 136 +- .../Generated/RevealerTransitionType.swift | 120 +- Sources/Gtk/Generated/Root.swift | 12 +- Sources/Gtk/Generated/Scale.swift | 202 +- Sources/Gtk/Generated/ScrollStep.swift | 72 +- Sources/Gtk/Generated/ScrollType.swift | 192 +- Sources/Gtk/Generated/Scrollable.swift | 23 +- Sources/Gtk/Generated/ScrollablePolicy.swift | 24 +- Sources/Gtk/Generated/SelectionMode.swift | 64 +- Sources/Gtk/Generated/SelectionModel.swift | 29 +- Sources/Gtk/Generated/SensitivityType.swift | 38 +- Sources/Gtk/Generated/ShortcutManager.swift | 10 +- Sources/Gtk/Generated/ShortcutScope.swift | 42 +- Sources/Gtk/Generated/ShortcutType.swift | 126 +- Sources/Gtk/Generated/SizeGroupMode.swift | 48 +- Sources/Gtk/Generated/SizeRequestMode.swift | 36 +- Sources/Gtk/Generated/SortType.swift | 24 +- Sources/Gtk/Generated/SorterChange.swift | 58 +- Sources/Gtk/Generated/SorterOrder.swift | 42 +- .../Generated/SpinButtonUpdatePolicy.swift | 32 +- Sources/Gtk/Generated/SpinType.swift | 84 +- Sources/Gtk/Generated/Spinner.swift | 51 +- .../Gtk/Generated/StackTransitionType.swift | 278 +-- .../Gtk/Generated/StringFilterMatchMode.swift | 42 +- Sources/Gtk/Generated/StyleProvider.swift | 10 +- Sources/Gtk/Generated/Switch.swift | 241 +- Sources/Gtk/Generated/SystemSetting.swift | 80 +- Sources/Gtk/Generated/TextDirection.swift | 36 +- .../Gtk/Generated/TextExtendSelection.swift | 28 +- Sources/Gtk/Generated/TextViewLayer.swift | 24 +- Sources/Gtk/Generated/TextWindowType.swift | 72 +- Sources/Gtk/Generated/TreeDragDest.swift | 4 +- Sources/Gtk/Generated/TreeDragSource.swift | 4 +- Sources/Gtk/Generated/TreeSortable.swift | 11 +- .../Gtk/Generated/TreeViewColumnSizing.swift | 36 +- .../Gtk/Generated/TreeViewDropPosition.swift | 48 +- Sources/Gtk/Generated/TreeViewGridLines.swift | 48 +- Sources/Gtk/Generated/Unit.swift | 48 +- Sources/Gtk/Generated/WrapMode.swift | 54 +- Sources/Gtk3/Generated/Activatable.swift | 110 +- Sources/Gtk3/Generated/Align.swift | 62 +- Sources/Gtk3/Generated/AppChooser.swift | 15 +- Sources/Gtk3/Generated/ArrowPlacement.swift | 36 +- Sources/Gtk3/Generated/ArrowType.swift | 48 +- .../Gtk3/Generated/AssistantPageType.swift | 94 +- Sources/Gtk3/Generated/BorderStyle.swift | 120 +- Sources/Gtk3/Generated/Buildable.swift | 8 +- Sources/Gtk3/Generated/BuilderError.swift | 186 +- Sources/Gtk3/Generated/Button.swift | 459 ++-- Sources/Gtk3/Generated/ButtonBoxStyle.swift | 52 +- Sources/Gtk3/Generated/ButtonRole.swift | 36 +- Sources/Gtk3/Generated/ButtonsType.swift | 74 +- .../Gtk3/Generated/CellAccessibleParent.swift | 5 +- Sources/Gtk3/Generated/CellEditable.swift | 51 +- Sources/Gtk3/Generated/CellLayout.swift | 36 +- .../Generated/CellRendererAccelMode.swift | 24 +- Sources/Gtk3/Generated/CellRendererMode.swift | 42 +- Sources/Gtk3/Generated/CheckButton.swift | 55 +- Sources/Gtk3/Generated/CornerType.swift | 56 +- Sources/Gtk3/Generated/CssProviderError.swift | 72 +- Sources/Gtk3/Generated/DeleteType.swift | 108 +- Sources/Gtk3/Generated/DirectionType.swift | 72 +- Sources/Gtk3/Generated/DragResult.swift | 76 +- Sources/Gtk3/Generated/DrawingArea.swift | 51 +- Sources/Gtk3/Generated/Editable.swift | 69 +- Sources/Gtk3/Generated/Entry.swift | 2018 +++++++++-------- Sources/Gtk3/Generated/EventBox.swift | 70 +- Sources/Gtk3/Generated/EventController.swift | 53 +- Sources/Gtk3/Generated/ExpanderStyle.swift | 48 +- Sources/Gtk3/Generated/FileChooser.swift | 315 ++- .../Gtk3/Generated/FileChooserAction.swift | 62 +- Sources/Gtk3/Generated/FileChooserError.swift | 50 +- .../Gtk3/Generated/FileChooserNative.swift | 798 +++---- Sources/Gtk3/Generated/FontChooser.swift | 20 +- Sources/Gtk3/Generated/GLArea.swift | 320 +-- Sources/Gtk3/Generated/Gesture.swift | 278 +-- Sources/Gtk3/Generated/GestureLongPress.swift | 84 +- Sources/Gtk3/Generated/GestureSingle.swift | 80 +- Sources/Gtk3/Generated/IMPreeditStyle.swift | 36 +- Sources/Gtk3/Generated/IMStatusStyle.swift | 36 +- Sources/Gtk3/Generated/IconSize.swift | 84 +- Sources/Gtk3/Generated/IconThemeError.swift | 24 +- .../Gtk3/Generated/IconViewDropPosition.swift | 72 +- Sources/Gtk3/Generated/Image.swift | 487 ++-- Sources/Gtk3/Generated/ImageType.swift | 102 +- Sources/Gtk3/Generated/Justification.swift | 48 +- Sources/Gtk3/Generated/Label.swift | 827 +++---- .../Gtk3/Generated/MenuDirectionType.swift | 48 +- Sources/Gtk3/Generated/MenuShell.swift | 237 +- Sources/Gtk3/Generated/MessageType.swift | 60 +- Sources/Gtk3/Generated/MovementStep.swift | 121 +- Sources/Gtk3/Generated/NativeDialog.swift | 142 +- Sources/Gtk3/Generated/NotebookTab.swift | 24 +- Sources/Gtk3/Generated/NumberUpLayout.swift | 96 +- Sources/Gtk3/Generated/Orientation.swift | 24 +- Sources/Gtk3/Generated/PackDirection.swift | 48 +- Sources/Gtk3/Generated/PackType.swift | 24 +- Sources/Gtk3/Generated/PadActionType.swift | 36 +- Sources/Gtk3/Generated/PageOrientation.swift | 48 +- Sources/Gtk3/Generated/PageSet.swift | 36 +- Sources/Gtk3/Generated/PathPriorityType.swift | 72 +- Sources/Gtk3/Generated/PathType.swift | 36 +- Sources/Gtk3/Generated/PolicyType.swift | 42 +- Sources/Gtk3/Generated/PositionType.swift | 48 +- Sources/Gtk3/Generated/PrintDuplex.swift | 36 +- Sources/Gtk3/Generated/PrintError.swift | 50 +- .../Gtk3/Generated/PrintOperationAction.swift | 52 +- .../Gtk3/Generated/PrintOperationResult.swift | 52 +- Sources/Gtk3/Generated/PrintPages.swift | 48 +- Sources/Gtk3/Generated/PrintQuality.swift | 48 +- Sources/Gtk3/Generated/PrintStatus.swift | 120 +- Sources/Gtk3/Generated/ProgressBar.swift | 211 +- Sources/Gtk3/Generated/Range.swift | 360 +-- Sources/Gtk3/Generated/RcTokenType.swift | 480 ++-- Sources/Gtk3/Generated/RecentChooser.swift | 26 +- Sources/Gtk3/Generated/ReliefStyle.swift | 36 +- Sources/Gtk3/Generated/ResizeMode.swift | 37 +- Sources/Gtk3/Generated/ResponseType.swift | 134 +- .../Generated/RevealerTransitionType.swift | 72 +- Sources/Gtk3/Generated/Scale.swift | 182 +- Sources/Gtk3/Generated/ScrollStep.swift | 73 +- Sources/Gtk3/Generated/ScrollType.swift | 192 +- Sources/Gtk3/Generated/Scrollable.swift | 18 +- Sources/Gtk3/Generated/ScrollablePolicy.swift | 24 +- Sources/Gtk3/Generated/SelectionMode.swift | 64 +- Sources/Gtk3/Generated/SensitivityType.swift | 38 +- Sources/Gtk3/Generated/ShadowType.swift | 62 +- Sources/Gtk3/Generated/SizeGroupMode.swift | 48 +- Sources/Gtk3/Generated/SizeRequestMode.swift | 36 +- Sources/Gtk3/Generated/SortType.swift | 24 +- .../Generated/SpinButtonUpdatePolicy.swift | 30 +- Sources/Gtk3/Generated/SpinType.swift | 84 +- Sources/Gtk3/Generated/Spinner.swift | 43 +- .../Gtk3/Generated/StackTransitionType.swift | 98 +- Sources/Gtk3/Generated/StateType.swift | 92 +- Sources/Gtk3/Generated/StyleProvider.swift | 4 +- Sources/Gtk3/Generated/Switch.swift | 205 +- .../Gtk3/Generated/TextBufferTargetInfo.swift | 38 +- Sources/Gtk3/Generated/TextDirection.swift | 36 +- Sources/Gtk3/Generated/TextViewLayer.swift | 24 +- Sources/Gtk3/Generated/TextWindowType.swift | 84 +- Sources/Gtk3/Generated/ToolShell.swift | 4 +- .../Gtk3/Generated/ToolbarSpaceStyle.swift | 24 +- Sources/Gtk3/Generated/ToolbarStyle.swift | 50 +- Sources/Gtk3/Generated/TreeDragDest.swift | 5 +- Sources/Gtk3/Generated/TreeDragSource.swift | 5 +- Sources/Gtk3/Generated/TreeSortable.swift | 9 +- .../Gtk3/Generated/TreeViewColumnSizing.swift | 36 +- .../Gtk3/Generated/TreeViewDropPosition.swift | 48 +- .../Gtk3/Generated/TreeViewGridLines.swift | 48 +- Sources/Gtk3/Generated/Unit.swift | 48 +- Sources/Gtk3/Generated/WidgetHelpType.swift | 24 +- Sources/Gtk3/Generated/WindowPosition.swift | 62 +- Sources/Gtk3/Generated/WindowType.swift | 24 +- Sources/Gtk3/Generated/WrapMode.swift | 54 +- Sources/GtkCodeGen/GtkCodeGen.swift | 2 +- 254 files changed, 14506 insertions(+), 14108 deletions(-) diff --git a/Sources/AppKitBackend/AppKitBackend.swift b/Sources/AppKitBackend/AppKitBackend.swift index 99b13caa08..4f23de39d1 100644 --- a/Sources/AppKitBackend/AppKitBackend.swift +++ b/Sources/AppKitBackend/AppKitBackend.swift @@ -1787,7 +1787,7 @@ final class NSCustomHoverTarget: NSView { override func mouseExited(with event: NSEvent) { hoverChangesHandler?(false) } - + private func setNewTrackingArea() { let options: NSTrackingArea.Options = [ .mouseEnteredAndExited, diff --git a/Sources/Gtk/Generated/Accessible.swift b/Sources/Gtk/Generated/Accessible.swift index 4a356e0d18..4659bc8e0f 100644 --- a/Sources/Gtk/Generated/Accessible.swift +++ b/Sources/Gtk/Generated/Accessible.swift @@ -1,30 +1,30 @@ import CGtk /// An interface for describing UI elements for Assistive Technologies. -/// +/// /// Every accessible implementation has: -/// +/// /// - a “role”, represented by a value of the [enum@Gtk.AccessibleRole] enumeration /// - “attributes”, represented by a set of [enum@Gtk.AccessibleState], /// [enum@Gtk.AccessibleProperty] and [enum@Gtk.AccessibleRelation] values -/// +/// /// The role cannot be changed after instantiating a `GtkAccessible` /// implementation. -/// +/// /// The attributes are updated every time a UI element's state changes in /// a way that should be reflected by assistive technologies. For instance, /// if a `GtkWidget` visibility changes, the %GTK_ACCESSIBLE_STATE_HIDDEN /// state will also change to reflect the [property@Gtk.Widget:visible] property. -/// +/// /// Every accessible implementation is part of a tree of accessible objects. /// Normally, this tree corresponds to the widget tree, but can be customized /// by reimplementing the [vfunc@Gtk.Accessible.get_accessible_parent], /// [vfunc@Gtk.Accessible.get_first_accessible_child] and /// [vfunc@Gtk.Accessible.get_next_accessible_sibling] virtual functions. -/// +/// /// Note that you can not create a top-level accessible object as of now, /// which means that you must always have a parent accessible object. -/// +/// /// Also note that when an accessible object does not correspond to a widget, /// and it has children, whose implementation you don't control, /// it is necessary to ensure the correct shape of the a11y tree @@ -32,9 +32,8 @@ import CGtk /// updating the sibling by [method@Gtk.Accessible.update_next_accessible_sibling]. public protocol Accessible: GObjectRepresentable { /// The accessible role of the given `GtkAccessible` implementation. -/// -/// The accessible role cannot be changed once set. -var accessibleRole: AccessibleRole { get set } + /// + /// The accessible role cannot be changed once set. + var accessibleRole: AccessibleRole { get set } - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AccessibleAutocomplete.swift b/Sources/Gtk/Generated/AccessibleAutocomplete.swift index f877f61ae8..1af0f8d331 100644 --- a/Sources/Gtk/Generated/AccessibleAutocomplete.swift +++ b/Sources/Gtk/Generated/AccessibleAutocomplete.swift @@ -6,36 +6,36 @@ public enum AccessibleAutocomplete: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleAutocomplete /// Automatic suggestions are not displayed. -case none -/// When a user is providing input, text -/// suggesting one way to complete the provided input may be dynamically -/// inserted after the caret. -case inline -/// When a user is providing input, an element -/// containing a collection of values that could complete the provided input -/// may be displayed. -case list -/// When a user is providing input, an element -/// containing a collection of values that could complete the provided input -/// may be displayed. If displayed, one value in the collection is automatically -/// selected, and the text needed to complete the automatically selected value -/// appears after the caret in the input. -case both + case none + /// When a user is providing input, text + /// suggesting one way to complete the provided input may be dynamically + /// inserted after the caret. + case inline + /// When a user is providing input, an element + /// containing a collection of values that could complete the provided input + /// may be displayed. + case list + /// When a user is providing input, an element + /// containing a collection of values that could complete the provided input + /// may be displayed. If displayed, one value in the collection is automatically + /// selected, and the text needed to complete the automatically selected value + /// appears after the caret in the input. + case both public static var type: GType { - gtk_accessible_autocomplete_get_type() -} + gtk_accessible_autocomplete_get_type() + } public init(from gtkEnum: GtkAccessibleAutocomplete) { switch gtkEnum { case GTK_ACCESSIBLE_AUTOCOMPLETE_NONE: - self = .none -case GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE: - self = .inline -case GTK_ACCESSIBLE_AUTOCOMPLETE_LIST: - self = .list -case GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH: - self = .both + self = .none + case GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE: + self = .inline + case GTK_ACCESSIBLE_AUTOCOMPLETE_LIST: + self = .list + case GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH: + self = .both default: fatalError("Unsupported GtkAccessibleAutocomplete enum value: \(gtkEnum.rawValue)") } @@ -44,13 +44,13 @@ case GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH: public func toGtk() -> GtkAccessibleAutocomplete { switch self { case .none: - return GTK_ACCESSIBLE_AUTOCOMPLETE_NONE -case .inline: - return GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE -case .list: - return GTK_ACCESSIBLE_AUTOCOMPLETE_LIST -case .both: - return GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH + return GTK_ACCESSIBLE_AUTOCOMPLETE_NONE + case .inline: + return GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE + case .list: + return GTK_ACCESSIBLE_AUTOCOMPLETE_LIST + case .both: + return GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AccessibleInvalidState.swift b/Sources/Gtk/Generated/AccessibleInvalidState.swift index 76c2055efe..be5eff22c3 100644 --- a/Sources/Gtk/Generated/AccessibleInvalidState.swift +++ b/Sources/Gtk/Generated/AccessibleInvalidState.swift @@ -2,7 +2,7 @@ import CGtk /// The possible values for the %GTK_ACCESSIBLE_STATE_INVALID /// accessible state. -/// +/// /// Note that the %GTK_ACCESSIBLE_INVALID_FALSE and /// %GTK_ACCESSIBLE_INVALID_TRUE have the same values /// as %FALSE and %TRUE. @@ -10,28 +10,28 @@ public enum AccessibleInvalidState: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleInvalidState /// There are no detected errors in the value -case false_ -/// The value entered by the user has failed validation -case true_ -/// A grammatical error was detected -case grammar -/// A spelling error was detected -case spelling + case false_ + /// The value entered by the user has failed validation + case true_ + /// A grammatical error was detected + case grammar + /// A spelling error was detected + case spelling public static var type: GType { - gtk_accessible_invalid_state_get_type() -} + gtk_accessible_invalid_state_get_type() + } public init(from gtkEnum: GtkAccessibleInvalidState) { switch gtkEnum { case GTK_ACCESSIBLE_INVALID_FALSE: - self = .false_ -case GTK_ACCESSIBLE_INVALID_TRUE: - self = .true_ -case GTK_ACCESSIBLE_INVALID_GRAMMAR: - self = .grammar -case GTK_ACCESSIBLE_INVALID_SPELLING: - self = .spelling + self = .false_ + case GTK_ACCESSIBLE_INVALID_TRUE: + self = .true_ + case GTK_ACCESSIBLE_INVALID_GRAMMAR: + self = .grammar + case GTK_ACCESSIBLE_INVALID_SPELLING: + self = .spelling default: fatalError("Unsupported GtkAccessibleInvalidState enum value: \(gtkEnum.rawValue)") } @@ -40,13 +40,13 @@ case GTK_ACCESSIBLE_INVALID_SPELLING: public func toGtk() -> GtkAccessibleInvalidState { switch self { case .false_: - return GTK_ACCESSIBLE_INVALID_FALSE -case .true_: - return GTK_ACCESSIBLE_INVALID_TRUE -case .grammar: - return GTK_ACCESSIBLE_INVALID_GRAMMAR -case .spelling: - return GTK_ACCESSIBLE_INVALID_SPELLING + return GTK_ACCESSIBLE_INVALID_FALSE + case .true_: + return GTK_ACCESSIBLE_INVALID_TRUE + case .grammar: + return GTK_ACCESSIBLE_INVALID_GRAMMAR + case .spelling: + return GTK_ACCESSIBLE_INVALID_SPELLING } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AccessibleProperty.swift b/Sources/Gtk/Generated/AccessibleProperty.swift index a98b3b4e67..a30c276c15 100644 --- a/Sources/Gtk/Generated/AccessibleProperty.swift +++ b/Sources/Gtk/Generated/AccessibleProperty.swift @@ -5,118 +5,118 @@ public enum AccessibleProperty: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleProperty /// Indicates whether inputting text -/// could trigger display of one or more predictions of the user's intended -/// value for a combobox, searchbox, or textbox and specifies how predictions -/// would be presented if they were made. Value type: [enum@AccessibleAutocomplete] -case autocomplete -/// Defines a string value that describes -/// or annotates the current element. Value type: string -case description -/// Indicates the availability and type of -/// interactive popup element, such as menu or dialog, that can be triggered -/// by an element. -case hasPopup -/// Indicates keyboard shortcuts that an -/// author has implemented to activate or give focus to an element. Value type: -/// string. The format of the value is a space-separated list of shortcuts, with -/// each shortcut consisting of one or more modifiers (`Control`, `Alt` or `Shift`), -/// followed by a non-modifier key, all separated by `+`. -/// Examples: `F2`, `Alt-F`, `Control+Shift+N` -case keyShortcuts -/// Defines a string value that labels the current -/// element. Value type: string -case label -/// Defines the hierarchical level of an element -/// within a structure. Value type: integer -case level -/// Indicates whether an element is modal when -/// displayed. Value type: boolean -case modal -/// Indicates whether a text box accepts -/// multiple lines of input or only a single line. Value type: boolean -case multiLine -/// Indicates that the user may select -/// more than one item from the current selectable descendants. Value type: -/// boolean -case multiSelectable -/// Indicates whether the element's -/// orientation is horizontal, vertical, or unknown/ambiguous. Value type: -/// [enum@Orientation] -case orientation -/// Defines a short hint (a word or short -/// phrase) intended to aid the user with data entry when the control has no -/// value. A hint could be a sample value or a brief description of the expected -/// format. Value type: string -case placeholder -/// Indicates that the element is not editable, -/// but is otherwise operable. Value type: boolean -case readOnly -/// Indicates that user input is required on -/// the element before a form may be submitted. Value type: boolean -case required -/// Defines a human-readable, -/// author-localized description for the role of an element. Value type: string -case roleDescription -/// Indicates if items in a table or grid are -/// sorted in ascending or descending order. Value type: [enum@AccessibleSort] -case sort -/// Defines the maximum allowed value for a -/// range widget. Value type: double -case valueMax -/// Defines the minimum allowed value for a -/// range widget. Value type: double -case valueMin -/// Defines the current value for a range widget. -/// Value type: double -case valueNow -/// Defines the human readable text alternative -/// of aria-valuenow for a range widget. Value type: string -case valueText + /// could trigger display of one or more predictions of the user's intended + /// value for a combobox, searchbox, or textbox and specifies how predictions + /// would be presented if they were made. Value type: [enum@AccessibleAutocomplete] + case autocomplete + /// Defines a string value that describes + /// or annotates the current element. Value type: string + case description + /// Indicates the availability and type of + /// interactive popup element, such as menu or dialog, that can be triggered + /// by an element. + case hasPopup + /// Indicates keyboard shortcuts that an + /// author has implemented to activate or give focus to an element. Value type: + /// string. The format of the value is a space-separated list of shortcuts, with + /// each shortcut consisting of one or more modifiers (`Control`, `Alt` or `Shift`), + /// followed by a non-modifier key, all separated by `+`. + /// Examples: `F2`, `Alt-F`, `Control+Shift+N` + case keyShortcuts + /// Defines a string value that labels the current + /// element. Value type: string + case label + /// Defines the hierarchical level of an element + /// within a structure. Value type: integer + case level + /// Indicates whether an element is modal when + /// displayed. Value type: boolean + case modal + /// Indicates whether a text box accepts + /// multiple lines of input or only a single line. Value type: boolean + case multiLine + /// Indicates that the user may select + /// more than one item from the current selectable descendants. Value type: + /// boolean + case multiSelectable + /// Indicates whether the element's + /// orientation is horizontal, vertical, or unknown/ambiguous. Value type: + /// [enum@Orientation] + case orientation + /// Defines a short hint (a word or short + /// phrase) intended to aid the user with data entry when the control has no + /// value. A hint could be a sample value or a brief description of the expected + /// format. Value type: string + case placeholder + /// Indicates that the element is not editable, + /// but is otherwise operable. Value type: boolean + case readOnly + /// Indicates that user input is required on + /// the element before a form may be submitted. Value type: boolean + case required + /// Defines a human-readable, + /// author-localized description for the role of an element. Value type: string + case roleDescription + /// Indicates if items in a table or grid are + /// sorted in ascending or descending order. Value type: [enum@AccessibleSort] + case sort + /// Defines the maximum allowed value for a + /// range widget. Value type: double + case valueMax + /// Defines the minimum allowed value for a + /// range widget. Value type: double + case valueMin + /// Defines the current value for a range widget. + /// Value type: double + case valueNow + /// Defines the human readable text alternative + /// of aria-valuenow for a range widget. Value type: string + case valueText public static var type: GType { - gtk_accessible_property_get_type() -} + gtk_accessible_property_get_type() + } public init(from gtkEnum: GtkAccessibleProperty) { switch gtkEnum { case GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE: - self = .autocomplete -case GTK_ACCESSIBLE_PROPERTY_DESCRIPTION: - self = .description -case GTK_ACCESSIBLE_PROPERTY_HAS_POPUP: - self = .hasPopup -case GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS: - self = .keyShortcuts -case GTK_ACCESSIBLE_PROPERTY_LABEL: - self = .label -case GTK_ACCESSIBLE_PROPERTY_LEVEL: - self = .level -case GTK_ACCESSIBLE_PROPERTY_MODAL: - self = .modal -case GTK_ACCESSIBLE_PROPERTY_MULTI_LINE: - self = .multiLine -case GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE: - self = .multiSelectable -case GTK_ACCESSIBLE_PROPERTY_ORIENTATION: - self = .orientation -case GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER: - self = .placeholder -case GTK_ACCESSIBLE_PROPERTY_READ_ONLY: - self = .readOnly -case GTK_ACCESSIBLE_PROPERTY_REQUIRED: - self = .required -case GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION: - self = .roleDescription -case GTK_ACCESSIBLE_PROPERTY_SORT: - self = .sort -case GTK_ACCESSIBLE_PROPERTY_VALUE_MAX: - self = .valueMax -case GTK_ACCESSIBLE_PROPERTY_VALUE_MIN: - self = .valueMin -case GTK_ACCESSIBLE_PROPERTY_VALUE_NOW: - self = .valueNow -case GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT: - self = .valueText + self = .autocomplete + case GTK_ACCESSIBLE_PROPERTY_DESCRIPTION: + self = .description + case GTK_ACCESSIBLE_PROPERTY_HAS_POPUP: + self = .hasPopup + case GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS: + self = .keyShortcuts + case GTK_ACCESSIBLE_PROPERTY_LABEL: + self = .label + case GTK_ACCESSIBLE_PROPERTY_LEVEL: + self = .level + case GTK_ACCESSIBLE_PROPERTY_MODAL: + self = .modal + case GTK_ACCESSIBLE_PROPERTY_MULTI_LINE: + self = .multiLine + case GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE: + self = .multiSelectable + case GTK_ACCESSIBLE_PROPERTY_ORIENTATION: + self = .orientation + case GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER: + self = .placeholder + case GTK_ACCESSIBLE_PROPERTY_READ_ONLY: + self = .readOnly + case GTK_ACCESSIBLE_PROPERTY_REQUIRED: + self = .required + case GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION: + self = .roleDescription + case GTK_ACCESSIBLE_PROPERTY_SORT: + self = .sort + case GTK_ACCESSIBLE_PROPERTY_VALUE_MAX: + self = .valueMax + case GTK_ACCESSIBLE_PROPERTY_VALUE_MIN: + self = .valueMin + case GTK_ACCESSIBLE_PROPERTY_VALUE_NOW: + self = .valueNow + case GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT: + self = .valueText default: fatalError("Unsupported GtkAccessibleProperty enum value: \(gtkEnum.rawValue)") } @@ -125,43 +125,43 @@ case GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT: public func toGtk() -> GtkAccessibleProperty { switch self { case .autocomplete: - return GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE -case .description: - return GTK_ACCESSIBLE_PROPERTY_DESCRIPTION -case .hasPopup: - return GTK_ACCESSIBLE_PROPERTY_HAS_POPUP -case .keyShortcuts: - return GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS -case .label: - return GTK_ACCESSIBLE_PROPERTY_LABEL -case .level: - return GTK_ACCESSIBLE_PROPERTY_LEVEL -case .modal: - return GTK_ACCESSIBLE_PROPERTY_MODAL -case .multiLine: - return GTK_ACCESSIBLE_PROPERTY_MULTI_LINE -case .multiSelectable: - return GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE -case .orientation: - return GTK_ACCESSIBLE_PROPERTY_ORIENTATION -case .placeholder: - return GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER -case .readOnly: - return GTK_ACCESSIBLE_PROPERTY_READ_ONLY -case .required: - return GTK_ACCESSIBLE_PROPERTY_REQUIRED -case .roleDescription: - return GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION -case .sort: - return GTK_ACCESSIBLE_PROPERTY_SORT -case .valueMax: - return GTK_ACCESSIBLE_PROPERTY_VALUE_MAX -case .valueMin: - return GTK_ACCESSIBLE_PROPERTY_VALUE_MIN -case .valueNow: - return GTK_ACCESSIBLE_PROPERTY_VALUE_NOW -case .valueText: - return GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT + return GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE + case .description: + return GTK_ACCESSIBLE_PROPERTY_DESCRIPTION + case .hasPopup: + return GTK_ACCESSIBLE_PROPERTY_HAS_POPUP + case .keyShortcuts: + return GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS + case .label: + return GTK_ACCESSIBLE_PROPERTY_LABEL + case .level: + return GTK_ACCESSIBLE_PROPERTY_LEVEL + case .modal: + return GTK_ACCESSIBLE_PROPERTY_MODAL + case .multiLine: + return GTK_ACCESSIBLE_PROPERTY_MULTI_LINE + case .multiSelectable: + return GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE + case .orientation: + return GTK_ACCESSIBLE_PROPERTY_ORIENTATION + case .placeholder: + return GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER + case .readOnly: + return GTK_ACCESSIBLE_PROPERTY_READ_ONLY + case .required: + return GTK_ACCESSIBLE_PROPERTY_REQUIRED + case .roleDescription: + return GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION + case .sort: + return GTK_ACCESSIBLE_PROPERTY_SORT + case .valueMax: + return GTK_ACCESSIBLE_PROPERTY_VALUE_MAX + case .valueMin: + return GTK_ACCESSIBLE_PROPERTY_VALUE_MIN + case .valueNow: + return GTK_ACCESSIBLE_PROPERTY_VALUE_NOW + case .valueText: + return GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AccessibleRelation.swift b/Sources/Gtk/Generated/AccessibleRelation.swift index a88676ffc6..8e6cba4ed1 100644 --- a/Sources/Gtk/Generated/AccessibleRelation.swift +++ b/Sources/Gtk/Generated/AccessibleRelation.swift @@ -1,116 +1,116 @@ import CGtk /// The possible accessible relations of a [iface@Accessible]. -/// +/// /// Accessible relations can be references to other widgets, /// integers or strings. public enum AccessibleRelation: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleRelation /// Identifies the currently active -/// element when focus is on a composite widget, combobox, textbox, group, -/// or application. Value type: reference -case activeDescendant -/// Defines the total number of columns -/// in a table, grid, or treegrid. Value type: integer -case colCount -/// Defines an element's column index or -/// position with respect to the total number of columns within a table, -/// grid, or treegrid. Value type: integer -case colIndex -/// Defines a human readable text -/// alternative of %GTK_ACCESSIBLE_RELATION_COL_INDEX. Value type: string -case colIndexText -/// Defines the number of columns spanned -/// by a cell or gridcell within a table, grid, or treegrid. Value type: integer -case colSpan -/// Identifies the element (or elements) whose -/// contents or presence are controlled by the current element. Value type: reference -case controls -/// Identifies the element (or elements) -/// that describes the object. Value type: reference -case describedBy -/// Identifies the element (or elements) that -/// provide additional information related to the object. Value type: reference -case details -/// Identifies the element (or elements) that -/// provide an error message for an object. Value type: reference -case errorMessage -/// Identifies the next element (or elements) -/// in an alternate reading order of content which, at the user's discretion, -/// allows assistive technology to override the general default of reading in -/// document source order. Value type: reference -case flowTo -/// Identifies the element (or elements) -/// that labels the current element. Value type: reference -case labelledBy -/// Identifies an element (or elements) in order -/// to define a visual, functional, or contextual parent/child relationship -/// between elements where the widget hierarchy cannot be used to represent -/// the relationship. Value type: reference -case owns -/// Defines an element's number or position -/// in the current set of listitems or treeitems. Value type: integer -case posInSet -/// Defines the total number of rows in a table, -/// grid, or treegrid. Value type: integer -case rowCount -/// Defines an element's row index or position -/// with respect to the total number of rows within a table, grid, or treegrid. -/// Value type: integer -case rowIndex -/// Defines a human readable text -/// alternative of aria-rowindex. Value type: string -case rowIndexText -/// Defines the number of rows spanned by a -/// cell or gridcell within a table, grid, or treegrid. Value type: integer -case rowSpan -/// Defines the number of items in the current -/// set of listitems or treeitems. Value type: integer -case setSize + /// element when focus is on a composite widget, combobox, textbox, group, + /// or application. Value type: reference + case activeDescendant + /// Defines the total number of columns + /// in a table, grid, or treegrid. Value type: integer + case colCount + /// Defines an element's column index or + /// position with respect to the total number of columns within a table, + /// grid, or treegrid. Value type: integer + case colIndex + /// Defines a human readable text + /// alternative of %GTK_ACCESSIBLE_RELATION_COL_INDEX. Value type: string + case colIndexText + /// Defines the number of columns spanned + /// by a cell or gridcell within a table, grid, or treegrid. Value type: integer + case colSpan + /// Identifies the element (or elements) whose + /// contents or presence are controlled by the current element. Value type: reference + case controls + /// Identifies the element (or elements) + /// that describes the object. Value type: reference + case describedBy + /// Identifies the element (or elements) that + /// provide additional information related to the object. Value type: reference + case details + /// Identifies the element (or elements) that + /// provide an error message for an object. Value type: reference + case errorMessage + /// Identifies the next element (or elements) + /// in an alternate reading order of content which, at the user's discretion, + /// allows assistive technology to override the general default of reading in + /// document source order. Value type: reference + case flowTo + /// Identifies the element (or elements) + /// that labels the current element. Value type: reference + case labelledBy + /// Identifies an element (or elements) in order + /// to define a visual, functional, or contextual parent/child relationship + /// between elements where the widget hierarchy cannot be used to represent + /// the relationship. Value type: reference + case owns + /// Defines an element's number or position + /// in the current set of listitems or treeitems. Value type: integer + case posInSet + /// Defines the total number of rows in a table, + /// grid, or treegrid. Value type: integer + case rowCount + /// Defines an element's row index or position + /// with respect to the total number of rows within a table, grid, or treegrid. + /// Value type: integer + case rowIndex + /// Defines a human readable text + /// alternative of aria-rowindex. Value type: string + case rowIndexText + /// Defines the number of rows spanned by a + /// cell or gridcell within a table, grid, or treegrid. Value type: integer + case rowSpan + /// Defines the number of items in the current + /// set of listitems or treeitems. Value type: integer + case setSize public static var type: GType { - gtk_accessible_relation_get_type() -} + gtk_accessible_relation_get_type() + } public init(from gtkEnum: GtkAccessibleRelation) { switch gtkEnum { case GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT: - self = .activeDescendant -case GTK_ACCESSIBLE_RELATION_COL_COUNT: - self = .colCount -case GTK_ACCESSIBLE_RELATION_COL_INDEX: - self = .colIndex -case GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT: - self = .colIndexText -case GTK_ACCESSIBLE_RELATION_COL_SPAN: - self = .colSpan -case GTK_ACCESSIBLE_RELATION_CONTROLS: - self = .controls -case GTK_ACCESSIBLE_RELATION_DESCRIBED_BY: - self = .describedBy -case GTK_ACCESSIBLE_RELATION_DETAILS: - self = .details -case GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE: - self = .errorMessage -case GTK_ACCESSIBLE_RELATION_FLOW_TO: - self = .flowTo -case GTK_ACCESSIBLE_RELATION_LABELLED_BY: - self = .labelledBy -case GTK_ACCESSIBLE_RELATION_OWNS: - self = .owns -case GTK_ACCESSIBLE_RELATION_POS_IN_SET: - self = .posInSet -case GTK_ACCESSIBLE_RELATION_ROW_COUNT: - self = .rowCount -case GTK_ACCESSIBLE_RELATION_ROW_INDEX: - self = .rowIndex -case GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT: - self = .rowIndexText -case GTK_ACCESSIBLE_RELATION_ROW_SPAN: - self = .rowSpan -case GTK_ACCESSIBLE_RELATION_SET_SIZE: - self = .setSize + self = .activeDescendant + case GTK_ACCESSIBLE_RELATION_COL_COUNT: + self = .colCount + case GTK_ACCESSIBLE_RELATION_COL_INDEX: + self = .colIndex + case GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT: + self = .colIndexText + case GTK_ACCESSIBLE_RELATION_COL_SPAN: + self = .colSpan + case GTK_ACCESSIBLE_RELATION_CONTROLS: + self = .controls + case GTK_ACCESSIBLE_RELATION_DESCRIBED_BY: + self = .describedBy + case GTK_ACCESSIBLE_RELATION_DETAILS: + self = .details + case GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE: + self = .errorMessage + case GTK_ACCESSIBLE_RELATION_FLOW_TO: + self = .flowTo + case GTK_ACCESSIBLE_RELATION_LABELLED_BY: + self = .labelledBy + case GTK_ACCESSIBLE_RELATION_OWNS: + self = .owns + case GTK_ACCESSIBLE_RELATION_POS_IN_SET: + self = .posInSet + case GTK_ACCESSIBLE_RELATION_ROW_COUNT: + self = .rowCount + case GTK_ACCESSIBLE_RELATION_ROW_INDEX: + self = .rowIndex + case GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT: + self = .rowIndexText + case GTK_ACCESSIBLE_RELATION_ROW_SPAN: + self = .rowSpan + case GTK_ACCESSIBLE_RELATION_SET_SIZE: + self = .setSize default: fatalError("Unsupported GtkAccessibleRelation enum value: \(gtkEnum.rawValue)") } @@ -119,41 +119,41 @@ case GTK_ACCESSIBLE_RELATION_SET_SIZE: public func toGtk() -> GtkAccessibleRelation { switch self { case .activeDescendant: - return GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT -case .colCount: - return GTK_ACCESSIBLE_RELATION_COL_COUNT -case .colIndex: - return GTK_ACCESSIBLE_RELATION_COL_INDEX -case .colIndexText: - return GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT -case .colSpan: - return GTK_ACCESSIBLE_RELATION_COL_SPAN -case .controls: - return GTK_ACCESSIBLE_RELATION_CONTROLS -case .describedBy: - return GTK_ACCESSIBLE_RELATION_DESCRIBED_BY -case .details: - return GTK_ACCESSIBLE_RELATION_DETAILS -case .errorMessage: - return GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE -case .flowTo: - return GTK_ACCESSIBLE_RELATION_FLOW_TO -case .labelledBy: - return GTK_ACCESSIBLE_RELATION_LABELLED_BY -case .owns: - return GTK_ACCESSIBLE_RELATION_OWNS -case .posInSet: - return GTK_ACCESSIBLE_RELATION_POS_IN_SET -case .rowCount: - return GTK_ACCESSIBLE_RELATION_ROW_COUNT -case .rowIndex: - return GTK_ACCESSIBLE_RELATION_ROW_INDEX -case .rowIndexText: - return GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT -case .rowSpan: - return GTK_ACCESSIBLE_RELATION_ROW_SPAN -case .setSize: - return GTK_ACCESSIBLE_RELATION_SET_SIZE + return GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT + case .colCount: + return GTK_ACCESSIBLE_RELATION_COL_COUNT + case .colIndex: + return GTK_ACCESSIBLE_RELATION_COL_INDEX + case .colIndexText: + return GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT + case .colSpan: + return GTK_ACCESSIBLE_RELATION_COL_SPAN + case .controls: + return GTK_ACCESSIBLE_RELATION_CONTROLS + case .describedBy: + return GTK_ACCESSIBLE_RELATION_DESCRIBED_BY + case .details: + return GTK_ACCESSIBLE_RELATION_DETAILS + case .errorMessage: + return GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE + case .flowTo: + return GTK_ACCESSIBLE_RELATION_FLOW_TO + case .labelledBy: + return GTK_ACCESSIBLE_RELATION_LABELLED_BY + case .owns: + return GTK_ACCESSIBLE_RELATION_OWNS + case .posInSet: + return GTK_ACCESSIBLE_RELATION_POS_IN_SET + case .rowCount: + return GTK_ACCESSIBLE_RELATION_ROW_COUNT + case .rowIndex: + return GTK_ACCESSIBLE_RELATION_ROW_INDEX + case .rowIndexText: + return GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT + case .rowSpan: + return GTK_ACCESSIBLE_RELATION_ROW_SPAN + case .setSize: + return GTK_ACCESSIBLE_RELATION_SET_SIZE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AccessibleRole.swift b/Sources/Gtk/Generated/AccessibleRole.swift index c9e2ceb871..b2e0c1d12d 100644 --- a/Sources/Gtk/Generated/AccessibleRole.swift +++ b/Sources/Gtk/Generated/AccessibleRole.swift @@ -1,355 +1,355 @@ import CGtk /// The accessible role for a [iface@Accessible] implementation. -/// +/// /// Abstract roles are only used as part of the ontology; application /// developers must not use abstract roles in their code. public enum AccessibleRole: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleRole /// An element with important, and usually -/// time-sensitive, information -case alert -/// A type of dialog that contains an -/// alert message -case alertDialog -/// Unused -case banner -/// An input element that allows for -/// user-triggered actions when clicked or pressed -case button -/// Unused -case caption -/// Unused -case cell -/// A checkable input element that has -/// three possible values: `true`, `false`, or `mixed` -case checkbox -/// A header in a columned list. -case columnHeader -/// An input that controls another element, -/// such as a list or a grid, that can dynamically pop up to help the user -/// set the value of the input -case comboBox -/// Abstract role. -case command -/// Abstract role. -case composite -/// A dialog is a window that is designed to interrupt -/// the current processing of an application in order to prompt the user to enter -/// information or require a response. -case dialog -/// Content that assistive technology users may want to -/// browse in a reading mode. -case document -/// Unused -case feed -/// Unused -case form -/// A nameless container that has no semantic meaning -/// of its own. This is the role that GTK uses by default for widgets. -case generic -/// A grid of items. -case grid -/// An item in a grid or tree grid. -case gridCell -/// An element that groups multiple related widgets. GTK uses -/// this role for various containers, like [class@Gtk.HeaderBar] or [class@Gtk.Notebook]. -case group -/// Unused -case heading -/// An image. -case img -/// Abstract role. -case input -/// A visible name or caption for a user interface component. -case label -/// Abstract role. -case landmark -/// Unused -case legend -/// A clickable link. -case link -/// A list of items. -case list -/// Unused. -case listBox -/// An item in a list. -case listItem -/// Unused -case log -/// Unused -case main -/// Unused -case marquee -/// Unused -case math -/// An element that represents a value within a known range. -case meter -/// A menu. -case menu -/// A menubar. -case menuBar -/// An item in a menu. -case menuItem -/// A check item in a menu. -case menuItemCheckbox -/// A radio item in a menu. -case menuItemRadio -/// Unused -case navigation -/// An element that is not represented to accessibility technologies. -/// This role is synonymous to @GTK_ACCESSIBLE_ROLE_PRESENTATION. -case none -/// Unused -case note -/// Unused -case option -/// An element that is not represented to accessibility technologies. -/// This role is synonymous to @GTK_ACCESSIBLE_ROLE_NONE. -case presentation -/// An element that displays the progress -/// status for tasks that take a long time. -case progressBar -/// A checkable input in a group of radio roles, -/// only one of which can be checked at a time. -case radio -/// Unused -case radioGroup -/// Abstract role. -case range -/// Unused -case region -/// A row in a columned list. -case row -/// Unused -case rowGroup -/// Unused -case rowHeader -/// A graphical object that controls the scrolling -/// of content within a viewing area, regardless of whether the content is fully -/// displayed within the viewing area. -case scrollbar -/// Unused -case search -/// A type of textbox intended for specifying -/// search criteria. -case searchBox -/// Abstract role. -case section -/// Abstract role. -case sectionHead -/// Abstract role. -case select -/// A divider that separates and distinguishes -/// sections of content or groups of menuitems. -case separator -/// A user input where the user selects a value -/// from within a given range. -case slider -/// A form of range that expects the user to -/// select from among discrete choices. -case spinButton -/// Unused -case status -/// Abstract role. -case structure -/// A type of checkbox that represents on/off values, -/// as opposed to checked/unchecked values. -case switch_ -/// An item in a list of tab used for switching pages. -case tab -/// Unused -case table -/// A list of tabs for switching pages. -case tabList -/// A page in a notebook or stack. -case tabPanel -/// A type of input that allows free-form text -/// as its value. -case textBox -/// Unused -case time -/// Unused -case timer -/// Unused -case toolbar -/// Unused -case tooltip -/// Unused -case tree -/// A treeview-like, columned list. -case treeGrid -/// Unused -case treeItem -/// Abstract role for interactive components of a -/// graphical user interface -case widget -/// Abstract role for windows. -case window + /// time-sensitive, information + case alert + /// A type of dialog that contains an + /// alert message + case alertDialog + /// Unused + case banner + /// An input element that allows for + /// user-triggered actions when clicked or pressed + case button + /// Unused + case caption + /// Unused + case cell + /// A checkable input element that has + /// three possible values: `true`, `false`, or `mixed` + case checkbox + /// A header in a columned list. + case columnHeader + /// An input that controls another element, + /// such as a list or a grid, that can dynamically pop up to help the user + /// set the value of the input + case comboBox + /// Abstract role. + case command + /// Abstract role. + case composite + /// A dialog is a window that is designed to interrupt + /// the current processing of an application in order to prompt the user to enter + /// information or require a response. + case dialog + /// Content that assistive technology users may want to + /// browse in a reading mode. + case document + /// Unused + case feed + /// Unused + case form + /// A nameless container that has no semantic meaning + /// of its own. This is the role that GTK uses by default for widgets. + case generic + /// A grid of items. + case grid + /// An item in a grid or tree grid. + case gridCell + /// An element that groups multiple related widgets. GTK uses + /// this role for various containers, like [class@Gtk.HeaderBar] or [class@Gtk.Notebook]. + case group + /// Unused + case heading + /// An image. + case img + /// Abstract role. + case input + /// A visible name or caption for a user interface component. + case label + /// Abstract role. + case landmark + /// Unused + case legend + /// A clickable link. + case link + /// A list of items. + case list + /// Unused. + case listBox + /// An item in a list. + case listItem + /// Unused + case log + /// Unused + case main + /// Unused + case marquee + /// Unused + case math + /// An element that represents a value within a known range. + case meter + /// A menu. + case menu + /// A menubar. + case menuBar + /// An item in a menu. + case menuItem + /// A check item in a menu. + case menuItemCheckbox + /// A radio item in a menu. + case menuItemRadio + /// Unused + case navigation + /// An element that is not represented to accessibility technologies. + /// This role is synonymous to @GTK_ACCESSIBLE_ROLE_PRESENTATION. + case none + /// Unused + case note + /// Unused + case option + /// An element that is not represented to accessibility technologies. + /// This role is synonymous to @GTK_ACCESSIBLE_ROLE_NONE. + case presentation + /// An element that displays the progress + /// status for tasks that take a long time. + case progressBar + /// A checkable input in a group of radio roles, + /// only one of which can be checked at a time. + case radio + /// Unused + case radioGroup + /// Abstract role. + case range + /// Unused + case region + /// A row in a columned list. + case row + /// Unused + case rowGroup + /// Unused + case rowHeader + /// A graphical object that controls the scrolling + /// of content within a viewing area, regardless of whether the content is fully + /// displayed within the viewing area. + case scrollbar + /// Unused + case search + /// A type of textbox intended for specifying + /// search criteria. + case searchBox + /// Abstract role. + case section + /// Abstract role. + case sectionHead + /// Abstract role. + case select + /// A divider that separates and distinguishes + /// sections of content or groups of menuitems. + case separator + /// A user input where the user selects a value + /// from within a given range. + case slider + /// A form of range that expects the user to + /// select from among discrete choices. + case spinButton + /// Unused + case status + /// Abstract role. + case structure + /// A type of checkbox that represents on/off values, + /// as opposed to checked/unchecked values. + case switch_ + /// An item in a list of tab used for switching pages. + case tab + /// Unused + case table + /// A list of tabs for switching pages. + case tabList + /// A page in a notebook or stack. + case tabPanel + /// A type of input that allows free-form text + /// as its value. + case textBox + /// Unused + case time + /// Unused + case timer + /// Unused + case toolbar + /// Unused + case tooltip + /// Unused + case tree + /// A treeview-like, columned list. + case treeGrid + /// Unused + case treeItem + /// Abstract role for interactive components of a + /// graphical user interface + case widget + /// Abstract role for windows. + case window public static var type: GType { - gtk_accessible_role_get_type() -} + gtk_accessible_role_get_type() + } public init(from gtkEnum: GtkAccessibleRole) { switch gtkEnum { case GTK_ACCESSIBLE_ROLE_ALERT: - self = .alert -case GTK_ACCESSIBLE_ROLE_ALERT_DIALOG: - self = .alertDialog -case GTK_ACCESSIBLE_ROLE_BANNER: - self = .banner -case GTK_ACCESSIBLE_ROLE_BUTTON: - self = .button -case GTK_ACCESSIBLE_ROLE_CAPTION: - self = .caption -case GTK_ACCESSIBLE_ROLE_CELL: - self = .cell -case GTK_ACCESSIBLE_ROLE_CHECKBOX: - self = .checkbox -case GTK_ACCESSIBLE_ROLE_COLUMN_HEADER: - self = .columnHeader -case GTK_ACCESSIBLE_ROLE_COMBO_BOX: - self = .comboBox -case GTK_ACCESSIBLE_ROLE_COMMAND: - self = .command -case GTK_ACCESSIBLE_ROLE_COMPOSITE: - self = .composite -case GTK_ACCESSIBLE_ROLE_DIALOG: - self = .dialog -case GTK_ACCESSIBLE_ROLE_DOCUMENT: - self = .document -case GTK_ACCESSIBLE_ROLE_FEED: - self = .feed -case GTK_ACCESSIBLE_ROLE_FORM: - self = .form -case GTK_ACCESSIBLE_ROLE_GENERIC: - self = .generic -case GTK_ACCESSIBLE_ROLE_GRID: - self = .grid -case GTK_ACCESSIBLE_ROLE_GRID_CELL: - self = .gridCell -case GTK_ACCESSIBLE_ROLE_GROUP: - self = .group -case GTK_ACCESSIBLE_ROLE_HEADING: - self = .heading -case GTK_ACCESSIBLE_ROLE_IMG: - self = .img -case GTK_ACCESSIBLE_ROLE_INPUT: - self = .input -case GTK_ACCESSIBLE_ROLE_LABEL: - self = .label -case GTK_ACCESSIBLE_ROLE_LANDMARK: - self = .landmark -case GTK_ACCESSIBLE_ROLE_LEGEND: - self = .legend -case GTK_ACCESSIBLE_ROLE_LINK: - self = .link -case GTK_ACCESSIBLE_ROLE_LIST: - self = .list -case GTK_ACCESSIBLE_ROLE_LIST_BOX: - self = .listBox -case GTK_ACCESSIBLE_ROLE_LIST_ITEM: - self = .listItem -case GTK_ACCESSIBLE_ROLE_LOG: - self = .log -case GTK_ACCESSIBLE_ROLE_MAIN: - self = .main -case GTK_ACCESSIBLE_ROLE_MARQUEE: - self = .marquee -case GTK_ACCESSIBLE_ROLE_MATH: - self = .math -case GTK_ACCESSIBLE_ROLE_METER: - self = .meter -case GTK_ACCESSIBLE_ROLE_MENU: - self = .menu -case GTK_ACCESSIBLE_ROLE_MENU_BAR: - self = .menuBar -case GTK_ACCESSIBLE_ROLE_MENU_ITEM: - self = .menuItem -case GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX: - self = .menuItemCheckbox -case GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO: - self = .menuItemRadio -case GTK_ACCESSIBLE_ROLE_NAVIGATION: - self = .navigation -case GTK_ACCESSIBLE_ROLE_NONE: - self = .none -case GTK_ACCESSIBLE_ROLE_NOTE: - self = .note -case GTK_ACCESSIBLE_ROLE_OPTION: - self = .option -case GTK_ACCESSIBLE_ROLE_PRESENTATION: - self = .presentation -case GTK_ACCESSIBLE_ROLE_PROGRESS_BAR: - self = .progressBar -case GTK_ACCESSIBLE_ROLE_RADIO: - self = .radio -case GTK_ACCESSIBLE_ROLE_RADIO_GROUP: - self = .radioGroup -case GTK_ACCESSIBLE_ROLE_RANGE: - self = .range -case GTK_ACCESSIBLE_ROLE_REGION: - self = .region -case GTK_ACCESSIBLE_ROLE_ROW: - self = .row -case GTK_ACCESSIBLE_ROLE_ROW_GROUP: - self = .rowGroup -case GTK_ACCESSIBLE_ROLE_ROW_HEADER: - self = .rowHeader -case GTK_ACCESSIBLE_ROLE_SCROLLBAR: - self = .scrollbar -case GTK_ACCESSIBLE_ROLE_SEARCH: - self = .search -case GTK_ACCESSIBLE_ROLE_SEARCH_BOX: - self = .searchBox -case GTK_ACCESSIBLE_ROLE_SECTION: - self = .section -case GTK_ACCESSIBLE_ROLE_SECTION_HEAD: - self = .sectionHead -case GTK_ACCESSIBLE_ROLE_SELECT: - self = .select -case GTK_ACCESSIBLE_ROLE_SEPARATOR: - self = .separator -case GTK_ACCESSIBLE_ROLE_SLIDER: - self = .slider -case GTK_ACCESSIBLE_ROLE_SPIN_BUTTON: - self = .spinButton -case GTK_ACCESSIBLE_ROLE_STATUS: - self = .status -case GTK_ACCESSIBLE_ROLE_STRUCTURE: - self = .structure -case GTK_ACCESSIBLE_ROLE_SWITCH: - self = .switch_ -case GTK_ACCESSIBLE_ROLE_TAB: - self = .tab -case GTK_ACCESSIBLE_ROLE_TABLE: - self = .table -case GTK_ACCESSIBLE_ROLE_TAB_LIST: - self = .tabList -case GTK_ACCESSIBLE_ROLE_TAB_PANEL: - self = .tabPanel -case GTK_ACCESSIBLE_ROLE_TEXT_BOX: - self = .textBox -case GTK_ACCESSIBLE_ROLE_TIME: - self = .time -case GTK_ACCESSIBLE_ROLE_TIMER: - self = .timer -case GTK_ACCESSIBLE_ROLE_TOOLBAR: - self = .toolbar -case GTK_ACCESSIBLE_ROLE_TOOLTIP: - self = .tooltip -case GTK_ACCESSIBLE_ROLE_TREE: - self = .tree -case GTK_ACCESSIBLE_ROLE_TREE_GRID: - self = .treeGrid -case GTK_ACCESSIBLE_ROLE_TREE_ITEM: - self = .treeItem -case GTK_ACCESSIBLE_ROLE_WIDGET: - self = .widget -case GTK_ACCESSIBLE_ROLE_WINDOW: - self = .window + self = .alert + case GTK_ACCESSIBLE_ROLE_ALERT_DIALOG: + self = .alertDialog + case GTK_ACCESSIBLE_ROLE_BANNER: + self = .banner + case GTK_ACCESSIBLE_ROLE_BUTTON: + self = .button + case GTK_ACCESSIBLE_ROLE_CAPTION: + self = .caption + case GTK_ACCESSIBLE_ROLE_CELL: + self = .cell + case GTK_ACCESSIBLE_ROLE_CHECKBOX: + self = .checkbox + case GTK_ACCESSIBLE_ROLE_COLUMN_HEADER: + self = .columnHeader + case GTK_ACCESSIBLE_ROLE_COMBO_BOX: + self = .comboBox + case GTK_ACCESSIBLE_ROLE_COMMAND: + self = .command + case GTK_ACCESSIBLE_ROLE_COMPOSITE: + self = .composite + case GTK_ACCESSIBLE_ROLE_DIALOG: + self = .dialog + case GTK_ACCESSIBLE_ROLE_DOCUMENT: + self = .document + case GTK_ACCESSIBLE_ROLE_FEED: + self = .feed + case GTK_ACCESSIBLE_ROLE_FORM: + self = .form + case GTK_ACCESSIBLE_ROLE_GENERIC: + self = .generic + case GTK_ACCESSIBLE_ROLE_GRID: + self = .grid + case GTK_ACCESSIBLE_ROLE_GRID_CELL: + self = .gridCell + case GTK_ACCESSIBLE_ROLE_GROUP: + self = .group + case GTK_ACCESSIBLE_ROLE_HEADING: + self = .heading + case GTK_ACCESSIBLE_ROLE_IMG: + self = .img + case GTK_ACCESSIBLE_ROLE_INPUT: + self = .input + case GTK_ACCESSIBLE_ROLE_LABEL: + self = .label + case GTK_ACCESSIBLE_ROLE_LANDMARK: + self = .landmark + case GTK_ACCESSIBLE_ROLE_LEGEND: + self = .legend + case GTK_ACCESSIBLE_ROLE_LINK: + self = .link + case GTK_ACCESSIBLE_ROLE_LIST: + self = .list + case GTK_ACCESSIBLE_ROLE_LIST_BOX: + self = .listBox + case GTK_ACCESSIBLE_ROLE_LIST_ITEM: + self = .listItem + case GTK_ACCESSIBLE_ROLE_LOG: + self = .log + case GTK_ACCESSIBLE_ROLE_MAIN: + self = .main + case GTK_ACCESSIBLE_ROLE_MARQUEE: + self = .marquee + case GTK_ACCESSIBLE_ROLE_MATH: + self = .math + case GTK_ACCESSIBLE_ROLE_METER: + self = .meter + case GTK_ACCESSIBLE_ROLE_MENU: + self = .menu + case GTK_ACCESSIBLE_ROLE_MENU_BAR: + self = .menuBar + case GTK_ACCESSIBLE_ROLE_MENU_ITEM: + self = .menuItem + case GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX: + self = .menuItemCheckbox + case GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO: + self = .menuItemRadio + case GTK_ACCESSIBLE_ROLE_NAVIGATION: + self = .navigation + case GTK_ACCESSIBLE_ROLE_NONE: + self = .none + case GTK_ACCESSIBLE_ROLE_NOTE: + self = .note + case GTK_ACCESSIBLE_ROLE_OPTION: + self = .option + case GTK_ACCESSIBLE_ROLE_PRESENTATION: + self = .presentation + case GTK_ACCESSIBLE_ROLE_PROGRESS_BAR: + self = .progressBar + case GTK_ACCESSIBLE_ROLE_RADIO: + self = .radio + case GTK_ACCESSIBLE_ROLE_RADIO_GROUP: + self = .radioGroup + case GTK_ACCESSIBLE_ROLE_RANGE: + self = .range + case GTK_ACCESSIBLE_ROLE_REGION: + self = .region + case GTK_ACCESSIBLE_ROLE_ROW: + self = .row + case GTK_ACCESSIBLE_ROLE_ROW_GROUP: + self = .rowGroup + case GTK_ACCESSIBLE_ROLE_ROW_HEADER: + self = .rowHeader + case GTK_ACCESSIBLE_ROLE_SCROLLBAR: + self = .scrollbar + case GTK_ACCESSIBLE_ROLE_SEARCH: + self = .search + case GTK_ACCESSIBLE_ROLE_SEARCH_BOX: + self = .searchBox + case GTK_ACCESSIBLE_ROLE_SECTION: + self = .section + case GTK_ACCESSIBLE_ROLE_SECTION_HEAD: + self = .sectionHead + case GTK_ACCESSIBLE_ROLE_SELECT: + self = .select + case GTK_ACCESSIBLE_ROLE_SEPARATOR: + self = .separator + case GTK_ACCESSIBLE_ROLE_SLIDER: + self = .slider + case GTK_ACCESSIBLE_ROLE_SPIN_BUTTON: + self = .spinButton + case GTK_ACCESSIBLE_ROLE_STATUS: + self = .status + case GTK_ACCESSIBLE_ROLE_STRUCTURE: + self = .structure + case GTK_ACCESSIBLE_ROLE_SWITCH: + self = .switch_ + case GTK_ACCESSIBLE_ROLE_TAB: + self = .tab + case GTK_ACCESSIBLE_ROLE_TABLE: + self = .table + case GTK_ACCESSIBLE_ROLE_TAB_LIST: + self = .tabList + case GTK_ACCESSIBLE_ROLE_TAB_PANEL: + self = .tabPanel + case GTK_ACCESSIBLE_ROLE_TEXT_BOX: + self = .textBox + case GTK_ACCESSIBLE_ROLE_TIME: + self = .time + case GTK_ACCESSIBLE_ROLE_TIMER: + self = .timer + case GTK_ACCESSIBLE_ROLE_TOOLBAR: + self = .toolbar + case GTK_ACCESSIBLE_ROLE_TOOLTIP: + self = .tooltip + case GTK_ACCESSIBLE_ROLE_TREE: + self = .tree + case GTK_ACCESSIBLE_ROLE_TREE_GRID: + self = .treeGrid + case GTK_ACCESSIBLE_ROLE_TREE_ITEM: + self = .treeItem + case GTK_ACCESSIBLE_ROLE_WIDGET: + self = .widget + case GTK_ACCESSIBLE_ROLE_WINDOW: + self = .window default: fatalError("Unsupported GtkAccessibleRole enum value: \(gtkEnum.rawValue)") } @@ -358,161 +358,161 @@ case GTK_ACCESSIBLE_ROLE_WINDOW: public func toGtk() -> GtkAccessibleRole { switch self { case .alert: - return GTK_ACCESSIBLE_ROLE_ALERT -case .alertDialog: - return GTK_ACCESSIBLE_ROLE_ALERT_DIALOG -case .banner: - return GTK_ACCESSIBLE_ROLE_BANNER -case .button: - return GTK_ACCESSIBLE_ROLE_BUTTON -case .caption: - return GTK_ACCESSIBLE_ROLE_CAPTION -case .cell: - return GTK_ACCESSIBLE_ROLE_CELL -case .checkbox: - return GTK_ACCESSIBLE_ROLE_CHECKBOX -case .columnHeader: - return GTK_ACCESSIBLE_ROLE_COLUMN_HEADER -case .comboBox: - return GTK_ACCESSIBLE_ROLE_COMBO_BOX -case .command: - return GTK_ACCESSIBLE_ROLE_COMMAND -case .composite: - return GTK_ACCESSIBLE_ROLE_COMPOSITE -case .dialog: - return GTK_ACCESSIBLE_ROLE_DIALOG -case .document: - return GTK_ACCESSIBLE_ROLE_DOCUMENT -case .feed: - return GTK_ACCESSIBLE_ROLE_FEED -case .form: - return GTK_ACCESSIBLE_ROLE_FORM -case .generic: - return GTK_ACCESSIBLE_ROLE_GENERIC -case .grid: - return GTK_ACCESSIBLE_ROLE_GRID -case .gridCell: - return GTK_ACCESSIBLE_ROLE_GRID_CELL -case .group: - return GTK_ACCESSIBLE_ROLE_GROUP -case .heading: - return GTK_ACCESSIBLE_ROLE_HEADING -case .img: - return GTK_ACCESSIBLE_ROLE_IMG -case .input: - return GTK_ACCESSIBLE_ROLE_INPUT -case .label: - return GTK_ACCESSIBLE_ROLE_LABEL -case .landmark: - return GTK_ACCESSIBLE_ROLE_LANDMARK -case .legend: - return GTK_ACCESSIBLE_ROLE_LEGEND -case .link: - return GTK_ACCESSIBLE_ROLE_LINK -case .list: - return GTK_ACCESSIBLE_ROLE_LIST -case .listBox: - return GTK_ACCESSIBLE_ROLE_LIST_BOX -case .listItem: - return GTK_ACCESSIBLE_ROLE_LIST_ITEM -case .log: - return GTK_ACCESSIBLE_ROLE_LOG -case .main: - return GTK_ACCESSIBLE_ROLE_MAIN -case .marquee: - return GTK_ACCESSIBLE_ROLE_MARQUEE -case .math: - return GTK_ACCESSIBLE_ROLE_MATH -case .meter: - return GTK_ACCESSIBLE_ROLE_METER -case .menu: - return GTK_ACCESSIBLE_ROLE_MENU -case .menuBar: - return GTK_ACCESSIBLE_ROLE_MENU_BAR -case .menuItem: - return GTK_ACCESSIBLE_ROLE_MENU_ITEM -case .menuItemCheckbox: - return GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX -case .menuItemRadio: - return GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO -case .navigation: - return GTK_ACCESSIBLE_ROLE_NAVIGATION -case .none: - return GTK_ACCESSIBLE_ROLE_NONE -case .note: - return GTK_ACCESSIBLE_ROLE_NOTE -case .option: - return GTK_ACCESSIBLE_ROLE_OPTION -case .presentation: - return GTK_ACCESSIBLE_ROLE_PRESENTATION -case .progressBar: - return GTK_ACCESSIBLE_ROLE_PROGRESS_BAR -case .radio: - return GTK_ACCESSIBLE_ROLE_RADIO -case .radioGroup: - return GTK_ACCESSIBLE_ROLE_RADIO_GROUP -case .range: - return GTK_ACCESSIBLE_ROLE_RANGE -case .region: - return GTK_ACCESSIBLE_ROLE_REGION -case .row: - return GTK_ACCESSIBLE_ROLE_ROW -case .rowGroup: - return GTK_ACCESSIBLE_ROLE_ROW_GROUP -case .rowHeader: - return GTK_ACCESSIBLE_ROLE_ROW_HEADER -case .scrollbar: - return GTK_ACCESSIBLE_ROLE_SCROLLBAR -case .search: - return GTK_ACCESSIBLE_ROLE_SEARCH -case .searchBox: - return GTK_ACCESSIBLE_ROLE_SEARCH_BOX -case .section: - return GTK_ACCESSIBLE_ROLE_SECTION -case .sectionHead: - return GTK_ACCESSIBLE_ROLE_SECTION_HEAD -case .select: - return GTK_ACCESSIBLE_ROLE_SELECT -case .separator: - return GTK_ACCESSIBLE_ROLE_SEPARATOR -case .slider: - return GTK_ACCESSIBLE_ROLE_SLIDER -case .spinButton: - return GTK_ACCESSIBLE_ROLE_SPIN_BUTTON -case .status: - return GTK_ACCESSIBLE_ROLE_STATUS -case .structure: - return GTK_ACCESSIBLE_ROLE_STRUCTURE -case .switch_: - return GTK_ACCESSIBLE_ROLE_SWITCH -case .tab: - return GTK_ACCESSIBLE_ROLE_TAB -case .table: - return GTK_ACCESSIBLE_ROLE_TABLE -case .tabList: - return GTK_ACCESSIBLE_ROLE_TAB_LIST -case .tabPanel: - return GTK_ACCESSIBLE_ROLE_TAB_PANEL -case .textBox: - return GTK_ACCESSIBLE_ROLE_TEXT_BOX -case .time: - return GTK_ACCESSIBLE_ROLE_TIME -case .timer: - return GTK_ACCESSIBLE_ROLE_TIMER -case .toolbar: - return GTK_ACCESSIBLE_ROLE_TOOLBAR -case .tooltip: - return GTK_ACCESSIBLE_ROLE_TOOLTIP -case .tree: - return GTK_ACCESSIBLE_ROLE_TREE -case .treeGrid: - return GTK_ACCESSIBLE_ROLE_TREE_GRID -case .treeItem: - return GTK_ACCESSIBLE_ROLE_TREE_ITEM -case .widget: - return GTK_ACCESSIBLE_ROLE_WIDGET -case .window: - return GTK_ACCESSIBLE_ROLE_WINDOW + return GTK_ACCESSIBLE_ROLE_ALERT + case .alertDialog: + return GTK_ACCESSIBLE_ROLE_ALERT_DIALOG + case .banner: + return GTK_ACCESSIBLE_ROLE_BANNER + case .button: + return GTK_ACCESSIBLE_ROLE_BUTTON + case .caption: + return GTK_ACCESSIBLE_ROLE_CAPTION + case .cell: + return GTK_ACCESSIBLE_ROLE_CELL + case .checkbox: + return GTK_ACCESSIBLE_ROLE_CHECKBOX + case .columnHeader: + return GTK_ACCESSIBLE_ROLE_COLUMN_HEADER + case .comboBox: + return GTK_ACCESSIBLE_ROLE_COMBO_BOX + case .command: + return GTK_ACCESSIBLE_ROLE_COMMAND + case .composite: + return GTK_ACCESSIBLE_ROLE_COMPOSITE + case .dialog: + return GTK_ACCESSIBLE_ROLE_DIALOG + case .document: + return GTK_ACCESSIBLE_ROLE_DOCUMENT + case .feed: + return GTK_ACCESSIBLE_ROLE_FEED + case .form: + return GTK_ACCESSIBLE_ROLE_FORM + case .generic: + return GTK_ACCESSIBLE_ROLE_GENERIC + case .grid: + return GTK_ACCESSIBLE_ROLE_GRID + case .gridCell: + return GTK_ACCESSIBLE_ROLE_GRID_CELL + case .group: + return GTK_ACCESSIBLE_ROLE_GROUP + case .heading: + return GTK_ACCESSIBLE_ROLE_HEADING + case .img: + return GTK_ACCESSIBLE_ROLE_IMG + case .input: + return GTK_ACCESSIBLE_ROLE_INPUT + case .label: + return GTK_ACCESSIBLE_ROLE_LABEL + case .landmark: + return GTK_ACCESSIBLE_ROLE_LANDMARK + case .legend: + return GTK_ACCESSIBLE_ROLE_LEGEND + case .link: + return GTK_ACCESSIBLE_ROLE_LINK + case .list: + return GTK_ACCESSIBLE_ROLE_LIST + case .listBox: + return GTK_ACCESSIBLE_ROLE_LIST_BOX + case .listItem: + return GTK_ACCESSIBLE_ROLE_LIST_ITEM + case .log: + return GTK_ACCESSIBLE_ROLE_LOG + case .main: + return GTK_ACCESSIBLE_ROLE_MAIN + case .marquee: + return GTK_ACCESSIBLE_ROLE_MARQUEE + case .math: + return GTK_ACCESSIBLE_ROLE_MATH + case .meter: + return GTK_ACCESSIBLE_ROLE_METER + case .menu: + return GTK_ACCESSIBLE_ROLE_MENU + case .menuBar: + return GTK_ACCESSIBLE_ROLE_MENU_BAR + case .menuItem: + return GTK_ACCESSIBLE_ROLE_MENU_ITEM + case .menuItemCheckbox: + return GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX + case .menuItemRadio: + return GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO + case .navigation: + return GTK_ACCESSIBLE_ROLE_NAVIGATION + case .none: + return GTK_ACCESSIBLE_ROLE_NONE + case .note: + return GTK_ACCESSIBLE_ROLE_NOTE + case .option: + return GTK_ACCESSIBLE_ROLE_OPTION + case .presentation: + return GTK_ACCESSIBLE_ROLE_PRESENTATION + case .progressBar: + return GTK_ACCESSIBLE_ROLE_PROGRESS_BAR + case .radio: + return GTK_ACCESSIBLE_ROLE_RADIO + case .radioGroup: + return GTK_ACCESSIBLE_ROLE_RADIO_GROUP + case .range: + return GTK_ACCESSIBLE_ROLE_RANGE + case .region: + return GTK_ACCESSIBLE_ROLE_REGION + case .row: + return GTK_ACCESSIBLE_ROLE_ROW + case .rowGroup: + return GTK_ACCESSIBLE_ROLE_ROW_GROUP + case .rowHeader: + return GTK_ACCESSIBLE_ROLE_ROW_HEADER + case .scrollbar: + return GTK_ACCESSIBLE_ROLE_SCROLLBAR + case .search: + return GTK_ACCESSIBLE_ROLE_SEARCH + case .searchBox: + return GTK_ACCESSIBLE_ROLE_SEARCH_BOX + case .section: + return GTK_ACCESSIBLE_ROLE_SECTION + case .sectionHead: + return GTK_ACCESSIBLE_ROLE_SECTION_HEAD + case .select: + return GTK_ACCESSIBLE_ROLE_SELECT + case .separator: + return GTK_ACCESSIBLE_ROLE_SEPARATOR + case .slider: + return GTK_ACCESSIBLE_ROLE_SLIDER + case .spinButton: + return GTK_ACCESSIBLE_ROLE_SPIN_BUTTON + case .status: + return GTK_ACCESSIBLE_ROLE_STATUS + case .structure: + return GTK_ACCESSIBLE_ROLE_STRUCTURE + case .switch_: + return GTK_ACCESSIBLE_ROLE_SWITCH + case .tab: + return GTK_ACCESSIBLE_ROLE_TAB + case .table: + return GTK_ACCESSIBLE_ROLE_TABLE + case .tabList: + return GTK_ACCESSIBLE_ROLE_TAB_LIST + case .tabPanel: + return GTK_ACCESSIBLE_ROLE_TAB_PANEL + case .textBox: + return GTK_ACCESSIBLE_ROLE_TEXT_BOX + case .time: + return GTK_ACCESSIBLE_ROLE_TIME + case .timer: + return GTK_ACCESSIBLE_ROLE_TIMER + case .toolbar: + return GTK_ACCESSIBLE_ROLE_TOOLBAR + case .tooltip: + return GTK_ACCESSIBLE_ROLE_TOOLTIP + case .tree: + return GTK_ACCESSIBLE_ROLE_TREE + case .treeGrid: + return GTK_ACCESSIBLE_ROLE_TREE_GRID + case .treeItem: + return GTK_ACCESSIBLE_ROLE_TREE_ITEM + case .widget: + return GTK_ACCESSIBLE_ROLE_WIDGET + case .window: + return GTK_ACCESSIBLE_ROLE_WINDOW } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AccessibleSort.swift b/Sources/Gtk/Generated/AccessibleSort.swift index 393573ab31..35f91845e7 100644 --- a/Sources/Gtk/Generated/AccessibleSort.swift +++ b/Sources/Gtk/Generated/AccessibleSort.swift @@ -6,29 +6,29 @@ public enum AccessibleSort: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleSort /// There is no defined sort applied to the column. -case none -/// Items are sorted in ascending order by this column. -case ascending -/// Items are sorted in descending order by this column. -case descending -/// A sort algorithm other than ascending or -/// descending has been applied. -case other + case none + /// Items are sorted in ascending order by this column. + case ascending + /// Items are sorted in descending order by this column. + case descending + /// A sort algorithm other than ascending or + /// descending has been applied. + case other public static var type: GType { - gtk_accessible_sort_get_type() -} + gtk_accessible_sort_get_type() + } public init(from gtkEnum: GtkAccessibleSort) { switch gtkEnum { case GTK_ACCESSIBLE_SORT_NONE: - self = .none -case GTK_ACCESSIBLE_SORT_ASCENDING: - self = .ascending -case GTK_ACCESSIBLE_SORT_DESCENDING: - self = .descending -case GTK_ACCESSIBLE_SORT_OTHER: - self = .other + self = .none + case GTK_ACCESSIBLE_SORT_ASCENDING: + self = .ascending + case GTK_ACCESSIBLE_SORT_DESCENDING: + self = .descending + case GTK_ACCESSIBLE_SORT_OTHER: + self = .other default: fatalError("Unsupported GtkAccessibleSort enum value: \(gtkEnum.rawValue)") } @@ -37,13 +37,13 @@ case GTK_ACCESSIBLE_SORT_OTHER: public func toGtk() -> GtkAccessibleSort { switch self { case .none: - return GTK_ACCESSIBLE_SORT_NONE -case .ascending: - return GTK_ACCESSIBLE_SORT_ASCENDING -case .descending: - return GTK_ACCESSIBLE_SORT_DESCENDING -case .other: - return GTK_ACCESSIBLE_SORT_OTHER + return GTK_ACCESSIBLE_SORT_NONE + case .ascending: + return GTK_ACCESSIBLE_SORT_ASCENDING + case .descending: + return GTK_ACCESSIBLE_SORT_DESCENDING + case .other: + return GTK_ACCESSIBLE_SORT_OTHER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AccessibleState.swift b/Sources/Gtk/Generated/AccessibleState.swift index 3ddaa60b89..7cfbf36ba3 100644 --- a/Sources/Gtk/Generated/AccessibleState.swift +++ b/Sources/Gtk/Generated/AccessibleState.swift @@ -5,57 +5,57 @@ public enum AccessibleState: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleState /// A “busy” state. This state has boolean values -case busy -/// A “checked” state; indicates the current -/// state of a [class@CheckButton]. Value type: [enum@AccessibleTristate] -case checked -/// A “disabled” state; corresponds to the -/// [property@Widget:sensitive] property. It indicates a UI element -/// that is perceivable, but not editable or operable. Value type: boolean -case disabled -/// An “expanded” state; corresponds to the -/// [property@Expander:expanded] property. Value type: boolean -/// or undefined -case expanded -/// A “hidden” state; corresponds to the -/// [property@Widget:visible] property. You can use this state -/// explicitly on UI elements that should not be exposed to an assistive -/// technology. Value type: boolean -/// See also: %GTK_ACCESSIBLE_STATE_DISABLED -case hidden -/// An “invalid” state; set when a widget -/// is showing an error. Value type: [enum@AccessibleInvalidState] -case invalid -/// A “pressed” state; indicates the current -/// state of a [class@ToggleButton]. Value type: [enum@AccessibleTristate] -/// enumeration -case pressed -/// A “selected” state; set when a widget -/// is selected. Value type: boolean or undefined -case selected + case busy + /// A “checked” state; indicates the current + /// state of a [class@CheckButton]. Value type: [enum@AccessibleTristate] + case checked + /// A “disabled” state; corresponds to the + /// [property@Widget:sensitive] property. It indicates a UI element + /// that is perceivable, but not editable or operable. Value type: boolean + case disabled + /// An “expanded” state; corresponds to the + /// [property@Expander:expanded] property. Value type: boolean + /// or undefined + case expanded + /// A “hidden” state; corresponds to the + /// [property@Widget:visible] property. You can use this state + /// explicitly on UI elements that should not be exposed to an assistive + /// technology. Value type: boolean + /// See also: %GTK_ACCESSIBLE_STATE_DISABLED + case hidden + /// An “invalid” state; set when a widget + /// is showing an error. Value type: [enum@AccessibleInvalidState] + case invalid + /// A “pressed” state; indicates the current + /// state of a [class@ToggleButton]. Value type: [enum@AccessibleTristate] + /// enumeration + case pressed + /// A “selected” state; set when a widget + /// is selected. Value type: boolean or undefined + case selected public static var type: GType { - gtk_accessible_state_get_type() -} + gtk_accessible_state_get_type() + } public init(from gtkEnum: GtkAccessibleState) { switch gtkEnum { case GTK_ACCESSIBLE_STATE_BUSY: - self = .busy -case GTK_ACCESSIBLE_STATE_CHECKED: - self = .checked -case GTK_ACCESSIBLE_STATE_DISABLED: - self = .disabled -case GTK_ACCESSIBLE_STATE_EXPANDED: - self = .expanded -case GTK_ACCESSIBLE_STATE_HIDDEN: - self = .hidden -case GTK_ACCESSIBLE_STATE_INVALID: - self = .invalid -case GTK_ACCESSIBLE_STATE_PRESSED: - self = .pressed -case GTK_ACCESSIBLE_STATE_SELECTED: - self = .selected + self = .busy + case GTK_ACCESSIBLE_STATE_CHECKED: + self = .checked + case GTK_ACCESSIBLE_STATE_DISABLED: + self = .disabled + case GTK_ACCESSIBLE_STATE_EXPANDED: + self = .expanded + case GTK_ACCESSIBLE_STATE_HIDDEN: + self = .hidden + case GTK_ACCESSIBLE_STATE_INVALID: + self = .invalid + case GTK_ACCESSIBLE_STATE_PRESSED: + self = .pressed + case GTK_ACCESSIBLE_STATE_SELECTED: + self = .selected default: fatalError("Unsupported GtkAccessibleState enum value: \(gtkEnum.rawValue)") } @@ -64,21 +64,21 @@ case GTK_ACCESSIBLE_STATE_SELECTED: public func toGtk() -> GtkAccessibleState { switch self { case .busy: - return GTK_ACCESSIBLE_STATE_BUSY -case .checked: - return GTK_ACCESSIBLE_STATE_CHECKED -case .disabled: - return GTK_ACCESSIBLE_STATE_DISABLED -case .expanded: - return GTK_ACCESSIBLE_STATE_EXPANDED -case .hidden: - return GTK_ACCESSIBLE_STATE_HIDDEN -case .invalid: - return GTK_ACCESSIBLE_STATE_INVALID -case .pressed: - return GTK_ACCESSIBLE_STATE_PRESSED -case .selected: - return GTK_ACCESSIBLE_STATE_SELECTED + return GTK_ACCESSIBLE_STATE_BUSY + case .checked: + return GTK_ACCESSIBLE_STATE_CHECKED + case .disabled: + return GTK_ACCESSIBLE_STATE_DISABLED + case .expanded: + return GTK_ACCESSIBLE_STATE_EXPANDED + case .hidden: + return GTK_ACCESSIBLE_STATE_HIDDEN + case .invalid: + return GTK_ACCESSIBLE_STATE_INVALID + case .pressed: + return GTK_ACCESSIBLE_STATE_PRESSED + case .selected: + return GTK_ACCESSIBLE_STATE_SELECTED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AccessibleTristate.swift b/Sources/Gtk/Generated/AccessibleTristate.swift index 56d1a4ac1f..ea5f6b8b5b 100644 --- a/Sources/Gtk/Generated/AccessibleTristate.swift +++ b/Sources/Gtk/Generated/AccessibleTristate.swift @@ -2,7 +2,7 @@ import CGtk /// The possible values for the %GTK_ACCESSIBLE_STATE_PRESSED /// accessible state. -/// +/// /// Note that the %GTK_ACCESSIBLE_TRISTATE_FALSE and /// %GTK_ACCESSIBLE_TRISTATE_TRUE have the same values /// as %FALSE and %TRUE. @@ -10,24 +10,24 @@ public enum AccessibleTristate: GValueRepresentableEnum { public typealias GtkEnum = GtkAccessibleTristate /// The state is `false` -case false_ -/// The state is `true` -case true_ -/// The state is `mixed` -case mixed + case false_ + /// The state is `true` + case true_ + /// The state is `mixed` + case mixed public static var type: GType { - gtk_accessible_tristate_get_type() -} + gtk_accessible_tristate_get_type() + } public init(from gtkEnum: GtkAccessibleTristate) { switch gtkEnum { case GTK_ACCESSIBLE_TRISTATE_FALSE: - self = .false_ -case GTK_ACCESSIBLE_TRISTATE_TRUE: - self = .true_ -case GTK_ACCESSIBLE_TRISTATE_MIXED: - self = .mixed + self = .false_ + case GTK_ACCESSIBLE_TRISTATE_TRUE: + self = .true_ + case GTK_ACCESSIBLE_TRISTATE_MIXED: + self = .mixed default: fatalError("Unsupported GtkAccessibleTristate enum value: \(gtkEnum.rawValue)") } @@ -36,11 +36,11 @@ case GTK_ACCESSIBLE_TRISTATE_MIXED: public func toGtk() -> GtkAccessibleTristate { switch self { case .false_: - return GTK_ACCESSIBLE_TRISTATE_FALSE -case .true_: - return GTK_ACCESSIBLE_TRISTATE_TRUE -case .mixed: - return GTK_ACCESSIBLE_TRISTATE_MIXED + return GTK_ACCESSIBLE_TRISTATE_FALSE + case .true_: + return GTK_ACCESSIBLE_TRISTATE_TRUE + case .mixed: + return GTK_ACCESSIBLE_TRISTATE_MIXED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Actionable.swift b/Sources/Gtk/Generated/Actionable.swift index 129d7093a6..5a4713d18d 100644 --- a/Sources/Gtk/Generated/Actionable.swift +++ b/Sources/Gtk/Generated/Actionable.swift @@ -1,11 +1,11 @@ import CGtk /// Provides a way to associate widgets with actions. -/// +/// /// It primarily consists of two properties: [property@Gtk.Actionable:action-name] /// and [property@Gtk.Actionable:action-target]. There are also some convenience /// APIs for setting these properties. -/// +/// /// The action will be looked up in action groups that are found among /// the widgets ancestors. Most commonly, these will be the actions with /// the “win.” or “app.” prefix that are associated with the @@ -14,7 +14,6 @@ import CGtk /// as well. public protocol Actionable: GObjectRepresentable { /// The name of the action with which this widget should be associated. -var actionName: String? { get set } + var actionName: String? { get set } - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Align.swift b/Sources/Gtk/Generated/Align.swift index b711436f4c..120d4707f9 100644 --- a/Sources/Gtk/Generated/Align.swift +++ b/Sources/Gtk/Generated/Align.swift @@ -1,17 +1,17 @@ import CGtk /// Controls how a widget deals with extra space in a single dimension. -/// +/// /// Alignment only matters if the widget receives a “too large” allocation, /// for example if you packed the widget with the [property@Gtk.Widget:hexpand] /// property inside a [class@Box], then the widget might get extra space. /// If you have for example a 16x16 icon inside a 32x32 space, the icon /// could be scaled and stretched, it could be centered, or it could be /// positioned to one side of the space. -/// +/// /// Note that in horizontal context `GTK_ALIGN_START` and `GTK_ALIGN_END` /// are interpreted relative to text direction. -/// +/// /// Baseline support is optional for containers and widgets, and is only available /// for vertical alignment. `GTK_ALIGN_BASELINE_CENTER` and `GTK_ALIGN_BASELINE_FILL` /// are treated similar to `GTK_ALIGN_CENTER` and `GTK_ALIGN_FILL`, except that it @@ -20,29 +20,29 @@ public enum Align: GValueRepresentableEnum { public typealias GtkEnum = GtkAlign /// Stretch to fill all space if possible, center if -/// no meaningful way to stretch -case fill -/// Snap to left or top side, leaving space on right or bottom -case start -/// Snap to right or bottom side, leaving space on left or top -case end -/// Center natural width of widget inside the allocation -case center + /// no meaningful way to stretch + case fill + /// Snap to left or top side, leaving space on right or bottom + case start + /// Snap to right or bottom side, leaving space on left or top + case end + /// Center natural width of widget inside the allocation + case center public static var type: GType { - gtk_align_get_type() -} + gtk_align_get_type() + } public init(from gtkEnum: GtkAlign) { switch gtkEnum { case GTK_ALIGN_FILL: - self = .fill -case GTK_ALIGN_START: - self = .start -case GTK_ALIGN_END: - self = .end -case GTK_ALIGN_CENTER: - self = .center + self = .fill + case GTK_ALIGN_START: + self = .start + case GTK_ALIGN_END: + self = .end + case GTK_ALIGN_CENTER: + self = .center default: fatalError("Unsupported GtkAlign enum value: \(gtkEnum.rawValue)") } @@ -51,13 +51,13 @@ case GTK_ALIGN_CENTER: public func toGtk() -> GtkAlign { switch self { case .fill: - return GTK_ALIGN_FILL -case .start: - return GTK_ALIGN_START -case .end: - return GTK_ALIGN_END -case .center: - return GTK_ALIGN_CENTER + return GTK_ALIGN_FILL + case .start: + return GTK_ALIGN_START + case .end: + return GTK_ALIGN_END + case .center: + return GTK_ALIGN_CENTER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AppChooser.swift b/Sources/Gtk/Generated/AppChooser.swift index 142bef0320..5d4489089c 100644 --- a/Sources/Gtk/Generated/AppChooser.swift +++ b/Sources/Gtk/Generated/AppChooser.swift @@ -2,11 +2,11 @@ import CGtk /// `GtkAppChooser` is an interface for widgets which allow the user to /// choose an application. -/// +/// /// The main objects that implement this interface are /// [class@Gtk.AppChooserWidget], /// [class@Gtk.AppChooserDialog] and [class@Gtk.AppChooserButton]. -/// +/// /// Applications are represented by GIO `GAppInfo` objects here. /// GIO has a concept of recommended and fallback applications for a /// given content type. Recommended applications are those that claim @@ -16,14 +16,13 @@ import CGtk /// type. The `GtkAppChooserWidget` provides detailed control over /// whether the shown list of applications should include default, /// recommended or fallback applications. -/// +/// /// To obtain the application that has been selected in a `GtkAppChooser`, /// use [method@Gtk.AppChooser.get_app_info]. public protocol AppChooser: GObjectRepresentable { /// The content type of the `GtkAppChooser` object. -/// -/// See `GContentType` for more information about content types. -var contentType: String { get set } + /// + /// See `GContentType` for more information about content types. + var contentType: String { get set } - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ArrowType.swift b/Sources/Gtk/Generated/ArrowType.swift index 2e6a4a3dd6..8c591c0df6 100644 --- a/Sources/Gtk/Generated/ArrowType.swift +++ b/Sources/Gtk/Generated/ArrowType.swift @@ -5,32 +5,32 @@ public enum ArrowType: GValueRepresentableEnum { public typealias GtkEnum = GtkArrowType /// Represents an upward pointing arrow. -case up -/// Represents a downward pointing arrow. -case down -/// Represents a left pointing arrow. -case left -/// Represents a right pointing arrow. -case right -/// No arrow. -case none + case up + /// Represents a downward pointing arrow. + case down + /// Represents a left pointing arrow. + case left + /// Represents a right pointing arrow. + case right + /// No arrow. + case none public static var type: GType { - gtk_arrow_type_get_type() -} + gtk_arrow_type_get_type() + } public init(from gtkEnum: GtkArrowType) { switch gtkEnum { case GTK_ARROW_UP: - self = .up -case GTK_ARROW_DOWN: - self = .down -case GTK_ARROW_LEFT: - self = .left -case GTK_ARROW_RIGHT: - self = .right -case GTK_ARROW_NONE: - self = .none + self = .up + case GTK_ARROW_DOWN: + self = .down + case GTK_ARROW_LEFT: + self = .left + case GTK_ARROW_RIGHT: + self = .right + case GTK_ARROW_NONE: + self = .none default: fatalError("Unsupported GtkArrowType enum value: \(gtkEnum.rawValue)") } @@ -39,15 +39,15 @@ case GTK_ARROW_NONE: public func toGtk() -> GtkArrowType { switch self { case .up: - return GTK_ARROW_UP -case .down: - return GTK_ARROW_DOWN -case .left: - return GTK_ARROW_LEFT -case .right: - return GTK_ARROW_RIGHT -case .none: - return GTK_ARROW_NONE + return GTK_ARROW_UP + case .down: + return GTK_ARROW_DOWN + case .left: + return GTK_ARROW_LEFT + case .right: + return GTK_ARROW_RIGHT + case .none: + return GTK_ARROW_NONE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/AssistantPageType.swift b/Sources/Gtk/Generated/AssistantPageType.swift index a160f080c1..35e0bfdc55 100644 --- a/Sources/Gtk/Generated/AssistantPageType.swift +++ b/Sources/Gtk/Generated/AssistantPageType.swift @@ -1,58 +1,58 @@ import CGtk /// Determines the role of a page inside a `GtkAssistant`. -/// +/// /// The role is used to handle buttons sensitivity and visibility. -/// +/// /// Note that an assistant needs to end its page flow with a page of type /// %GTK_ASSISTANT_PAGE_CONFIRM, %GTK_ASSISTANT_PAGE_SUMMARY or /// %GTK_ASSISTANT_PAGE_PROGRESS to be correct. -/// +/// /// The Cancel button will only be shown if the page isn’t “committed”. /// See gtk_assistant_commit() for details. public enum AssistantPageType: GValueRepresentableEnum { public typealias GtkEnum = GtkAssistantPageType /// The page has regular contents. Both the -/// Back and forward buttons will be shown. -case content -/// The page contains an introduction to the -/// assistant task. Only the Forward button will be shown if there is a -/// next page. -case intro -/// The page lets the user confirm or deny the -/// changes. The Back and Apply buttons will be shown. -case confirm -/// The page informs the user of the changes -/// done. Only the Close button will be shown. -case summary -/// Used for tasks that take a long time to -/// complete, blocks the assistant until the page is marked as complete. -/// Only the back button will be shown. -case progress -/// Used for when other page types are not -/// appropriate. No buttons will be shown, and the application must -/// add its own buttons through gtk_assistant_add_action_widget(). -case custom + /// Back and forward buttons will be shown. + case content + /// The page contains an introduction to the + /// assistant task. Only the Forward button will be shown if there is a + /// next page. + case intro + /// The page lets the user confirm or deny the + /// changes. The Back and Apply buttons will be shown. + case confirm + /// The page informs the user of the changes + /// done. Only the Close button will be shown. + case summary + /// Used for tasks that take a long time to + /// complete, blocks the assistant until the page is marked as complete. + /// Only the back button will be shown. + case progress + /// Used for when other page types are not + /// appropriate. No buttons will be shown, and the application must + /// add its own buttons through gtk_assistant_add_action_widget(). + case custom public static var type: GType { - gtk_assistant_page_type_get_type() -} + gtk_assistant_page_type_get_type() + } public init(from gtkEnum: GtkAssistantPageType) { switch gtkEnum { case GTK_ASSISTANT_PAGE_CONTENT: - self = .content -case GTK_ASSISTANT_PAGE_INTRO: - self = .intro -case GTK_ASSISTANT_PAGE_CONFIRM: - self = .confirm -case GTK_ASSISTANT_PAGE_SUMMARY: - self = .summary -case GTK_ASSISTANT_PAGE_PROGRESS: - self = .progress -case GTK_ASSISTANT_PAGE_CUSTOM: - self = .custom + self = .content + case GTK_ASSISTANT_PAGE_INTRO: + self = .intro + case GTK_ASSISTANT_PAGE_CONFIRM: + self = .confirm + case GTK_ASSISTANT_PAGE_SUMMARY: + self = .summary + case GTK_ASSISTANT_PAGE_PROGRESS: + self = .progress + case GTK_ASSISTANT_PAGE_CUSTOM: + self = .custom default: fatalError("Unsupported GtkAssistantPageType enum value: \(gtkEnum.rawValue)") } @@ -61,17 +61,17 @@ case GTK_ASSISTANT_PAGE_CUSTOM: public func toGtk() -> GtkAssistantPageType { switch self { case .content: - return GTK_ASSISTANT_PAGE_CONTENT -case .intro: - return GTK_ASSISTANT_PAGE_INTRO -case .confirm: - return GTK_ASSISTANT_PAGE_CONFIRM -case .summary: - return GTK_ASSISTANT_PAGE_SUMMARY -case .progress: - return GTK_ASSISTANT_PAGE_PROGRESS -case .custom: - return GTK_ASSISTANT_PAGE_CUSTOM + return GTK_ASSISTANT_PAGE_CONTENT + case .intro: + return GTK_ASSISTANT_PAGE_INTRO + case .confirm: + return GTK_ASSISTANT_PAGE_CONFIRM + case .summary: + return GTK_ASSISTANT_PAGE_SUMMARY + case .progress: + return GTK_ASSISTANT_PAGE_PROGRESS + case .custom: + return GTK_ASSISTANT_PAGE_CUSTOM } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/BaselinePosition.swift b/Sources/Gtk/Generated/BaselinePosition.swift index dc9baaee71..9a1efe3a51 100644 --- a/Sources/Gtk/Generated/BaselinePosition.swift +++ b/Sources/Gtk/Generated/BaselinePosition.swift @@ -1,7 +1,7 @@ import CGtk /// Baseline position in a row of widgets. -/// +/// /// Whenever a container has some form of natural row it may align /// children in that row along a common typographical baseline. If /// the amount of vertical space in the row is taller than the total @@ -12,24 +12,24 @@ public enum BaselinePosition: GValueRepresentableEnum { public typealias GtkEnum = GtkBaselinePosition /// Align the baseline at the top -case top -/// Center the baseline -case center -/// Align the baseline at the bottom -case bottom + case top + /// Center the baseline + case center + /// Align the baseline at the bottom + case bottom public static var type: GType { - gtk_baseline_position_get_type() -} + gtk_baseline_position_get_type() + } public init(from gtkEnum: GtkBaselinePosition) { switch gtkEnum { case GTK_BASELINE_POSITION_TOP: - self = .top -case GTK_BASELINE_POSITION_CENTER: - self = .center -case GTK_BASELINE_POSITION_BOTTOM: - self = .bottom + self = .top + case GTK_BASELINE_POSITION_CENTER: + self = .center + case GTK_BASELINE_POSITION_BOTTOM: + self = .bottom default: fatalError("Unsupported GtkBaselinePosition enum value: \(gtkEnum.rawValue)") } @@ -38,11 +38,11 @@ case GTK_BASELINE_POSITION_BOTTOM: public func toGtk() -> GtkBaselinePosition { switch self { case .top: - return GTK_BASELINE_POSITION_TOP -case .center: - return GTK_BASELINE_POSITION_CENTER -case .bottom: - return GTK_BASELINE_POSITION_BOTTOM + return GTK_BASELINE_POSITION_TOP + case .center: + return GTK_BASELINE_POSITION_CENTER + case .bottom: + return GTK_BASELINE_POSITION_BOTTOM } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/BorderStyle.swift b/Sources/Gtk/Generated/BorderStyle.swift index 65b71ef962..e29013f349 100644 --- a/Sources/Gtk/Generated/BorderStyle.swift +++ b/Sources/Gtk/Generated/BorderStyle.swift @@ -5,52 +5,52 @@ public enum BorderStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkBorderStyle /// No visible border -case none -/// Same as %GTK_BORDER_STYLE_NONE -case hidden -/// A single line segment -case solid -/// Looks as if the content is sunken into the canvas -case inset -/// Looks as if the content is coming out of the canvas -case outset -/// A series of round dots -case dotted -/// A series of square-ended dashes -case dashed -/// Two parallel lines with some space between them -case double -/// Looks as if it were carved in the canvas -case groove -/// Looks as if it were coming out of the canvas -case ridge + case none + /// Same as %GTK_BORDER_STYLE_NONE + case hidden + /// A single line segment + case solid + /// Looks as if the content is sunken into the canvas + case inset + /// Looks as if the content is coming out of the canvas + case outset + /// A series of round dots + case dotted + /// A series of square-ended dashes + case dashed + /// Two parallel lines with some space between them + case double + /// Looks as if it were carved in the canvas + case groove + /// Looks as if it were coming out of the canvas + case ridge public static var type: GType { - gtk_border_style_get_type() -} + gtk_border_style_get_type() + } public init(from gtkEnum: GtkBorderStyle) { switch gtkEnum { case GTK_BORDER_STYLE_NONE: - self = .none -case GTK_BORDER_STYLE_HIDDEN: - self = .hidden -case GTK_BORDER_STYLE_SOLID: - self = .solid -case GTK_BORDER_STYLE_INSET: - self = .inset -case GTK_BORDER_STYLE_OUTSET: - self = .outset -case GTK_BORDER_STYLE_DOTTED: - self = .dotted -case GTK_BORDER_STYLE_DASHED: - self = .dashed -case GTK_BORDER_STYLE_DOUBLE: - self = .double -case GTK_BORDER_STYLE_GROOVE: - self = .groove -case GTK_BORDER_STYLE_RIDGE: - self = .ridge + self = .none + case GTK_BORDER_STYLE_HIDDEN: + self = .hidden + case GTK_BORDER_STYLE_SOLID: + self = .solid + case GTK_BORDER_STYLE_INSET: + self = .inset + case GTK_BORDER_STYLE_OUTSET: + self = .outset + case GTK_BORDER_STYLE_DOTTED: + self = .dotted + case GTK_BORDER_STYLE_DASHED: + self = .dashed + case GTK_BORDER_STYLE_DOUBLE: + self = .double + case GTK_BORDER_STYLE_GROOVE: + self = .groove + case GTK_BORDER_STYLE_RIDGE: + self = .ridge default: fatalError("Unsupported GtkBorderStyle enum value: \(gtkEnum.rawValue)") } @@ -59,25 +59,25 @@ case GTK_BORDER_STYLE_RIDGE: public func toGtk() -> GtkBorderStyle { switch self { case .none: - return GTK_BORDER_STYLE_NONE -case .hidden: - return GTK_BORDER_STYLE_HIDDEN -case .solid: - return GTK_BORDER_STYLE_SOLID -case .inset: - return GTK_BORDER_STYLE_INSET -case .outset: - return GTK_BORDER_STYLE_OUTSET -case .dotted: - return GTK_BORDER_STYLE_DOTTED -case .dashed: - return GTK_BORDER_STYLE_DASHED -case .double: - return GTK_BORDER_STYLE_DOUBLE -case .groove: - return GTK_BORDER_STYLE_GROOVE -case .ridge: - return GTK_BORDER_STYLE_RIDGE + return GTK_BORDER_STYLE_NONE + case .hidden: + return GTK_BORDER_STYLE_HIDDEN + case .solid: + return GTK_BORDER_STYLE_SOLID + case .inset: + return GTK_BORDER_STYLE_INSET + case .outset: + return GTK_BORDER_STYLE_OUTSET + case .dotted: + return GTK_BORDER_STYLE_DOTTED + case .dashed: + return GTK_BORDER_STYLE_DASHED + case .double: + return GTK_BORDER_STYLE_DOUBLE + case .groove: + return GTK_BORDER_STYLE_GROOVE + case .ridge: + return GTK_BORDER_STYLE_RIDGE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Buildable.swift b/Sources/Gtk/Generated/Buildable.swift index 954cb37f73..a72135d704 100644 --- a/Sources/Gtk/Generated/Buildable.swift +++ b/Sources/Gtk/Generated/Buildable.swift @@ -1,19 +1,17 @@ import CGtk /// Allows objects to extend and customize deserialization from ui files. -/// +/// /// The `GtkBuildable` interface includes methods for setting names and /// properties of objects, parsing custom tags and constructing child objects. -/// +/// /// It is implemented by all widgets and many of the non-widget objects that are /// provided by GTK. The main user of this interface is [class@Gtk.Builder]. /// There should be very little need for applications to call any of these /// functions directly. -/// +/// /// An object only needs to implement this interface if it needs to extend the /// `GtkBuilder` XML format or run any extra routines at deserialization time. public protocol Buildable: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/BuilderError.swift b/Sources/Gtk/Generated/BuilderError.swift index c41097eab7..aff20af88a 100644 --- a/Sources/Gtk/Generated/BuilderError.swift +++ b/Sources/Gtk/Generated/BuilderError.swift @@ -6,83 +6,83 @@ public enum BuilderError: GValueRepresentableEnum { public typealias GtkEnum = GtkBuilderError /// A type-func attribute didn’t name -/// a function that returns a `GType`. -case invalidTypeFunction -/// The input contained a tag that `GtkBuilder` -/// can’t handle. -case unhandledTag -/// An attribute that is required by -/// `GtkBuilder` was missing. -case missingAttribute -/// `GtkBuilder` found an attribute that -/// it doesn’t understand. -case invalidAttribute -/// `GtkBuilder` found a tag that -/// it doesn’t understand. -case invalidTag -/// A required property value was -/// missing. -case missingPropertyValue -/// `GtkBuilder` couldn’t parse -/// some attribute value. -case invalidValue -/// The input file requires a newer version -/// of GTK. -case versionMismatch -/// An object id occurred twice. -case duplicateId -/// A specified object type is of the same type or -/// derived from the type of the composite class being extended with builder XML. -case objectTypeRefused -/// The wrong type was specified in a composite class’s template XML -case templateMismatch -/// The specified property is unknown for the object class. -case invalidProperty -/// The specified signal is unknown for the object class. -case invalidSignal -/// An object id is unknown. -case invalidId -/// A function could not be found. This often happens -/// when symbols are set to be kept private. Compiling code with -rdynamic or using the -/// `gmodule-export-2.0` pkgconfig module can fix this problem. -case invalidFunction + /// a function that returns a `GType`. + case invalidTypeFunction + /// The input contained a tag that `GtkBuilder` + /// can’t handle. + case unhandledTag + /// An attribute that is required by + /// `GtkBuilder` was missing. + case missingAttribute + /// `GtkBuilder` found an attribute that + /// it doesn’t understand. + case invalidAttribute + /// `GtkBuilder` found a tag that + /// it doesn’t understand. + case invalidTag + /// A required property value was + /// missing. + case missingPropertyValue + /// `GtkBuilder` couldn’t parse + /// some attribute value. + case invalidValue + /// The input file requires a newer version + /// of GTK. + case versionMismatch + /// An object id occurred twice. + case duplicateId + /// A specified object type is of the same type or + /// derived from the type of the composite class being extended with builder XML. + case objectTypeRefused + /// The wrong type was specified in a composite class’s template XML + case templateMismatch + /// The specified property is unknown for the object class. + case invalidProperty + /// The specified signal is unknown for the object class. + case invalidSignal + /// An object id is unknown. + case invalidId + /// A function could not be found. This often happens + /// when symbols are set to be kept private. Compiling code with -rdynamic or using the + /// `gmodule-export-2.0` pkgconfig module can fix this problem. + case invalidFunction public static var type: GType { - gtk_builder_error_get_type() -} + gtk_builder_error_get_type() + } public init(from gtkEnum: GtkBuilderError) { switch gtkEnum { case GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION: - self = .invalidTypeFunction -case GTK_BUILDER_ERROR_UNHANDLED_TAG: - self = .unhandledTag -case GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: - self = .missingAttribute -case GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: - self = .invalidAttribute -case GTK_BUILDER_ERROR_INVALID_TAG: - self = .invalidTag -case GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: - self = .missingPropertyValue -case GTK_BUILDER_ERROR_INVALID_VALUE: - self = .invalidValue -case GTK_BUILDER_ERROR_VERSION_MISMATCH: - self = .versionMismatch -case GTK_BUILDER_ERROR_DUPLICATE_ID: - self = .duplicateId -case GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED: - self = .objectTypeRefused -case GTK_BUILDER_ERROR_TEMPLATE_MISMATCH: - self = .templateMismatch -case GTK_BUILDER_ERROR_INVALID_PROPERTY: - self = .invalidProperty -case GTK_BUILDER_ERROR_INVALID_SIGNAL: - self = .invalidSignal -case GTK_BUILDER_ERROR_INVALID_ID: - self = .invalidId -case GTK_BUILDER_ERROR_INVALID_FUNCTION: - self = .invalidFunction + self = .invalidTypeFunction + case GTK_BUILDER_ERROR_UNHANDLED_TAG: + self = .unhandledTag + case GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: + self = .missingAttribute + case GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: + self = .invalidAttribute + case GTK_BUILDER_ERROR_INVALID_TAG: + self = .invalidTag + case GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: + self = .missingPropertyValue + case GTK_BUILDER_ERROR_INVALID_VALUE: + self = .invalidValue + case GTK_BUILDER_ERROR_VERSION_MISMATCH: + self = .versionMismatch + case GTK_BUILDER_ERROR_DUPLICATE_ID: + self = .duplicateId + case GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED: + self = .objectTypeRefused + case GTK_BUILDER_ERROR_TEMPLATE_MISMATCH: + self = .templateMismatch + case GTK_BUILDER_ERROR_INVALID_PROPERTY: + self = .invalidProperty + case GTK_BUILDER_ERROR_INVALID_SIGNAL: + self = .invalidSignal + case GTK_BUILDER_ERROR_INVALID_ID: + self = .invalidId + case GTK_BUILDER_ERROR_INVALID_FUNCTION: + self = .invalidFunction default: fatalError("Unsupported GtkBuilderError enum value: \(gtkEnum.rawValue)") } @@ -91,35 +91,35 @@ case GTK_BUILDER_ERROR_INVALID_FUNCTION: public func toGtk() -> GtkBuilderError { switch self { case .invalidTypeFunction: - return GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION -case .unhandledTag: - return GTK_BUILDER_ERROR_UNHANDLED_TAG -case .missingAttribute: - return GTK_BUILDER_ERROR_MISSING_ATTRIBUTE -case .invalidAttribute: - return GTK_BUILDER_ERROR_INVALID_ATTRIBUTE -case .invalidTag: - return GTK_BUILDER_ERROR_INVALID_TAG -case .missingPropertyValue: - return GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE -case .invalidValue: - return GTK_BUILDER_ERROR_INVALID_VALUE -case .versionMismatch: - return GTK_BUILDER_ERROR_VERSION_MISMATCH -case .duplicateId: - return GTK_BUILDER_ERROR_DUPLICATE_ID -case .objectTypeRefused: - return GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED -case .templateMismatch: - return GTK_BUILDER_ERROR_TEMPLATE_MISMATCH -case .invalidProperty: - return GTK_BUILDER_ERROR_INVALID_PROPERTY -case .invalidSignal: - return GTK_BUILDER_ERROR_INVALID_SIGNAL -case .invalidId: - return GTK_BUILDER_ERROR_INVALID_ID -case .invalidFunction: - return GTK_BUILDER_ERROR_INVALID_FUNCTION + return GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION + case .unhandledTag: + return GTK_BUILDER_ERROR_UNHANDLED_TAG + case .missingAttribute: + return GTK_BUILDER_ERROR_MISSING_ATTRIBUTE + case .invalidAttribute: + return GTK_BUILDER_ERROR_INVALID_ATTRIBUTE + case .invalidTag: + return GTK_BUILDER_ERROR_INVALID_TAG + case .missingPropertyValue: + return GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE + case .invalidValue: + return GTK_BUILDER_ERROR_INVALID_VALUE + case .versionMismatch: + return GTK_BUILDER_ERROR_VERSION_MISMATCH + case .duplicateId: + return GTK_BUILDER_ERROR_DUPLICATE_ID + case .objectTypeRefused: + return GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED + case .templateMismatch: + return GTK_BUILDER_ERROR_TEMPLATE_MISMATCH + case .invalidProperty: + return GTK_BUILDER_ERROR_INVALID_PROPERTY + case .invalidSignal: + return GTK_BUILDER_ERROR_INVALID_SIGNAL + case .invalidId: + return GTK_BUILDER_ERROR_INVALID_ID + case .invalidFunction: + return GTK_BUILDER_ERROR_INVALID_FUNCTION } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/BuilderScope.swift b/Sources/Gtk/Generated/BuilderScope.swift index 3aae527b45..2390cbc4bf 100644 --- a/Sources/Gtk/Generated/BuilderScope.swift +++ b/Sources/Gtk/Generated/BuilderScope.swift @@ -1,24 +1,22 @@ import CGtk /// Provides language binding support to `GtkBuilder`. -/// +/// /// The goal of `GtkBuilderScope` is to look up programming-language-specific /// values for strings that are given in a `GtkBuilder` UI file. -/// +/// /// The primary intended audience is bindings that want to provide deeper /// integration of `GtkBuilder` into the language. -/// +/// /// A `GtkBuilderScope` instance may be used with multiple `GtkBuilder` objects, /// even at once. -/// +/// /// By default, GTK will use its own implementation of `GtkBuilderScope` /// for the C language which can be created via [ctor@Gtk.BuilderCScope.new]. -/// +/// /// If you implement `GtkBuilderScope` for a language binding, you /// may want to (partially) derive from or fall back to a [class@Gtk.BuilderCScope], /// as that class implements support for automatic lookups from C symbols. public protocol BuilderScope: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Button.swift b/Sources/Gtk/Generated/Button.swift index 32a2c7b9a1..b932a6ac92 100644 --- a/Sources/Gtk/Generated/Button.swift +++ b/Sources/Gtk/Generated/Button.swift @@ -1,224 +1,232 @@ import CGtk /// Calls a callback function when the button is clicked. -/// +/// /// An example GtkButton -/// +/// /// The `GtkButton` widget can hold any valid child widget. That is, it can hold /// almost any other standard `GtkWidget`. The most commonly used child is the /// `GtkLabel`. -/// +/// /// # Shortcuts and Gestures -/// +/// /// The following signals have default keybindings: -/// +/// /// - [signal@Gtk.Button::activate] -/// +/// /// # CSS nodes -/// +/// /// `GtkButton` has a single CSS node with name button. The node will get the /// style classes .image-button or .text-button, if the content is just an /// image or label, respectively. It may also receive the .flat style class. /// When activating a button via the keyboard, the button will temporarily /// gain the .keyboard-activating style class. -/// +/// /// Other style classes that are commonly used with `GtkButton` include /// .suggested-action and .destructive-action. In special cases, buttons /// can be made round by adding the .circular style class. -/// +/// /// Button-like widgets like [class@Gtk.ToggleButton], [class@Gtk.MenuButton], /// [class@Gtk.VolumeButton], [class@Gtk.LockButton], [class@Gtk.ColorButton] /// or [class@Gtk.FontButton] use style classes such as .toggle, .popup, .scale, /// .lock, .color on the button node to differentiate themselves from a plain /// `GtkButton`. -/// +/// /// # Accessibility -/// +/// /// `GtkButton` uses the [enum@Gtk.AccessibleRole.button] role. open class Button: Widget, Actionable { /// Creates a new `GtkButton` widget. -/// -/// To add a child widget to the button, use [method@Gtk.Button.set_child]. -public convenience init() { - self.init( - gtk_button_new() - ) -} - -/// Creates a new button containing an icon from the current icon theme. -/// -/// If the icon name isn’t known, a “broken image” icon will be -/// displayed instead. If the current icon theme is changed, the icon -/// will be updated appropriately. -public convenience init(iconName: String) { - self.init( - gtk_button_new_from_icon_name(iconName) - ) -} - -/// Creates a `GtkButton` widget with a `GtkLabel` child. -public convenience init(label: String) { - self.init( - gtk_button_new_with_label(label) - ) -} - -/// Creates a new `GtkButton` containing a label. -/// -/// If characters in @label are preceded by an underscore, they are underlined. -/// If you need a literal underscore character in a label, use “__” (two -/// underscores). The first underlined character represents a keyboard -/// accelerator called a mnemonic. Pressing Alt and that key -/// activates the button. -public convenience init(mnemonic label: String) { - self.init( - gtk_button_new_with_mnemonic(label) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) -} - -addSignal(name: "clicked") { [weak self] () in - guard let self = self else { return } - self.clicked?(self) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// + /// To add a child widget to the button, use [method@Gtk.Button.set_child]. + public convenience init() { + self.init( + gtk_button_new() + ) } -addSignal(name: "notify::can-shrink", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCanShrink?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new button containing an icon from the current icon theme. + /// + /// If the icon name isn’t known, a “broken image” icon will be + /// displayed instead. If the current icon theme is changed, the icon + /// will be updated appropriately. + public convenience init(iconName: String) { + self.init( + gtk_button_new_from_icon_name(iconName) + ) } -addSignal(name: "notify::child", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyChild?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a `GtkButton` widget with a `GtkLabel` child. + public convenience init(label: String) { + self.init( + gtk_button_new_with_label(label) + ) } -addSignal(name: "notify::has-frame", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasFrame?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new `GtkButton` containing a label. + /// + /// If characters in @label are preceded by an underscore, they are underlined. + /// If you need a literal underscore character in a label, use “__” (two + /// underscores). The first underlined character represents a keyboard + /// accelerator called a mnemonic. Pressing Alt and that key + /// activates the button. + public convenience init(mnemonic label: String) { + self.init( + gtk_button_new_with_mnemonic(label) + ) } -addSignal(name: "notify::icon-name", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIconName?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) + } + + addSignal(name: "clicked") { [weak self] () in + guard let self = self else { return } + self.clicked?(self) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::can-shrink", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCanShrink?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::child", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyChild?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::has-frame", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasFrame?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::icon-name", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIconName?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::label", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLabel?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-underline", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseUnderline?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::action-name", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionName?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::action-target", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionTarget?(self, param0) + } } -addSignal(name: "notify::label", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLabel?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::use-underline", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseUnderline?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::action-name", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionName?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::action-target", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionTarget?(self, param0) -} -} - /// Whether the button has a frame. -@GObjectProperty(named: "has-frame") public var hasFrame: Bool - -/// The name of the icon used to automatically populate the button. -@GObjectProperty(named: "icon-name") public var iconName: String? - -/// Text of the label inside the button, if the button contains a label widget. -@GObjectProperty(named: "label") public var label: String? - -/// If set, an underline in the text indicates that the following character is -/// to be used as mnemonic. -@GObjectProperty(named: "use-underline") public var useUnderline: Bool - -/// The name of the action with which this widget should be associated. -@GObjectProperty(named: "action-name") public var actionName: String? + @GObjectProperty(named: "has-frame") public var hasFrame: Bool -/// Emitted to animate press then release. -/// -/// This is an action signal. Applications should never connect -/// to this signal, but use the [signal@Gtk.Button::clicked] signal. -/// -/// The default bindings for this signal are all forms of the -/// and Enter keys. -public var activate: ((Button) -> Void)? + /// The name of the icon used to automatically populate the button. + @GObjectProperty(named: "icon-name") public var iconName: String? -/// Emitted when the button has been activated (pressed and released). -public var clicked: ((Button) -> Void)? + /// Text of the label inside the button, if the button contains a label widget. + @GObjectProperty(named: "label") public var label: String? + /// If set, an underline in the text indicates that the following character is + /// to be used as mnemonic. + @GObjectProperty(named: "use-underline") public var useUnderline: Bool -public var notifyCanShrink: ((Button, OpaquePointer) -> Void)? + /// The name of the action with which this widget should be associated. + @GObjectProperty(named: "action-name") public var actionName: String? + /// Emitted to animate press then release. + /// + /// This is an action signal. Applications should never connect + /// to this signal, but use the [signal@Gtk.Button::clicked] signal. + /// + /// The default bindings for this signal are all forms of the + /// and Enter keys. + public var activate: ((Button) -> Void)? -public var notifyChild: ((Button, OpaquePointer) -> Void)? + /// Emitted when the button has been activated (pressed and released). + public var clicked: ((Button) -> Void)? + public var notifyCanShrink: ((Button, OpaquePointer) -> Void)? -public var notifyHasFrame: ((Button, OpaquePointer) -> Void)? + public var notifyChild: ((Button, OpaquePointer) -> Void)? + public var notifyHasFrame: ((Button, OpaquePointer) -> Void)? -public var notifyIconName: ((Button, OpaquePointer) -> Void)? + public var notifyIconName: ((Button, OpaquePointer) -> Void)? + public var notifyLabel: ((Button, OpaquePointer) -> Void)? -public var notifyLabel: ((Button, OpaquePointer) -> Void)? + public var notifyUseUnderline: ((Button, OpaquePointer) -> Void)? + public var notifyActionName: ((Button, OpaquePointer) -> Void)? -public var notifyUseUnderline: ((Button, OpaquePointer) -> Void)? - - -public var notifyActionName: ((Button, OpaquePointer) -> Void)? - - -public var notifyActionTarget: ((Button, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyActionTarget: ((Button, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/ButtonsType.swift b/Sources/Gtk/Generated/ButtonsType.swift index daa430f79a..ae70565d91 100644 --- a/Sources/Gtk/Generated/ButtonsType.swift +++ b/Sources/Gtk/Generated/ButtonsType.swift @@ -1,10 +1,10 @@ import CGtk /// Prebuilt sets of buttons for `GtkDialog`. -/// +/// /// If none of these choices are appropriate, simply use /// %GTK_BUTTONS_NONE and call [method@Gtk.Dialog.add_buttons]. -/// +/// /// > Please note that %GTK_BUTTONS_OK, %GTK_BUTTONS_YES_NO /// > and %GTK_BUTTONS_OK_CANCEL are discouraged by the /// > [GNOME Human Interface Guidelines](https://developer.gnome.org/hig/). @@ -12,36 +12,36 @@ public enum ButtonsType: GValueRepresentableEnum { public typealias GtkEnum = GtkButtonsType /// No buttons at all -case none -/// An OK button -case ok -/// A Close button -case close -/// A Cancel button -case cancel -/// Yes and No buttons -case yesNo -/// OK and Cancel buttons -case okCancel + case none + /// An OK button + case ok + /// A Close button + case close + /// A Cancel button + case cancel + /// Yes and No buttons + case yesNo + /// OK and Cancel buttons + case okCancel public static var type: GType { - gtk_buttons_type_get_type() -} + gtk_buttons_type_get_type() + } public init(from gtkEnum: GtkButtonsType) { switch gtkEnum { case GTK_BUTTONS_NONE: - self = .none -case GTK_BUTTONS_OK: - self = .ok -case GTK_BUTTONS_CLOSE: - self = .close -case GTK_BUTTONS_CANCEL: - self = .cancel -case GTK_BUTTONS_YES_NO: - self = .yesNo -case GTK_BUTTONS_OK_CANCEL: - self = .okCancel + self = .none + case GTK_BUTTONS_OK: + self = .ok + case GTK_BUTTONS_CLOSE: + self = .close + case GTK_BUTTONS_CANCEL: + self = .cancel + case GTK_BUTTONS_YES_NO: + self = .yesNo + case GTK_BUTTONS_OK_CANCEL: + self = .okCancel default: fatalError("Unsupported GtkButtonsType enum value: \(gtkEnum.rawValue)") } @@ -50,17 +50,17 @@ case GTK_BUTTONS_OK_CANCEL: public func toGtk() -> GtkButtonsType { switch self { case .none: - return GTK_BUTTONS_NONE -case .ok: - return GTK_BUTTONS_OK -case .close: - return GTK_BUTTONS_CLOSE -case .cancel: - return GTK_BUTTONS_CANCEL -case .yesNo: - return GTK_BUTTONS_YES_NO -case .okCancel: - return GTK_BUTTONS_OK_CANCEL + return GTK_BUTTONS_NONE + case .ok: + return GTK_BUTTONS_OK + case .close: + return GTK_BUTTONS_CLOSE + case .cancel: + return GTK_BUTTONS_CANCEL + case .yesNo: + return GTK_BUTTONS_YES_NO + case .okCancel: + return GTK_BUTTONS_OK_CANCEL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/CellEditable.swift b/Sources/Gtk/Generated/CellEditable.swift index 918485f6a2..fa4c171a02 100644 --- a/Sources/Gtk/Generated/CellEditable.swift +++ b/Sources/Gtk/Generated/CellEditable.swift @@ -1,37 +1,36 @@ import CGtk /// Interface for widgets that can be used for editing cells -/// +/// /// The `GtkCellEditable` interface must be implemented for widgets to be usable /// to edit the contents of a `GtkTreeView` cell. It provides a way to specify how /// temporary widgets should be configured for editing, get the new value, etc. public protocol CellEditable: GObjectRepresentable { - /// This signal is a sign for the cell renderer to update its -/// value from the @cell_editable. -/// -/// Implementations of `GtkCellEditable` are responsible for -/// emitting this signal when they are done editing, e.g. -/// `GtkEntry` emits this signal when the user presses Enter. Typical things to -/// do in a handler for ::editing-done are to capture the edited value, -/// disconnect the @cell_editable from signals on the `GtkCellRenderer`, etc. -/// -/// gtk_cell_editable_editing_done() is a convenience method -/// for emitting `GtkCellEditable::editing-done`. -var editingDone: ((Self) -> Void)? { get set } + /// value from the @cell_editable. + /// + /// Implementations of `GtkCellEditable` are responsible for + /// emitting this signal when they are done editing, e.g. + /// `GtkEntry` emits this signal when the user presses Enter. Typical things to + /// do in a handler for ::editing-done are to capture the edited value, + /// disconnect the @cell_editable from signals on the `GtkCellRenderer`, etc. + /// + /// gtk_cell_editable_editing_done() is a convenience method + /// for emitting `GtkCellEditable::editing-done`. + var editingDone: ((Self) -> Void)? { get set } -/// This signal is meant to indicate that the cell is finished -/// editing, and the @cell_editable widget is being removed and may -/// subsequently be destroyed. -/// -/// Implementations of `GtkCellEditable` are responsible for -/// emitting this signal when they are done editing. It must -/// be emitted after the `GtkCellEditable::editing-done` signal, -/// to give the cell renderer a chance to update the cell's value -/// before the widget is removed. -/// -/// gtk_cell_editable_remove_widget() is a convenience method -/// for emitting `GtkCellEditable::remove-widget`. -var removeWidget: ((Self) -> Void)? { get set } -} \ No newline at end of file + /// This signal is meant to indicate that the cell is finished + /// editing, and the @cell_editable widget is being removed and may + /// subsequently be destroyed. + /// + /// Implementations of `GtkCellEditable` are responsible for + /// emitting this signal when they are done editing. It must + /// be emitted after the `GtkCellEditable::editing-done` signal, + /// to give the cell renderer a chance to update the cell's value + /// before the widget is removed. + /// + /// gtk_cell_editable_remove_widget() is a convenience method + /// for emitting `GtkCellEditable::remove-widget`. + var removeWidget: ((Self) -> Void)? { get set } +} diff --git a/Sources/Gtk/Generated/CellLayout.swift b/Sources/Gtk/Generated/CellLayout.swift index 51c91867db..2aa7aa88b5 100644 --- a/Sources/Gtk/Generated/CellLayout.swift +++ b/Sources/Gtk/Generated/CellLayout.swift @@ -1,11 +1,11 @@ import CGtk /// An interface for packing cells -/// +/// /// `GtkCellLayout` is an interface to be implemented by all objects which /// want to provide a `GtkTreeViewColumn` like API for packing cells, /// setting attributes and data funcs. -/// +/// /// One of the notable features provided by implementations of /// `GtkCellLayout` are attributes. Attributes let you set the properties /// in flexible ways. They can just be set to constant values like regular @@ -15,9 +15,9 @@ import CGtk /// the cell renderer. Finally, it is possible to specify a function with /// gtk_cell_layout_set_cell_data_func() that is called to determine the /// value of the attribute for each cell that is rendered. -/// +/// /// ## GtkCellLayouts as GtkBuildable -/// +/// /// Implementations of GtkCellLayout which also implement the GtkBuildable /// interface (`GtkCellView`, `GtkIconView`, `GtkComboBox`, /// `GtkEntryCompletion`, `GtkTreeViewColumn`) accept `GtkCellRenderer` objects @@ -26,38 +26,38 @@ import CGtk /// elements. Each `` element has a name attribute which specifies /// a property of the cell renderer; the content of the element is the /// attribute value. -/// +/// /// This is an example of a UI definition fragment specifying attributes: -/// +/// /// ```xml /// 0 /// ``` -/// +/// /// Furthermore for implementations of `GtkCellLayout` that use a `GtkCellArea` /// to lay out cells (all `GtkCellLayout`s in GTK use a `GtkCellArea`) /// [cell properties](class.CellArea.html#cell-properties) can also be defined /// in the format by specifying the custom `` attribute which can /// contain multiple `` elements. -/// +/// /// Here is a UI definition fragment specifying cell properties: -/// +/// /// ```xml /// TrueFalse /// ``` -/// +/// /// ## Subclassing GtkCellLayout implementations -/// +/// /// When subclassing a widget that implements `GtkCellLayout` like /// `GtkIconView` or `GtkComboBox`, there are some considerations related /// to the fact that these widgets internally use a `GtkCellArea`. /// The cell area is exposed as a construct-only property by these /// widgets. This means that it is possible to e.g. do -/// +/// /// ```c /// GtkWIdget *combo = /// g_object_new (GTK_TYPE_COMBO_BOX, "cell-area", my_cell_area, NULL); /// ``` -/// +/// /// to use a custom cell area with a combo box. But construct properties /// are only initialized after instance `init()` /// functions have run, which means that using functions which rely on @@ -65,21 +65,21 @@ import CGtk /// cause the default cell area to be instantiated. In this case, a provided /// construct property value will be ignored (with a warning, to alert /// you to the problem). -/// +/// /// ```c /// static void /// my_combo_box_init (MyComboBox *b) /// { /// GtkCellRenderer *cell; -/// +/// /// cell = gtk_cell_renderer_pixbuf_new (); -/// +/// /// // The following call causes the default cell area for combo boxes, /// // a GtkCellAreaBox, to be instantiated /// gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (b), cell, FALSE); /// ... /// } -/// +/// /// GtkWidget * /// my_combo_box_new (GtkCellArea *area) /// { @@ -87,14 +87,12 @@ import CGtk /// return g_object_new (MY_TYPE_COMBO_BOX, "cell-area", area, NULL); /// } /// ``` -/// +/// /// If supporting alternative cell areas with your derived widget is /// not important, then this does not have to concern you. If you want /// to support alternative cell areas, you can do so by moving the /// problematic calls out of `init()` and into a `constructor()` /// for your class. public protocol CellLayout: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/CellRendererAccelMode.swift b/Sources/Gtk/Generated/CellRendererAccelMode.swift index 4952def369..80a29bf5bd 100644 --- a/Sources/Gtk/Generated/CellRendererAccelMode.swift +++ b/Sources/Gtk/Generated/CellRendererAccelMode.swift @@ -5,20 +5,20 @@ public enum CellRendererAccelMode: GValueRepresentableEnum { public typealias GtkEnum = GtkCellRendererAccelMode /// GTK accelerators mode -case gtk -/// Other accelerator mode -case other + case gtk + /// Other accelerator mode + case other public static var type: GType { - gtk_cell_renderer_accel_mode_get_type() -} + gtk_cell_renderer_accel_mode_get_type() + } public init(from gtkEnum: GtkCellRendererAccelMode) { switch gtkEnum { case GTK_CELL_RENDERER_ACCEL_MODE_GTK: - self = .gtk -case GTK_CELL_RENDERER_ACCEL_MODE_OTHER: - self = .other + self = .gtk + case GTK_CELL_RENDERER_ACCEL_MODE_OTHER: + self = .other default: fatalError("Unsupported GtkCellRendererAccelMode enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ case GTK_CELL_RENDERER_ACCEL_MODE_OTHER: public func toGtk() -> GtkCellRendererAccelMode { switch self { case .gtk: - return GTK_CELL_RENDERER_ACCEL_MODE_GTK -case .other: - return GTK_CELL_RENDERER_ACCEL_MODE_OTHER + return GTK_CELL_RENDERER_ACCEL_MODE_GTK + case .other: + return GTK_CELL_RENDERER_ACCEL_MODE_OTHER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/CellRendererMode.swift b/Sources/Gtk/Generated/CellRendererMode.swift index 74d702f294..b073354ea2 100644 --- a/Sources/Gtk/Generated/CellRendererMode.swift +++ b/Sources/Gtk/Generated/CellRendererMode.swift @@ -5,27 +5,27 @@ public enum CellRendererMode: GValueRepresentableEnum { public typealias GtkEnum = GtkCellRendererMode /// The cell is just for display -/// and cannot be interacted with. Note that this doesn’t mean that eg. the -/// row being drawn can’t be selected -- just that a particular element of -/// it cannot be individually modified. -case inert -/// The cell can be clicked. -case activatable -/// The cell can be edited or otherwise modified. -case editable + /// and cannot be interacted with. Note that this doesn’t mean that eg. the + /// row being drawn can’t be selected -- just that a particular element of + /// it cannot be individually modified. + case inert + /// The cell can be clicked. + case activatable + /// The cell can be edited or otherwise modified. + case editable public static var type: GType { - gtk_cell_renderer_mode_get_type() -} + gtk_cell_renderer_mode_get_type() + } public init(from gtkEnum: GtkCellRendererMode) { switch gtkEnum { case GTK_CELL_RENDERER_MODE_INERT: - self = .inert -case GTK_CELL_RENDERER_MODE_ACTIVATABLE: - self = .activatable -case GTK_CELL_RENDERER_MODE_EDITABLE: - self = .editable + self = .inert + case GTK_CELL_RENDERER_MODE_ACTIVATABLE: + self = .activatable + case GTK_CELL_RENDERER_MODE_EDITABLE: + self = .editable default: fatalError("Unsupported GtkCellRendererMode enum value: \(gtkEnum.rawValue)") } @@ -34,11 +34,11 @@ case GTK_CELL_RENDERER_MODE_EDITABLE: public func toGtk() -> GtkCellRendererMode { switch self { case .inert: - return GTK_CELL_RENDERER_MODE_INERT -case .activatable: - return GTK_CELL_RENDERER_MODE_ACTIVATABLE -case .editable: - return GTK_CELL_RENDERER_MODE_EDITABLE + return GTK_CELL_RENDERER_MODE_INERT + case .activatable: + return GTK_CELL_RENDERER_MODE_ACTIVATABLE + case .editable: + return GTK_CELL_RENDERER_MODE_EDITABLE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/CheckButton.swift b/Sources/Gtk/Generated/CheckButton.swift index 9c15409bac..287ea926a3 100644 --- a/Sources/Gtk/Generated/CheckButton.swift +++ b/Sources/Gtk/Generated/CheckButton.swift @@ -1,243 +1,251 @@ import CGtk /// Places a label next to an indicator. -/// +/// /// Example GtkCheckButtons -/// +/// /// A `GtkCheckButton` is created by calling either [ctor@Gtk.CheckButton.new] /// or [ctor@Gtk.CheckButton.new_with_label]. -/// +/// /// The state of a `GtkCheckButton` can be set specifically using /// [method@Gtk.CheckButton.set_active], and retrieved using /// [method@Gtk.CheckButton.get_active]. -/// +/// /// # Inconsistent state -/// +/// /// In addition to "on" and "off", check buttons can be an /// "in between" state that is neither on nor off. This can be used /// e.g. when the user has selected a range of elements (such as some /// text or spreadsheet cells) that are affected by a check button, /// and the current values in that range are inconsistent. -/// +/// /// To set a `GtkCheckButton` to inconsistent state, use /// [method@Gtk.CheckButton.set_inconsistent]. -/// +/// /// # Grouping -/// +/// /// Check buttons can be grouped together, to form mutually exclusive /// groups - only one of the buttons can be toggled at a time, and toggling /// another one will switch the currently toggled one off. -/// +/// /// Grouped check buttons use a different indicator, and are commonly referred /// to as *radio buttons*. -/// +/// /// Example GtkRadioButtons -/// +/// /// To add a `GtkCheckButton` to a group, use [method@Gtk.CheckButton.set_group]. -/// +/// /// When the code must keep track of the state of a group of radio buttons, it /// is recommended to keep track of such state through a stateful /// `GAction` with a target for each button. Using the `toggled` signals to keep /// track of the group changes and state is discouraged. -/// +/// /// # Shortcuts and Gestures -/// +/// /// `GtkCheckButton` supports the following keyboard shortcuts: -/// +/// /// - or Enter activates the button. -/// +/// /// # CSS nodes -/// +/// /// ``` /// checkbutton[.text-button][.grouped] /// ├── check /// ╰── [label] /// ``` -/// +/// /// A `GtkCheckButton` has a main node with name checkbutton. If the /// [property@Gtk.CheckButton:label] or [property@Gtk.CheckButton:child] /// properties are set, it contains a child widget. The indicator node /// is named check when no group is set, and radio if the checkbutton /// is grouped together with other checkbuttons. -/// +/// /// # Accessibility -/// +/// /// `GtkCheckButton` uses the [enum@Gtk.AccessibleRole.checkbox] role. open class CheckButton: Widget, Actionable { /// Creates a new `GtkCheckButton`. -public convenience init() { - self.init( - gtk_check_button_new() - ) -} - -/// Creates a new `GtkCheckButton` with the given text. -public convenience init(label: String) { - self.init( - gtk_check_button_new_with_label(label) - ) -} - -/// Creates a new `GtkCheckButton` with the given text and a mnemonic. -public convenience init(mnemonic label: String) { - self.init( - gtk_check_button_new_with_mnemonic(label) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) -} - -addSignal(name: "toggled") { [weak self] () in - guard let self = self else { return } - self.toggled?(self) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_check_button_new() + ) } -addSignal(name: "notify::active", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActive?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new `GtkCheckButton` with the given text. + public convenience init(label: String) { + self.init( + gtk_check_button_new_with_label(label) + ) } -addSignal(name: "notify::child", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyChild?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new `GtkCheckButton` with the given text and a mnemonic. + public convenience init(mnemonic label: String) { + self.init( + gtk_check_button_new_with_mnemonic(label) + ) } -addSignal(name: "notify::group", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyGroup?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) + } + + addSignal(name: "toggled") { [weak self] () in + guard let self = self else { return } + self.toggled?(self) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::active", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActive?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::child", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyChild?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::group", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyGroup?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::inconsistent", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInconsistent?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::label", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLabel?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-underline", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseUnderline?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::action-name", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionName?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::action-target", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionTarget?(self, param0) + } } -addSignal(name: "notify::inconsistent", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInconsistent?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::label", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLabel?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::use-underline", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseUnderline?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::action-name", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionName?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::action-target", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionTarget?(self, param0) -} -} - /// If the check button is active. -/// -/// Setting `active` to %TRUE will add the `:checked:` state to both -/// the check button and the indicator CSS node. -@GObjectProperty(named: "active") public var active: Bool - -/// If the check button is in an “in between” state. -/// -/// The inconsistent state only affects visual appearance, -/// not the semantics of the button. -@GObjectProperty(named: "inconsistent") public var inconsistent: Bool - -/// Text of the label inside the check button, if it contains a label widget. -@GObjectProperty(named: "label") public var label: String? - -/// If set, an underline in the text indicates that the following -/// character is to be used as mnemonic. -@GObjectProperty(named: "use-underline") public var useUnderline: Bool - -/// The name of the action with which this widget should be associated. -@GObjectProperty(named: "action-name") public var actionName: String? + /// + /// Setting `active` to %TRUE will add the `:checked:` state to both + /// the check button and the indicator CSS node. + @GObjectProperty(named: "active") public var active: Bool -/// Emitted to when the check button is activated. -/// -/// The `::activate` signal on `GtkCheckButton` is an action signal and -/// emitting it causes the button to animate press then release. -/// -/// Applications should never connect to this signal, but use the -/// [signal@Gtk.CheckButton::toggled] signal. -/// -/// The default bindings for this signal are all forms of the -/// and Enter keys. -public var activate: ((CheckButton) -> Void)? + /// If the check button is in an “in between” state. + /// + /// The inconsistent state only affects visual appearance, + /// not the semantics of the button. + @GObjectProperty(named: "inconsistent") public var inconsistent: Bool -/// Emitted when the buttons's [property@Gtk.CheckButton:active] -/// property changes. -public var toggled: ((CheckButton) -> Void)? + /// Text of the label inside the check button, if it contains a label widget. + @GObjectProperty(named: "label") public var label: String? + /// If set, an underline in the text indicates that the following + /// character is to be used as mnemonic. + @GObjectProperty(named: "use-underline") public var useUnderline: Bool -public var notifyActive: ((CheckButton, OpaquePointer) -> Void)? + /// The name of the action with which this widget should be associated. + @GObjectProperty(named: "action-name") public var actionName: String? + /// Emitted to when the check button is activated. + /// + /// The `::activate` signal on `GtkCheckButton` is an action signal and + /// emitting it causes the button to animate press then release. + /// + /// Applications should never connect to this signal, but use the + /// [signal@Gtk.CheckButton::toggled] signal. + /// + /// The default bindings for this signal are all forms of the + /// and Enter keys. + public var activate: ((CheckButton) -> Void)? -public var notifyChild: ((CheckButton, OpaquePointer) -> Void)? + /// Emitted when the buttons's [property@Gtk.CheckButton:active] + /// property changes. + public var toggled: ((CheckButton) -> Void)? + public var notifyActive: ((CheckButton, OpaquePointer) -> Void)? -public var notifyGroup: ((CheckButton, OpaquePointer) -> Void)? + public var notifyChild: ((CheckButton, OpaquePointer) -> Void)? + public var notifyGroup: ((CheckButton, OpaquePointer) -> Void)? -public var notifyInconsistent: ((CheckButton, OpaquePointer) -> Void)? + public var notifyInconsistent: ((CheckButton, OpaquePointer) -> Void)? + public var notifyLabel: ((CheckButton, OpaquePointer) -> Void)? -public var notifyLabel: ((CheckButton, OpaquePointer) -> Void)? + public var notifyUseUnderline: ((CheckButton, OpaquePointer) -> Void)? + public var notifyActionName: ((CheckButton, OpaquePointer) -> Void)? -public var notifyUseUnderline: ((CheckButton, OpaquePointer) -> Void)? - - -public var notifyActionName: ((CheckButton, OpaquePointer) -> Void)? - - -public var notifyActionTarget: ((CheckButton, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyActionTarget: ((CheckButton, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/ConstraintAttribute.swift b/Sources/Gtk/Generated/ConstraintAttribute.swift index 1e5c0ce066..1bc24638df 100644 --- a/Sources/Gtk/Generated/ConstraintAttribute.swift +++ b/Sources/Gtk/Generated/ConstraintAttribute.swift @@ -5,69 +5,69 @@ public enum ConstraintAttribute: GValueRepresentableEnum { public typealias GtkEnum = GtkConstraintAttribute /// No attribute, used for constant -/// relations -case none -/// The left edge of a widget, regardless of -/// text direction -case left -/// The right edge of a widget, regardless -/// of text direction -case right -/// The top edge of a widget -case top -/// The bottom edge of a widget -case bottom -/// The leading edge of a widget, depending -/// on text direction; equivalent to %GTK_CONSTRAINT_ATTRIBUTE_LEFT for LTR -/// languages, and %GTK_CONSTRAINT_ATTRIBUTE_RIGHT for RTL ones -case start -/// The trailing edge of a widget, depending -/// on text direction; equivalent to %GTK_CONSTRAINT_ATTRIBUTE_RIGHT for LTR -/// languages, and %GTK_CONSTRAINT_ATTRIBUTE_LEFT for RTL ones -case end -/// The width of a widget -case width -/// The height of a widget -case height -/// The center of a widget, on the -/// horizontal axis -case centerX -/// The center of a widget, on the -/// vertical axis -case centerY -/// The baseline of a widget -case baseline + /// relations + case none + /// The left edge of a widget, regardless of + /// text direction + case left + /// The right edge of a widget, regardless + /// of text direction + case right + /// The top edge of a widget + case top + /// The bottom edge of a widget + case bottom + /// The leading edge of a widget, depending + /// on text direction; equivalent to %GTK_CONSTRAINT_ATTRIBUTE_LEFT for LTR + /// languages, and %GTK_CONSTRAINT_ATTRIBUTE_RIGHT for RTL ones + case start + /// The trailing edge of a widget, depending + /// on text direction; equivalent to %GTK_CONSTRAINT_ATTRIBUTE_RIGHT for LTR + /// languages, and %GTK_CONSTRAINT_ATTRIBUTE_LEFT for RTL ones + case end + /// The width of a widget + case width + /// The height of a widget + case height + /// The center of a widget, on the + /// horizontal axis + case centerX + /// The center of a widget, on the + /// vertical axis + case centerY + /// The baseline of a widget + case baseline public static var type: GType { - gtk_constraint_attribute_get_type() -} + gtk_constraint_attribute_get_type() + } public init(from gtkEnum: GtkConstraintAttribute) { switch gtkEnum { case GTK_CONSTRAINT_ATTRIBUTE_NONE: - self = .none -case GTK_CONSTRAINT_ATTRIBUTE_LEFT: - self = .left -case GTK_CONSTRAINT_ATTRIBUTE_RIGHT: - self = .right -case GTK_CONSTRAINT_ATTRIBUTE_TOP: - self = .top -case GTK_CONSTRAINT_ATTRIBUTE_BOTTOM: - self = .bottom -case GTK_CONSTRAINT_ATTRIBUTE_START: - self = .start -case GTK_CONSTRAINT_ATTRIBUTE_END: - self = .end -case GTK_CONSTRAINT_ATTRIBUTE_WIDTH: - self = .width -case GTK_CONSTRAINT_ATTRIBUTE_HEIGHT: - self = .height -case GTK_CONSTRAINT_ATTRIBUTE_CENTER_X: - self = .centerX -case GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y: - self = .centerY -case GTK_CONSTRAINT_ATTRIBUTE_BASELINE: - self = .baseline + self = .none + case GTK_CONSTRAINT_ATTRIBUTE_LEFT: + self = .left + case GTK_CONSTRAINT_ATTRIBUTE_RIGHT: + self = .right + case GTK_CONSTRAINT_ATTRIBUTE_TOP: + self = .top + case GTK_CONSTRAINT_ATTRIBUTE_BOTTOM: + self = .bottom + case GTK_CONSTRAINT_ATTRIBUTE_START: + self = .start + case GTK_CONSTRAINT_ATTRIBUTE_END: + self = .end + case GTK_CONSTRAINT_ATTRIBUTE_WIDTH: + self = .width + case GTK_CONSTRAINT_ATTRIBUTE_HEIGHT: + self = .height + case GTK_CONSTRAINT_ATTRIBUTE_CENTER_X: + self = .centerX + case GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y: + self = .centerY + case GTK_CONSTRAINT_ATTRIBUTE_BASELINE: + self = .baseline default: fatalError("Unsupported GtkConstraintAttribute enum value: \(gtkEnum.rawValue)") } @@ -76,29 +76,29 @@ case GTK_CONSTRAINT_ATTRIBUTE_BASELINE: public func toGtk() -> GtkConstraintAttribute { switch self { case .none: - return GTK_CONSTRAINT_ATTRIBUTE_NONE -case .left: - return GTK_CONSTRAINT_ATTRIBUTE_LEFT -case .right: - return GTK_CONSTRAINT_ATTRIBUTE_RIGHT -case .top: - return GTK_CONSTRAINT_ATTRIBUTE_TOP -case .bottom: - return GTK_CONSTRAINT_ATTRIBUTE_BOTTOM -case .start: - return GTK_CONSTRAINT_ATTRIBUTE_START -case .end: - return GTK_CONSTRAINT_ATTRIBUTE_END -case .width: - return GTK_CONSTRAINT_ATTRIBUTE_WIDTH -case .height: - return GTK_CONSTRAINT_ATTRIBUTE_HEIGHT -case .centerX: - return GTK_CONSTRAINT_ATTRIBUTE_CENTER_X -case .centerY: - return GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y -case .baseline: - return GTK_CONSTRAINT_ATTRIBUTE_BASELINE + return GTK_CONSTRAINT_ATTRIBUTE_NONE + case .left: + return GTK_CONSTRAINT_ATTRIBUTE_LEFT + case .right: + return GTK_CONSTRAINT_ATTRIBUTE_RIGHT + case .top: + return GTK_CONSTRAINT_ATTRIBUTE_TOP + case .bottom: + return GTK_CONSTRAINT_ATTRIBUTE_BOTTOM + case .start: + return GTK_CONSTRAINT_ATTRIBUTE_START + case .end: + return GTK_CONSTRAINT_ATTRIBUTE_END + case .width: + return GTK_CONSTRAINT_ATTRIBUTE_WIDTH + case .height: + return GTK_CONSTRAINT_ATTRIBUTE_HEIGHT + case .centerX: + return GTK_CONSTRAINT_ATTRIBUTE_CENTER_X + case .centerY: + return GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y + case .baseline: + return GTK_CONSTRAINT_ATTRIBUTE_BASELINE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ConstraintRelation.swift b/Sources/Gtk/Generated/ConstraintRelation.swift index 78cd718df6..58e75a256e 100644 --- a/Sources/Gtk/Generated/ConstraintRelation.swift +++ b/Sources/Gtk/Generated/ConstraintRelation.swift @@ -5,24 +5,24 @@ public enum ConstraintRelation: GValueRepresentableEnum { public typealias GtkEnum = GtkConstraintRelation /// Less than, or equal -case le -/// Equal -case eq -/// Greater than, or equal -case ge + case le + /// Equal + case eq + /// Greater than, or equal + case ge public static var type: GType { - gtk_constraint_relation_get_type() -} + gtk_constraint_relation_get_type() + } public init(from gtkEnum: GtkConstraintRelation) { switch gtkEnum { case GTK_CONSTRAINT_RELATION_LE: - self = .le -case GTK_CONSTRAINT_RELATION_EQ: - self = .eq -case GTK_CONSTRAINT_RELATION_GE: - self = .ge + self = .le + case GTK_CONSTRAINT_RELATION_EQ: + self = .eq + case GTK_CONSTRAINT_RELATION_GE: + self = .ge default: fatalError("Unsupported GtkConstraintRelation enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ case GTK_CONSTRAINT_RELATION_GE: public func toGtk() -> GtkConstraintRelation { switch self { case .le: - return GTK_CONSTRAINT_RELATION_LE -case .eq: - return GTK_CONSTRAINT_RELATION_EQ -case .ge: - return GTK_CONSTRAINT_RELATION_GE + return GTK_CONSTRAINT_RELATION_LE + case .eq: + return GTK_CONSTRAINT_RELATION_EQ + case .ge: + return GTK_CONSTRAINT_RELATION_GE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ConstraintStrength.swift b/Sources/Gtk/Generated/ConstraintStrength.swift index 56e0c59e20..0e0fa5367b 100644 --- a/Sources/Gtk/Generated/ConstraintStrength.swift +++ b/Sources/Gtk/Generated/ConstraintStrength.swift @@ -1,35 +1,35 @@ import CGtk /// The strength of a constraint, expressed as a symbolic constant. -/// +/// /// The strength of a [class@Constraint] can be expressed with any positive /// integer; the values of this enumeration can be used for readability. public enum ConstraintStrength: GValueRepresentableEnum { public typealias GtkEnum = GtkConstraintStrength /// The constraint is required towards solving the layout -case required -/// A strong constraint -case strong -/// A medium constraint -case medium -/// A weak constraint -case weak + case required + /// A strong constraint + case strong + /// A medium constraint + case medium + /// A weak constraint + case weak public static var type: GType { - gtk_constraint_strength_get_type() -} + gtk_constraint_strength_get_type() + } public init(from gtkEnum: GtkConstraintStrength) { switch gtkEnum { case GTK_CONSTRAINT_STRENGTH_REQUIRED: - self = .required -case GTK_CONSTRAINT_STRENGTH_STRONG: - self = .strong -case GTK_CONSTRAINT_STRENGTH_MEDIUM: - self = .medium -case GTK_CONSTRAINT_STRENGTH_WEAK: - self = .weak + self = .required + case GTK_CONSTRAINT_STRENGTH_STRONG: + self = .strong + case GTK_CONSTRAINT_STRENGTH_MEDIUM: + self = .medium + case GTK_CONSTRAINT_STRENGTH_WEAK: + self = .weak default: fatalError("Unsupported GtkConstraintStrength enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ case GTK_CONSTRAINT_STRENGTH_WEAK: public func toGtk() -> GtkConstraintStrength { switch self { case .required: - return GTK_CONSTRAINT_STRENGTH_REQUIRED -case .strong: - return GTK_CONSTRAINT_STRENGTH_STRONG -case .medium: - return GTK_CONSTRAINT_STRENGTH_MEDIUM -case .weak: - return GTK_CONSTRAINT_STRENGTH_WEAK + return GTK_CONSTRAINT_STRENGTH_REQUIRED + case .strong: + return GTK_CONSTRAINT_STRENGTH_STRONG + case .medium: + return GTK_CONSTRAINT_STRENGTH_MEDIUM + case .weak: + return GTK_CONSTRAINT_STRENGTH_WEAK } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ConstraintTarget.swift b/Sources/Gtk/Generated/ConstraintTarget.swift index 222de0a185..07bfaf33b9 100644 --- a/Sources/Gtk/Generated/ConstraintTarget.swift +++ b/Sources/Gtk/Generated/ConstraintTarget.swift @@ -2,10 +2,8 @@ import CGtk /// Makes it possible to use an object as source or target in a /// [class@Gtk.Constraint]. -/// +/// /// Besides `GtkWidget`, it is also implemented by `GtkConstraintGuide`. public protocol ConstraintTarget: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ConstraintVflParserError.swift b/Sources/Gtk/Generated/ConstraintVflParserError.swift index 8bda010e9e..1b485c06f8 100644 --- a/Sources/Gtk/Generated/ConstraintVflParserError.swift +++ b/Sources/Gtk/Generated/ConstraintVflParserError.swift @@ -5,55 +5,56 @@ public enum ConstraintVflParserError: GValueRepresentableEnum { public typealias GtkEnum = GtkConstraintVflParserError /// Invalid or unknown symbol -case symbol -/// Invalid or unknown attribute -case attribute -/// Invalid or unknown view -case view -/// Invalid or unknown metric -case metric -/// Invalid or unknown priority -case priority -/// Invalid or unknown relation -case relation + case symbol + /// Invalid or unknown attribute + case attribute + /// Invalid or unknown view + case view + /// Invalid or unknown metric + case metric + /// Invalid or unknown priority + case priority + /// Invalid or unknown relation + case relation public static var type: GType { - gtk_constraint_vfl_parser_error_get_type() -} + gtk_constraint_vfl_parser_error_get_type() + } public init(from gtkEnum: GtkConstraintVflParserError) { switch gtkEnum { case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL: - self = .symbol -case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE: - self = .attribute -case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW: - self = .view -case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC: - self = .metric -case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY: - self = .priority -case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION: - self = .relation + self = .symbol + case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE: + self = .attribute + case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW: + self = .view + case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC: + self = .metric + case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY: + self = .priority + case GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION: + self = .relation default: - fatalError("Unsupported GtkConstraintVflParserError enum value: \(gtkEnum.rawValue)") + fatalError( + "Unsupported GtkConstraintVflParserError enum value: \(gtkEnum.rawValue)") } } public func toGtk() -> GtkConstraintVflParserError { switch self { case .symbol: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL -case .attribute: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE -case .view: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW -case .metric: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC -case .priority: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY -case .relation: - return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL + case .attribute: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE + case .view: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW + case .metric: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC + case .priority: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY + case .relation: + return GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/CornerType.swift b/Sources/Gtk/Generated/CornerType.swift index 4224f19381..8d6999bae6 100644 --- a/Sources/Gtk/Generated/CornerType.swift +++ b/Sources/Gtk/Generated/CornerType.swift @@ -2,38 +2,38 @@ import CGtk /// Specifies which corner a child widget should be placed in when packed into /// a `GtkScrolledWindow.` -/// +/// /// This is effectively the opposite of where the scroll bars are placed. public enum CornerType: GValueRepresentableEnum { public typealias GtkEnum = GtkCornerType /// Place the scrollbars on the right and bottom of the -/// widget (default behaviour). -case topLeft -/// Place the scrollbars on the top and right of the -/// widget. -case bottomLeft -/// Place the scrollbars on the left and bottom of the -/// widget. -case topRight -/// Place the scrollbars on the top and left of the -/// widget. -case bottomRight + /// widget (default behaviour). + case topLeft + /// Place the scrollbars on the top and right of the + /// widget. + case bottomLeft + /// Place the scrollbars on the left and bottom of the + /// widget. + case topRight + /// Place the scrollbars on the top and left of the + /// widget. + case bottomRight public static var type: GType { - gtk_corner_type_get_type() -} + gtk_corner_type_get_type() + } public init(from gtkEnum: GtkCornerType) { switch gtkEnum { case GTK_CORNER_TOP_LEFT: - self = .topLeft -case GTK_CORNER_BOTTOM_LEFT: - self = .bottomLeft -case GTK_CORNER_TOP_RIGHT: - self = .topRight -case GTK_CORNER_BOTTOM_RIGHT: - self = .bottomRight + self = .topLeft + case GTK_CORNER_BOTTOM_LEFT: + self = .bottomLeft + case GTK_CORNER_TOP_RIGHT: + self = .topRight + case GTK_CORNER_BOTTOM_RIGHT: + self = .bottomRight default: fatalError("Unsupported GtkCornerType enum value: \(gtkEnum.rawValue)") } @@ -42,13 +42,13 @@ case GTK_CORNER_BOTTOM_RIGHT: public func toGtk() -> GtkCornerType { switch self { case .topLeft: - return GTK_CORNER_TOP_LEFT -case .bottomLeft: - return GTK_CORNER_BOTTOM_LEFT -case .topRight: - return GTK_CORNER_TOP_RIGHT -case .bottomRight: - return GTK_CORNER_BOTTOM_RIGHT + return GTK_CORNER_TOP_LEFT + case .bottomLeft: + return GTK_CORNER_BOTTOM_LEFT + case .topRight: + return GTK_CORNER_TOP_RIGHT + case .bottomRight: + return GTK_CORNER_BOTTOM_RIGHT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/CssParserError.swift b/Sources/Gtk/Generated/CssParserError.swift index 9566e2db89..8036a95f88 100644 --- a/Sources/Gtk/Generated/CssParserError.swift +++ b/Sources/Gtk/Generated/CssParserError.swift @@ -1,39 +1,39 @@ import CGtk /// Errors that can occur while parsing CSS. -/// +/// /// These errors are unexpected and will cause parts of the given CSS /// to be ignored. public enum CssParserError: GValueRepresentableEnum { public typealias GtkEnum = GtkCssParserError /// Unknown failure. -case failed -/// The given text does not form valid syntax -case syntax -/// Failed to import a resource -case import_ -/// The given name has not been defined -case name -/// The given value is not correct -case unknownValue + case failed + /// The given text does not form valid syntax + case syntax + /// Failed to import a resource + case import_ + /// The given name has not been defined + case name + /// The given value is not correct + case unknownValue public static var type: GType { - gtk_css_parser_error_get_type() -} + gtk_css_parser_error_get_type() + } public init(from gtkEnum: GtkCssParserError) { switch gtkEnum { case GTK_CSS_PARSER_ERROR_FAILED: - self = .failed -case GTK_CSS_PARSER_ERROR_SYNTAX: - self = .syntax -case GTK_CSS_PARSER_ERROR_IMPORT: - self = .import_ -case GTK_CSS_PARSER_ERROR_NAME: - self = .name -case GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE: - self = .unknownValue + self = .failed + case GTK_CSS_PARSER_ERROR_SYNTAX: + self = .syntax + case GTK_CSS_PARSER_ERROR_IMPORT: + self = .import_ + case GTK_CSS_PARSER_ERROR_NAME: + self = .name + case GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE: + self = .unknownValue default: fatalError("Unsupported GtkCssParserError enum value: \(gtkEnum.rawValue)") } @@ -42,15 +42,15 @@ case GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE: public func toGtk() -> GtkCssParserError { switch self { case .failed: - return GTK_CSS_PARSER_ERROR_FAILED -case .syntax: - return GTK_CSS_PARSER_ERROR_SYNTAX -case .import_: - return GTK_CSS_PARSER_ERROR_IMPORT -case .name: - return GTK_CSS_PARSER_ERROR_NAME -case .unknownValue: - return GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE + return GTK_CSS_PARSER_ERROR_FAILED + case .syntax: + return GTK_CSS_PARSER_ERROR_SYNTAX + case .import_: + return GTK_CSS_PARSER_ERROR_IMPORT + case .name: + return GTK_CSS_PARSER_ERROR_NAME + case .unknownValue: + return GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/CssParserWarning.swift b/Sources/Gtk/Generated/CssParserWarning.swift index 459ecb80b9..3050bfa3f3 100644 --- a/Sources/Gtk/Generated/CssParserWarning.swift +++ b/Sources/Gtk/Generated/CssParserWarning.swift @@ -1,33 +1,33 @@ import CGtk /// Warnings that can occur while parsing CSS. -/// +/// /// Unlike `GtkCssParserError`s, warnings do not cause the parser to /// skip any input, but they indicate issues that should be fixed. public enum CssParserWarning: GValueRepresentableEnum { public typealias GtkEnum = GtkCssParserWarning /// The given construct is -/// deprecated and will be removed in a future version -case deprecated -/// A syntax construct was used -/// that should be avoided -case syntax -/// A feature is not implemented -case unimplemented + /// deprecated and will be removed in a future version + case deprecated + /// A syntax construct was used + /// that should be avoided + case syntax + /// A feature is not implemented + case unimplemented public static var type: GType { - gtk_css_parser_warning_get_type() -} + gtk_css_parser_warning_get_type() + } public init(from gtkEnum: GtkCssParserWarning) { switch gtkEnum { case GTK_CSS_PARSER_WARNING_DEPRECATED: - self = .deprecated -case GTK_CSS_PARSER_WARNING_SYNTAX: - self = .syntax -case GTK_CSS_PARSER_WARNING_UNIMPLEMENTED: - self = .unimplemented + self = .deprecated + case GTK_CSS_PARSER_WARNING_SYNTAX: + self = .syntax + case GTK_CSS_PARSER_WARNING_UNIMPLEMENTED: + self = .unimplemented default: fatalError("Unsupported GtkCssParserWarning enum value: \(gtkEnum.rawValue)") } @@ -36,11 +36,11 @@ case GTK_CSS_PARSER_WARNING_UNIMPLEMENTED: public func toGtk() -> GtkCssParserWarning { switch self { case .deprecated: - return GTK_CSS_PARSER_WARNING_DEPRECATED -case .syntax: - return GTK_CSS_PARSER_WARNING_SYNTAX -case .unimplemented: - return GTK_CSS_PARSER_WARNING_UNIMPLEMENTED + return GTK_CSS_PARSER_WARNING_DEPRECATED + case .syntax: + return GTK_CSS_PARSER_WARNING_SYNTAX + case .unimplemented: + return GTK_CSS_PARSER_WARNING_UNIMPLEMENTED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/DeleteType.swift b/Sources/Gtk/Generated/DeleteType.swift index 7b22266c3e..9d5197ef0c 100644 --- a/Sources/Gtk/Generated/DeleteType.swift +++ b/Sources/Gtk/Generated/DeleteType.swift @@ -5,50 +5,50 @@ public enum DeleteType: GValueRepresentableEnum { public typealias GtkEnum = GtkDeleteType /// Delete characters. -case chars -/// Delete only the portion of the word to the -/// left/right of cursor if we’re in the middle of a word. -case wordEnds -/// Delete words. -case words -/// Delete display-lines. Display-lines -/// refers to the visible lines, with respect to the current line -/// breaks. As opposed to paragraphs, which are defined by line -/// breaks in the input. -case displayLines -/// Delete only the portion of the -/// display-line to the left/right of cursor. -case displayLineEnds -/// Delete to the end of the -/// paragraph. Like C-k in Emacs (or its reverse). -case paragraphEnds -/// Delete entire line. Like C-k in pico. -case paragraphs -/// Delete only whitespace. Like M-\ in Emacs. -case whitespace + case chars + /// Delete only the portion of the word to the + /// left/right of cursor if we’re in the middle of a word. + case wordEnds + /// Delete words. + case words + /// Delete display-lines. Display-lines + /// refers to the visible lines, with respect to the current line + /// breaks. As opposed to paragraphs, which are defined by line + /// breaks in the input. + case displayLines + /// Delete only the portion of the + /// display-line to the left/right of cursor. + case displayLineEnds + /// Delete to the end of the + /// paragraph. Like C-k in Emacs (or its reverse). + case paragraphEnds + /// Delete entire line. Like C-k in pico. + case paragraphs + /// Delete only whitespace. Like M-\ in Emacs. + case whitespace public static var type: GType { - gtk_delete_type_get_type() -} + gtk_delete_type_get_type() + } public init(from gtkEnum: GtkDeleteType) { switch gtkEnum { case GTK_DELETE_CHARS: - self = .chars -case GTK_DELETE_WORD_ENDS: - self = .wordEnds -case GTK_DELETE_WORDS: - self = .words -case GTK_DELETE_DISPLAY_LINES: - self = .displayLines -case GTK_DELETE_DISPLAY_LINE_ENDS: - self = .displayLineEnds -case GTK_DELETE_PARAGRAPH_ENDS: - self = .paragraphEnds -case GTK_DELETE_PARAGRAPHS: - self = .paragraphs -case GTK_DELETE_WHITESPACE: - self = .whitespace + self = .chars + case GTK_DELETE_WORD_ENDS: + self = .wordEnds + case GTK_DELETE_WORDS: + self = .words + case GTK_DELETE_DISPLAY_LINES: + self = .displayLines + case GTK_DELETE_DISPLAY_LINE_ENDS: + self = .displayLineEnds + case GTK_DELETE_PARAGRAPH_ENDS: + self = .paragraphEnds + case GTK_DELETE_PARAGRAPHS: + self = .paragraphs + case GTK_DELETE_WHITESPACE: + self = .whitespace default: fatalError("Unsupported GtkDeleteType enum value: \(gtkEnum.rawValue)") } @@ -57,21 +57,21 @@ case GTK_DELETE_WHITESPACE: public func toGtk() -> GtkDeleteType { switch self { case .chars: - return GTK_DELETE_CHARS -case .wordEnds: - return GTK_DELETE_WORD_ENDS -case .words: - return GTK_DELETE_WORDS -case .displayLines: - return GTK_DELETE_DISPLAY_LINES -case .displayLineEnds: - return GTK_DELETE_DISPLAY_LINE_ENDS -case .paragraphEnds: - return GTK_DELETE_PARAGRAPH_ENDS -case .paragraphs: - return GTK_DELETE_PARAGRAPHS -case .whitespace: - return GTK_DELETE_WHITESPACE + return GTK_DELETE_CHARS + case .wordEnds: + return GTK_DELETE_WORD_ENDS + case .words: + return GTK_DELETE_WORDS + case .displayLines: + return GTK_DELETE_DISPLAY_LINES + case .displayLineEnds: + return GTK_DELETE_DISPLAY_LINE_ENDS + case .paragraphEnds: + return GTK_DELETE_PARAGRAPH_ENDS + case .paragraphs: + return GTK_DELETE_PARAGRAPHS + case .whitespace: + return GTK_DELETE_WHITESPACE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/DirectionType.swift b/Sources/Gtk/Generated/DirectionType.swift index bd80042ac2..af0b146996 100644 --- a/Sources/Gtk/Generated/DirectionType.swift +++ b/Sources/Gtk/Generated/DirectionType.swift @@ -5,36 +5,36 @@ public enum DirectionType: GValueRepresentableEnum { public typealias GtkEnum = GtkDirectionType /// Move forward. -case tabForward -/// Move backward. -case tabBackward -/// Move up. -case up -/// Move down. -case down -/// Move left. -case left -/// Move right. -case right + case tabForward + /// Move backward. + case tabBackward + /// Move up. + case up + /// Move down. + case down + /// Move left. + case left + /// Move right. + case right public static var type: GType { - gtk_direction_type_get_type() -} + gtk_direction_type_get_type() + } public init(from gtkEnum: GtkDirectionType) { switch gtkEnum { case GTK_DIR_TAB_FORWARD: - self = .tabForward -case GTK_DIR_TAB_BACKWARD: - self = .tabBackward -case GTK_DIR_UP: - self = .up -case GTK_DIR_DOWN: - self = .down -case GTK_DIR_LEFT: - self = .left -case GTK_DIR_RIGHT: - self = .right + self = .tabForward + case GTK_DIR_TAB_BACKWARD: + self = .tabBackward + case GTK_DIR_UP: + self = .up + case GTK_DIR_DOWN: + self = .down + case GTK_DIR_LEFT: + self = .left + case GTK_DIR_RIGHT: + self = .right default: fatalError("Unsupported GtkDirectionType enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ case GTK_DIR_RIGHT: public func toGtk() -> GtkDirectionType { switch self { case .tabForward: - return GTK_DIR_TAB_FORWARD -case .tabBackward: - return GTK_DIR_TAB_BACKWARD -case .up: - return GTK_DIR_UP -case .down: - return GTK_DIR_DOWN -case .left: - return GTK_DIR_LEFT -case .right: - return GTK_DIR_RIGHT + return GTK_DIR_TAB_FORWARD + case .tabBackward: + return GTK_DIR_TAB_BACKWARD + case .up: + return GTK_DIR_UP + case .down: + return GTK_DIR_DOWN + case .left: + return GTK_DIR_LEFT + case .right: + return GTK_DIR_RIGHT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/DrawingArea.swift b/Sources/Gtk/Generated/DrawingArea.swift index c24736f50a..4fa422c1dc 100644 --- a/Sources/Gtk/Generated/DrawingArea.swift +++ b/Sources/Gtk/Generated/DrawingArea.swift @@ -1,28 +1,28 @@ import CGtk /// Allows drawing with cairo. -/// +/// /// An example GtkDrawingArea -/// +/// /// It’s essentially a blank widget; you can draw on it. After /// creating a drawing area, the application may want to connect to: -/// +/// /// - The [signal@Gtk.Widget::realize] signal to take any necessary actions /// when the widget is instantiated on a particular display. /// (Create GDK resources in response to this signal.) -/// +/// /// - The [signal@Gtk.DrawingArea::resize] signal to take any necessary /// actions when the widget changes size. -/// +/// /// - Call [method@Gtk.DrawingArea.set_draw_func] to handle redrawing the /// contents of the widget. -/// +/// /// The following code portion demonstrates using a drawing /// area to display a circle in the normal widget foreground /// color. -/// +/// /// ## Simple GtkDrawingArea usage -/// +/// /// ```c /// static void /// draw_function (GtkDrawingArea *area, @@ -32,24 +32,24 @@ import CGtk /// gpointer data) /// { /// GdkRGBA color; -/// +/// /// cairo_arc (cr, /// width / 2.0, height / 2.0, /// MIN (width, height) / 2.0, /// 0, 2 * G_PI); -/// +/// /// gtk_widget_get_color (GTK_WIDGET (area), /// &color); /// gdk_cairo_set_source_rgba (cr, &color); -/// +/// /// cairo_fill (cr); /// } -/// +/// /// int /// main (int argc, char **argv) /// { /// gtk_init (); -/// +/// /// GtkWidget *area = gtk_drawing_area_new (); /// gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (area), 100); /// gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (area), 100); @@ -59,83 +59,87 @@ import CGtk /// return 0; /// } /// ``` -/// +/// /// The draw function is normally called when a drawing area first comes /// onscreen, or when it’s covered by another window and then uncovered. /// You can also force a redraw by adding to the “damage region” of the /// drawing area’s window using [method@Gtk.Widget.queue_draw]. /// This will cause the drawing area to call the draw function again. -/// +/// /// The available routines for drawing are documented in the /// [Cairo documentation](https://www.cairographics.org/manual/); GDK /// offers additional API to integrate with Cairo, like [func@Gdk.cairo_set_source_rgba] /// or [func@Gdk.cairo_set_source_pixbuf]. -/// +/// /// To receive mouse events on a drawing area, you will need to use /// event controllers. To receive keyboard events, you will need to set /// the “can-focus” property on the drawing area, and you should probably /// draw some user-visible indication that the drawing area is focused. -/// +/// /// If you need more complex control over your widget, you should consider /// creating your own `GtkWidget` subclass. open class DrawingArea: Widget { /// Creates a new drawing area. -public convenience init() { - self.init( - gtk_drawing_area_new() - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) + public convenience init() { + self.init( + gtk_drawing_area_new() + ) } -addSignal(name: "resize", handler: gCallback(handler0)) { [weak self] (param0: Int, param1: Int) in - guard let self = self else { return } - self.resize?(self, param0, param1) -} + override func didMoveToParent() { + super.didMoveToParent() -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + let handler0: + @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } -addSignal(name: "notify::content-height", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContentHeight?(self, param0) -} + addSignal(name: "resize", handler: gCallback(handler0)) { + [weak self] (param0: Int, param1: Int) in + guard let self = self else { return } + self.resize?(self, param0, param1) + } -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } -addSignal(name: "notify::content-width", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContentWidth?(self, param0) -} -} + addSignal(name: "notify::content-height", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContentHeight?(self, param0) + } - /// The content height. -@GObjectProperty(named: "content-height") public var contentHeight: Int + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } -/// The content width. -@GObjectProperty(named: "content-width") public var contentWidth: Int + addSignal(name: "notify::content-width", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContentWidth?(self, param0) + } + } -/// Emitted once when the widget is realized, and then each time the widget -/// is changed while realized. -/// -/// This is useful in order to keep state up to date with the widget size, -/// like for instance a backing surface. -public var resize: ((DrawingArea, Int, Int) -> Void)? + /// The content height. + @GObjectProperty(named: "content-height") public var contentHeight: Int + /// The content width. + @GObjectProperty(named: "content-width") public var contentWidth: Int -public var notifyContentHeight: ((DrawingArea, OpaquePointer) -> Void)? + /// Emitted once when the widget is realized, and then each time the widget + /// is changed while realized. + /// + /// This is useful in order to keep state up to date with the widget size, + /// like for instance a backing surface. + public var resize: ((DrawingArea, Int, Int) -> Void)? + public var notifyContentHeight: ((DrawingArea, OpaquePointer) -> Void)? -public var notifyContentWidth: ((DrawingArea, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyContentWidth: ((DrawingArea, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/DropDown.swift b/Sources/Gtk/Generated/DropDown.swift index 16265c0ffb..5ff024cbf5 100644 --- a/Sources/Gtk/Generated/DropDown.swift +++ b/Sources/Gtk/Generated/DropDown.swift @@ -1,219 +1,230 @@ import CGtk /// Allows the user to choose an item from a list of options. -/// +/// /// An example GtkDropDown -/// +/// /// The `GtkDropDown` displays the [selected][property@Gtk.DropDown:selected] /// choice. -/// +/// /// The options are given to `GtkDropDown` in the form of `GListModel` /// and how the individual options are represented is determined by /// a [class@Gtk.ListItemFactory]. The default factory displays simple strings, /// and adds a checkmark to the selected item in the popup. -/// +/// /// To set your own factory, use [method@Gtk.DropDown.set_factory]. It is /// possible to use a separate factory for the items in the popup, with /// [method@Gtk.DropDown.set_list_factory]. -/// +/// /// `GtkDropDown` knows how to obtain strings from the items in a /// [class@Gtk.StringList]; for other models, you have to provide an expression /// to find the strings via [method@Gtk.DropDown.set_expression]. -/// +/// /// `GtkDropDown` can optionally allow search in the popup, which is /// useful if the list of options is long. To enable the search entry, /// use [method@Gtk.DropDown.set_enable_search]. -/// +/// /// Here is a UI definition example for `GtkDropDown` with a simple model: -/// +/// /// ```xml /// FactoryHomeSubway /// ``` -/// +/// /// If a `GtkDropDown` is created in this manner, or with /// [ctor@Gtk.DropDown.new_from_strings], for instance, the object returned from /// [method@Gtk.DropDown.get_selected_item] will be a [class@Gtk.StringObject]. -/// +/// /// To learn more about the list widget framework, see the /// [overview](section-list-widget.html). -/// +/// /// ## CSS nodes -/// +/// /// `GtkDropDown` has a single CSS node with name dropdown, /// with the button and popover nodes as children. -/// +/// /// ## Accessibility -/// +/// /// `GtkDropDown` uses the [enum@Gtk.AccessibleRole.combo_box] role. open class DropDown: Widget { /// Creates a new `GtkDropDown` that is populated with -/// the strings. -public convenience init(strings: [String]) { - self.init( - gtk_drop_down_new_from_strings(strings - .map({ UnsafePointer($0.unsafeUTF8Copy().baseAddress) }) - .unsafeCopy() - .baseAddress!) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::enable-search", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEnableSearch?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// the strings. + public convenience init(strings: [String]) { + self.init( + gtk_drop_down_new_from_strings( + strings + .map({ UnsafePointer($0.unsafeUTF8Copy().baseAddress) }) + .unsafeCopy() + .baseAddress!) + ) } -addSignal(name: "notify::expression", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExpression?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::factory", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFactory?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::header-factory", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHeaderFactory?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::list-factory", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyListFactory?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::model", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyModel?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::enable-search", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEnableSearch?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::expression", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExpression?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::factory", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFactory?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::header-factory", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHeaderFactory?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::list-factory", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyListFactory?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::model", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyModel?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::search-match-mode", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySearchMatchMode?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::selected", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelected?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::selected-item", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectedItem?(self, param0) + } + + let handler10: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::show-arrow", handler: gCallback(handler10)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowArrow?(self, param0) + } } -addSignal(name: "notify::search-match-mode", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySearchMatchMode?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::selected", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelected?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::selected-item", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectedItem?(self, param0) -} - -let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::show-arrow", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowArrow?(self, param0) -} -} - /// Whether to show a search entry in the popup. -/// -/// Note that search requires [property@Gtk.DropDown:expression] -/// to be set. -@GObjectProperty(named: "enable-search") public var enableSearch: Bool - -/// Model for the displayed items. -@GObjectProperty(named: "model") public var model: OpaquePointer? - -/// The position of the selected item. -/// -/// If no item is selected, the property has the value -/// %GTK_INVALID_LIST_POSITION. -@GObjectProperty(named: "selected") public var selected: Int - -/// Emitted to when the drop down is activated. -/// -/// The `::activate` signal on `GtkDropDown` is an action signal and -/// emitting it causes the drop down to pop up its dropdown. -public var activate: ((DropDown) -> Void)? - - -public var notifyEnableSearch: ((DropDown, OpaquePointer) -> Void)? + /// + /// Note that search requires [property@Gtk.DropDown:expression] + /// to be set. + @GObjectProperty(named: "enable-search") public var enableSearch: Bool + /// Model for the displayed items. + @GObjectProperty(named: "model") public var model: OpaquePointer? -public var notifyExpression: ((DropDown, OpaquePointer) -> Void)? + /// The position of the selected item. + /// + /// If no item is selected, the property has the value + /// %GTK_INVALID_LIST_POSITION. + @GObjectProperty(named: "selected") public var selected: Int + /// Emitted to when the drop down is activated. + /// + /// The `::activate` signal on `GtkDropDown` is an action signal and + /// emitting it causes the drop down to pop up its dropdown. + public var activate: ((DropDown) -> Void)? -public var notifyFactory: ((DropDown, OpaquePointer) -> Void)? + public var notifyEnableSearch: ((DropDown, OpaquePointer) -> Void)? + public var notifyExpression: ((DropDown, OpaquePointer) -> Void)? -public var notifyHeaderFactory: ((DropDown, OpaquePointer) -> Void)? + public var notifyFactory: ((DropDown, OpaquePointer) -> Void)? + public var notifyHeaderFactory: ((DropDown, OpaquePointer) -> Void)? -public var notifyListFactory: ((DropDown, OpaquePointer) -> Void)? + public var notifyListFactory: ((DropDown, OpaquePointer) -> Void)? + public var notifyModel: ((DropDown, OpaquePointer) -> Void)? -public var notifyModel: ((DropDown, OpaquePointer) -> Void)? + public var notifySearchMatchMode: ((DropDown, OpaquePointer) -> Void)? + public var notifySelected: ((DropDown, OpaquePointer) -> Void)? -public var notifySearchMatchMode: ((DropDown, OpaquePointer) -> Void)? + public var notifySelectedItem: ((DropDown, OpaquePointer) -> Void)? - -public var notifySelected: ((DropDown, OpaquePointer) -> Void)? - - -public var notifySelectedItem: ((DropDown, OpaquePointer) -> Void)? - - -public var notifyShowArrow: ((DropDown, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyShowArrow: ((DropDown, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/Editable.swift b/Sources/Gtk/Generated/Editable.swift index b36043e6ab..7f75a1573c 100644 --- a/Sources/Gtk/Generated/Editable.swift +++ b/Sources/Gtk/Generated/Editable.swift @@ -1,22 +1,22 @@ import CGtk /// Interface for single-line text editing widgets. -/// +/// /// Typical examples of editable widgets are [class@Gtk.Entry] and /// [class@Gtk.SpinButton]. It contains functions for generically manipulating /// an editable widget, a large number of action signals used for key bindings, /// and several signals that an application can connect to modify the behavior /// of a widget. -/// +/// /// As an example of the latter usage, by connecting the following handler to /// [signal@Gtk.Editable::insert-text], an application can convert all entry /// into a widget into uppercase. -/// +/// /// ## Forcing entry to uppercase. -/// +/// /// ```c /// #include -/// +/// /// void /// insert_text_handler (GtkEditable *editable, /// const char *text, @@ -25,29 +25,29 @@ import CGtk /// gpointer data) /// { /// char *result = g_utf8_strup (text, length); -/// +/// /// g_signal_handlers_block_by_func (editable, /// (gpointer) insert_text_handler, data); /// gtk_editable_insert_text (editable, result, length, position); /// g_signal_handlers_unblock_by_func (editable, /// (gpointer) insert_text_handler, data); -/// +/// /// g_signal_stop_emission_by_name (editable, "insert_text"); -/// +/// /// g_free (result); /// } /// ``` -/// +/// /// ## Implementing GtkEditable -/// +/// /// The most likely scenario for implementing `GtkEditable` on your own widget /// is that you will embed a `GtkText` inside a complex widget, and want to /// delegate the editable functionality to that text widget. `GtkEditable` /// provides some utility functions to make this easy. -/// +/// /// In your class_init function, call [func@Gtk.Editable.install_properties], /// passing the first available property ID: -/// +/// /// ```c /// static void /// my_class_init (MyClass *class) @@ -58,31 +58,31 @@ import CGtk /// ... /// } /// ``` -/// +/// /// In your interface_init function for the `GtkEditable` interface, provide /// an implementation for the get_delegate vfunc that returns your text widget: -/// +/// /// ```c /// GtkEditable * /// get_editable_delegate (GtkEditable *editable) /// { /// return GTK_EDITABLE (MY_WIDGET (editable)->text_widget); /// } -/// +/// /// static void /// my_editable_init (GtkEditableInterface *iface) /// { /// iface->get_delegate = get_editable_delegate; /// } /// ``` -/// +/// /// You don't need to provide any other vfuncs. The default implementations /// work by forwarding to the delegate that the GtkEditableInterface.get_delegate() /// vfunc returns. -/// +/// /// In your instance_init function, create your text widget, and then call /// [method@Gtk.Editable.init_delegate]: -/// +/// /// ```c /// static void /// my_widget_init (MyWidget *self) @@ -93,10 +93,10 @@ import CGtk /// ... /// } /// ``` -/// +/// /// In your dispose function, call [method@Gtk.Editable.finish_delegate] before /// destroying your text widget: -/// +/// /// ```c /// static void /// my_widget_dispose (GObject *object) @@ -107,19 +107,19 @@ import CGtk /// ... /// } /// ``` -/// +/// /// Finally, use [func@Gtk.Editable.delegate_set_property] in your `set_property` /// function (and similar for `get_property`), to set the editable properties: -/// +/// /// ```c /// ... /// if (gtk_editable_delegate_set_property (object, prop_id, value, pspec)) /// return; -/// +/// /// switch (prop_id) /// ... /// ``` -/// +/// /// It is important to note that if you create a `GtkEditable` that uses /// a delegate, the low level [signal@Gtk.Editable::insert-text] and /// [signal@Gtk.Editable::delete-text] signals will be propagated from the @@ -130,54 +130,54 @@ import CGtk /// to them on the delegate obtained via [method@Gtk.Editable.get_delegate]. public protocol Editable: GObjectRepresentable { /// The current position of the insertion cursor in chars. -var cursorPosition: Int { get set } + var cursorPosition: Int { get set } -/// Whether the entry contents can be edited. -var editable: Bool { get set } + /// Whether the entry contents can be edited. + var editable: Bool { get set } -/// If undo/redo should be enabled for the editable. -var enableUndo: Bool { get set } + /// If undo/redo should be enabled for the editable. + var enableUndo: Bool { get set } -/// The desired maximum width of the entry, in characters. -var maxWidthChars: Int { get set } + /// The desired maximum width of the entry, in characters. + var maxWidthChars: Int { get set } -/// The contents of the entry. -var text: String { get set } + /// The contents of the entry. + var text: String { get set } -/// Number of characters to leave space for in the entry. -var widthChars: Int { get set } + /// Number of characters to leave space for in the entry. + var widthChars: Int { get set } -/// The horizontal alignment, from 0 (left) to 1 (right). -/// -/// Reversed for RTL layouts. -var xalign: Float { get set } + /// The horizontal alignment, from 0 (left) to 1 (right). + /// + /// Reversed for RTL layouts. + var xalign: Float { get set } /// Emitted at the end of a single user-visible operation on the -/// contents. -/// -/// E.g., a paste operation that replaces the contents of the -/// selection will cause only one signal emission (even though it -/// is implemented by first deleting the selection, then inserting -/// the new content, and may cause multiple ::notify::text signals -/// to be emitted). -var changed: ((Self) -> Void)? { get set } + /// contents. + /// + /// E.g., a paste operation that replaces the contents of the + /// selection will cause only one signal emission (even though it + /// is implemented by first deleting the selection, then inserting + /// the new content, and may cause multiple ::notify::text signals + /// to be emitted). + var changed: ((Self) -> Void)? { get set } -/// Emitted when text is deleted from the widget by the user. -/// -/// The default handler for this signal will normally be responsible for -/// deleting the text, so by connecting to this signal and then stopping -/// the signal with g_signal_stop_emission(), it is possible to modify the -/// range of deleted text, or prevent it from being deleted entirely. -/// -/// The @start_pos and @end_pos parameters are interpreted as for -/// [method@Gtk.Editable.delete_text]. -var deleteText: ((Self, Int, Int) -> Void)? { get set } + /// Emitted when text is deleted from the widget by the user. + /// + /// The default handler for this signal will normally be responsible for + /// deleting the text, so by connecting to this signal and then stopping + /// the signal with g_signal_stop_emission(), it is possible to modify the + /// range of deleted text, or prevent it from being deleted entirely. + /// + /// The @start_pos and @end_pos parameters are interpreted as for + /// [method@Gtk.Editable.delete_text]. + var deleteText: ((Self, Int, Int) -> Void)? { get set } -/// Emitted when text is inserted into the widget by the user. -/// -/// The default handler for this signal will normally be responsible -/// for inserting the text, so by connecting to this signal and then -/// stopping the signal with g_signal_stop_emission(), it is possible -/// to modify the inserted text, or prevent it from being inserted entirely. -var insertText: ((Self, UnsafePointer, Int, gpointer) -> Void)? { get set } -} \ No newline at end of file + /// Emitted when text is inserted into the widget by the user. + /// + /// The default handler for this signal will normally be responsible + /// for inserting the text, so by connecting to this signal and then + /// stopping the signal with g_signal_stop_emission(), it is possible + /// to modify the inserted text, or prevent it from being inserted entirely. + var insertText: ((Self, UnsafePointer, Int, gpointer) -> Void)? { get set } +} diff --git a/Sources/Gtk/Generated/EditableProperties.swift b/Sources/Gtk/Generated/EditableProperties.swift index ac550444ea..99c51d3239 100644 --- a/Sources/Gtk/Generated/EditableProperties.swift +++ b/Sources/Gtk/Generated/EditableProperties.swift @@ -1,55 +1,55 @@ import CGtk /// The identifiers for [iface@Gtk.Editable] properties. -/// +/// /// See [func@Gtk.Editable.install_properties] for details on how to /// implement the `GtkEditable` interface. public enum EditableProperties: GValueRepresentableEnum { public typealias GtkEnum = GtkEditableProperties /// The property id for [property@Gtk.Editable:text] -case propText -/// The property id for [property@Gtk.Editable:cursor-position] -case propCursorPosition -/// The property id for [property@Gtk.Editable:selection-bound] -case propSelectionBound -/// The property id for [property@Gtk.Editable:editable] -case propEditable -/// The property id for [property@Gtk.Editable:width-chars] -case propWidthChars -/// The property id for [property@Gtk.Editable:max-width-chars] -case propMaxWidthChars -/// The property id for [property@Gtk.Editable:xalign] -case propXalign -/// The property id for [property@Gtk.Editable:enable-undo] -case propEnableUndo -/// The number of properties -case numProperties + case propText + /// The property id for [property@Gtk.Editable:cursor-position] + case propCursorPosition + /// The property id for [property@Gtk.Editable:selection-bound] + case propSelectionBound + /// The property id for [property@Gtk.Editable:editable] + case propEditable + /// The property id for [property@Gtk.Editable:width-chars] + case propWidthChars + /// The property id for [property@Gtk.Editable:max-width-chars] + case propMaxWidthChars + /// The property id for [property@Gtk.Editable:xalign] + case propXalign + /// The property id for [property@Gtk.Editable:enable-undo] + case propEnableUndo + /// The number of properties + case numProperties public static var type: GType { - gtk_editable_properties_get_type() -} + gtk_editable_properties_get_type() + } public init(from gtkEnum: GtkEditableProperties) { switch gtkEnum { case GTK_EDITABLE_PROP_TEXT: - self = .propText -case GTK_EDITABLE_PROP_CURSOR_POSITION: - self = .propCursorPosition -case GTK_EDITABLE_PROP_SELECTION_BOUND: - self = .propSelectionBound -case GTK_EDITABLE_PROP_EDITABLE: - self = .propEditable -case GTK_EDITABLE_PROP_WIDTH_CHARS: - self = .propWidthChars -case GTK_EDITABLE_PROP_MAX_WIDTH_CHARS: - self = .propMaxWidthChars -case GTK_EDITABLE_PROP_XALIGN: - self = .propXalign -case GTK_EDITABLE_PROP_ENABLE_UNDO: - self = .propEnableUndo -case GTK_EDITABLE_NUM_PROPERTIES: - self = .numProperties + self = .propText + case GTK_EDITABLE_PROP_CURSOR_POSITION: + self = .propCursorPosition + case GTK_EDITABLE_PROP_SELECTION_BOUND: + self = .propSelectionBound + case GTK_EDITABLE_PROP_EDITABLE: + self = .propEditable + case GTK_EDITABLE_PROP_WIDTH_CHARS: + self = .propWidthChars + case GTK_EDITABLE_PROP_MAX_WIDTH_CHARS: + self = .propMaxWidthChars + case GTK_EDITABLE_PROP_XALIGN: + self = .propXalign + case GTK_EDITABLE_PROP_ENABLE_UNDO: + self = .propEnableUndo + case GTK_EDITABLE_NUM_PROPERTIES: + self = .numProperties default: fatalError("Unsupported GtkEditableProperties enum value: \(gtkEnum.rawValue)") } @@ -58,23 +58,23 @@ case GTK_EDITABLE_NUM_PROPERTIES: public func toGtk() -> GtkEditableProperties { switch self { case .propText: - return GTK_EDITABLE_PROP_TEXT -case .propCursorPosition: - return GTK_EDITABLE_PROP_CURSOR_POSITION -case .propSelectionBound: - return GTK_EDITABLE_PROP_SELECTION_BOUND -case .propEditable: - return GTK_EDITABLE_PROP_EDITABLE -case .propWidthChars: - return GTK_EDITABLE_PROP_WIDTH_CHARS -case .propMaxWidthChars: - return GTK_EDITABLE_PROP_MAX_WIDTH_CHARS -case .propXalign: - return GTK_EDITABLE_PROP_XALIGN -case .propEnableUndo: - return GTK_EDITABLE_PROP_ENABLE_UNDO -case .numProperties: - return GTK_EDITABLE_NUM_PROPERTIES + return GTK_EDITABLE_PROP_TEXT + case .propCursorPosition: + return GTK_EDITABLE_PROP_CURSOR_POSITION + case .propSelectionBound: + return GTK_EDITABLE_PROP_SELECTION_BOUND + case .propEditable: + return GTK_EDITABLE_PROP_EDITABLE + case .propWidthChars: + return GTK_EDITABLE_PROP_WIDTH_CHARS + case .propMaxWidthChars: + return GTK_EDITABLE_PROP_MAX_WIDTH_CHARS + case .propXalign: + return GTK_EDITABLE_PROP_XALIGN + case .propEnableUndo: + return GTK_EDITABLE_PROP_ENABLE_UNDO + case .numProperties: + return GTK_EDITABLE_NUM_PROPERTIES } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Entry.swift b/Sources/Gtk/Generated/Entry.swift index 8a3d9764b7..26b74f887b 100644 --- a/Sources/Gtk/Generated/Entry.swift +++ b/Sources/Gtk/Generated/Entry.swift @@ -1,25 +1,25 @@ import CGtk /// A single-line text entry widget. -/// +/// /// An example GtkEntry -/// +/// /// A fairly large set of key bindings are supported by default. If the /// entered text is longer than the allocation of the widget, the widget /// will scroll so that the cursor position is visible. -/// +/// /// When using an entry for passwords and other sensitive information, it /// can be put into “password mode” using [method@Gtk.Entry.set_visibility]. /// In this mode, entered text is displayed using a “invisible” character. /// By default, GTK picks the best invisible character that is available /// in the current font, but it can be changed with /// [method@Gtk.Entry.set_invisible_char]. -/// +/// /// `GtkEntry` has the ability to display progress or activity /// information behind the text. To make an entry display such information, /// use [method@Gtk.Entry.set_progress_fraction] or /// [method@Gtk.Entry.set_progress_pulse_step]. -/// +/// /// Additionally, `GtkEntry` can show icons at either side of the entry. /// These icons can be activatable by clicking, can be set up as drag source /// and can have tooltips. To add an icon, use @@ -30,15 +30,15 @@ import CGtk /// [method@Gtk.Entry.set_icon_drag_source]. To set a tooltip on an icon, use /// [method@Gtk.Entry.set_icon_tooltip_text] or the corresponding function /// for markup. -/// +/// /// Note that functionality or information that is only available by clicking /// on an icon in an entry may not be accessible at all to users which are not /// able to use a mouse or other pointing device. It is therefore recommended /// that any such functionality should also be available by other means, e.g. /// via the context menu of the entry. -/// +/// /// # CSS nodes -/// +/// /// ``` /// entry[.flat][.warning][.error] /// ├── text[.readonly] @@ -46,904 +46,968 @@ import CGtk /// ├── image.right /// ╰── [progress[.pulse]] /// ``` -/// +/// /// `GtkEntry` has a main node with the name entry. Depending on the properties /// of the entry, the style classes .read-only and .flat may appear. The style /// classes .warning and .error may also be used with entries. -/// +/// /// When the entry shows icons, it adds subnodes with the name image and the /// style class .left or .right, depending on where the icon appears. -/// +/// /// When the entry shows progress, it adds a subnode with the name progress. /// The node has the style class .pulse when the shown progress is pulsing. -/// +/// /// For all the subnodes added to the text node in various situations, /// see [class@Gtk.Text]. -/// +/// /// # GtkEntry as GtkBuildable -/// +/// /// The `GtkEntry` implementation of the `GtkBuildable` interface supports a /// custom `` element, which supports any number of `` /// elements. The `` element has attributes named “name“, “value“, /// “start“ and “end“ and allows you to specify `PangoAttribute` values for /// this label. -/// +/// /// An example of a UI definition fragment specifying Pango attributes: /// ```xml /// /// ``` -/// +/// /// The start and end attributes specify the range of characters to which the /// Pango attribute applies. If start and end are not specified, the attribute /// is applied to the whole text. Note that specifying ranges does not make much /// sense with translatable attributes. Use markup embedded in the translatable /// content instead. -/// +/// /// # Accessibility -/// +/// /// `GtkEntry` uses the [enum@Gtk.AccessibleRole.text_box] role. open class Entry: Widget, CellEditable, Editable { /// Creates a new entry. -public convenience init() { - self.init( - gtk_entry_new() - ) -} - -/// Creates a new entry with the specified text buffer. -public convenience init(buffer: UnsafeMutablePointer!) { - self.init( - gtk_entry_new_with_buffer(buffer) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "icon-press", handler: gCallback(handler1)) { [weak self] (param0: GtkEntryIconPosition) in - guard let self = self else { return } - self.iconPress?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "icon-release", handler: gCallback(handler2)) { [weak self] (param0: GtkEntryIconPosition) in - guard let self = self else { return } - self.iconRelease?(self, param0) -} - -addSignal(name: "editing-done") { [weak self] () in - guard let self = self else { return } - self.editingDone?(self) -} - -addSignal(name: "remove-widget") { [weak self] () in - guard let self = self else { return } - self.removeWidget?(self) -} - -addSignal(name: "changed") { [weak self] () in - guard let self = self else { return } - self.changed?(self) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - -addSignal(name: "delete-text", handler: gCallback(handler6)) { [weak self] (param0: Int, param1: Int) in - guard let self = self else { return } - self.deleteText?(self, param0, param1) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, UnsafePointer, Int, gpointer, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, value3, data in - SignalBox3, Int, gpointer>.run(data, value1, value2, value3) - } - -addSignal(name: "insert-text", handler: gCallback(handler7)) { [weak self] (param0: UnsafePointer, param1: Int, param2: gpointer) in - guard let self = self else { return } - self.insertText?(self, param0, param1, param2) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::activates-default", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActivatesDefault?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::attributes", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAttributes?(self, param0) -} - -let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::buffer", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyBuffer?(self, param0) -} - -let handler11: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::completion", handler: gCallback(handler11)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCompletion?(self, param0) -} - -let handler12: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::enable-emoji-completion", handler: gCallback(handler12)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEnableEmojiCompletion?(self, param0) -} - -let handler13: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::extra-menu", handler: gCallback(handler13)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExtraMenu?(self, param0) -} - -let handler14: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::has-frame", handler: gCallback(handler14)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasFrame?(self, param0) -} - -let handler15: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::im-module", handler: gCallback(handler15)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyImModule?(self, param0) -} - -let handler16: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::input-hints", handler: gCallback(handler16)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInputHints?(self, param0) -} - -let handler17: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::input-purpose", handler: gCallback(handler17)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInputPurpose?(self, param0) -} - -let handler18: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::invisible-char", handler: gCallback(handler18)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInvisibleCharacter?(self, param0) -} - -let handler19: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::invisible-char-set", handler: gCallback(handler19)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInvisibleCharacterSet?(self, param0) -} - -let handler20: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::max-length", handler: gCallback(handler20)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMaxLength?(self, param0) -} - -let handler21: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::menu-entry-icon-primary-text", handler: gCallback(handler21)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMenuEntryIconPrimaryText?(self, param0) -} - -let handler22: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::menu-entry-icon-secondary-text", handler: gCallback(handler22)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMenuEntryIconSecondaryText?(self, param0) -} - -let handler23: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_entry_new() + ) + } + + /// Creates a new entry with the specified text buffer. + public convenience init(buffer: UnsafeMutablePointer!) { + self.init( + gtk_entry_new_with_buffer(buffer) + ) + } + + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, UnsafeMutableRawPointer) + -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "icon-press", handler: gCallback(handler1)) { + [weak self] (param0: GtkEntryIconPosition) in + guard let self = self else { return } + self.iconPress?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, UnsafeMutableRawPointer) + -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "icon-release", handler: gCallback(handler2)) { + [weak self] (param0: GtkEntryIconPosition) in + guard let self = self else { return } + self.iconRelease?(self, param0) + } + + addSignal(name: "editing-done") { [weak self] () in + guard let self = self else { return } + self.editingDone?(self) + } + + addSignal(name: "remove-widget") { [weak self] () in + guard let self = self else { return } + self.removeWidget?(self) + } + + addSignal(name: "changed") { [weak self] () in + guard let self = self else { return } + self.changed?(self) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "delete-text", handler: gCallback(handler6)) { + [weak self] (param0: Int, param1: Int) in + guard let self = self else { return } + self.deleteText?(self, param0, param1) + } + + let handler7: + @convention(c) ( + UnsafeMutableRawPointer, UnsafePointer, Int, gpointer, + UnsafeMutableRawPointer + ) -> Void = + { _, value1, value2, value3, data in + SignalBox3, Int, gpointer>.run( + data, value1, value2, value3) + } + + addSignal(name: "insert-text", handler: gCallback(handler7)) { + [weak self] (param0: UnsafePointer, param1: Int, param2: gpointer) in + guard let self = self else { return } + self.insertText?(self, param0, param1, param2) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::activates-default", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActivatesDefault?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::attributes", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAttributes?(self, param0) + } + + let handler10: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::buffer", handler: gCallback(handler10)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyBuffer?(self, param0) + } + + let handler11: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::completion", handler: gCallback(handler11)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCompletion?(self, param0) + } + + let handler12: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::enable-emoji-completion", handler: gCallback(handler12)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEnableEmojiCompletion?(self, param0) + } + + let handler13: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::extra-menu", handler: gCallback(handler13)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExtraMenu?(self, param0) + } + + let handler14: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::has-frame", handler: gCallback(handler14)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasFrame?(self, param0) + } + + let handler15: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::im-module", handler: gCallback(handler15)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyImModule?(self, param0) + } + + let handler16: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::input-hints", handler: gCallback(handler16)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInputHints?(self, param0) + } + + let handler17: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::input-purpose", handler: gCallback(handler17)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInputPurpose?(self, param0) + } + + let handler18: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::invisible-char", handler: gCallback(handler18)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInvisibleCharacter?(self, param0) + } + + let handler19: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::invisible-char-set", handler: gCallback(handler19)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInvisibleCharacterSet?(self, param0) + } + + let handler20: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::max-length", handler: gCallback(handler20)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMaxLength?(self, param0) + } + + let handler21: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::menu-entry-icon-primary-text", handler: gCallback(handler21)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMenuEntryIconPrimaryText?(self, param0) + } + + let handler22: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::menu-entry-icon-secondary-text", handler: gCallback(handler22)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMenuEntryIconSecondaryText?(self, param0) + } + + let handler23: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::overwrite-mode", handler: gCallback(handler23)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyOverwriteMode?(self, param0) + } + + let handler24: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::placeholder-text", handler: gCallback(handler24)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPlaceholderText?(self, param0) + } + + let handler25: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-activatable", handler: gCallback(handler25)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconActivatable?(self, param0) + } + + let handler26: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-gicon", handler: gCallback(handler26)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconGicon?(self, param0) + } + + let handler27: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-name", handler: gCallback(handler27)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconName?(self, param0) + } + + let handler28: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-paintable", handler: gCallback(handler28)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconPaintable?(self, param0) + } + + let handler29: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-sensitive", handler: gCallback(handler29)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconSensitive?(self, param0) + } + + let handler30: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-storage-type", handler: gCallback(handler30)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconStorageType?(self, param0) + } + + let handler31: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-tooltip-markup", handler: gCallback(handler31)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconTooltipMarkup?(self, param0) + } + + let handler32: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-tooltip-text", handler: gCallback(handler32)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconTooltipText?(self, param0) + } + + let handler33: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::progress-fraction", handler: gCallback(handler33)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyProgressFraction?(self, param0) + } + + let handler34: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::progress-pulse-step", handler: gCallback(handler34)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyProgressPulseStep?(self, param0) + } + + let handler35: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::scroll-offset", handler: gCallback(handler35)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyScrollOffset?(self, param0) + } + + let handler36: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-activatable", handler: gCallback(handler36)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconActivatable?(self, param0) + } + + let handler37: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-gicon", handler: gCallback(handler37)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconGicon?(self, param0) + } + + let handler38: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-name", handler: gCallback(handler38)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconName?(self, param0) + } + + let handler39: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-paintable", handler: gCallback(handler39)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconPaintable?(self, param0) + } + + let handler40: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-sensitive", handler: gCallback(handler40)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconSensitive?(self, param0) + } + + let handler41: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-storage-type", handler: gCallback(handler41)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconStorageType?(self, param0) + } + + let handler42: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-tooltip-markup", handler: gCallback(handler42)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconTooltipMarkup?(self, param0) + } + + let handler43: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-tooltip-text", handler: gCallback(handler43)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconTooltipText?(self, param0) + } + + let handler44: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::show-emoji-icon", handler: gCallback(handler44)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowEmojiIcon?(self, param0) + } + + let handler45: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::tabs", handler: gCallback(handler45)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTabs?(self, param0) + } + + let handler46: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::text-length", handler: gCallback(handler46)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTextLength?(self, param0) + } + + let handler47: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::truncate-multiline", handler: gCallback(handler47)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTruncateMultiline?(self, param0) + } + + let handler48: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::visibility", handler: gCallback(handler48)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyVisibility?(self, param0) + } + + let handler49: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::editing-canceled", handler: gCallback(handler49)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEditingCanceled?(self, param0) + } + + let handler50: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::cursor-position", handler: gCallback(handler50)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCursorPosition?(self, param0) + } + + let handler51: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::editable", handler: gCallback(handler51)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEditable?(self, param0) + } + + let handler52: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::enable-undo", handler: gCallback(handler52)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEnableUndo?(self, param0) + } + + let handler53: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::max-width-chars", handler: gCallback(handler53)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMaxWidthChars?(self, param0) + } + + let handler54: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::selection-bound", handler: gCallback(handler54)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectionBound?(self, param0) + } + + let handler55: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::text", handler: gCallback(handler55)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyText?(self, param0) + } + + let handler56: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::width-chars", handler: gCallback(handler56)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWidthChars?(self, param0) + } + + let handler57: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::xalign", handler: gCallback(handler57)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyXalign?(self, param0) + } } -addSignal(name: "notify::overwrite-mode", handler: gCallback(handler23)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyOverwriteMode?(self, param0) -} - -let handler24: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::placeholder-text", handler: gCallback(handler24)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPlaceholderText?(self, param0) -} - -let handler25: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-activatable", handler: gCallback(handler25)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconActivatable?(self, param0) -} - -let handler26: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-gicon", handler: gCallback(handler26)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconGicon?(self, param0) -} - -let handler27: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-name", handler: gCallback(handler27)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconName?(self, param0) -} - -let handler28: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-paintable", handler: gCallback(handler28)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconPaintable?(self, param0) -} - -let handler29: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-sensitive", handler: gCallback(handler29)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconSensitive?(self, param0) -} - -let handler30: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-storage-type", handler: gCallback(handler30)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconStorageType?(self, param0) -} - -let handler31: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-tooltip-markup", handler: gCallback(handler31)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconTooltipMarkup?(self, param0) -} - -let handler32: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-tooltip-text", handler: gCallback(handler32)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconTooltipText?(self, param0) -} - -let handler33: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::progress-fraction", handler: gCallback(handler33)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyProgressFraction?(self, param0) -} - -let handler34: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::progress-pulse-step", handler: gCallback(handler34)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyProgressPulseStep?(self, param0) -} - -let handler35: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::scroll-offset", handler: gCallback(handler35)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyScrollOffset?(self, param0) -} - -let handler36: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::secondary-icon-activatable", handler: gCallback(handler36)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconActivatable?(self, param0) -} - -let handler37: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::secondary-icon-gicon", handler: gCallback(handler37)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconGicon?(self, param0) -} - -let handler38: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::secondary-icon-name", handler: gCallback(handler38)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconName?(self, param0) -} - -let handler39: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::secondary-icon-paintable", handler: gCallback(handler39)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconPaintable?(self, param0) -} - -let handler40: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::secondary-icon-sensitive", handler: gCallback(handler40)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconSensitive?(self, param0) -} - -let handler41: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::secondary-icon-storage-type", handler: gCallback(handler41)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconStorageType?(self, param0) -} - -let handler42: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::secondary-icon-tooltip-markup", handler: gCallback(handler42)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconTooltipMarkup?(self, param0) -} - -let handler43: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::secondary-icon-tooltip-text", handler: gCallback(handler43)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconTooltipText?(self, param0) -} - -let handler44: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::show-emoji-icon", handler: gCallback(handler44)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowEmojiIcon?(self, param0) -} - -let handler45: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::tabs", handler: gCallback(handler45)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTabs?(self, param0) -} - -let handler46: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::text-length", handler: gCallback(handler46)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTextLength?(self, param0) -} - -let handler47: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::truncate-multiline", handler: gCallback(handler47)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTruncateMultiline?(self, param0) -} - -let handler48: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::visibility", handler: gCallback(handler48)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyVisibility?(self, param0) -} - -let handler49: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::editing-canceled", handler: gCallback(handler49)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEditingCanceled?(self, param0) -} - -let handler50: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::cursor-position", handler: gCallback(handler50)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCursorPosition?(self, param0) -} - -let handler51: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::editable", handler: gCallback(handler51)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEditable?(self, param0) -} - -let handler52: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::enable-undo", handler: gCallback(handler52)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEnableUndo?(self, param0) -} - -let handler53: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::max-width-chars", handler: gCallback(handler53)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMaxWidthChars?(self, param0) -} - -let handler54: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::selection-bound", handler: gCallback(handler54)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectionBound?(self, param0) -} - -let handler55: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::text", handler: gCallback(handler55)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyText?(self, param0) -} - -let handler56: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::width-chars", handler: gCallback(handler56)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWidthChars?(self, param0) -} - -let handler57: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::xalign", handler: gCallback(handler57)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyXalign?(self, param0) -} -} - /// Whether to activate the default widget when Enter is pressed. -@GObjectProperty(named: "activates-default") public var activatesDefault: Bool - -/// Whether the entry should draw a frame. -@GObjectProperty(named: "has-frame") public var hasFrame: Bool - -/// The purpose of this text field. -/// -/// This property can be used by on-screen keyboards and other input -/// methods to adjust their behaviour. -/// -/// Note that setting the purpose to %GTK_INPUT_PURPOSE_PASSWORD or -/// %GTK_INPUT_PURPOSE_PIN is independent from setting -/// [property@Gtk.Entry:visibility]. -@GObjectProperty(named: "input-purpose") public var inputPurpose: InputPurpose - -/// The character to use when masking entry contents (“password mode”). -@GObjectProperty(named: "invisible-char") public var invisibleCharacter: UInt - -/// Maximum number of characters for this entry. -@GObjectProperty(named: "max-length") public var maxLength: Int - -/// If text is overwritten when typing in the `GtkEntry`. -@GObjectProperty(named: "overwrite-mode") public var overwriteMode: Bool - -/// The text that will be displayed in the `GtkEntry` when it is empty -/// and unfocused. -@GObjectProperty(named: "placeholder-text") public var placeholderText: String? - -/// The current fraction of the task that's been completed. -@GObjectProperty(named: "progress-fraction") public var progressFraction: Double - -/// The fraction of total entry width to move the progress -/// bouncing block for each pulse. -/// -/// See [method@Gtk.Entry.progress_pulse]. -@GObjectProperty(named: "progress-pulse-step") public var progressPulseStep: Double - -/// The length of the text in the `GtkEntry`. -@GObjectProperty(named: "text-length") public var textLength: UInt - -/// Whether the entry should show the “invisible char” instead of the -/// actual text (“password mode”). -@GObjectProperty(named: "visibility") public var visibility: Bool - -/// The current position of the insertion cursor in chars. -@GObjectProperty(named: "cursor-position") public var cursorPosition: Int - -/// Whether the entry contents can be edited. -@GObjectProperty(named: "editable") public var editable: Bool - -/// If undo/redo should be enabled for the editable. -@GObjectProperty(named: "enable-undo") public var enableUndo: Bool - -/// The desired maximum width of the entry, in characters. -@GObjectProperty(named: "max-width-chars") public var maxWidthChars: Int - -/// The contents of the entry. -@GObjectProperty(named: "text") public var text: String - -/// Number of characters to leave space for in the entry. -@GObjectProperty(named: "width-chars") public var widthChars: Int - -/// The horizontal alignment, from 0 (left) to 1 (right). -/// -/// Reversed for RTL layouts. -@GObjectProperty(named: "xalign") public var xalign: Float - -/// Emitted when the entry is activated. -/// -/// The keybindings for this signal are all forms of the Enter key. -public var activate: ((Entry) -> Void)? - -/// Emitted when an activatable icon is clicked. -public var iconPress: ((Entry, GtkEntryIconPosition) -> Void)? - -/// Emitted on the button release from a mouse click -/// over an activatable icon. -public var iconRelease: ((Entry, GtkEntryIconPosition) -> Void)? - -/// This signal is a sign for the cell renderer to update its -/// value from the @cell_editable. -/// -/// Implementations of `GtkCellEditable` are responsible for -/// emitting this signal when they are done editing, e.g. -/// `GtkEntry` emits this signal when the user presses Enter. Typical things to -/// do in a handler for ::editing-done are to capture the edited value, -/// disconnect the @cell_editable from signals on the `GtkCellRenderer`, etc. -/// -/// gtk_cell_editable_editing_done() is a convenience method -/// for emitting `GtkCellEditable::editing-done`. -public var editingDone: ((Entry) -> Void)? - -/// This signal is meant to indicate that the cell is finished -/// editing, and the @cell_editable widget is being removed and may -/// subsequently be destroyed. -/// -/// Implementations of `GtkCellEditable` are responsible for -/// emitting this signal when they are done editing. It must -/// be emitted after the `GtkCellEditable::editing-done` signal, -/// to give the cell renderer a chance to update the cell's value -/// before the widget is removed. -/// -/// gtk_cell_editable_remove_widget() is a convenience method -/// for emitting `GtkCellEditable::remove-widget`. -public var removeWidget: ((Entry) -> Void)? - -/// Emitted at the end of a single user-visible operation on the -/// contents. -/// -/// E.g., a paste operation that replaces the contents of the -/// selection will cause only one signal emission (even though it -/// is implemented by first deleting the selection, then inserting -/// the new content, and may cause multiple ::notify::text signals -/// to be emitted). -public var changed: ((Entry) -> Void)? - -/// Emitted when text is deleted from the widget by the user. -/// -/// The default handler for this signal will normally be responsible for -/// deleting the text, so by connecting to this signal and then stopping -/// the signal with g_signal_stop_emission(), it is possible to modify the -/// range of deleted text, or prevent it from being deleted entirely. -/// -/// The @start_pos and @end_pos parameters are interpreted as for -/// [method@Gtk.Editable.delete_text]. -public var deleteText: ((Entry, Int, Int) -> Void)? - -/// Emitted when text is inserted into the widget by the user. -/// -/// The default handler for this signal will normally be responsible -/// for inserting the text, so by connecting to this signal and then -/// stopping the signal with g_signal_stop_emission(), it is possible -/// to modify the inserted text, or prevent it from being inserted entirely. -public var insertText: ((Entry, UnsafePointer, Int, gpointer) -> Void)? - - -public var notifyActivatesDefault: ((Entry, OpaquePointer) -> Void)? - - -public var notifyAttributes: ((Entry, OpaquePointer) -> Void)? - - -public var notifyBuffer: ((Entry, OpaquePointer) -> Void)? - - -public var notifyCompletion: ((Entry, OpaquePointer) -> Void)? + @GObjectProperty(named: "activates-default") public var activatesDefault: Bool + + /// Whether the entry should draw a frame. + @GObjectProperty(named: "has-frame") public var hasFrame: Bool + + /// The purpose of this text field. + /// + /// This property can be used by on-screen keyboards and other input + /// methods to adjust their behaviour. + /// + /// Note that setting the purpose to %GTK_INPUT_PURPOSE_PASSWORD or + /// %GTK_INPUT_PURPOSE_PIN is independent from setting + /// [property@Gtk.Entry:visibility]. + @GObjectProperty(named: "input-purpose") public var inputPurpose: InputPurpose + + /// The character to use when masking entry contents (“password mode”). + @GObjectProperty(named: "invisible-char") public var invisibleCharacter: UInt + + /// Maximum number of characters for this entry. + @GObjectProperty(named: "max-length") public var maxLength: Int + + /// If text is overwritten when typing in the `GtkEntry`. + @GObjectProperty(named: "overwrite-mode") public var overwriteMode: Bool + + /// The text that will be displayed in the `GtkEntry` when it is empty + /// and unfocused. + @GObjectProperty(named: "placeholder-text") public var placeholderText: String? + + /// The current fraction of the task that's been completed. + @GObjectProperty(named: "progress-fraction") public var progressFraction: Double + + /// The fraction of total entry width to move the progress + /// bouncing block for each pulse. + /// + /// See [method@Gtk.Entry.progress_pulse]. + @GObjectProperty(named: "progress-pulse-step") public var progressPulseStep: Double + + /// The length of the text in the `GtkEntry`. + @GObjectProperty(named: "text-length") public var textLength: UInt + + /// Whether the entry should show the “invisible char” instead of the + /// actual text (“password mode”). + @GObjectProperty(named: "visibility") public var visibility: Bool + + /// The current position of the insertion cursor in chars. + @GObjectProperty(named: "cursor-position") public var cursorPosition: Int + + /// Whether the entry contents can be edited. + @GObjectProperty(named: "editable") public var editable: Bool + + /// If undo/redo should be enabled for the editable. + @GObjectProperty(named: "enable-undo") public var enableUndo: Bool + + /// The desired maximum width of the entry, in characters. + @GObjectProperty(named: "max-width-chars") public var maxWidthChars: Int + + /// The contents of the entry. + @GObjectProperty(named: "text") public var text: String + + /// Number of characters to leave space for in the entry. + @GObjectProperty(named: "width-chars") public var widthChars: Int + + /// The horizontal alignment, from 0 (left) to 1 (right). + /// + /// Reversed for RTL layouts. + @GObjectProperty(named: "xalign") public var xalign: Float + /// Emitted when the entry is activated. + /// + /// The keybindings for this signal are all forms of the Enter key. + public var activate: ((Entry) -> Void)? -public var notifyEnableEmojiCompletion: ((Entry, OpaquePointer) -> Void)? + /// Emitted when an activatable icon is clicked. + public var iconPress: ((Entry, GtkEntryIconPosition) -> Void)? + /// Emitted on the button release from a mouse click + /// over an activatable icon. + public var iconRelease: ((Entry, GtkEntryIconPosition) -> Void)? -public var notifyExtraMenu: ((Entry, OpaquePointer) -> Void)? + /// This signal is a sign for the cell renderer to update its + /// value from the @cell_editable. + /// + /// Implementations of `GtkCellEditable` are responsible for + /// emitting this signal when they are done editing, e.g. + /// `GtkEntry` emits this signal when the user presses Enter. Typical things to + /// do in a handler for ::editing-done are to capture the edited value, + /// disconnect the @cell_editable from signals on the `GtkCellRenderer`, etc. + /// + /// gtk_cell_editable_editing_done() is a convenience method + /// for emitting `GtkCellEditable::editing-done`. + public var editingDone: ((Entry) -> Void)? + /// This signal is meant to indicate that the cell is finished + /// editing, and the @cell_editable widget is being removed and may + /// subsequently be destroyed. + /// + /// Implementations of `GtkCellEditable` are responsible for + /// emitting this signal when they are done editing. It must + /// be emitted after the `GtkCellEditable::editing-done` signal, + /// to give the cell renderer a chance to update the cell's value + /// before the widget is removed. + /// + /// gtk_cell_editable_remove_widget() is a convenience method + /// for emitting `GtkCellEditable::remove-widget`. + public var removeWidget: ((Entry) -> Void)? -public var notifyHasFrame: ((Entry, OpaquePointer) -> Void)? + /// Emitted at the end of a single user-visible operation on the + /// contents. + /// + /// E.g., a paste operation that replaces the contents of the + /// selection will cause only one signal emission (even though it + /// is implemented by first deleting the selection, then inserting + /// the new content, and may cause multiple ::notify::text signals + /// to be emitted). + public var changed: ((Entry) -> Void)? + /// Emitted when text is deleted from the widget by the user. + /// + /// The default handler for this signal will normally be responsible for + /// deleting the text, so by connecting to this signal and then stopping + /// the signal with g_signal_stop_emission(), it is possible to modify the + /// range of deleted text, or prevent it from being deleted entirely. + /// + /// The @start_pos and @end_pos parameters are interpreted as for + /// [method@Gtk.Editable.delete_text]. + public var deleteText: ((Entry, Int, Int) -> Void)? -public var notifyImModule: ((Entry, OpaquePointer) -> Void)? + /// Emitted when text is inserted into the widget by the user. + /// + /// The default handler for this signal will normally be responsible + /// for inserting the text, so by connecting to this signal and then + /// stopping the signal with g_signal_stop_emission(), it is possible + /// to modify the inserted text, or prevent it from being inserted entirely. + public var insertText: ((Entry, UnsafePointer, Int, gpointer) -> Void)? + public var notifyActivatesDefault: ((Entry, OpaquePointer) -> Void)? -public var notifyInputHints: ((Entry, OpaquePointer) -> Void)? + public var notifyAttributes: ((Entry, OpaquePointer) -> Void)? + public var notifyBuffer: ((Entry, OpaquePointer) -> Void)? -public var notifyInputPurpose: ((Entry, OpaquePointer) -> Void)? + public var notifyCompletion: ((Entry, OpaquePointer) -> Void)? + public var notifyEnableEmojiCompletion: ((Entry, OpaquePointer) -> Void)? -public var notifyInvisibleCharacter: ((Entry, OpaquePointer) -> Void)? + public var notifyExtraMenu: ((Entry, OpaquePointer) -> Void)? + public var notifyHasFrame: ((Entry, OpaquePointer) -> Void)? -public var notifyInvisibleCharacterSet: ((Entry, OpaquePointer) -> Void)? + public var notifyImModule: ((Entry, OpaquePointer) -> Void)? + public var notifyInputHints: ((Entry, OpaquePointer) -> Void)? -public var notifyMaxLength: ((Entry, OpaquePointer) -> Void)? + public var notifyInputPurpose: ((Entry, OpaquePointer) -> Void)? + public var notifyInvisibleCharacter: ((Entry, OpaquePointer) -> Void)? -public var notifyMenuEntryIconPrimaryText: ((Entry, OpaquePointer) -> Void)? + public var notifyInvisibleCharacterSet: ((Entry, OpaquePointer) -> Void)? + public var notifyMaxLength: ((Entry, OpaquePointer) -> Void)? -public var notifyMenuEntryIconSecondaryText: ((Entry, OpaquePointer) -> Void)? + public var notifyMenuEntryIconPrimaryText: ((Entry, OpaquePointer) -> Void)? + public var notifyMenuEntryIconSecondaryText: ((Entry, OpaquePointer) -> Void)? -public var notifyOverwriteMode: ((Entry, OpaquePointer) -> Void)? + public var notifyOverwriteMode: ((Entry, OpaquePointer) -> Void)? + public var notifyPlaceholderText: ((Entry, OpaquePointer) -> Void)? -public var notifyPlaceholderText: ((Entry, OpaquePointer) -> Void)? + public var notifyPrimaryIconActivatable: ((Entry, OpaquePointer) -> Void)? + public var notifyPrimaryIconGicon: ((Entry, OpaquePointer) -> Void)? -public var notifyPrimaryIconActivatable: ((Entry, OpaquePointer) -> Void)? + public var notifyPrimaryIconName: ((Entry, OpaquePointer) -> Void)? + public var notifyPrimaryIconPaintable: ((Entry, OpaquePointer) -> Void)? -public var notifyPrimaryIconGicon: ((Entry, OpaquePointer) -> Void)? + public var notifyPrimaryIconSensitive: ((Entry, OpaquePointer) -> Void)? + public var notifyPrimaryIconStorageType: ((Entry, OpaquePointer) -> Void)? -public var notifyPrimaryIconName: ((Entry, OpaquePointer) -> Void)? + public var notifyPrimaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? + public var notifyPrimaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? -public var notifyPrimaryIconPaintable: ((Entry, OpaquePointer) -> Void)? + public var notifyProgressFraction: ((Entry, OpaquePointer) -> Void)? + public var notifyProgressPulseStep: ((Entry, OpaquePointer) -> Void)? -public var notifyPrimaryIconSensitive: ((Entry, OpaquePointer) -> Void)? + public var notifyScrollOffset: ((Entry, OpaquePointer) -> Void)? + public var notifySecondaryIconActivatable: ((Entry, OpaquePointer) -> Void)? -public var notifyPrimaryIconStorageType: ((Entry, OpaquePointer) -> Void)? + public var notifySecondaryIconGicon: ((Entry, OpaquePointer) -> Void)? + public var notifySecondaryIconName: ((Entry, OpaquePointer) -> Void)? -public var notifyPrimaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? + public var notifySecondaryIconPaintable: ((Entry, OpaquePointer) -> Void)? + public var notifySecondaryIconSensitive: ((Entry, OpaquePointer) -> Void)? -public var notifyPrimaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? + public var notifySecondaryIconStorageType: ((Entry, OpaquePointer) -> Void)? + public var notifySecondaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? -public var notifyProgressFraction: ((Entry, OpaquePointer) -> Void)? + public var notifySecondaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? + public var notifyShowEmojiIcon: ((Entry, OpaquePointer) -> Void)? -public var notifyProgressPulseStep: ((Entry, OpaquePointer) -> Void)? + public var notifyTabs: ((Entry, OpaquePointer) -> Void)? + public var notifyTextLength: ((Entry, OpaquePointer) -> Void)? -public var notifyScrollOffset: ((Entry, OpaquePointer) -> Void)? + public var notifyTruncateMultiline: ((Entry, OpaquePointer) -> Void)? + public var notifyVisibility: ((Entry, OpaquePointer) -> Void)? -public var notifySecondaryIconActivatable: ((Entry, OpaquePointer) -> Void)? + public var notifyEditingCanceled: ((Entry, OpaquePointer) -> Void)? + public var notifyCursorPosition: ((Entry, OpaquePointer) -> Void)? -public var notifySecondaryIconGicon: ((Entry, OpaquePointer) -> Void)? + public var notifyEditable: ((Entry, OpaquePointer) -> Void)? + public var notifyEnableUndo: ((Entry, OpaquePointer) -> Void)? -public var notifySecondaryIconName: ((Entry, OpaquePointer) -> Void)? + public var notifyMaxWidthChars: ((Entry, OpaquePointer) -> Void)? + public var notifySelectionBound: ((Entry, OpaquePointer) -> Void)? -public var notifySecondaryIconPaintable: ((Entry, OpaquePointer) -> Void)? + public var notifyText: ((Entry, OpaquePointer) -> Void)? + public var notifyWidthChars: ((Entry, OpaquePointer) -> Void)? -public var notifySecondaryIconSensitive: ((Entry, OpaquePointer) -> Void)? - - -public var notifySecondaryIconStorageType: ((Entry, OpaquePointer) -> Void)? - - -public var notifySecondaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? - - -public var notifySecondaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? - - -public var notifyShowEmojiIcon: ((Entry, OpaquePointer) -> Void)? - - -public var notifyTabs: ((Entry, OpaquePointer) -> Void)? - - -public var notifyTextLength: ((Entry, OpaquePointer) -> Void)? - - -public var notifyTruncateMultiline: ((Entry, OpaquePointer) -> Void)? - - -public var notifyVisibility: ((Entry, OpaquePointer) -> Void)? - - -public var notifyEditingCanceled: ((Entry, OpaquePointer) -> Void)? - - -public var notifyCursorPosition: ((Entry, OpaquePointer) -> Void)? - - -public var notifyEditable: ((Entry, OpaquePointer) -> Void)? - - -public var notifyEnableUndo: ((Entry, OpaquePointer) -> Void)? - - -public var notifyMaxWidthChars: ((Entry, OpaquePointer) -> Void)? - - -public var notifySelectionBound: ((Entry, OpaquePointer) -> Void)? - - -public var notifyText: ((Entry, OpaquePointer) -> Void)? - - -public var notifyWidthChars: ((Entry, OpaquePointer) -> Void)? - - -public var notifyXalign: ((Entry, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyXalign: ((Entry, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/EntryIconPosition.swift b/Sources/Gtk/Generated/EntryIconPosition.swift index 9528a4e836..6ef056f05c 100644 --- a/Sources/Gtk/Generated/EntryIconPosition.swift +++ b/Sources/Gtk/Generated/EntryIconPosition.swift @@ -5,20 +5,20 @@ public enum EntryIconPosition: GValueRepresentableEnum { public typealias GtkEnum = GtkEntryIconPosition /// At the beginning of the entry (depending on the text direction). -case primary -/// At the end of the entry (depending on the text direction). -case secondary + case primary + /// At the end of the entry (depending on the text direction). + case secondary public static var type: GType { - gtk_entry_icon_position_get_type() -} + gtk_entry_icon_position_get_type() + } public init(from gtkEnum: GtkEntryIconPosition) { switch gtkEnum { case GTK_ENTRY_ICON_PRIMARY: - self = .primary -case GTK_ENTRY_ICON_SECONDARY: - self = .secondary + self = .primary + case GTK_ENTRY_ICON_SECONDARY: + self = .secondary default: fatalError("Unsupported GtkEntryIconPosition enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ case GTK_ENTRY_ICON_SECONDARY: public func toGtk() -> GtkEntryIconPosition { switch self { case .primary: - return GTK_ENTRY_ICON_PRIMARY -case .secondary: - return GTK_ENTRY_ICON_SECONDARY + return GTK_ENTRY_ICON_PRIMARY + case .secondary: + return GTK_ENTRY_ICON_SECONDARY } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/EventController.swift b/Sources/Gtk/Generated/EventController.swift index 6842e79b31..c29ce1254a 100644 --- a/Sources/Gtk/Generated/EventController.swift +++ b/Sources/Gtk/Generated/EventController.swift @@ -1,82 +1,85 @@ import CGtk /// The base class for event controllers. -/// +/// /// These are ancillary objects associated to widgets, which react /// to `GdkEvents`, and possibly trigger actions as a consequence. -/// +/// /// Event controllers are added to a widget with /// [method@Gtk.Widget.add_controller]. It is rarely necessary to /// explicitly remove a controller with [method@Gtk.Widget.remove_controller]. -/// +/// /// See the chapter on [input handling](input-handling.html) for /// an overview of the basic concepts, such as the capture and bubble /// phases of event propagation. open class EventController: GObject { - public override func registerSignals() { - super.registerSignals() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::name", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyName?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + super.registerSignals() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::name", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyName?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::propagation-limit", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPropagationLimit?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::propagation-phase", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPropagationPhase?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::widget", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWidget?(self, param0) + } } -addSignal(name: "notify::propagation-limit", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPropagationLimit?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::propagation-phase", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPropagationPhase?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::widget", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWidget?(self, param0) -} -} - /// The name for this controller, typically used for debugging purposes. -@GObjectProperty(named: "name") public var name: String? + @GObjectProperty(named: "name") public var name: String? -/// The limit for which events this controller will handle. -@GObjectProperty(named: "propagation-limit") public var propagationLimit: PropagationLimit + /// The limit for which events this controller will handle. + @GObjectProperty(named: "propagation-limit") public var propagationLimit: PropagationLimit -/// The propagation phase at which this controller will handle events. -@GObjectProperty(named: "propagation-phase") public var propagationPhase: PropagationPhase + /// The propagation phase at which this controller will handle events. + @GObjectProperty(named: "propagation-phase") public var propagationPhase: PropagationPhase + public var notifyName: ((EventController, OpaquePointer) -> Void)? -public var notifyName: ((EventController, OpaquePointer) -> Void)? + public var notifyPropagationLimit: ((EventController, OpaquePointer) -> Void)? + public var notifyPropagationPhase: ((EventController, OpaquePointer) -> Void)? -public var notifyPropagationLimit: ((EventController, OpaquePointer) -> Void)? - - -public var notifyPropagationPhase: ((EventController, OpaquePointer) -> Void)? - - -public var notifyWidget: ((EventController, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyWidget: ((EventController, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/EventControllerMotion.swift b/Sources/Gtk/Generated/EventControllerMotion.swift index 9310628743..152ca94e59 100644 --- a/Sources/Gtk/Generated/EventControllerMotion.swift +++ b/Sources/Gtk/Generated/EventControllerMotion.swift @@ -1,7 +1,7 @@ import CGtk /// Tracks the pointer position. -/// +/// /// The event controller offers [signal@Gtk.EventControllerMotion::enter] /// and [signal@Gtk.EventControllerMotion::leave] signals, as well as /// [property@Gtk.EventControllerMotion:is-pointer] and @@ -10,92 +10,100 @@ import CGtk /// moves over the widget. open class EventControllerMotion: EventController { /// Creates a new event controller that will handle motion events. -public convenience init() { - self.init( - gtk_event_controller_motion_new() - ) -} - - public override func registerSignals() { - super.registerSignals() - - let handler0: @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) + public convenience init() { + self.init( + gtk_event_controller_motion_new() + ) } -addSignal(name: "enter", handler: gCallback(handler0)) { [weak self] (param0: Double, param1: Double) in - guard let self = self else { return } - self.enter?(self, param0, param1) -} - -addSignal(name: "leave") { [weak self] () in - guard let self = self else { return } - self.leave?(self) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - -addSignal(name: "motion", handler: gCallback(handler2)) { [weak self] (param0: Double, param1: Double) in - guard let self = self else { return } - self.motion?(self, param0, param1) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::contains-pointer", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContainsPointer?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public override func registerSignals() { + super.registerSignals() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> + Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "enter", handler: gCallback(handler0)) { + [weak self] (param0: Double, param1: Double) in + guard let self = self else { return } + self.enter?(self, param0, param1) + } + + addSignal(name: "leave") { [weak self] () in + guard let self = self else { return } + self.leave?(self) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> + Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "motion", handler: gCallback(handler2)) { + [weak self] (param0: Double, param1: Double) in + guard let self = self else { return } + self.motion?(self, param0, param1) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::contains-pointer", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContainsPointer?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::is-pointer", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIsPointer?(self, param0) + } } -addSignal(name: "notify::is-pointer", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIsPointer?(self, param0) -} -} - /// Whether the pointer is in the controllers widget or a descendant. -/// -/// See also [property@Gtk.EventControllerMotion:is-pointer]. -/// -/// When handling crossing events, this property is updated -/// before [signal@Gtk.EventControllerMotion::enter], but after -/// [signal@Gtk.EventControllerMotion::leave] is emitted. -@GObjectProperty(named: "contains-pointer") public var containsPointer: Bool - -/// Whether the pointer is in the controllers widget itself, -/// as opposed to in a descendent widget. -/// -/// See also [property@Gtk.EventControllerMotion:contains-pointer]. -/// -/// When handling crossing events, this property is updated -/// before [signal@Gtk.EventControllerMotion::enter], but after -/// [signal@Gtk.EventControllerMotion::leave] is emitted. -@GObjectProperty(named: "is-pointer") public var isPointer: Bool - -/// Signals that the pointer has entered the widget. -public var enter: ((EventControllerMotion, Double, Double) -> Void)? - -/// Signals that the pointer has left the widget. -public var leave: ((EventControllerMotion) -> Void)? - -/// Emitted when the pointer moves inside the widget. -public var motion: ((EventControllerMotion, Double, Double) -> Void)? - - -public var notifyContainsPointer: ((EventControllerMotion, OpaquePointer) -> Void)? - - -public var notifyIsPointer: ((EventControllerMotion, OpaquePointer) -> Void)? -} \ No newline at end of file + /// + /// See also [property@Gtk.EventControllerMotion:is-pointer]. + /// + /// When handling crossing events, this property is updated + /// before [signal@Gtk.EventControllerMotion::enter], but after + /// [signal@Gtk.EventControllerMotion::leave] is emitted. + @GObjectProperty(named: "contains-pointer") public var containsPointer: Bool + + /// Whether the pointer is in the controllers widget itself, + /// as opposed to in a descendent widget. + /// + /// See also [property@Gtk.EventControllerMotion:contains-pointer]. + /// + /// When handling crossing events, this property is updated + /// before [signal@Gtk.EventControllerMotion::enter], but after + /// [signal@Gtk.EventControllerMotion::leave] is emitted. + @GObjectProperty(named: "is-pointer") public var isPointer: Bool + + /// Signals that the pointer has entered the widget. + public var enter: ((EventControllerMotion, Double, Double) -> Void)? + + /// Signals that the pointer has left the widget. + public var leave: ((EventControllerMotion) -> Void)? + + /// Emitted when the pointer moves inside the widget. + public var motion: ((EventControllerMotion, Double, Double) -> Void)? + + public var notifyContainsPointer: ((EventControllerMotion, OpaquePointer) -> Void)? + + public var notifyIsPointer: ((EventControllerMotion, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/EventSequenceState.swift b/Sources/Gtk/Generated/EventSequenceState.swift index ca6ae3e2d7..d64e046cab 100644 --- a/Sources/Gtk/Generated/EventSequenceState.swift +++ b/Sources/Gtk/Generated/EventSequenceState.swift @@ -5,24 +5,24 @@ public enum EventSequenceState: GValueRepresentableEnum { public typealias GtkEnum = GtkEventSequenceState /// The sequence is handled, but not grabbed. -case none -/// The sequence is handled and grabbed. -case claimed -/// The sequence is denied. -case denied + case none + /// The sequence is handled and grabbed. + case claimed + /// The sequence is denied. + case denied public static var type: GType { - gtk_event_sequence_state_get_type() -} + gtk_event_sequence_state_get_type() + } public init(from gtkEnum: GtkEventSequenceState) { switch gtkEnum { case GTK_EVENT_SEQUENCE_NONE: - self = .none -case GTK_EVENT_SEQUENCE_CLAIMED: - self = .claimed -case GTK_EVENT_SEQUENCE_DENIED: - self = .denied + self = .none + case GTK_EVENT_SEQUENCE_CLAIMED: + self = .claimed + case GTK_EVENT_SEQUENCE_DENIED: + self = .denied default: fatalError("Unsupported GtkEventSequenceState enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ case GTK_EVENT_SEQUENCE_DENIED: public func toGtk() -> GtkEventSequenceState { switch self { case .none: - return GTK_EVENT_SEQUENCE_NONE -case .claimed: - return GTK_EVENT_SEQUENCE_CLAIMED -case .denied: - return GTK_EVENT_SEQUENCE_DENIED + return GTK_EVENT_SEQUENCE_NONE + case .claimed: + return GTK_EVENT_SEQUENCE_CLAIMED + case .denied: + return GTK_EVENT_SEQUENCE_DENIED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/FileChooser.swift b/Sources/Gtk/Generated/FileChooser.swift index ca019aca97..057280132d 100644 --- a/Sources/Gtk/Generated/FileChooser.swift +++ b/Sources/Gtk/Generated/FileChooser.swift @@ -2,37 +2,37 @@ import CGtk /// `GtkFileChooser` is an interface that can be implemented by file /// selection widgets. -/// +/// /// In GTK, the main objects that implement this interface are /// [class@Gtk.FileChooserWidget] and [class@Gtk.FileChooserDialog]. -/// +/// /// You do not need to write an object that implements the `GtkFileChooser` /// interface unless you are trying to adapt an existing file selector to /// expose a standard programming interface. -/// +/// /// `GtkFileChooser` allows for shortcuts to various places in the filesystem. /// In the default implementation these are displayed in the left pane. It /// may be a bit confusing at first that these shortcuts come from various /// sources and in various flavours, so lets explain the terminology here: -/// +/// /// - Bookmarks: are created by the user, by dragging folders from the /// right pane to the left pane, or by using the “Add”. Bookmarks /// can be renamed and deleted by the user. -/// +/// /// - Shortcuts: can be provided by the application. For example, a Paint /// program may want to add a shortcut for a Clipart folder. Shortcuts /// cannot be modified by the user. -/// +/// /// - Volumes: are provided by the underlying filesystem abstraction. They are /// the “roots” of the filesystem. -/// +/// /// # File Names and Encodings -/// +/// /// When the user is finished selecting files in a `GtkFileChooser`, your /// program can get the selected filenames as `GFile`s. -/// +/// /// # Adding options -/// +/// /// You can add extra widgets to a file chooser to provide options /// that are not present in the default design, by using /// [method@Gtk.FileChooser.add_choice]. Each choice has an identifier and @@ -42,28 +42,27 @@ import CGtk /// be rendered as a combo box. public protocol FileChooser: GObjectRepresentable { /// The type of operation that the file chooser is performing. -var action: FileChooserAction { get set } + var action: FileChooserAction { get set } -/// Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode -/// will offer the user to create new folders. -var createFolders: Bool { get set } + /// Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode + /// will offer the user to create new folders. + var createFolders: Bool { get set } -/// A `GListModel` containing the filters that have been -/// added with gtk_file_chooser_add_filter(). -/// -/// The returned object should not be modified. It may -/// or may not be updated for later changes. -var filters: OpaquePointer { get set } + /// A `GListModel` containing the filters that have been + /// added with gtk_file_chooser_add_filter(). + /// + /// The returned object should not be modified. It may + /// or may not be updated for later changes. + var filters: OpaquePointer { get set } -/// Whether to allow multiple files to be selected. -var selectMultiple: Bool { get set } + /// Whether to allow multiple files to be selected. + var selectMultiple: Bool { get set } -/// A `GListModel` containing the shortcut folders that have been -/// added with gtk_file_chooser_add_shortcut_folder(). -/// -/// The returned object should not be modified. It may -/// or may not be updated for later changes. -var shortcutFolders: OpaquePointer { get set } + /// A `GListModel` containing the shortcut folders that have been + /// added with gtk_file_chooser_add_shortcut_folder(). + /// + /// The returned object should not be modified. It may + /// or may not be updated for later changes. + var shortcutFolders: OpaquePointer { get set } - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/FileChooserAction.swift b/Sources/Gtk/Generated/FileChooserAction.swift index dab1abc72c..fb1e889e94 100644 --- a/Sources/Gtk/Generated/FileChooserAction.swift +++ b/Sources/Gtk/Generated/FileChooserAction.swift @@ -6,29 +6,29 @@ public enum FileChooserAction: GValueRepresentableEnum { public typealias GtkEnum = GtkFileChooserAction /// Indicates open mode. The file chooser -/// will only let the user pick an existing file. -case open -/// Indicates save mode. The file chooser -/// will let the user pick an existing file, or type in a new -/// filename. -case save -/// Indicates an Open mode for -/// selecting folders. The file chooser will let the user pick an -/// existing folder. -case selectFolder + /// will only let the user pick an existing file. + case open + /// Indicates save mode. The file chooser + /// will let the user pick an existing file, or type in a new + /// filename. + case save + /// Indicates an Open mode for + /// selecting folders. The file chooser will let the user pick an + /// existing folder. + case selectFolder public static var type: GType { - gtk_file_chooser_action_get_type() -} + gtk_file_chooser_action_get_type() + } public init(from gtkEnum: GtkFileChooserAction) { switch gtkEnum { case GTK_FILE_CHOOSER_ACTION_OPEN: - self = .open -case GTK_FILE_CHOOSER_ACTION_SAVE: - self = .save -case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER: - self = .selectFolder + self = .open + case GTK_FILE_CHOOSER_ACTION_SAVE: + self = .save + case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER: + self = .selectFolder default: fatalError("Unsupported GtkFileChooserAction enum value: \(gtkEnum.rawValue)") } @@ -37,11 +37,11 @@ case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER: public func toGtk() -> GtkFileChooserAction { switch self { case .open: - return GTK_FILE_CHOOSER_ACTION_OPEN -case .save: - return GTK_FILE_CHOOSER_ACTION_SAVE -case .selectFolder: - return GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER + return GTK_FILE_CHOOSER_ACTION_OPEN + case .save: + return GTK_FILE_CHOOSER_ACTION_SAVE + case .selectFolder: + return GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/FileChooserError.swift b/Sources/Gtk/Generated/FileChooserError.swift index 4b5ae8e16a..78085a9ffa 100644 --- a/Sources/Gtk/Generated/FileChooserError.swift +++ b/Sources/Gtk/Generated/FileChooserError.swift @@ -6,30 +6,30 @@ public enum FileChooserError: GValueRepresentableEnum { public typealias GtkEnum = GtkFileChooserError /// Indicates that a file does not exist. -case nonexistent -/// Indicates a malformed filename. -case badFilename -/// Indicates a duplicate path (e.g. when -/// adding a bookmark). -case alreadyExists -/// Indicates an incomplete hostname -/// (e.g. "http://foo" without a slash after that). -case incompleteHostname + case nonexistent + /// Indicates a malformed filename. + case badFilename + /// Indicates a duplicate path (e.g. when + /// adding a bookmark). + case alreadyExists + /// Indicates an incomplete hostname + /// (e.g. "http://foo" without a slash after that). + case incompleteHostname public static var type: GType { - gtk_file_chooser_error_get_type() -} + gtk_file_chooser_error_get_type() + } public init(from gtkEnum: GtkFileChooserError) { switch gtkEnum { case GTK_FILE_CHOOSER_ERROR_NONEXISTENT: - self = .nonexistent -case GTK_FILE_CHOOSER_ERROR_BAD_FILENAME: - self = .badFilename -case GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS: - self = .alreadyExists -case GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME: - self = .incompleteHostname + self = .nonexistent + case GTK_FILE_CHOOSER_ERROR_BAD_FILENAME: + self = .badFilename + case GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS: + self = .alreadyExists + case GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME: + self = .incompleteHostname default: fatalError("Unsupported GtkFileChooserError enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ case GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME: public func toGtk() -> GtkFileChooserError { switch self { case .nonexistent: - return GTK_FILE_CHOOSER_ERROR_NONEXISTENT -case .badFilename: - return GTK_FILE_CHOOSER_ERROR_BAD_FILENAME -case .alreadyExists: - return GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS -case .incompleteHostname: - return GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME + return GTK_FILE_CHOOSER_ERROR_NONEXISTENT + case .badFilename: + return GTK_FILE_CHOOSER_ERROR_BAD_FILENAME + case .alreadyExists: + return GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS + case .incompleteHostname: + return GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/FileChooserNative.swift b/Sources/Gtk/Generated/FileChooserNative.swift index 970c5c4ead..ad788b8891 100644 --- a/Sources/Gtk/Generated/FileChooserNative.swift +++ b/Sources/Gtk/Generated/FileChooserNative.swift @@ -2,7 +2,7 @@ import CGtk /// `GtkFileChooserNative` is an abstraction of a dialog suitable /// for use with “File Open” or “File Save as” commands. -/// +/// /// By default, this just uses a `GtkFileChooserDialog` to implement /// the actual dialog. However, on some platforms, such as Windows and /// macOS, the native platform file chooser is used instead. When the @@ -10,25 +10,25 @@ import CGtk /// filesystem access (such as Flatpak), `GtkFileChooserNative` may call /// the proper APIs (portals) to let the user choose a file and make it /// available to the application. -/// +/// /// While the API of `GtkFileChooserNative` closely mirrors `GtkFileChooserDialog`, /// the main difference is that there is no access to any `GtkWindow` or `GtkWidget` /// for the dialog. This is required, as there may not be one in the case of a /// platform native dialog. -/// +/// /// Showing, hiding and running the dialog is handled by the /// [class@Gtk.NativeDialog] functions. -/// +/// /// Note that unlike `GtkFileChooserDialog`, `GtkFileChooserNative` objects /// are not toplevel widgets, and GTK does not keep them alive. It is your /// responsibility to keep a reference until you are done with the /// object. -/// +/// /// ## Typical usage -/// +/// /// In the simplest of cases, you can the following code to use /// `GtkFileChooserNative` to select a file for opening: -/// +/// /// ```c /// static void /// on_response (GtkNativeDialog *native, @@ -38,31 +38,31 @@ import CGtk /// { /// GtkFileChooser *chooser = GTK_FILE_CHOOSER (native); /// GFile *file = gtk_file_chooser_get_file (chooser); -/// +/// /// open_file (file); -/// +/// /// g_object_unref (file); /// } -/// +/// /// g_object_unref (native); /// } -/// +/// /// // ... /// GtkFileChooserNative *native; /// GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN; -/// +/// /// native = gtk_file_chooser_native_new ("Open File", /// parent_window, /// action, /// "_Open", /// "_Cancel"); -/// +/// /// g_signal_connect (native, "response", G_CALLBACK (on_response), NULL); /// gtk_native_dialog_show (GTK_NATIVE_DIALOG (native)); /// ``` -/// +/// /// To use a `GtkFileChooserNative` for saving, you can use this: -/// +/// /// ```c /// static void /// on_response (GtkNativeDialog *native, @@ -72,225 +72,236 @@ import CGtk /// { /// GtkFileChooser *chooser = GTK_FILE_CHOOSER (native); /// GFile *file = gtk_file_chooser_get_file (chooser); -/// +/// /// save_to_file (file); -/// +/// /// g_object_unref (file); /// } -/// +/// /// g_object_unref (native); /// } -/// +/// /// // ... /// GtkFileChooserNative *native; /// GtkFileChooser *chooser; /// GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SAVE; -/// +/// /// native = gtk_file_chooser_native_new ("Save File", /// parent_window, /// action, /// "_Save", /// "_Cancel"); /// chooser = GTK_FILE_CHOOSER (native); -/// +/// /// if (user_edited_a_new_document) /// gtk_file_chooser_set_current_name (chooser, _("Untitled document")); /// else /// gtk_file_chooser_set_file (chooser, existing_file, NULL); -/// +/// /// g_signal_connect (native, "response", G_CALLBACK (on_response), NULL); /// gtk_native_dialog_show (GTK_NATIVE_DIALOG (native)); /// ``` -/// +/// /// For more information on how to best set up a file dialog, /// see the [class@Gtk.FileChooserDialog] documentation. -/// +/// /// ## Response Codes -/// +/// /// `GtkFileChooserNative` inherits from [class@Gtk.NativeDialog], /// which means it will return %GTK_RESPONSE_ACCEPT if the user accepted, /// and %GTK_RESPONSE_CANCEL if he pressed cancel. It can also return /// %GTK_RESPONSE_DELETE_EVENT if the window was unexpectedly closed. -/// +/// /// ## Differences from `GtkFileChooserDialog` -/// +/// /// There are a few things in the [iface@Gtk.FileChooser] interface that /// are not possible to use with `GtkFileChooserNative`, as such use would /// prohibit the use of a native dialog. -/// +/// /// No operations that change the dialog work while the dialog is visible. /// Set all the properties that are required before showing the dialog. -/// +/// /// ## Win32 details -/// +/// /// On windows the `IFileDialog` implementation (added in Windows Vista) is /// used. It supports many of the features that `GtkFileChooser` has, but /// there are some things it does not handle: -/// +/// /// * Any [class@Gtk.FileFilter] added using a mimetype -/// +/// /// If any of these features are used the regular `GtkFileChooserDialog` /// will be used in place of the native one. -/// +/// /// ## Portal details -/// +/// /// When the `org.freedesktop.portal.FileChooser` portal is available on /// the session bus, it is used to bring up an out-of-process file chooser. /// Depending on the kind of session the application is running in, this may /// or may not be a GTK file chooser. -/// +/// /// ## macOS details -/// +/// /// On macOS the `NSSavePanel` and `NSOpenPanel` classes are used to provide /// native file chooser dialogs. Some features provided by `GtkFileChooser` /// are not supported: -/// +/// /// * Shortcut folders. open class FileChooserNative: NativeDialog, FileChooser { /// Creates a new `GtkFileChooserNative`. -public convenience init(title: String, parent: UnsafeMutablePointer!, action: GtkFileChooserAction, acceptLabel: String, cancelLabel: String) { - self.init( - gtk_file_chooser_native_new(title, parent, action, acceptLabel, cancelLabel) - ) -} - - public override func registerSignals() { - super.registerSignals() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::accept-label", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAcceptLabel?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::cancel-label", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCancelLabel?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::action", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAction?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init( + title: String, parent: UnsafeMutablePointer!, action: GtkFileChooserAction, + acceptLabel: String, cancelLabel: String + ) { + self.init( + gtk_file_chooser_native_new(title, parent, action, acceptLabel, cancelLabel) + ) } -addSignal(name: "notify::create-folders", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCreateFolders?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::filter", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFilter?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::filters", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFilters?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::select-multiple", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectMultiple?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public override func registerSignals() { + super.registerSignals() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::accept-label", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAcceptLabel?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::cancel-label", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCancelLabel?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::action", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAction?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::create-folders", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCreateFolders?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::filter", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFilter?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::filters", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFilters?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::select-multiple", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectMultiple?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::shortcut-folders", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShortcutFolders?(self, param0) + } } -addSignal(name: "notify::shortcut-folders", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShortcutFolders?(self, param0) -} -} - /// The text used for the label on the accept button in the dialog, or -/// %NULL to use the default text. -@GObjectProperty(named: "accept-label") public var acceptLabel: String? - -/// The text used for the label on the cancel button in the dialog, or -/// %NULL to use the default text. -@GObjectProperty(named: "cancel-label") public var cancelLabel: String? - -/// The type of operation that the file chooser is performing. -@GObjectProperty(named: "action") public var action: FileChooserAction - -/// Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode -/// will offer the user to create new folders. -@GObjectProperty(named: "create-folders") public var createFolders: Bool - -/// A `GListModel` containing the filters that have been -/// added with gtk_file_chooser_add_filter(). -/// -/// The returned object should not be modified. It may -/// or may not be updated for later changes. -@GObjectProperty(named: "filters") public var filters: OpaquePointer + /// %NULL to use the default text. + @GObjectProperty(named: "accept-label") public var acceptLabel: String? -/// Whether to allow multiple files to be selected. -@GObjectProperty(named: "select-multiple") public var selectMultiple: Bool + /// The text used for the label on the cancel button in the dialog, or + /// %NULL to use the default text. + @GObjectProperty(named: "cancel-label") public var cancelLabel: String? -/// A `GListModel` containing the shortcut folders that have been -/// added with gtk_file_chooser_add_shortcut_folder(). -/// -/// The returned object should not be modified. It may -/// or may not be updated for later changes. -@GObjectProperty(named: "shortcut-folders") public var shortcutFolders: OpaquePointer + /// The type of operation that the file chooser is performing. + @GObjectProperty(named: "action") public var action: FileChooserAction + /// Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode + /// will offer the user to create new folders. + @GObjectProperty(named: "create-folders") public var createFolders: Bool -public var notifyAcceptLabel: ((FileChooserNative, OpaquePointer) -> Void)? + /// A `GListModel` containing the filters that have been + /// added with gtk_file_chooser_add_filter(). + /// + /// The returned object should not be modified. It may + /// or may not be updated for later changes. + @GObjectProperty(named: "filters") public var filters: OpaquePointer + /// Whether to allow multiple files to be selected. + @GObjectProperty(named: "select-multiple") public var selectMultiple: Bool -public var notifyCancelLabel: ((FileChooserNative, OpaquePointer) -> Void)? + /// A `GListModel` containing the shortcut folders that have been + /// added with gtk_file_chooser_add_shortcut_folder(). + /// + /// The returned object should not be modified. It may + /// or may not be updated for later changes. + @GObjectProperty(named: "shortcut-folders") public var shortcutFolders: OpaquePointer + public var notifyAcceptLabel: ((FileChooserNative, OpaquePointer) -> Void)? -public var notifyAction: ((FileChooserNative, OpaquePointer) -> Void)? + public var notifyCancelLabel: ((FileChooserNative, OpaquePointer) -> Void)? + public var notifyAction: ((FileChooserNative, OpaquePointer) -> Void)? -public var notifyCreateFolders: ((FileChooserNative, OpaquePointer) -> Void)? + public var notifyCreateFolders: ((FileChooserNative, OpaquePointer) -> Void)? + public var notifyFilter: ((FileChooserNative, OpaquePointer) -> Void)? -public var notifyFilter: ((FileChooserNative, OpaquePointer) -> Void)? + public var notifyFilters: ((FileChooserNative, OpaquePointer) -> Void)? + public var notifySelectMultiple: ((FileChooserNative, OpaquePointer) -> Void)? -public var notifyFilters: ((FileChooserNative, OpaquePointer) -> Void)? - - -public var notifySelectMultiple: ((FileChooserNative, OpaquePointer) -> Void)? - - -public var notifyShortcutFolders: ((FileChooserNative, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyShortcutFolders: ((FileChooserNative, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/FilterChange.swift b/Sources/Gtk/Generated/FilterChange.swift index ff29ec0419..ef229a3148 100644 --- a/Sources/Gtk/Generated/FilterChange.swift +++ b/Sources/Gtk/Generated/FilterChange.swift @@ -2,39 +2,39 @@ import CGtk /// Describes changes in a filter in more detail and allows objects /// using the filter to optimize refiltering items. -/// +/// /// If you are writing an implementation and are not sure which /// value to pass, `GTK_FILTER_CHANGE_DIFFERENT` is always a correct /// choice. -/// +/// /// New values may be added in the future. public enum FilterChange: GValueRepresentableEnum { public typealias GtkEnum = GtkFilterChange /// The filter change cannot be -/// described with any of the other enumeration values -case different -/// The filter is less strict than -/// it was before: All items that it used to return true -/// still return true, others now may, too. -case lessStrict -/// The filter is more strict than -/// it was before: All items that it used to return false -/// still return false, others now may, too. -case moreStrict + /// described with any of the other enumeration values + case different + /// The filter is less strict than + /// it was before: All items that it used to return true + /// still return true, others now may, too. + case lessStrict + /// The filter is more strict than + /// it was before: All items that it used to return false + /// still return false, others now may, too. + case moreStrict public static var type: GType { - gtk_filter_change_get_type() -} + gtk_filter_change_get_type() + } public init(from gtkEnum: GtkFilterChange) { switch gtkEnum { case GTK_FILTER_CHANGE_DIFFERENT: - self = .different -case GTK_FILTER_CHANGE_LESS_STRICT: - self = .lessStrict -case GTK_FILTER_CHANGE_MORE_STRICT: - self = .moreStrict + self = .different + case GTK_FILTER_CHANGE_LESS_STRICT: + self = .lessStrict + case GTK_FILTER_CHANGE_MORE_STRICT: + self = .moreStrict default: fatalError("Unsupported GtkFilterChange enum value: \(gtkEnum.rawValue)") } @@ -43,11 +43,11 @@ case GTK_FILTER_CHANGE_MORE_STRICT: public func toGtk() -> GtkFilterChange { switch self { case .different: - return GTK_FILTER_CHANGE_DIFFERENT -case .lessStrict: - return GTK_FILTER_CHANGE_LESS_STRICT -case .moreStrict: - return GTK_FILTER_CHANGE_MORE_STRICT + return GTK_FILTER_CHANGE_DIFFERENT + case .lessStrict: + return GTK_FILTER_CHANGE_LESS_STRICT + case .moreStrict: + return GTK_FILTER_CHANGE_MORE_STRICT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/FilterMatch.swift b/Sources/Gtk/Generated/FilterMatch.swift index 6057e32d95..27def01204 100644 --- a/Sources/Gtk/Generated/FilterMatch.swift +++ b/Sources/Gtk/Generated/FilterMatch.swift @@ -1,7 +1,7 @@ import CGtk /// Describes the known strictness of a filter. -/// +/// /// Note that for filters where the strictness is not known, /// `GTK_FILTER_MATCH_SOME` is always an acceptable value, /// even if a filter does match all or no items. @@ -9,27 +9,27 @@ public enum FilterMatch: GValueRepresentableEnum { public typealias GtkEnum = GtkFilterMatch /// The filter matches some items, -/// [method@Gtk.Filter.match] may return true or false -case some -/// The filter does not match any item, -/// [method@Gtk.Filter.match] will always return false -case none -/// The filter matches all items, -/// [method@Gtk.Filter.match] will alays return true -case all + /// [method@Gtk.Filter.match] may return true or false + case some + /// The filter does not match any item, + /// [method@Gtk.Filter.match] will always return false + case none + /// The filter matches all items, + /// [method@Gtk.Filter.match] will alays return true + case all public static var type: GType { - gtk_filter_match_get_type() -} + gtk_filter_match_get_type() + } public init(from gtkEnum: GtkFilterMatch) { switch gtkEnum { case GTK_FILTER_MATCH_SOME: - self = .some -case GTK_FILTER_MATCH_NONE: - self = .none -case GTK_FILTER_MATCH_ALL: - self = .all + self = .some + case GTK_FILTER_MATCH_NONE: + self = .none + case GTK_FILTER_MATCH_ALL: + self = .all default: fatalError("Unsupported GtkFilterMatch enum value: \(gtkEnum.rawValue)") } @@ -38,11 +38,11 @@ case GTK_FILTER_MATCH_ALL: public func toGtk() -> GtkFilterMatch { switch self { case .some: - return GTK_FILTER_MATCH_SOME -case .none: - return GTK_FILTER_MATCH_NONE -case .all: - return GTK_FILTER_MATCH_ALL + return GTK_FILTER_MATCH_SOME + case .none: + return GTK_FILTER_MATCH_NONE + case .all: + return GTK_FILTER_MATCH_ALL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/FontChooser.swift b/Sources/Gtk/Generated/FontChooser.swift index 451dff6cdc..1739368b72 100644 --- a/Sources/Gtk/Generated/FontChooser.swift +++ b/Sources/Gtk/Generated/FontChooser.swift @@ -2,33 +2,33 @@ import CGtk /// `GtkFontChooser` is an interface that can be implemented by widgets /// for choosing fonts. -/// +/// /// In GTK, the main objects that implement this interface are /// [class@Gtk.FontChooserWidget], [class@Gtk.FontChooserDialog] and /// [class@Gtk.FontButton]. public protocol FontChooser: GObjectRepresentable { /// The font description as a string, e.g. "Sans Italic 12". -var font: String? { get set } + var font: String? { get set } -/// The selected font features. -/// -/// The format of the string is compatible with -/// CSS and with Pango attributes. -var fontFeatures: String { get set } + /// The selected font features. + /// + /// The format of the string is compatible with + /// CSS and with Pango attributes. + var fontFeatures: String { get set } -/// The language for which the font features were selected. -var language: String { get set } + /// The language for which the font features were selected. + var language: String { get set } -/// The string with which to preview the font. -var previewText: String { get set } + /// The string with which to preview the font. + var previewText: String { get set } -/// Whether to show an entry to change the preview text. -var showPreviewEntry: Bool { get set } + /// Whether to show an entry to change the preview text. + var showPreviewEntry: Bool { get set } /// Emitted when a font is activated. -/// -/// This usually happens when the user double clicks an item, -/// or an item is selected and the user presses one of the keys -/// Space, Shift+Space, Return or Enter. -var fontActivated: ((Self, UnsafePointer) -> Void)? { get set } -} \ No newline at end of file + /// + /// This usually happens when the user double clicks an item, + /// or an item is selected and the user presses one of the keys + /// Space, Shift+Space, Return or Enter. + var fontActivated: ((Self, UnsafePointer) -> Void)? { get set } +} diff --git a/Sources/Gtk/Generated/GLArea.swift b/Sources/Gtk/Generated/GLArea.swift index 11bec91792..5247e75482 100644 --- a/Sources/Gtk/Generated/GLArea.swift +++ b/Sources/Gtk/Generated/GLArea.swift @@ -1,33 +1,33 @@ import CGtk /// Allows drawing with OpenGL. -/// +/// /// An example GtkGLArea -/// +/// /// `GtkGLArea` sets up its own [class@Gdk.GLContext], and creates a custom /// GL framebuffer that the widget will do GL rendering onto. It also ensures /// that this framebuffer is the default GL rendering target when rendering. /// The completed rendering is integrated into the larger GTK scene graph as /// a texture. -/// +/// /// In order to draw, you have to connect to the [signal@Gtk.GLArea::render] /// signal, or subclass `GtkGLArea` and override the GtkGLAreaClass.render /// virtual function. -/// +/// /// The `GtkGLArea` widget ensures that the `GdkGLContext` is associated with /// the widget's drawing area, and it is kept updated when the size and /// position of the drawing area changes. -/// +/// /// ## Drawing with GtkGLArea -/// +/// /// The simplest way to draw using OpenGL commands in a `GtkGLArea` is to /// create a widget instance and connect to the [signal@Gtk.GLArea::render] signal: -/// +/// /// The `render()` function will be called when the `GtkGLArea` is ready /// for you to draw its content: -/// +/// /// The initial contents of the framebuffer are transparent. -/// +/// /// ```c /// static gboolean /// render (GtkGLArea *area, GdkGLContext *context) @@ -36,45 +36,45 @@ import CGtk /// // GdkGLContext has been made current to the drawable /// // surface used by the `GtkGLArea` and the viewport has /// // already been set to be the size of the allocation -/// +/// /// // we can start by clearing the buffer /// glClearColor (0, 0, 0, 0); /// glClear (GL_COLOR_BUFFER_BIT); -/// +/// /// // record the active framebuffer ID, so we can return to it /// // with `glBindFramebuffer (GL_FRAMEBUFFER, screen_fb)` should /// // we, for instance, intend on utilizing the results of an /// // intermediate render texture pass /// GLuint screen_fb = 0; /// glGetIntegerv (GL_FRAMEBUFFER_BINDING, &screen_fb); -/// +/// /// // draw your object /// // draw_an_object (); -/// +/// /// // we completed our drawing; the draw commands will be /// // flushed at the end of the signal emission chain, and /// // the buffers will be drawn on the window /// return TRUE; /// } -/// +/// /// void setup_glarea (void) /// { /// // create a GtkGLArea instance /// GtkWidget *gl_area = gtk_gl_area_new (); -/// +/// /// // connect to the "render" signal /// g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL); /// } /// ``` -/// +/// /// If you need to initialize OpenGL state, e.g. buffer objects or /// shaders, you should use the [signal@Gtk.Widget::realize] signal; /// you can use the [signal@Gtk.Widget::unrealize] signal to clean up. /// Since the `GdkGLContext` creation and initialization may fail, you /// will need to check for errors, using [method@Gtk.GLArea.get_error]. -/// +/// /// An example of how to safely initialize the GL state is: -/// +/// /// ```c /// static void /// on_realize (GtkGLArea *area) @@ -82,13 +82,13 @@ import CGtk /// // We need to make the context current if we want to /// // call GL API /// gtk_gl_area_make_current (area); -/// +/// /// // If there were errors during the initialization or /// // when trying to make the context current, this /// // function will return a GError for you to catch /// if (gtk_gl_area_get_error (area) != NULL) /// return; -/// +/// /// // You can also use gtk_gl_area_set_error() in order /// // to show eventual initialization errors on the /// // GtkGLArea widget itself @@ -100,7 +100,7 @@ import CGtk /// g_error_free (error); /// return; /// } -/// +/// /// init_shaders (&error); /// if (error != NULL) /// { @@ -110,199 +110,210 @@ import CGtk /// } /// } /// ``` -/// +/// /// If you need to change the options for creating the `GdkGLContext` /// you should use the [signal@Gtk.GLArea::create-context] signal. open class GLArea: Widget { /// Creates a new `GtkGLArea` widget. -public convenience init() { - self.init( - gtk_gl_area_new() - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "create-context") { [weak self] () in - guard let self = self else { return } - self.createContext?(self) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "render", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.render?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - -addSignal(name: "resize", handler: gCallback(handler2)) { [weak self] (param0: Int, param1: Int) in - guard let self = self else { return } - self.resize?(self, param0, param1) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::allowed-apis", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAllowedApis?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::api", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyApi?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::auto-render", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAutoRender?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::context", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContext?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::has-depth-buffer", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasDepthBuffer?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_gl_area_new() + ) } -addSignal(name: "notify::has-stencil-buffer", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasStencilBuffer?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "create-context") { [weak self] () in + guard let self = self else { return } + self.createContext?(self) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "render", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.render?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "resize", handler: gCallback(handler2)) { + [weak self] (param0: Int, param1: Int) in + guard let self = self else { return } + self.resize?(self, param0, param1) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::allowed-apis", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAllowedApis?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::api", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyApi?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::auto-render", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAutoRender?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::context", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContext?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::has-depth-buffer", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasDepthBuffer?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::has-stencil-buffer", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasStencilBuffer?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-es", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseEs?(self, param0) + } } -addSignal(name: "notify::use-es", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseEs?(self, param0) -} -} - /// If set to %TRUE the ::render signal will be emitted every time -/// the widget draws. -/// -/// This is the default and is useful if drawing the widget is faster. -/// -/// If set to %FALSE the data from previous rendering is kept around and will -/// be used for drawing the widget the next time, unless the window is resized. -/// In order to force a rendering [method@Gtk.GLArea.queue_render] must be called. -/// This mode is useful when the scene changes seldom, but takes a long time -/// to redraw. -@GObjectProperty(named: "auto-render") public var autoRender: Bool - -/// The `GdkGLContext` used by the `GtkGLArea` widget. -/// -/// The `GtkGLArea` widget is responsible for creating the `GdkGLContext` -/// instance. If you need to render with other kinds of buffers (stencil, -/// depth, etc), use render buffers. -@GObjectProperty(named: "context") public var context: OpaquePointer? - -/// If set to %TRUE the widget will allocate and enable a depth buffer for the -/// target framebuffer. -/// -/// Setting this property will enable GL's depth testing as a side effect. If -/// you don't need depth testing, you should call `glDisable(GL_DEPTH_TEST)` -/// in your `GtkGLArea::render` handler. -@GObjectProperty(named: "has-depth-buffer") public var hasDepthBuffer: Bool - -/// If set to %TRUE the widget will allocate and enable a stencil buffer for the -/// target framebuffer. -@GObjectProperty(named: "has-stencil-buffer") public var hasStencilBuffer: Bool - -/// If set to %TRUE the widget will try to create a `GdkGLContext` using -/// OpenGL ES instead of OpenGL. -@GObjectProperty(named: "use-es") public var useEs: Bool - -/// Emitted when the widget is being realized. -/// -/// This allows you to override how the GL context is created. -/// This is useful when you want to reuse an existing GL context, -/// or if you want to try creating different kinds of GL options. -/// -/// If context creation fails then the signal handler can use -/// [method@Gtk.GLArea.set_error] to register a more detailed error -/// of how the construction failed. -public var createContext: ((GLArea) -> Void)? - -/// Emitted every time the contents of the `GtkGLArea` should be redrawn. -/// -/// The @context is bound to the @area prior to emitting this function, -/// and the buffers are painted to the window once the emission terminates. -public var render: ((GLArea, OpaquePointer) -> Void)? - -/// Emitted once when the widget is realized, and then each time the widget -/// is changed while realized. -/// -/// This is useful in order to keep GL state up to date with the widget size, -/// like for instance camera properties which may depend on the width/height -/// ratio. -/// -/// The GL context for the area is guaranteed to be current when this signal -/// is emitted. -/// -/// The default handler sets up the GL viewport. -public var resize: ((GLArea, Int, Int) -> Void)? - - -public var notifyAllowedApis: ((GLArea, OpaquePointer) -> Void)? - - -public var notifyApi: ((GLArea, OpaquePointer) -> Void)? - - -public var notifyAutoRender: ((GLArea, OpaquePointer) -> Void)? - - -public var notifyContext: ((GLArea, OpaquePointer) -> Void)? - - -public var notifyHasDepthBuffer: ((GLArea, OpaquePointer) -> Void)? - - -public var notifyHasStencilBuffer: ((GLArea, OpaquePointer) -> Void)? - - -public var notifyUseEs: ((GLArea, OpaquePointer) -> Void)? -} \ No newline at end of file + /// the widget draws. + /// + /// This is the default and is useful if drawing the widget is faster. + /// + /// If set to %FALSE the data from previous rendering is kept around and will + /// be used for drawing the widget the next time, unless the window is resized. + /// In order to force a rendering [method@Gtk.GLArea.queue_render] must be called. + /// This mode is useful when the scene changes seldom, but takes a long time + /// to redraw. + @GObjectProperty(named: "auto-render") public var autoRender: Bool + + /// The `GdkGLContext` used by the `GtkGLArea` widget. + /// + /// The `GtkGLArea` widget is responsible for creating the `GdkGLContext` + /// instance. If you need to render with other kinds of buffers (stencil, + /// depth, etc), use render buffers. + @GObjectProperty(named: "context") public var context: OpaquePointer? + + /// If set to %TRUE the widget will allocate and enable a depth buffer for the + /// target framebuffer. + /// + /// Setting this property will enable GL's depth testing as a side effect. If + /// you don't need depth testing, you should call `glDisable(GL_DEPTH_TEST)` + /// in your `GtkGLArea::render` handler. + @GObjectProperty(named: "has-depth-buffer") public var hasDepthBuffer: Bool + + /// If set to %TRUE the widget will allocate and enable a stencil buffer for the + /// target framebuffer. + @GObjectProperty(named: "has-stencil-buffer") public var hasStencilBuffer: Bool + + /// If set to %TRUE the widget will try to create a `GdkGLContext` using + /// OpenGL ES instead of OpenGL. + @GObjectProperty(named: "use-es") public var useEs: Bool + + /// Emitted when the widget is being realized. + /// + /// This allows you to override how the GL context is created. + /// This is useful when you want to reuse an existing GL context, + /// or if you want to try creating different kinds of GL options. + /// + /// If context creation fails then the signal handler can use + /// [method@Gtk.GLArea.set_error] to register a more detailed error + /// of how the construction failed. + public var createContext: ((GLArea) -> Void)? + + /// Emitted every time the contents of the `GtkGLArea` should be redrawn. + /// + /// The @context is bound to the @area prior to emitting this function, + /// and the buffers are painted to the window once the emission terminates. + public var render: ((GLArea, OpaquePointer) -> Void)? + + /// Emitted once when the widget is realized, and then each time the widget + /// is changed while realized. + /// + /// This is useful in order to keep GL state up to date with the widget size, + /// like for instance camera properties which may depend on the width/height + /// ratio. + /// + /// The GL context for the area is guaranteed to be current when this signal + /// is emitted. + /// + /// The default handler sets up the GL viewport. + public var resize: ((GLArea, Int, Int) -> Void)? + + public var notifyAllowedApis: ((GLArea, OpaquePointer) -> Void)? + + public var notifyApi: ((GLArea, OpaquePointer) -> Void)? + + public var notifyAutoRender: ((GLArea, OpaquePointer) -> Void)? + + public var notifyContext: ((GLArea, OpaquePointer) -> Void)? + + public var notifyHasDepthBuffer: ((GLArea, OpaquePointer) -> Void)? + + public var notifyHasStencilBuffer: ((GLArea, OpaquePointer) -> Void)? + + public var notifyUseEs: ((GLArea, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/Gesture.swift b/Sources/Gtk/Generated/Gesture.swift index d98561da4d..9b9b702cbf 100644 --- a/Sources/Gtk/Generated/Gesture.swift +++ b/Sources/Gtk/Generated/Gesture.swift @@ -1,206 +1,219 @@ import CGtk /// The base class for gesture recognition. -/// +/// /// Although `GtkGesture` is quite generalized to serve as a base for /// multi-touch gestures, it is suitable to implement single-touch and /// pointer-based gestures (using the special %NULL `GdkEventSequence` /// value for these). -/// +/// /// The number of touches that a `GtkGesture` need to be recognized is /// controlled by the [property@Gtk.Gesture:n-points] property, if a /// gesture is keeping track of less or more than that number of sequences, /// it won't check whether the gesture is recognized. -/// +/// /// As soon as the gesture has the expected number of touches, it will check /// regularly if it is recognized, the criteria to consider a gesture as /// "recognized" is left to `GtkGesture` subclasses. -/// +/// /// A recognized gesture will then emit the following signals: -/// +/// /// - [signal@Gtk.Gesture::begin] when the gesture is recognized. /// - [signal@Gtk.Gesture::update], whenever an input event is processed. /// - [signal@Gtk.Gesture::end] when the gesture is no longer recognized. -/// +/// /// ## Event propagation -/// +/// /// In order to receive events, a gesture needs to set a propagation phase /// through [method@Gtk.EventController.set_propagation_phase]. -/// +/// /// In the capture phase, events are propagated from the toplevel down /// to the target widget, and gestures that are attached to containers /// above the widget get a chance to interact with the event before it /// reaches the target. -/// +/// /// In the bubble phase, events are propagated up from the target widget /// to the toplevel, and gestures that are attached to containers above /// the widget get a chance to interact with events that have not been /// handled yet. -/// +/// /// ## States of a sequence -/// +/// /// Whenever input interaction happens, a single event may trigger a cascade /// of `GtkGesture`s, both across the parents of the widget receiving the /// event and in parallel within an individual widget. It is a responsibility /// of the widgets using those gestures to set the state of touch sequences /// accordingly in order to enable cooperation of gestures around the /// `GdkEventSequence`s triggering those. -/// +/// /// Within a widget, gestures can be grouped through [method@Gtk.Gesture.group]. /// Grouped gestures synchronize the state of sequences, so calling /// [method@Gtk.Gesture.set_state] on one will effectively propagate /// the state throughout the group. -/// +/// /// By default, all sequences start out in the %GTK_EVENT_SEQUENCE_NONE state, /// sequences in this state trigger the gesture event handler, but event /// propagation will continue unstopped by gestures. -/// +/// /// If a sequence enters into the %GTK_EVENT_SEQUENCE_DENIED state, the gesture /// group will effectively ignore the sequence, letting events go unstopped /// through the gesture, but the "slot" will still remain occupied while /// the touch is active. -/// +/// /// If a sequence enters in the %GTK_EVENT_SEQUENCE_CLAIMED state, the gesture /// group will grab all interaction on the sequence, by: -/// +/// /// - Setting the same sequence to %GTK_EVENT_SEQUENCE_DENIED on every other /// gesture group within the widget, and every gesture on parent widgets /// in the propagation chain. /// - Emitting [signal@Gtk.Gesture::cancel] on every gesture in widgets /// underneath in the propagation chain. /// - Stopping event propagation after the gesture group handles the event. -/// +/// /// Note: if a sequence is set early to %GTK_EVENT_SEQUENCE_CLAIMED on /// %GDK_TOUCH_BEGIN/%GDK_BUTTON_PRESS (so those events are captured before /// reaching the event widget, this implies %GTK_PHASE_CAPTURE), one similar /// event will be emulated if the sequence changes to %GTK_EVENT_SEQUENCE_DENIED. /// This way event coherence is preserved before event propagation is unstopped /// again. -/// +/// /// Sequence states can't be changed freely. /// See [method@Gtk.Gesture.set_state] to know about the possible /// lifetimes of a `GdkEventSequence`. -/// +/// /// ## Touchpad gestures -/// +/// /// On the platforms that support it, `GtkGesture` will handle transparently /// touchpad gesture events. The only precautions users of `GtkGesture` should /// do to enable this support are: -/// +/// /// - If the gesture has %GTK_PHASE_NONE, ensuring events of type /// %GDK_TOUCHPAD_SWIPE and %GDK_TOUCHPAD_PINCH are handled by the `GtkGesture` open class Gesture: EventController { - public override func registerSignals() { - super.registerSignals() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "begin", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.begin?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "cancel", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.cancel?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "end", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.end?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, GtkEventSequenceState, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) + super.registerSignals() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "begin", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.begin?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "cancel", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.cancel?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "end", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.end?(self, param0) + } + + let handler3: + @convention(c) ( + UnsafeMutableRawPointer, OpaquePointer, GtkEventSequenceState, + UnsafeMutableRawPointer + ) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "sequence-state-changed", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer, param1: GtkEventSequenceState) in + guard let self = self else { return } + self.sequenceStateChanged?(self, param0, param1) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "update", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.update?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::n-points", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyNPoints?(self, param0) + } } -addSignal(name: "sequence-state-changed", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer, param1: GtkEventSequenceState) in - guard let self = self else { return } - self.sequenceStateChanged?(self, param0, param1) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "update", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.update?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::n-points", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyNPoints?(self, param0) -} -} - /// Emitted when the gesture is recognized. -/// -/// This means the number of touch sequences matches -/// [property@Gtk.Gesture:n-points]. -/// -/// Note: These conditions may also happen when an extra touch -/// (eg. a third touch on a 2-touches gesture) is lifted, in that -/// situation @sequence won't pertain to the current set of active -/// touches, so don't rely on this being true. -public var begin: ((Gesture, OpaquePointer) -> Void)? - -/// Emitted whenever a sequence is cancelled. -/// -/// This usually happens on active touches when -/// [method@Gtk.EventController.reset] is called on @gesture -/// (manually, due to grabs...), or the individual @sequence -/// was claimed by parent widgets' controllers (see -/// [method@Gtk.Gesture.set_sequence_state]). -/// -/// @gesture must forget everything about @sequence as in -/// response to this signal. -public var cancel: ((Gesture, OpaquePointer) -> Void)? - -/// Emitted when @gesture either stopped recognizing the event -/// sequences as something to be handled, or the number of touch -/// sequences became higher or lower than [property@Gtk.Gesture:n-points]. -/// -/// Note: @sequence might not pertain to the group of sequences that -/// were previously triggering recognition on @gesture (ie. a just -/// pressed touch sequence that exceeds [property@Gtk.Gesture:n-points]). -/// This situation may be detected by checking through -/// [method@Gtk.Gesture.handles_sequence]. -public var end: ((Gesture, OpaquePointer) -> Void)? - -/// Emitted whenever a sequence state changes. -/// -/// See [method@Gtk.Gesture.set_sequence_state] to know -/// more about the expectable sequence lifetimes. -public var sequenceStateChanged: ((Gesture, OpaquePointer, GtkEventSequenceState) -> Void)? - -/// Emitted whenever an event is handled while the gesture is recognized. -/// -/// @sequence is guaranteed to pertain to the set of active touches. -public var update: ((Gesture, OpaquePointer) -> Void)? - - -public var notifyNPoints: ((Gesture, OpaquePointer) -> Void)? -} \ No newline at end of file + /// + /// This means the number of touch sequences matches + /// [property@Gtk.Gesture:n-points]. + /// + /// Note: These conditions may also happen when an extra touch + /// (eg. a third touch on a 2-touches gesture) is lifted, in that + /// situation @sequence won't pertain to the current set of active + /// touches, so don't rely on this being true. + public var begin: ((Gesture, OpaquePointer) -> Void)? + + /// Emitted whenever a sequence is cancelled. + /// + /// This usually happens on active touches when + /// [method@Gtk.EventController.reset] is called on @gesture + /// (manually, due to grabs...), or the individual @sequence + /// was claimed by parent widgets' controllers (see + /// [method@Gtk.Gesture.set_sequence_state]). + /// + /// @gesture must forget everything about @sequence as in + /// response to this signal. + public var cancel: ((Gesture, OpaquePointer) -> Void)? + + /// Emitted when @gesture either stopped recognizing the event + /// sequences as something to be handled, or the number of touch + /// sequences became higher or lower than [property@Gtk.Gesture:n-points]. + /// + /// Note: @sequence might not pertain to the group of sequences that + /// were previously triggering recognition on @gesture (ie. a just + /// pressed touch sequence that exceeds [property@Gtk.Gesture:n-points]). + /// This situation may be detected by checking through + /// [method@Gtk.Gesture.handles_sequence]. + public var end: ((Gesture, OpaquePointer) -> Void)? + + /// Emitted whenever a sequence state changes. + /// + /// See [method@Gtk.Gesture.set_sequence_state] to know + /// more about the expectable sequence lifetimes. + public var sequenceStateChanged: ((Gesture, OpaquePointer, GtkEventSequenceState) -> Void)? + + /// Emitted whenever an event is handled while the gesture is recognized. + /// + /// @sequence is guaranteed to pertain to the set of active touches. + public var update: ((Gesture, OpaquePointer) -> Void)? + + public var notifyNPoints: ((Gesture, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/GestureClick.swift b/Sources/Gtk/Generated/GestureClick.swift index 54cdd661b2..f71c8f6c84 100644 --- a/Sources/Gtk/Generated/GestureClick.swift +++ b/Sources/Gtk/Generated/GestureClick.swift @@ -1,7 +1,7 @@ import CGtk /// Recognizes click gestures. -/// +/// /// It is able to recognize multiple clicks on a nearby zone, which /// can be listened for through the [signal@Gtk.GestureClick::pressed] /// signal. Whenever time or distance between clicks exceed the GTK @@ -9,71 +9,83 @@ import CGtk /// click counter is reset. open class GestureClick: GestureSingle { /// Returns a newly created `GtkGesture` that recognizes -/// single and multiple presses. -public convenience init() { - self.init( - gtk_gesture_click_new() - ) -} + /// single and multiple presses. + public convenience init() { + self.init( + gtk_gesture_click_new() + ) + } public override func registerSignals() { - super.registerSignals() + super.registerSignals() - let handler0: @convention(c) (UnsafeMutableRawPointer, Int, Double, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, value3, data in - SignalBox3.run(data, value1, value2, value3) - } + let handler0: + @convention(c) (UnsafeMutableRawPointer, Int, Double, Double, UnsafeMutableRawPointer) + -> Void = + { _, value1, value2, value3, data in + SignalBox3.run(data, value1, value2, value3) + } -addSignal(name: "pressed", handler: gCallback(handler0)) { [weak self] (param0: Int, param1: Double, param2: Double) in - guard let self = self else { return } - self.pressed?(self, param0, param1, param2) -} + addSignal(name: "pressed", handler: gCallback(handler0)) { + [weak self] (param0: Int, param1: Double, param2: Double) in + guard let self = self else { return } + self.pressed?(self, param0, param1, param2) + } -let handler1: @convention(c) (UnsafeMutableRawPointer, Int, Double, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, value3, data in - SignalBox3.run(data, value1, value2, value3) - } + let handler1: + @convention(c) (UnsafeMutableRawPointer, Int, Double, Double, UnsafeMutableRawPointer) + -> Void = + { _, value1, value2, value3, data in + SignalBox3.run(data, value1, value2, value3) + } -addSignal(name: "released", handler: gCallback(handler1)) { [weak self] (param0: Int, param1: Double, param2: Double) in - guard let self = self else { return } - self.released?(self, param0, param1, param2) -} + addSignal(name: "released", handler: gCallback(handler1)) { + [weak self] (param0: Int, param1: Double, param2: Double) in + guard let self = self else { return } + self.released?(self, param0, param1, param2) + } -addSignal(name: "stopped") { [weak self] () in - guard let self = self else { return } - self.stopped?(self) -} + addSignal(name: "stopped") { [weak self] () in + guard let self = self else { return } + self.stopped?(self) + } -let handler3: @convention(c) (UnsafeMutableRawPointer, Double, Double, UInt, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, value3, value4, data in - SignalBox4.run(data, value1, value2, value3, value4) - } + let handler3: + @convention(c) ( + UnsafeMutableRawPointer, Double, Double, UInt, OpaquePointer, + UnsafeMutableRawPointer + ) -> Void = + { _, value1, value2, value3, value4, data in + SignalBox4.run( + data, value1, value2, value3, value4) + } -addSignal(name: "unpaired-release", handler: gCallback(handler3)) { [weak self] (param0: Double, param1: Double, param2: UInt, param3: OpaquePointer) in - guard let self = self else { return } - self.unpairedRelease?(self, param0, param1, param2, param3) -} -} + addSignal(name: "unpaired-release", handler: gCallback(handler3)) { + [weak self] (param0: Double, param1: Double, param2: UInt, param3: OpaquePointer) in + guard let self = self else { return } + self.unpairedRelease?(self, param0, param1, param2, param3) + } + } /// Emitted whenever a button or touch press happens. -public var pressed: ((GestureClick, Int, Double, Double) -> Void)? + public var pressed: ((GestureClick, Int, Double, Double) -> Void)? -/// Emitted when a button or touch is released. -/// -/// @n_press will report the number of press that is paired to -/// this event, note that [signal@Gtk.GestureClick::stopped] may -/// have been emitted between the press and its release, @n_press -/// will only start over at the next press. -public var released: ((GestureClick, Int, Double, Double) -> Void)? + /// Emitted when a button or touch is released. + /// + /// @n_press will report the number of press that is paired to + /// this event, note that [signal@Gtk.GestureClick::stopped] may + /// have been emitted between the press and its release, @n_press + /// will only start over at the next press. + public var released: ((GestureClick, Int, Double, Double) -> Void)? -/// Emitted whenever any time/distance threshold has been exceeded. -public var stopped: ((GestureClick) -> Void)? + /// Emitted whenever any time/distance threshold has been exceeded. + public var stopped: ((GestureClick) -> Void)? -/// Emitted whenever the gesture receives a release -/// event that had no previous corresponding press. -/// -/// Due to implicit grabs, this can only happen on situations -/// where input is grabbed elsewhere mid-press or the pressed -/// widget voluntarily relinquishes its implicit grab. -public var unpairedRelease: ((GestureClick, Double, Double, UInt, OpaquePointer) -> Void)? -} \ No newline at end of file + /// Emitted whenever the gesture receives a release + /// event that had no previous corresponding press. + /// + /// Due to implicit grabs, this can only happen on situations + /// where input is grabbed elsewhere mid-press or the pressed + /// widget voluntarily relinquishes its implicit grab. + public var unpairedRelease: ((GestureClick, Double, Double, UInt, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/GestureLongPress.swift b/Sources/Gtk/Generated/GestureLongPress.swift index 5adcd3ef4d..ee0eaaa4df 100644 --- a/Sources/Gtk/Generated/GestureLongPress.swift +++ b/Sources/Gtk/Generated/GestureLongPress.swift @@ -1,68 +1,72 @@ import CGtk /// Recognizes long press gestures. -/// +/// /// This gesture is also known as “Press and Hold”. -/// +/// /// When the timeout is exceeded, the gesture is triggering the /// [signal@Gtk.GestureLongPress::pressed] signal. -/// +/// /// If the touchpoint is lifted before the timeout passes, or if /// it drifts too far of the initial press point, the /// [signal@Gtk.GestureLongPress::cancelled] signal will be emitted. -/// +/// /// How long the timeout is before the ::pressed signal gets emitted is /// determined by the [property@Gtk.Settings:gtk-long-press-time] setting. /// It can be modified by the [property@Gtk.GestureLongPress:delay-factor] /// property. open class GestureLongPress: GestureSingle { /// Returns a newly created `GtkGesture` that recognizes long presses. -public convenience init() { - self.init( - gtk_gesture_long_press_new() - ) -} + public convenience init() { + self.init( + gtk_gesture_long_press_new() + ) + } public override func registerSignals() { - super.registerSignals() + super.registerSignals() - addSignal(name: "cancelled") { [weak self] () in - guard let self = self else { return } - self.cancelled?(self) -} + addSignal(name: "cancelled") { [weak self] () in + guard let self = self else { return } + self.cancelled?(self) + } -let handler1: @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } + let handler1: + @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> + Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } -addSignal(name: "pressed", handler: gCallback(handler1)) { [weak self] (param0: Double, param1: Double) in - guard let self = self else { return } - self.pressed?(self, param0, param1) -} + addSignal(name: "pressed", handler: gCallback(handler1)) { + [weak self] (param0: Double, param1: Double) in + guard let self = self else { return } + self.pressed?(self, param0, param1) + } -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } -addSignal(name: "notify::delay-factor", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDelayFactor?(self, param0) -} -} + addSignal(name: "notify::delay-factor", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDelayFactor?(self, param0) + } + } /// Factor by which to modify the default timeout. -@GObjectProperty(named: "delay-factor") public var delayFactor: Double + @GObjectProperty(named: "delay-factor") public var delayFactor: Double -/// Emitted whenever a press moved too far, or was released -/// before [signal@Gtk.GestureLongPress::pressed] happened. -public var cancelled: ((GestureLongPress) -> Void)? + /// Emitted whenever a press moved too far, or was released + /// before [signal@Gtk.GestureLongPress::pressed] happened. + public var cancelled: ((GestureLongPress) -> Void)? -/// Emitted whenever a press goes unmoved/unreleased longer than -/// what the GTK defaults tell. -public var pressed: ((GestureLongPress, Double, Double) -> Void)? + /// Emitted whenever a press goes unmoved/unreleased longer than + /// what the GTK defaults tell. + public var pressed: ((GestureLongPress, Double, Double) -> Void)? - -public var notifyDelayFactor: ((GestureLongPress, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyDelayFactor: ((GestureLongPress, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/GestureSingle.swift b/Sources/Gtk/Generated/GestureSingle.swift index 8bb88f0de6..c131329c8a 100644 --- a/Sources/Gtk/Generated/GestureSingle.swift +++ b/Sources/Gtk/Generated/GestureSingle.swift @@ -1,11 +1,11 @@ import CGtk /// A `GtkGesture` subclass optimized for singe-touch and mouse gestures. -/// +/// /// Under interaction, these gestures stick to the first interacting sequence, /// which is accessible through [method@Gtk.GestureSingle.get_current_sequence] /// while the gesture is being interacted with. -/// +/// /// By default gestures react to both %GDK_BUTTON_PRIMARY and touch events. /// [method@Gtk.GestureSingle.set_touch_only] can be used to change the /// touch behavior. Callers may also specify a different mouse button number @@ -14,59 +14,61 @@ import CGtk /// button being currently pressed can be known through /// [method@Gtk.GestureSingle.get_current_button]. open class GestureSingle: Gesture { - public override func registerSignals() { - super.registerSignals() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::button", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyButton?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::exclusive", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExclusive?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + super.registerSignals() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::button", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyButton?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::exclusive", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExclusive?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::touch-only", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTouchOnly?(self, param0) + } } -addSignal(name: "notify::touch-only", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTouchOnly?(self, param0) -} -} - /// Mouse button number to listen to, or 0 to listen for any button. -@GObjectProperty(named: "button") public var button: UInt + @GObjectProperty(named: "button") public var button: UInt -/// Whether the gesture is exclusive. -/// -/// Exclusive gestures only listen to pointer and pointer emulated events. -@GObjectProperty(named: "exclusive") public var exclusive: Bool + /// Whether the gesture is exclusive. + /// + /// Exclusive gestures only listen to pointer and pointer emulated events. + @GObjectProperty(named: "exclusive") public var exclusive: Bool -/// Whether the gesture handles only touch events. -@GObjectProperty(named: "touch-only") public var touchOnly: Bool + /// Whether the gesture handles only touch events. + @GObjectProperty(named: "touch-only") public var touchOnly: Bool + public var notifyButton: ((GestureSingle, OpaquePointer) -> Void)? -public var notifyButton: ((GestureSingle, OpaquePointer) -> Void)? + public var notifyExclusive: ((GestureSingle, OpaquePointer) -> Void)? - -public var notifyExclusive: ((GestureSingle, OpaquePointer) -> Void)? - - -public var notifyTouchOnly: ((GestureSingle, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyTouchOnly: ((GestureSingle, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/IconSize.swift b/Sources/Gtk/Generated/IconSize.swift index d1fb16ba73..d16dd7398f 100644 --- a/Sources/Gtk/Generated/IconSize.swift +++ b/Sources/Gtk/Generated/IconSize.swift @@ -1,10 +1,10 @@ import CGtk /// Built-in icon sizes. -/// +/// /// Icon sizes default to being inherited. Where they cannot be /// inherited, text size is the default. -/// +/// /// All widgets which use `GtkIconSize` set the normal-icons or /// large-icons style classes correspondingly, and let themes /// determine the actual size to be used with the @@ -13,24 +13,24 @@ public enum IconSize: GValueRepresentableEnum { public typealias GtkEnum = GtkIconSize /// Keep the size of the parent element -case inherit -/// Size similar to text size -case normal -/// Large size, for example in an icon view -case large + case inherit + /// Size similar to text size + case normal + /// Large size, for example in an icon view + case large public static var type: GType { - gtk_icon_size_get_type() -} + gtk_icon_size_get_type() + } public init(from gtkEnum: GtkIconSize) { switch gtkEnum { case GTK_ICON_SIZE_INHERIT: - self = .inherit -case GTK_ICON_SIZE_NORMAL: - self = .normal -case GTK_ICON_SIZE_LARGE: - self = .large + self = .inherit + case GTK_ICON_SIZE_NORMAL: + self = .normal + case GTK_ICON_SIZE_LARGE: + self = .large default: fatalError("Unsupported GtkIconSize enum value: \(gtkEnum.rawValue)") } @@ -39,11 +39,11 @@ case GTK_ICON_SIZE_LARGE: public func toGtk() -> GtkIconSize { switch self { case .inherit: - return GTK_ICON_SIZE_INHERIT -case .normal: - return GTK_ICON_SIZE_NORMAL -case .large: - return GTK_ICON_SIZE_LARGE + return GTK_ICON_SIZE_INHERIT + case .normal: + return GTK_ICON_SIZE_NORMAL + case .large: + return GTK_ICON_SIZE_LARGE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/IconThemeError.swift b/Sources/Gtk/Generated/IconThemeError.swift index 5a152db246..537df0dc54 100644 --- a/Sources/Gtk/Generated/IconThemeError.swift +++ b/Sources/Gtk/Generated/IconThemeError.swift @@ -5,20 +5,20 @@ public enum IconThemeError: GValueRepresentableEnum { public typealias GtkEnum = GtkIconThemeError /// The icon specified does not exist in the theme -case notFound -/// An unspecified error occurred. -case failed + case notFound + /// An unspecified error occurred. + case failed public static var type: GType { - gtk_icon_theme_error_get_type() -} + gtk_icon_theme_error_get_type() + } public init(from gtkEnum: GtkIconThemeError) { switch gtkEnum { case GTK_ICON_THEME_NOT_FOUND: - self = .notFound -case GTK_ICON_THEME_FAILED: - self = .failed + self = .notFound + case GTK_ICON_THEME_FAILED: + self = .failed default: fatalError("Unsupported GtkIconThemeError enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ case GTK_ICON_THEME_FAILED: public func toGtk() -> GtkIconThemeError { switch self { case .notFound: - return GTK_ICON_THEME_NOT_FOUND -case .failed: - return GTK_ICON_THEME_FAILED + return GTK_ICON_THEME_NOT_FOUND + case .failed: + return GTK_ICON_THEME_FAILED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/IconViewDropPosition.swift b/Sources/Gtk/Generated/IconViewDropPosition.swift index 3f3b74fba7..b6c709f411 100644 --- a/Sources/Gtk/Generated/IconViewDropPosition.swift +++ b/Sources/Gtk/Generated/IconViewDropPosition.swift @@ -5,36 +5,36 @@ public enum IconViewDropPosition: GValueRepresentableEnum { public typealias GtkEnum = GtkIconViewDropPosition /// No drop possible -case noDrop -/// Dropped item replaces the item -case dropInto -/// Dropped item is inserted to the left -case dropLeft -/// Dropped item is inserted to the right -case dropRight -/// Dropped item is inserted above -case dropAbove -/// Dropped item is inserted below -case dropBelow + case noDrop + /// Dropped item replaces the item + case dropInto + /// Dropped item is inserted to the left + case dropLeft + /// Dropped item is inserted to the right + case dropRight + /// Dropped item is inserted above + case dropAbove + /// Dropped item is inserted below + case dropBelow public static var type: GType { - gtk_icon_view_drop_position_get_type() -} + gtk_icon_view_drop_position_get_type() + } public init(from gtkEnum: GtkIconViewDropPosition) { switch gtkEnum { case GTK_ICON_VIEW_NO_DROP: - self = .noDrop -case GTK_ICON_VIEW_DROP_INTO: - self = .dropInto -case GTK_ICON_VIEW_DROP_LEFT: - self = .dropLeft -case GTK_ICON_VIEW_DROP_RIGHT: - self = .dropRight -case GTK_ICON_VIEW_DROP_ABOVE: - self = .dropAbove -case GTK_ICON_VIEW_DROP_BELOW: - self = .dropBelow + self = .noDrop + case GTK_ICON_VIEW_DROP_INTO: + self = .dropInto + case GTK_ICON_VIEW_DROP_LEFT: + self = .dropLeft + case GTK_ICON_VIEW_DROP_RIGHT: + self = .dropRight + case GTK_ICON_VIEW_DROP_ABOVE: + self = .dropAbove + case GTK_ICON_VIEW_DROP_BELOW: + self = .dropBelow default: fatalError("Unsupported GtkIconViewDropPosition enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ case GTK_ICON_VIEW_DROP_BELOW: public func toGtk() -> GtkIconViewDropPosition { switch self { case .noDrop: - return GTK_ICON_VIEW_NO_DROP -case .dropInto: - return GTK_ICON_VIEW_DROP_INTO -case .dropLeft: - return GTK_ICON_VIEW_DROP_LEFT -case .dropRight: - return GTK_ICON_VIEW_DROP_RIGHT -case .dropAbove: - return GTK_ICON_VIEW_DROP_ABOVE -case .dropBelow: - return GTK_ICON_VIEW_DROP_BELOW + return GTK_ICON_VIEW_NO_DROP + case .dropInto: + return GTK_ICON_VIEW_DROP_INTO + case .dropLeft: + return GTK_ICON_VIEW_DROP_LEFT + case .dropRight: + return GTK_ICON_VIEW_DROP_RIGHT + case .dropAbove: + return GTK_ICON_VIEW_DROP_ABOVE + case .dropBelow: + return GTK_ICON_VIEW_DROP_BELOW } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Image.swift b/Sources/Gtk/Generated/Image.swift index c33bfbdeba..be138278de 100644 --- a/Sources/Gtk/Generated/Image.swift +++ b/Sources/Gtk/Generated/Image.swift @@ -1,272 +1,281 @@ import CGtk /// Displays an image. -/// +/// /// picture>An example GtkImage -/// +/// /// Various kinds of object can be displayed as an image; most typically, /// you would load a `GdkTexture` from a file, using the convenience function /// [ctor@Gtk.Image.new_from_file], for instance: -/// +/// /// ```c /// GtkWidget *image = gtk_image_new_from_file ("myfile.png"); /// ``` -/// +/// /// If the file isn’t loaded successfully, the image will contain a /// “broken image” icon similar to that used in many web browsers. -/// +/// /// If you want to handle errors in loading the file yourself, for example /// by displaying an error message, then load the image with an image /// loading framework such as libglycin, then create the `GtkImage` with /// [ctor@Gtk.Image.new_from_paintable]. -/// +/// /// Sometimes an application will want to avoid depending on external data /// files, such as image files. See the documentation of `GResource` inside /// GIO, for details. In this case, [property@Gtk.Image:resource], /// [ctor@Gtk.Image.new_from_resource], and [method@Gtk.Image.set_from_resource] /// should be used. -/// +/// /// `GtkImage` displays its image as an icon, with a size that is determined /// by the application. See [class@Gtk.Picture] if you want to show an image /// at is actual size. -/// +/// /// ## CSS nodes -/// +/// /// `GtkImage` has a single CSS node with the name `image`. The style classes /// `.normal-icons` or `.large-icons` may appear, depending on the /// [property@Gtk.Image:icon-size] property. -/// +/// /// ## Accessibility -/// +/// /// `GtkImage` uses the [enum@Gtk.AccessibleRole.img] role. open class Image: Widget { /// Creates a new empty `GtkImage` widget. -public convenience init() { - self.init( - gtk_image_new() - ) -} - -/// Creates a new `GtkImage` displaying the file @filename. -/// -/// If the file isn’t found or can’t be loaded, the resulting `GtkImage` -/// will display a “broken image” icon. This function never returns %NULL, -/// it always returns a valid `GtkImage` widget. -/// -/// If you need to detect failures to load the file, use an -/// image loading framework such as libglycin to load the file -/// yourself, then create the `GtkImage` from the texture. -/// -/// The storage type (see [method@Gtk.Image.get_storage_type]) -/// of the returned image is not defined, it will be whatever -/// is appropriate for displaying the file. -public convenience init(filename: String) { - self.init( - gtk_image_new_from_file(filename) - ) -} - -/// Creates a `GtkImage` displaying an icon from the current icon theme. -/// -/// If the icon name isn’t known, a “broken image” icon will be -/// displayed instead. If the current icon theme is changed, the icon -/// will be updated appropriately. -public convenience init(icon: OpaquePointer) { - self.init( - gtk_image_new_from_gicon(icon) - ) -} - -/// Creates a `GtkImage` displaying an icon from the current icon theme. -/// -/// If the icon name isn’t known, a “broken image” icon will be -/// displayed instead. If the current icon theme is changed, the icon -/// will be updated appropriately. -public convenience init(iconName: String) { - self.init( - gtk_image_new_from_icon_name(iconName) - ) -} - -/// Creates a new `GtkImage` displaying @paintable. -/// -/// The `GtkImage` does not assume a reference to the paintable; you still -/// need to unref it if you own references. `GtkImage` will add its own -/// reference rather than adopting yours. -/// -/// The `GtkImage` will track changes to the @paintable and update -/// its size and contents in response to it. -/// -/// Note that paintables are still subject to the icon size that is -/// set on the image. If you want to display a paintable at its intrinsic -/// size, use [class@Gtk.Picture] instead. -/// -/// If @paintable is a [iface@Gtk.SymbolicPaintable], then it will be -/// recolored with the symbolic palette from the theme. -public convenience init(paintable: OpaquePointer) { - self.init( - gtk_image_new_from_paintable(paintable) - ) -} - -/// Creates a new `GtkImage` displaying the resource file @resource_path. -/// -/// If the file isn’t found or can’t be loaded, the resulting `GtkImage` will -/// display a “broken image” icon. This function never returns %NULL, -/// it always returns a valid `GtkImage` widget. -/// -/// If you need to detect failures to load the file, use an -/// image loading framework such as libglycin to load the file -/// yourself, then create the `GtkImage` from the texture. -/// -/// The storage type (see [method@Gtk.Image.get_storage_type]) of -/// the returned image is not defined, it will be whatever is -/// appropriate for displaying the file. -public convenience init(resourcePath: String) { - self.init( - gtk_image_new_from_resource(resourcePath) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::file", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFile?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_image_new() + ) } -addSignal(name: "notify::gicon", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyGicon?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::icon-name", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIconName?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new `GtkImage` displaying the file @filename. + /// + /// If the file isn’t found or can’t be loaded, the resulting `GtkImage` + /// will display a “broken image” icon. This function never returns %NULL, + /// it always returns a valid `GtkImage` widget. + /// + /// If you need to detect failures to load the file, use an + /// image loading framework such as libglycin to load the file + /// yourself, then create the `GtkImage` from the texture. + /// + /// The storage type (see [method@Gtk.Image.get_storage_type]) + /// of the returned image is not defined, it will be whatever + /// is appropriate for displaying the file. + public convenience init(filename: String) { + self.init( + gtk_image_new_from_file(filename) + ) } -addSignal(name: "notify::icon-size", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIconSize?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a `GtkImage` displaying an icon from the current icon theme. + /// + /// If the icon name isn’t known, a “broken image” icon will be + /// displayed instead. If the current icon theme is changed, the icon + /// will be updated appropriately. + public convenience init(icon: OpaquePointer) { + self.init( + gtk_image_new_from_gicon(icon) + ) } -addSignal(name: "notify::paintable", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPaintable?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a `GtkImage` displaying an icon from the current icon theme. + /// + /// If the icon name isn’t known, a “broken image” icon will be + /// displayed instead. If the current icon theme is changed, the icon + /// will be updated appropriately. + public convenience init(iconName: String) { + self.init( + gtk_image_new_from_icon_name(iconName) + ) } -addSignal(name: "notify::pixel-size", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPixelSize?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new `GtkImage` displaying @paintable. + /// + /// The `GtkImage` does not assume a reference to the paintable; you still + /// need to unref it if you own references. `GtkImage` will add its own + /// reference rather than adopting yours. + /// + /// The `GtkImage` will track changes to the @paintable and update + /// its size and contents in response to it. + /// + /// Note that paintables are still subject to the icon size that is + /// set on the image. If you want to display a paintable at its intrinsic + /// size, use [class@Gtk.Picture] instead. + /// + /// If @paintable is a [iface@Gtk.SymbolicPaintable], then it will be + /// recolored with the symbolic palette from the theme. + public convenience init(paintable: OpaquePointer) { + self.init( + gtk_image_new_from_paintable(paintable) + ) } -addSignal(name: "notify::resource", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyResource?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new `GtkImage` displaying the resource file @resource_path. + /// + /// If the file isn’t found or can’t be loaded, the resulting `GtkImage` will + /// display a “broken image” icon. This function never returns %NULL, + /// it always returns a valid `GtkImage` widget. + /// + /// If you need to detect failures to load the file, use an + /// image loading framework such as libglycin to load the file + /// yourself, then create the `GtkImage` from the texture. + /// + /// The storage type (see [method@Gtk.Image.get_storage_type]) of + /// the returned image is not defined, it will be whatever is + /// appropriate for displaying the file. + public convenience init(resourcePath: String) { + self.init( + gtk_image_new_from_resource(resourcePath) + ) } -addSignal(name: "notify::storage-type", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyStorageType?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::file", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFile?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::gicon", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyGicon?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::icon-name", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIconName?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::icon-size", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIconSize?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::paintable", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPaintable?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::pixel-size", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPixelSize?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::resource", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyResource?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::storage-type", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyStorageType?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-fallback", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseFallback?(self, param0) + } } -addSignal(name: "notify::use-fallback", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseFallback?(self, param0) -} -} - /// The name of the icon in the icon theme. -/// -/// If the icon theme is changed, the image will be updated automatically. -@GObjectProperty(named: "icon-name") public var iconName: String? - -/// The symbolic size to display icons at. -@GObjectProperty(named: "icon-size") public var iconSize: IconSize - -/// The `GdkPaintable` to display. -@GObjectProperty(named: "paintable") public var paintable: OpaquePointer? - -/// The size in pixels to display icons at. -/// -/// If set to a value != -1, this property overrides the -/// [property@Gtk.Image:icon-size] property for images of type -/// `GTK_IMAGE_ICON_NAME`. -@GObjectProperty(named: "pixel-size") public var pixelSize: Int - -/// The representation being used for image data. -@GObjectProperty(named: "storage-type") public var storageType: ImageType - + /// + /// If the icon theme is changed, the image will be updated automatically. + @GObjectProperty(named: "icon-name") public var iconName: String? -public var notifyFile: ((Image, OpaquePointer) -> Void)? + /// The symbolic size to display icons at. + @GObjectProperty(named: "icon-size") public var iconSize: IconSize + /// The `GdkPaintable` to display. + @GObjectProperty(named: "paintable") public var paintable: OpaquePointer? -public var notifyGicon: ((Image, OpaquePointer) -> Void)? + /// The size in pixels to display icons at. + /// + /// If set to a value != -1, this property overrides the + /// [property@Gtk.Image:icon-size] property for images of type + /// `GTK_IMAGE_ICON_NAME`. + @GObjectProperty(named: "pixel-size") public var pixelSize: Int + /// The representation being used for image data. + @GObjectProperty(named: "storage-type") public var storageType: ImageType -public var notifyIconName: ((Image, OpaquePointer) -> Void)? + public var notifyFile: ((Image, OpaquePointer) -> Void)? + public var notifyGicon: ((Image, OpaquePointer) -> Void)? -public var notifyIconSize: ((Image, OpaquePointer) -> Void)? + public var notifyIconName: ((Image, OpaquePointer) -> Void)? + public var notifyIconSize: ((Image, OpaquePointer) -> Void)? -public var notifyPaintable: ((Image, OpaquePointer) -> Void)? + public var notifyPaintable: ((Image, OpaquePointer) -> Void)? + public var notifyPixelSize: ((Image, OpaquePointer) -> Void)? -public var notifyPixelSize: ((Image, OpaquePointer) -> Void)? + public var notifyResource: ((Image, OpaquePointer) -> Void)? + public var notifyStorageType: ((Image, OpaquePointer) -> Void)? -public var notifyResource: ((Image, OpaquePointer) -> Void)? - - -public var notifyStorageType: ((Image, OpaquePointer) -> Void)? - - -public var notifyUseFallback: ((Image, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyUseFallback: ((Image, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/ImageType.swift b/Sources/Gtk/Generated/ImageType.swift index f34b0ae104..1adff5b1de 100644 --- a/Sources/Gtk/Generated/ImageType.swift +++ b/Sources/Gtk/Generated/ImageType.swift @@ -1,39 +1,39 @@ import CGtk /// Describes the image data representation used by a [class@Gtk.Image]. -/// +/// /// If you want to get the image from the widget, you can only get the /// currently-stored representation; for instance, if the gtk_image_get_storage_type() /// returns %GTK_IMAGE_PAINTABLE, then you can call gtk_image_get_paintable(). -/// +/// /// For empty images, you can request any storage type (call any of the "get" /// functions), but they will all return %NULL values. public enum ImageType: GValueRepresentableEnum { public typealias GtkEnum = GtkImageType /// There is no image displayed by the widget -case empty -/// The widget contains a named icon -case iconName -/// The widget contains a `GIcon` -case gicon -/// The widget contains a `GdkPaintable` -case paintable + case empty + /// The widget contains a named icon + case iconName + /// The widget contains a `GIcon` + case gicon + /// The widget contains a `GdkPaintable` + case paintable public static var type: GType { - gtk_image_type_get_type() -} + gtk_image_type_get_type() + } public init(from gtkEnum: GtkImageType) { switch gtkEnum { case GTK_IMAGE_EMPTY: - self = .empty -case GTK_IMAGE_ICON_NAME: - self = .iconName -case GTK_IMAGE_GICON: - self = .gicon -case GTK_IMAGE_PAINTABLE: - self = .paintable + self = .empty + case GTK_IMAGE_ICON_NAME: + self = .iconName + case GTK_IMAGE_GICON: + self = .gicon + case GTK_IMAGE_PAINTABLE: + self = .paintable default: fatalError("Unsupported GtkImageType enum value: \(gtkEnum.rawValue)") } @@ -42,13 +42,13 @@ case GTK_IMAGE_PAINTABLE: public func toGtk() -> GtkImageType { switch self { case .empty: - return GTK_IMAGE_EMPTY -case .iconName: - return GTK_IMAGE_ICON_NAME -case .gicon: - return GTK_IMAGE_GICON -case .paintable: - return GTK_IMAGE_PAINTABLE + return GTK_IMAGE_EMPTY + case .iconName: + return GTK_IMAGE_ICON_NAME + case .gicon: + return GTK_IMAGE_GICON + case .paintable: + return GTK_IMAGE_PAINTABLE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/InputPurpose.swift b/Sources/Gtk/Generated/InputPurpose.swift index e4ac62b696..c18b9b1cad 100644 --- a/Sources/Gtk/Generated/InputPurpose.swift +++ b/Sources/Gtk/Generated/InputPurpose.swift @@ -1,78 +1,78 @@ import CGtk /// Describes primary purpose of the input widget. -/// +/// /// This information is useful for on-screen keyboards and similar input /// methods to decide which keys should be presented to the user. -/// +/// /// Note that the purpose is not meant to impose a totally strict rule /// about allowed characters, and does not replace input validation. /// It is fine for an on-screen keyboard to let the user override the /// character set restriction that is expressed by the purpose. The /// application is expected to validate the entry contents, even if /// it specified a purpose. -/// +/// /// The difference between %GTK_INPUT_PURPOSE_DIGITS and /// %GTK_INPUT_PURPOSE_NUMBER is that the former accepts only digits /// while the latter also some punctuation (like commas or points, plus, /// minus) and “e” or “E” as in 3.14E+000. -/// +/// /// This enumeration may be extended in the future; input methods should /// interpret unknown values as “free form”. public enum InputPurpose: GValueRepresentableEnum { public typealias GtkEnum = GtkInputPurpose /// Allow any character -case freeForm -/// Allow only alphabetic characters -case alpha -/// Allow only digits -case digits -/// Edited field expects numbers -case number -/// Edited field expects phone number -case phone -/// Edited field expects URL -case url -/// Edited field expects email address -case email -/// Edited field expects the name of a person -case name -/// Like %GTK_INPUT_PURPOSE_FREE_FORM, but characters are hidden -case password -/// Like %GTK_INPUT_PURPOSE_DIGITS, but characters are hidden -case pin -/// Allow any character, in addition to control codes -case terminal + case freeForm + /// Allow only alphabetic characters + case alpha + /// Allow only digits + case digits + /// Edited field expects numbers + case number + /// Edited field expects phone number + case phone + /// Edited field expects URL + case url + /// Edited field expects email address + case email + /// Edited field expects the name of a person + case name + /// Like %GTK_INPUT_PURPOSE_FREE_FORM, but characters are hidden + case password + /// Like %GTK_INPUT_PURPOSE_DIGITS, but characters are hidden + case pin + /// Allow any character, in addition to control codes + case terminal public static var type: GType { - gtk_input_purpose_get_type() -} + gtk_input_purpose_get_type() + } public init(from gtkEnum: GtkInputPurpose) { switch gtkEnum { case GTK_INPUT_PURPOSE_FREE_FORM: - self = .freeForm -case GTK_INPUT_PURPOSE_ALPHA: - self = .alpha -case GTK_INPUT_PURPOSE_DIGITS: - self = .digits -case GTK_INPUT_PURPOSE_NUMBER: - self = .number -case GTK_INPUT_PURPOSE_PHONE: - self = .phone -case GTK_INPUT_PURPOSE_URL: - self = .url -case GTK_INPUT_PURPOSE_EMAIL: - self = .email -case GTK_INPUT_PURPOSE_NAME: - self = .name -case GTK_INPUT_PURPOSE_PASSWORD: - self = .password -case GTK_INPUT_PURPOSE_PIN: - self = .pin -case GTK_INPUT_PURPOSE_TERMINAL: - self = .terminal + self = .freeForm + case GTK_INPUT_PURPOSE_ALPHA: + self = .alpha + case GTK_INPUT_PURPOSE_DIGITS: + self = .digits + case GTK_INPUT_PURPOSE_NUMBER: + self = .number + case GTK_INPUT_PURPOSE_PHONE: + self = .phone + case GTK_INPUT_PURPOSE_URL: + self = .url + case GTK_INPUT_PURPOSE_EMAIL: + self = .email + case GTK_INPUT_PURPOSE_NAME: + self = .name + case GTK_INPUT_PURPOSE_PASSWORD: + self = .password + case GTK_INPUT_PURPOSE_PIN: + self = .pin + case GTK_INPUT_PURPOSE_TERMINAL: + self = .terminal default: fatalError("Unsupported GtkInputPurpose enum value: \(gtkEnum.rawValue)") } @@ -81,27 +81,27 @@ case GTK_INPUT_PURPOSE_TERMINAL: public func toGtk() -> GtkInputPurpose { switch self { case .freeForm: - return GTK_INPUT_PURPOSE_FREE_FORM -case .alpha: - return GTK_INPUT_PURPOSE_ALPHA -case .digits: - return GTK_INPUT_PURPOSE_DIGITS -case .number: - return GTK_INPUT_PURPOSE_NUMBER -case .phone: - return GTK_INPUT_PURPOSE_PHONE -case .url: - return GTK_INPUT_PURPOSE_URL -case .email: - return GTK_INPUT_PURPOSE_EMAIL -case .name: - return GTK_INPUT_PURPOSE_NAME -case .password: - return GTK_INPUT_PURPOSE_PASSWORD -case .pin: - return GTK_INPUT_PURPOSE_PIN -case .terminal: - return GTK_INPUT_PURPOSE_TERMINAL + return GTK_INPUT_PURPOSE_FREE_FORM + case .alpha: + return GTK_INPUT_PURPOSE_ALPHA + case .digits: + return GTK_INPUT_PURPOSE_DIGITS + case .number: + return GTK_INPUT_PURPOSE_NUMBER + case .phone: + return GTK_INPUT_PURPOSE_PHONE + case .url: + return GTK_INPUT_PURPOSE_URL + case .email: + return GTK_INPUT_PURPOSE_EMAIL + case .name: + return GTK_INPUT_PURPOSE_NAME + case .password: + return GTK_INPUT_PURPOSE_PASSWORD + case .pin: + return GTK_INPUT_PURPOSE_PIN + case .terminal: + return GTK_INPUT_PURPOSE_TERMINAL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Justification.swift b/Sources/Gtk/Generated/Justification.swift index 334fad46ff..a8d21f5f87 100644 --- a/Sources/Gtk/Generated/Justification.swift +++ b/Sources/Gtk/Generated/Justification.swift @@ -5,28 +5,28 @@ public enum Justification: GValueRepresentableEnum { public typealias GtkEnum = GtkJustification /// The text is placed at the left edge of the label. -case left -/// The text is placed at the right edge of the label. -case right -/// The text is placed in the center of the label. -case center -/// The text is placed is distributed across the label. -case fill + case left + /// The text is placed at the right edge of the label. + case right + /// The text is placed in the center of the label. + case center + /// The text is placed is distributed across the label. + case fill public static var type: GType { - gtk_justification_get_type() -} + gtk_justification_get_type() + } public init(from gtkEnum: GtkJustification) { switch gtkEnum { case GTK_JUSTIFY_LEFT: - self = .left -case GTK_JUSTIFY_RIGHT: - self = .right -case GTK_JUSTIFY_CENTER: - self = .center -case GTK_JUSTIFY_FILL: - self = .fill + self = .left + case GTK_JUSTIFY_RIGHT: + self = .right + case GTK_JUSTIFY_CENTER: + self = .center + case GTK_JUSTIFY_FILL: + self = .fill default: fatalError("Unsupported GtkJustification enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_JUSTIFY_FILL: public func toGtk() -> GtkJustification { switch self { case .left: - return GTK_JUSTIFY_LEFT -case .right: - return GTK_JUSTIFY_RIGHT -case .center: - return GTK_JUSTIFY_CENTER -case .fill: - return GTK_JUSTIFY_FILL + return GTK_JUSTIFY_LEFT + case .right: + return GTK_JUSTIFY_RIGHT + case .center: + return GTK_JUSTIFY_CENTER + case .fill: + return GTK_JUSTIFY_FILL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Label.swift b/Sources/Gtk/Generated/Label.swift index 0cba1191aa..f1e759cca0 100644 --- a/Sources/Gtk/Generated/Label.swift +++ b/Sources/Gtk/Generated/Label.swift @@ -1,32 +1,32 @@ import CGtk /// Displays a small amount of text. -/// +/// /// Most labels are used to label another widget (such as an [class@Entry]). -/// +/// /// An example GtkLabel -/// +/// /// ## Shortcuts and Gestures -/// +/// /// `GtkLabel` supports the following keyboard shortcuts, when the cursor is /// visible: -/// +/// /// - Shift+F10 or Menu opens the context menu. /// - Ctrl+A or Ctrl+/ /// selects all. /// - Ctrl+Shift+A or /// Ctrl+\ unselects all. -/// +/// /// Additionally, the following signals have default keybindings: -/// +/// /// - [signal@Gtk.Label::activate-current-link] /// - [signal@Gtk.Label::copy-clipboard] /// - [signal@Gtk.Label::move-cursor] -/// +/// /// ## Actions -/// +/// /// `GtkLabel` defines a set of built-in actions: -/// +/// /// - `clipboard.copy` copies the text to the clipboard. /// - `clipboard.cut` doesn't do anything, since text in labels can't be deleted. /// - `clipboard.paste` doesn't do anything, since text in labels can't be @@ -39,9 +39,9 @@ import CGtk /// deleted. /// - `selection.select-all` selects all of the text, if the label allows /// selection. -/// +/// /// ## CSS nodes -/// +/// /// ``` /// label /// ├── [selection] @@ -49,103 +49,103 @@ import CGtk /// ┊ /// ╰── [link] /// ``` -/// +/// /// `GtkLabel` has a single CSS node with the name label. A wide variety /// of style classes may be applied to labels, such as .title, .subtitle, /// .dim-label, etc. In the `GtkShortcutsWindow`, labels are used with the /// .keycap style class. -/// +/// /// If the label has a selection, it gets a subnode with name selection. -/// +/// /// If the label has links, there is one subnode per link. These subnodes /// carry the link or visited state depending on whether they have been /// visited. In this case, label node also gets a .link style class. -/// +/// /// ## GtkLabel as GtkBuildable -/// +/// /// The GtkLabel implementation of the GtkBuildable interface supports a /// custom `` element, which supports any number of `` /// elements. The `` element has attributes named “name“, “value“, /// “start“ and “end“ and allows you to specify [struct@Pango.Attribute] /// values for this label. -/// +/// /// An example of a UI definition fragment specifying Pango attributes: -/// +/// /// ```xml /// /// ``` -/// +/// /// The start and end attributes specify the range of characters to which the /// Pango attribute applies. If start and end are not specified, the attribute is /// applied to the whole text. Note that specifying ranges does not make much /// sense with translatable attributes. Use markup embedded in the translatable /// content instead. -/// +/// /// ## Accessibility -/// +/// /// `GtkLabel` uses the [enum@Gtk.AccessibleRole.label] role. -/// +/// /// ## Mnemonics -/// +/// /// Labels may contain “mnemonics”. Mnemonics are underlined characters in the /// label, used for keyboard navigation. Mnemonics are created by providing a /// string with an underscore before the mnemonic character, such as `"_File"`, /// to the functions [ctor@Gtk.Label.new_with_mnemonic] or /// [method@Gtk.Label.set_text_with_mnemonic]. -/// +/// /// Mnemonics automatically activate any activatable widget the label is /// inside, such as a [class@Gtk.Button]; if the label is not inside the /// mnemonic’s target widget, you have to tell the label about the target /// using [method@Gtk.Label.set_mnemonic_widget]. -/// +/// /// Here’s a simple example where the label is inside a button: -/// +/// /// ```c /// // Pressing Alt+H will activate this button /// GtkWidget *button = gtk_button_new (); /// GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello"); /// gtk_button_set_child (GTK_BUTTON (button), label); /// ``` -/// +/// /// There’s a convenience function to create buttons with a mnemonic label /// already inside: -/// +/// /// ```c /// // Pressing Alt+H will activate this button /// GtkWidget *button = gtk_button_new_with_mnemonic ("_Hello"); /// ``` -/// +/// /// To create a mnemonic for a widget alongside the label, such as a /// [class@Gtk.Entry], you have to point the label at the entry with /// [method@Gtk.Label.set_mnemonic_widget]: -/// +/// /// ```c /// // Pressing Alt+H will focus the entry /// GtkWidget *entry = gtk_entry_new (); /// GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello"); /// gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry); /// ``` -/// +/// /// ## Markup (styled text) -/// +/// /// To make it easy to format text in a label (changing colors, fonts, etc.), /// label text can be provided in a simple markup format: -/// +/// /// Here’s how to create a label with a small font: /// ```c /// GtkWidget *label = gtk_label_new (NULL); /// gtk_label_set_markup (GTK_LABEL (label), "Small text"); /// ``` -/// +/// /// (See the Pango manual for complete documentation] of available /// tags, [func@Pango.parse_markup]) -/// +/// /// The markup passed to [method@Gtk.Label.set_markup] must be valid XML; for example, /// literal `<`, `>` and `&` characters must be escaped as `<`, `>`, and `&`. /// If you pass text obtained from the user, file, or a network to /// [method@Gtk.Label.set_markup], you’ll want to escape it with /// [func@GLib.markup_escape_text] or [func@GLib.markup_printf_escaped]. -/// +/// /// Markup strings are just a convenient way to set the [struct@Pango.AttrList] /// on a label; [method@Gtk.Label.set_attributes] may be a simpler way to set /// attributes in some cases. Be careful though; [struct@Pango.AttrList] tends @@ -154,28 +154,28 @@ import CGtk /// to [0, `G_MAXINT`)). The reason is that specifying the `start_index` and /// `end_index` for a [struct@Pango.Attribute] requires knowledge of the exact /// string being displayed, so translations will cause problems. -/// +/// /// ## Selectable labels -/// +/// /// Labels can be made selectable with [method@Gtk.Label.set_selectable]. /// Selectable labels allow the user to copy the label contents to the /// clipboard. Only labels that contain useful-to-copy information — such /// as error messages — should be made selectable. -/// +/// /// ## Text layout -/// +/// /// A label can contain any number of paragraphs, but will have /// performance problems if it contains more than a small number. /// Paragraphs are separated by newlines or other paragraph separators /// understood by Pango. -/// +/// /// Labels can automatically wrap text if you call [method@Gtk.Label.set_wrap]. -/// +/// /// [method@Gtk.Label.set_justify] sets how the lines in a label align /// with one another. If you want to set how the label as a whole aligns /// in its available space, see the [property@Gtk.Widget:halign] and /// [property@Gtk.Widget:valign] properties. -/// +/// /// The [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] /// properties can be used to control the size allocation of ellipsized or /// wrapped labels. For ellipsizing labels, if either is specified (and less @@ -184,18 +184,18 @@ import CGtk /// width-chars is used as the minimum width, if specified, and max-width-chars /// is used as the natural width. Even if max-width-chars specified, wrapping /// labels will be rewrapped to use all of the available width. -/// +/// /// ## Links -/// +/// /// GTK supports markup for clickable hyperlinks in addition to regular Pango /// markup. The markup for links is borrowed from HTML, using the `` tag /// with “href“, “title“ and “class“ attributes. GTK renders links similar to /// the way they appear in web browsers, with colored, underlined text. The /// “title“ attribute is displayed as a tooltip on the link. The “class“ /// attribute is used as style class on the CSS node for the link. -/// +/// /// An example of inline links looks like this: -/// +/// /// ```c /// const char *text = /// "Go to the " @@ -204,455 +204,481 @@ import CGtk /// GtkWidget *label = gtk_label_new (NULL); /// gtk_label_set_markup (GTK_LABEL (label), text); /// ``` -/// +/// /// It is possible to implement custom handling for links and their tooltips /// with the [signal@Gtk.Label::activate-link] signal and the /// [method@Gtk.Label.get_current_uri] function. open class Label: Widget { /// Creates a new label with the given text inside it. -/// -/// You can pass `NULL` to get an empty label widget. -public convenience init(string: String) { - self.init( - gtk_label_new(string) - ) -} - -/// Creates a new label with the given text inside it, and a mnemonic. -/// -/// If characters in @str are preceded by an underscore, they are -/// underlined. If you need a literal underscore character in a label, use -/// '__' (two underscores). The first underlined character represents a -/// keyboard accelerator called a mnemonic. The mnemonic key can be used -/// to activate another widget, chosen automatically, or explicitly using -/// [method@Gtk.Label.set_mnemonic_widget]. -/// -/// If [method@Gtk.Label.set_mnemonic_widget] is not called, then the first -/// activatable ancestor of the label will be chosen as the mnemonic -/// widget. For instance, if the label is inside a button or menu item, -/// the button or menu item will automatically become the mnemonic widget -/// and be activated by the mnemonic. -public convenience init(mnemonic string: String) { - self.init( - gtk_label_new_with_mnemonic(string) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate-current-link") { [weak self] () in - guard let self = self else { return } - self.activateCurrentLink?(self) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1>.run(data, value1) - } - -addSignal(name: "activate-link", handler: gCallback(handler1)) { [weak self] (param0: UnsafePointer) in - guard let self = self else { return } - self.activateLink?(self, param0) -} - -addSignal(name: "copy-clipboard") { [weak self] () in - guard let self = self else { return } - self.copyClipboard?(self) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, value3, data in - SignalBox3.run(data, value1, value2, value3) - } - -addSignal(name: "move-cursor", handler: gCallback(handler3)) { [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool) in - guard let self = self else { return } - self.moveCursor?(self, param0, param1, param2) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::attributes", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAttributes?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::ellipsize", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEllipsize?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::extra-menu", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExtraMenu?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::justify", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyJustify?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::label", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLabel?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::lines", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLines?(self, param0) -} - -let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// + /// You can pass `NULL` to get an empty label widget. + public convenience init(string: String) { + self.init( + gtk_label_new(string) + ) } -addSignal(name: "notify::max-width-chars", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMaxWidthChars?(self, param0) -} - -let handler11: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new label with the given text inside it, and a mnemonic. + /// + /// If characters in @str are preceded by an underscore, they are + /// underlined. If you need a literal underscore character in a label, use + /// '__' (two underscores). The first underlined character represents a + /// keyboard accelerator called a mnemonic. The mnemonic key can be used + /// to activate another widget, chosen automatically, or explicitly using + /// [method@Gtk.Label.set_mnemonic_widget]. + /// + /// If [method@Gtk.Label.set_mnemonic_widget] is not called, then the first + /// activatable ancestor of the label will be chosen as the mnemonic + /// widget. For instance, if the label is inside a button or menu item, + /// the button or menu item will automatically become the mnemonic widget + /// and be activated by the mnemonic. + public convenience init(mnemonic string: String) { + self.init( + gtk_label_new_with_mnemonic(string) + ) } -addSignal(name: "notify::mnemonic-keyval", handler: gCallback(handler11)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMnemonicKeyval?(self, param0) -} - -let handler12: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate-current-link") { [weak self] () in + guard let self = self else { return } + self.activateCurrentLink?(self) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) + -> Void = + { _, value1, data in + SignalBox1>.run(data, value1) + } + + addSignal(name: "activate-link", handler: gCallback(handler1)) { + [weak self] (param0: UnsafePointer) in + guard let self = self else { return } + self.activateLink?(self, param0) + } + + addSignal(name: "copy-clipboard") { [weak self] () in + guard let self = self else { return } + self.copyClipboard?(self) + } + + let handler3: + @convention(c) ( + UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, UnsafeMutableRawPointer + ) -> Void = + { _, value1, value2, value3, data in + SignalBox3.run(data, value1, value2, value3) + } + + addSignal(name: "move-cursor", handler: gCallback(handler3)) { + [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool) in + guard let self = self else { return } + self.moveCursor?(self, param0, param1, param2) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::attributes", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAttributes?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::ellipsize", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEllipsize?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::extra-menu", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExtraMenu?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::justify", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyJustify?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::label", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLabel?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::lines", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLines?(self, param0) + } + + let handler10: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::max-width-chars", handler: gCallback(handler10)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMaxWidthChars?(self, param0) + } + + let handler11: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::mnemonic-keyval", handler: gCallback(handler11)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMnemonicKeyval?(self, param0) + } + + let handler12: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::natural-wrap-mode", handler: gCallback(handler12)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyNaturalWrapMode?(self, param0) + } + + let handler13: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::selectable", handler: gCallback(handler13)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectable?(self, param0) + } + + let handler14: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::single-line-mode", handler: gCallback(handler14)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySingleLineMode?(self, param0) + } + + let handler15: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::tabs", handler: gCallback(handler15)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTabs?(self, param0) + } + + let handler16: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-markup", handler: gCallback(handler16)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseMarkup?(self, param0) + } + + let handler17: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-underline", handler: gCallback(handler17)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseUnderline?(self, param0) + } + + let handler18: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::width-chars", handler: gCallback(handler18)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWidthChars?(self, param0) + } + + let handler19: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::wrap", handler: gCallback(handler19)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWrap?(self, param0) + } + + let handler20: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::wrap-mode", handler: gCallback(handler20)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWrapMode?(self, param0) + } + + let handler21: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::xalign", handler: gCallback(handler21)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyXalign?(self, param0) + } + + let handler22: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::yalign", handler: gCallback(handler22)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyYalign?(self, param0) + } } -addSignal(name: "notify::natural-wrap-mode", handler: gCallback(handler12)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyNaturalWrapMode?(self, param0) -} - -let handler13: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::selectable", handler: gCallback(handler13)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectable?(self, param0) -} - -let handler14: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::single-line-mode", handler: gCallback(handler14)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySingleLineMode?(self, param0) -} - -let handler15: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::tabs", handler: gCallback(handler15)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTabs?(self, param0) -} - -let handler16: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::use-markup", handler: gCallback(handler16)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseMarkup?(self, param0) -} - -let handler17: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::use-underline", handler: gCallback(handler17)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseUnderline?(self, param0) -} - -let handler18: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::width-chars", handler: gCallback(handler18)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWidthChars?(self, param0) -} - -let handler19: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::wrap", handler: gCallback(handler19)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWrap?(self, param0) -} - -let handler20: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::wrap-mode", handler: gCallback(handler20)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWrapMode?(self, param0) -} - -let handler21: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::xalign", handler: gCallback(handler21)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyXalign?(self, param0) -} - -let handler22: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::yalign", handler: gCallback(handler22)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyYalign?(self, param0) -} -} - /// The alignment of the lines in the text of the label, relative to each other. -/// -/// This does *not* affect the alignment of the label within its allocation. -/// See [property@Gtk.Label:xalign] for that. -@GObjectProperty(named: "justify") public var justify: Justification - -/// The contents of the label. -/// -/// If the string contains Pango markup (see [func@Pango.parse_markup]), -/// you will have to set the [property@Gtk.Label:use-markup] property to -/// true in order for the label to display the markup attributes. See also -/// [method@Gtk.Label.set_markup] for a convenience function that sets both -/// this property and the [property@Gtk.Label:use-markup] property at the -/// same time. -/// -/// If the string contains underlines acting as mnemonics, you will have to -/// set the [property@Gtk.Label:use-underline] property to true in order -/// for the label to display them. -@GObjectProperty(named: "label") public var label: String - -/// The number of lines to which an ellipsized, wrapping label -/// should display before it gets ellipsized. This both prevents the label -/// from ellipsizing before this many lines are displayed, and limits the -/// height request of the label to this many lines. -/// -/// ::: warning -/// Setting this property has unintuitive and unfortunate consequences -/// for the minimum _width_ of the label. Specifically, if the height -/// of the label is such that it fits a smaller number of lines than -/// the value of this property, the label can not be ellipsized at all, -/// which means it must be wide enough to fit all the text fully. -/// -/// This property has no effect if the label is not wrapping or ellipsized. -/// -/// Set this property to -1 if you don't want to limit the number of lines. -@GObjectProperty(named: "lines") public var lines: Int - -/// The desired maximum width of the label, in characters. -/// -/// If this property is set to -1, the width will be calculated automatically. -/// -/// See the section on [text layout](class.Label.html#text-layout) for details -/// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] -/// determine the width of ellipsized and wrapped labels. -@GObjectProperty(named: "max-width-chars") public var maxWidthChars: Int - -/// The mnemonic accelerator key for the label. -@GObjectProperty(named: "mnemonic-keyval") public var mnemonicKeyval: UInt - -/// Whether the label text can be selected with the mouse. -@GObjectProperty(named: "selectable") public var selectable: Bool - -/// Whether the label is in single line mode. -/// -/// In single line mode, the height of the label does not depend on the -/// actual text, it is always set to ascent + descent of the font. This -/// can be an advantage in situations where resizing the label because -/// of text changes would be distracting, e.g. in a statusbar. -@GObjectProperty(named: "single-line-mode") public var singleLineMode: Bool - -/// True if the text of the label includes Pango markup. -/// -/// See [func@Pango.parse_markup]. -@GObjectProperty(named: "use-markup") public var useMarkup: Bool - -/// True if the text of the label indicates a mnemonic with an `_` -/// before the mnemonic character. -@GObjectProperty(named: "use-underline") public var useUnderline: Bool - -/// The desired width of the label, in characters. -/// -/// If this property is set to -1, the width will be calculated automatically. -/// -/// See the section on [text layout](class.Label.html#text-layout) for details -/// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] -/// determine the width of ellipsized and wrapped labels. -@GObjectProperty(named: "width-chars") public var widthChars: Int - -/// True if the label text will wrap if it gets too wide. -@GObjectProperty(named: "wrap") public var wrap: Bool - -/// The horizontal alignment of the label text inside its size allocation. -/// -/// Compare this to [property@Gtk.Widget:halign], which determines how the -/// labels size allocation is positioned in the space available for the label. -@GObjectProperty(named: "xalign") public var xalign: Float - -/// The vertical alignment of the label text inside its size allocation. -/// -/// Compare this to [property@Gtk.Widget:valign], which determines how the -/// labels size allocation is positioned in the space available for the label. -@GObjectProperty(named: "yalign") public var yalign: Float - -/// Gets emitted when the user activates a link in the label. -/// -/// The `::activate-current-link` is a [keybinding signal](class.SignalAction.html). -/// -/// Applications may also emit the signal with g_signal_emit_by_name() -/// if they need to control activation of URIs programmatically. -/// -/// The default bindings for this signal are all forms of the Enter key. -public var activateCurrentLink: ((Label) -> Void)? - -/// Gets emitted to activate a URI. -/// -/// Applications may connect to it to override the default behaviour, -/// which is to call [method@Gtk.FileLauncher.launch]. -public var activateLink: ((Label, UnsafePointer) -> Void)? + /// + /// This does *not* affect the alignment of the label within its allocation. + /// See [property@Gtk.Label:xalign] for that. + @GObjectProperty(named: "justify") public var justify: Justification + + /// The contents of the label. + /// + /// If the string contains Pango markup (see [func@Pango.parse_markup]), + /// you will have to set the [property@Gtk.Label:use-markup] property to + /// true in order for the label to display the markup attributes. See also + /// [method@Gtk.Label.set_markup] for a convenience function that sets both + /// this property and the [property@Gtk.Label:use-markup] property at the + /// same time. + /// + /// If the string contains underlines acting as mnemonics, you will have to + /// set the [property@Gtk.Label:use-underline] property to true in order + /// for the label to display them. + @GObjectProperty(named: "label") public var label: String + + /// The number of lines to which an ellipsized, wrapping label + /// should display before it gets ellipsized. This both prevents the label + /// from ellipsizing before this many lines are displayed, and limits the + /// height request of the label to this many lines. + /// + /// ::: warning + /// Setting this property has unintuitive and unfortunate consequences + /// for the minimum _width_ of the label. Specifically, if the height + /// of the label is such that it fits a smaller number of lines than + /// the value of this property, the label can not be ellipsized at all, + /// which means it must be wide enough to fit all the text fully. + /// + /// This property has no effect if the label is not wrapping or ellipsized. + /// + /// Set this property to -1 if you don't want to limit the number of lines. + @GObjectProperty(named: "lines") public var lines: Int + + /// The desired maximum width of the label, in characters. + /// + /// If this property is set to -1, the width will be calculated automatically. + /// + /// See the section on [text layout](class.Label.html#text-layout) for details + /// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] + /// determine the width of ellipsized and wrapped labels. + @GObjectProperty(named: "max-width-chars") public var maxWidthChars: Int + + /// The mnemonic accelerator key for the label. + @GObjectProperty(named: "mnemonic-keyval") public var mnemonicKeyval: UInt + + /// Whether the label text can be selected with the mouse. + @GObjectProperty(named: "selectable") public var selectable: Bool + + /// Whether the label is in single line mode. + /// + /// In single line mode, the height of the label does not depend on the + /// actual text, it is always set to ascent + descent of the font. This + /// can be an advantage in situations where resizing the label because + /// of text changes would be distracting, e.g. in a statusbar. + @GObjectProperty(named: "single-line-mode") public var singleLineMode: Bool + + /// True if the text of the label includes Pango markup. + /// + /// See [func@Pango.parse_markup]. + @GObjectProperty(named: "use-markup") public var useMarkup: Bool + + /// True if the text of the label indicates a mnemonic with an `_` + /// before the mnemonic character. + @GObjectProperty(named: "use-underline") public var useUnderline: Bool + + /// The desired width of the label, in characters. + /// + /// If this property is set to -1, the width will be calculated automatically. + /// + /// See the section on [text layout](class.Label.html#text-layout) for details + /// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] + /// determine the width of ellipsized and wrapped labels. + @GObjectProperty(named: "width-chars") public var widthChars: Int + + /// True if the label text will wrap if it gets too wide. + @GObjectProperty(named: "wrap") public var wrap: Bool + + /// The horizontal alignment of the label text inside its size allocation. + /// + /// Compare this to [property@Gtk.Widget:halign], which determines how the + /// labels size allocation is positioned in the space available for the label. + @GObjectProperty(named: "xalign") public var xalign: Float + + /// The vertical alignment of the label text inside its size allocation. + /// + /// Compare this to [property@Gtk.Widget:valign], which determines how the + /// labels size allocation is positioned in the space available for the label. + @GObjectProperty(named: "yalign") public var yalign: Float + + /// Gets emitted when the user activates a link in the label. + /// + /// The `::activate-current-link` is a [keybinding signal](class.SignalAction.html). + /// + /// Applications may also emit the signal with g_signal_emit_by_name() + /// if they need to control activation of URIs programmatically. + /// + /// The default bindings for this signal are all forms of the Enter key. + public var activateCurrentLink: ((Label) -> Void)? + + /// Gets emitted to activate a URI. + /// + /// Applications may connect to it to override the default behaviour, + /// which is to call [method@Gtk.FileLauncher.launch]. + public var activateLink: ((Label, UnsafePointer) -> Void)? + + /// Gets emitted to copy the selection to the clipboard. + /// + /// The `::copy-clipboard` signal is a [keybinding signal](class.SignalAction.html). + /// + /// The default binding for this signal is Ctrl+c. + public var copyClipboard: ((Label) -> Void)? + + /// Gets emitted when the user initiates a cursor movement. + /// + /// The `::move-cursor` signal is a [keybinding signal](class.SignalAction.html). + /// If the cursor is not visible in @entry, this signal causes the viewport to + /// be moved instead. + /// + /// Applications should not connect to it, but may emit it with + /// [func@GObject.signal_emit_by_name] if they need to control + /// the cursor programmatically. + /// + /// The default bindings for this signal come in two variants, the + /// variant with the Shift modifier extends the selection, + /// the variant without the Shift modifier does not. + /// There are too many key combinations to list them all here. + /// + /// - , , , + /// move by individual characters/lines + /// - Ctrl+, etc. move by words/paragraphs + /// - Home and End move to the ends of the buffer + public var moveCursor: ((Label, GtkMovementStep, Int, Bool) -> Void)? + + public var notifyAttributes: ((Label, OpaquePointer) -> Void)? + + public var notifyEllipsize: ((Label, OpaquePointer) -> Void)? + + public var notifyExtraMenu: ((Label, OpaquePointer) -> Void)? + + public var notifyJustify: ((Label, OpaquePointer) -> Void)? -/// Gets emitted to copy the selection to the clipboard. -/// -/// The `::copy-clipboard` signal is a [keybinding signal](class.SignalAction.html). -/// -/// The default binding for this signal is Ctrl+c. -public var copyClipboard: ((Label) -> Void)? + public var notifyLabel: ((Label, OpaquePointer) -> Void)? + + public var notifyLines: ((Label, OpaquePointer) -> Void)? -/// Gets emitted when the user initiates a cursor movement. -/// -/// The `::move-cursor` signal is a [keybinding signal](class.SignalAction.html). -/// If the cursor is not visible in @entry, this signal causes the viewport to -/// be moved instead. -/// -/// Applications should not connect to it, but may emit it with -/// [func@GObject.signal_emit_by_name] if they need to control -/// the cursor programmatically. -/// -/// The default bindings for this signal come in two variants, the -/// variant with the Shift modifier extends the selection, -/// the variant without the Shift modifier does not. -/// There are too many key combinations to list them all here. -/// -/// - , , , -/// move by individual characters/lines -/// - Ctrl+, etc. move by words/paragraphs -/// - Home and End move to the ends of the buffer -public var moveCursor: ((Label, GtkMovementStep, Int, Bool) -> Void)? + public var notifyMaxWidthChars: ((Label, OpaquePointer) -> Void)? + + public var notifyMnemonicKeyval: ((Label, OpaquePointer) -> Void)? + + public var notifyNaturalWrapMode: ((Label, OpaquePointer) -> Void)? + + public var notifySelectable: ((Label, OpaquePointer) -> Void)? + public var notifySingleLineMode: ((Label, OpaquePointer) -> Void)? -public var notifyAttributes: ((Label, OpaquePointer) -> Void)? + public var notifyTabs: ((Label, OpaquePointer) -> Void)? + public var notifyUseMarkup: ((Label, OpaquePointer) -> Void)? -public var notifyEllipsize: ((Label, OpaquePointer) -> Void)? + public var notifyUseUnderline: ((Label, OpaquePointer) -> Void)? + public var notifyWidthChars: ((Label, OpaquePointer) -> Void)? -public var notifyExtraMenu: ((Label, OpaquePointer) -> Void)? + public var notifyWrap: ((Label, OpaquePointer) -> Void)? + public var notifyWrapMode: ((Label, OpaquePointer) -> Void)? -public var notifyJustify: ((Label, OpaquePointer) -> Void)? + public var notifyXalign: ((Label, OpaquePointer) -> Void)? - -public var notifyLabel: ((Label, OpaquePointer) -> Void)? - - -public var notifyLines: ((Label, OpaquePointer) -> Void)? - - -public var notifyMaxWidthChars: ((Label, OpaquePointer) -> Void)? - - -public var notifyMnemonicKeyval: ((Label, OpaquePointer) -> Void)? - - -public var notifyNaturalWrapMode: ((Label, OpaquePointer) -> Void)? - - -public var notifySelectable: ((Label, OpaquePointer) -> Void)? - - -public var notifySingleLineMode: ((Label, OpaquePointer) -> Void)? - - -public var notifyTabs: ((Label, OpaquePointer) -> Void)? - - -public var notifyUseMarkup: ((Label, OpaquePointer) -> Void)? - - -public var notifyUseUnderline: ((Label, OpaquePointer) -> Void)? - - -public var notifyWidthChars: ((Label, OpaquePointer) -> Void)? - - -public var notifyWrap: ((Label, OpaquePointer) -> Void)? - - -public var notifyWrapMode: ((Label, OpaquePointer) -> Void)? - - -public var notifyXalign: ((Label, OpaquePointer) -> Void)? - - -public var notifyYalign: ((Label, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyYalign: ((Label, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/LevelBarMode.swift b/Sources/Gtk/Generated/LevelBarMode.swift index 508c23645a..999e280dea 100644 --- a/Sources/Gtk/Generated/LevelBarMode.swift +++ b/Sources/Gtk/Generated/LevelBarMode.swift @@ -1,27 +1,27 @@ import CGtk /// Describes how [class@LevelBar] contents should be rendered. -/// +/// /// Note that this enumeration could be extended with additional modes /// in the future. public enum LevelBarMode: GValueRepresentableEnum { public typealias GtkEnum = GtkLevelBarMode /// The bar has a continuous mode -case continuous -/// The bar has a discrete mode -case discrete + case continuous + /// The bar has a discrete mode + case discrete public static var type: GType { - gtk_level_bar_mode_get_type() -} + gtk_level_bar_mode_get_type() + } public init(from gtkEnum: GtkLevelBarMode) { switch gtkEnum { case GTK_LEVEL_BAR_MODE_CONTINUOUS: - self = .continuous -case GTK_LEVEL_BAR_MODE_DISCRETE: - self = .discrete + self = .continuous + case GTK_LEVEL_BAR_MODE_DISCRETE: + self = .discrete default: fatalError("Unsupported GtkLevelBarMode enum value: \(gtkEnum.rawValue)") } @@ -30,9 +30,9 @@ case GTK_LEVEL_BAR_MODE_DISCRETE: public func toGtk() -> GtkLevelBarMode { switch self { case .continuous: - return GTK_LEVEL_BAR_MODE_CONTINUOUS -case .discrete: - return GTK_LEVEL_BAR_MODE_DISCRETE + return GTK_LEVEL_BAR_MODE_CONTINUOUS + case .discrete: + return GTK_LEVEL_BAR_MODE_DISCRETE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ListBox.swift b/Sources/Gtk/Generated/ListBox.swift index f10b14d5fe..bc5762d6c7 100644 --- a/Sources/Gtk/Generated/ListBox.swift +++ b/Sources/Gtk/Generated/ListBox.swift @@ -1,233 +1,253 @@ import CGtk /// Shows a vertical list. -/// +/// /// An example GtkListBox -/// +/// /// A `GtkListBox` only contains `GtkListBoxRow` children. These rows can /// by dynamically sorted and filtered, and headers can be added dynamically /// depending on the row content. It also allows keyboard and mouse navigation /// and selection like a typical list. -/// +/// /// Using `GtkListBox` is often an alternative to `GtkTreeView`, especially /// when the list contents has a more complicated layout than what is allowed /// by a `GtkCellRenderer`, or when the contents is interactive (i.e. has a /// button in it). -/// +/// /// Although a `GtkListBox` must have only `GtkListBoxRow` children, you can /// add any kind of widget to it via [method@Gtk.ListBox.prepend], /// [method@Gtk.ListBox.append] and [method@Gtk.ListBox.insert] and a /// `GtkListBoxRow` widget will automatically be inserted between the list /// and the widget. -/// +/// /// `GtkListBoxRows` can be marked as activatable or selectable. If a row is /// activatable, [signal@Gtk.ListBox::row-activated] will be emitted for it when /// the user tries to activate it. If it is selectable, the row will be marked /// as selected when the user tries to select it. -/// +/// /// # GtkListBox as GtkBuildable -/// +/// /// The `GtkListBox` implementation of the `GtkBuildable` interface supports /// setting a child as the placeholder by specifying “placeholder” as the “type” /// attribute of a `` element. See [method@Gtk.ListBox.set_placeholder] /// for info. -/// +/// /// # Shortcuts and Gestures -/// +/// /// The following signals have default keybindings: -/// +/// /// - [signal@Gtk.ListBox::move-cursor] /// - [signal@Gtk.ListBox::select-all] /// - [signal@Gtk.ListBox::toggle-cursor-row] /// - [signal@Gtk.ListBox::unselect-all] -/// +/// /// # CSS nodes -/// +/// /// ``` /// list[.separators][.rich-list][.navigation-sidebar][.boxed-list] /// ╰── row[.activatable] /// ``` -/// +/// /// `GtkListBox` uses a single CSS node named list. It may carry the .separators /// style class, when the [property@Gtk.ListBox:show-separators] property is set. /// Each `GtkListBoxRow` uses a single CSS node named row. The row nodes get the /// .activatable style class added when appropriate. -/// +/// /// It may also carry the .boxed-list style class. In this case, the list will be /// automatically surrounded by a frame and have separators. -/// +/// /// The main list node may also carry style classes to select /// the style of [list presentation](section-list-widget.html#list-styles): /// .rich-list, .navigation-sidebar or .data-table. -/// +/// /// # Accessibility -/// +/// /// `GtkListBox` uses the [enum@Gtk.AccessibleRole.list] role and `GtkListBoxRow` uses /// the [enum@Gtk.AccessibleRole.list_item] role. open class ListBox: Widget { /// Creates a new `GtkListBox` container. -public convenience init() { - self.init( - gtk_list_box_new() - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate-cursor-row") { [weak self] () in - guard let self = self else { return } - self.activateCursorRow?(self) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, Bool, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, value3, value4, data in - SignalBox4.run(data, value1, value2, value3, value4) - } - -addSignal(name: "move-cursor", handler: gCallback(handler1)) { [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool, param3: Bool) in - guard let self = self else { return } - self.moveCursor?(self, param0, param1, param2, param3) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, UnsafeMutablePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1>.run(data, value1) - } - -addSignal(name: "row-activated", handler: gCallback(handler2)) { [weak self] (param0: UnsafeMutablePointer) in - guard let self = self else { return } - self.rowActivated?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, UnsafeMutablePointer?, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1?>.run(data, value1) - } - -addSignal(name: "row-selected", handler: gCallback(handler3)) { [weak self] (param0: UnsafeMutablePointer?) in - guard let self = self else { return } - self.rowSelected?(self, param0) -} - -addSignal(name: "selected-rows-changed") { [weak self] () in - guard let self = self else { return } - self.selectedRowsChanged?(self) -} - -addSignal(name: "toggle-cursor-row") { [weak self] () in - guard let self = self else { return } - self.toggleCursorRow?(self) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::accept-unpaired-release", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAcceptUnpairedRelease?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::activate-on-single-click", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActivateOnSingleClick?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::selection-mode", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectionMode?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_list_box_new() + ) } -addSignal(name: "notify::show-separators", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowSeparators?(self, param0) -} - -let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate-cursor-row") { [weak self] () in + guard let self = self else { return } + self.activateCursorRow?(self) + } + + let handler1: + @convention(c) ( + UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, Bool, UnsafeMutableRawPointer + ) -> Void = + { _, value1, value2, value3, value4, data in + SignalBox4.run( + data, value1, value2, value3, value4) + } + + addSignal(name: "move-cursor", handler: gCallback(handler1)) { + [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool, param3: Bool) in + guard let self = self else { return } + self.moveCursor?(self, param0, param1, param2, param3) + } + + let handler2: + @convention(c) ( + UnsafeMutableRawPointer, UnsafeMutablePointer, + UnsafeMutableRawPointer + ) -> Void = + { _, value1, data in + SignalBox1>.run(data, value1) + } + + addSignal(name: "row-activated", handler: gCallback(handler2)) { + [weak self] (param0: UnsafeMutablePointer) in + guard let self = self else { return } + self.rowActivated?(self, param0) + } + + let handler3: + @convention(c) ( + UnsafeMutableRawPointer, UnsafeMutablePointer?, + UnsafeMutableRawPointer + ) -> Void = + { _, value1, data in + SignalBox1?>.run(data, value1) + } + + addSignal(name: "row-selected", handler: gCallback(handler3)) { + [weak self] (param0: UnsafeMutablePointer?) in + guard let self = self else { return } + self.rowSelected?(self, param0) + } + + addSignal(name: "selected-rows-changed") { [weak self] () in + guard let self = self else { return } + self.selectedRowsChanged?(self) + } + + addSignal(name: "toggle-cursor-row") { [weak self] () in + guard let self = self else { return } + self.toggleCursorRow?(self) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::accept-unpaired-release", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAcceptUnpairedRelease?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::activate-on-single-click", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActivateOnSingleClick?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::selection-mode", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectionMode?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::show-separators", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowSeparators?(self, param0) + } + + let handler10: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::tab-behavior", handler: gCallback(handler10)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTabBehavior?(self, param0) + } } -addSignal(name: "notify::tab-behavior", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTabBehavior?(self, param0) -} -} - /// Determines whether children can be activated with a single -/// click, or require a double-click. -@GObjectProperty(named: "activate-on-single-click") public var activateOnSingleClick: Bool - -/// The selection mode used by the list box. -@GObjectProperty(named: "selection-mode") public var selectionMode: SelectionMode + /// click, or require a double-click. + @GObjectProperty(named: "activate-on-single-click") public var activateOnSingleClick: Bool -/// Whether to show separators between rows. -@GObjectProperty(named: "show-separators") public var showSeparators: Bool + /// The selection mode used by the list box. + @GObjectProperty(named: "selection-mode") public var selectionMode: SelectionMode -/// Emitted when the cursor row is activated. -public var activateCursorRow: ((ListBox) -> Void)? + /// Whether to show separators between rows. + @GObjectProperty(named: "show-separators") public var showSeparators: Bool -/// Emitted when the user initiates a cursor movement. -/// -/// The default bindings for this signal come in two variants, the variant with -/// the Shift modifier extends the selection, the variant without the Shift -/// modifier does not. There are too many key combinations to list them all -/// here. -/// -/// - , , , -/// move by individual children -/// - Home, End move to the ends of the box -/// - PgUp, PgDn move vertically by pages -public var moveCursor: ((ListBox, GtkMovementStep, Int, Bool, Bool) -> Void)? + /// Emitted when the cursor row is activated. + public var activateCursorRow: ((ListBox) -> Void)? -/// Emitted when a row has been activated by the user. -public var rowActivated: ((ListBox, UnsafeMutablePointer) -> Void)? + /// Emitted when the user initiates a cursor movement. + /// + /// The default bindings for this signal come in two variants, the variant with + /// the Shift modifier extends the selection, the variant without the Shift + /// modifier does not. There are too many key combinations to list them all + /// here. + /// + /// - , , , + /// move by individual children + /// - Home, End move to the ends of the box + /// - PgUp, PgDn move vertically by pages + public var moveCursor: ((ListBox, GtkMovementStep, Int, Bool, Bool) -> Void)? -/// Emitted when a new row is selected, or (with a %NULL @row) -/// when the selection is cleared. -/// -/// When the @box is using %GTK_SELECTION_MULTIPLE, this signal will not -/// give you the full picture of selection changes, and you should use -/// the [signal@Gtk.ListBox::selected-rows-changed] signal instead. -public var rowSelected: ((ListBox, UnsafeMutablePointer?) -> Void)? + /// Emitted when a row has been activated by the user. + public var rowActivated: ((ListBox, UnsafeMutablePointer) -> Void)? -/// Emitted when the set of selected rows changes. -public var selectedRowsChanged: ((ListBox) -> Void)? + /// Emitted when a new row is selected, or (with a %NULL @row) + /// when the selection is cleared. + /// + /// When the @box is using %GTK_SELECTION_MULTIPLE, this signal will not + /// give you the full picture of selection changes, and you should use + /// the [signal@Gtk.ListBox::selected-rows-changed] signal instead. + public var rowSelected: ((ListBox, UnsafeMutablePointer?) -> Void)? -/// Emitted when the cursor row is toggled. -/// -/// The default bindings for this signal is Ctrl+. -public var toggleCursorRow: ((ListBox) -> Void)? + /// Emitted when the set of selected rows changes. + public var selectedRowsChanged: ((ListBox) -> Void)? + /// Emitted when the cursor row is toggled. + /// + /// The default bindings for this signal is Ctrl+. + public var toggleCursorRow: ((ListBox) -> Void)? -public var notifyAcceptUnpairedRelease: ((ListBox, OpaquePointer) -> Void)? + public var notifyAcceptUnpairedRelease: ((ListBox, OpaquePointer) -> Void)? + public var notifyActivateOnSingleClick: ((ListBox, OpaquePointer) -> Void)? -public var notifyActivateOnSingleClick: ((ListBox, OpaquePointer) -> Void)? + public var notifySelectionMode: ((ListBox, OpaquePointer) -> Void)? + public var notifyShowSeparators: ((ListBox, OpaquePointer) -> Void)? -public var notifySelectionMode: ((ListBox, OpaquePointer) -> Void)? - - -public var notifyShowSeparators: ((ListBox, OpaquePointer) -> Void)? - - -public var notifyTabBehavior: ((ListBox, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyTabBehavior: ((ListBox, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/MessageType.swift b/Sources/Gtk/Generated/MessageType.swift index ec25435d64..f842063b16 100644 --- a/Sources/Gtk/Generated/MessageType.swift +++ b/Sources/Gtk/Generated/MessageType.swift @@ -5,32 +5,32 @@ public enum MessageType: GValueRepresentableEnum { public typealias GtkEnum = GtkMessageType /// Informational message -case info -/// Non-fatal warning message -case warning -/// Question requiring a choice -case question -/// Fatal error message -case error -/// None of the above -case other + case info + /// Non-fatal warning message + case warning + /// Question requiring a choice + case question + /// Fatal error message + case error + /// None of the above + case other public static var type: GType { - gtk_message_type_get_type() -} + gtk_message_type_get_type() + } public init(from gtkEnum: GtkMessageType) { switch gtkEnum { case GTK_MESSAGE_INFO: - self = .info -case GTK_MESSAGE_WARNING: - self = .warning -case GTK_MESSAGE_QUESTION: - self = .question -case GTK_MESSAGE_ERROR: - self = .error -case GTK_MESSAGE_OTHER: - self = .other + self = .info + case GTK_MESSAGE_WARNING: + self = .warning + case GTK_MESSAGE_QUESTION: + self = .question + case GTK_MESSAGE_ERROR: + self = .error + case GTK_MESSAGE_OTHER: + self = .other default: fatalError("Unsupported GtkMessageType enum value: \(gtkEnum.rawValue)") } @@ -39,15 +39,15 @@ case GTK_MESSAGE_OTHER: public func toGtk() -> GtkMessageType { switch self { case .info: - return GTK_MESSAGE_INFO -case .warning: - return GTK_MESSAGE_WARNING -case .question: - return GTK_MESSAGE_QUESTION -case .error: - return GTK_MESSAGE_ERROR -case .other: - return GTK_MESSAGE_OTHER + return GTK_MESSAGE_INFO + case .warning: + return GTK_MESSAGE_WARNING + case .question: + return GTK_MESSAGE_QUESTION + case .error: + return GTK_MESSAGE_ERROR + case .other: + return GTK_MESSAGE_OTHER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/MovementStep.swift b/Sources/Gtk/Generated/MovementStep.swift index f6652e1c43..60162d7795 100644 --- a/Sources/Gtk/Generated/MovementStep.swift +++ b/Sources/Gtk/Generated/MovementStep.swift @@ -6,52 +6,52 @@ public enum MovementStep: GValueRepresentableEnum { public typealias GtkEnum = GtkMovementStep /// Move forward or back by graphemes -case logicalPositions -/// Move left or right by graphemes -case visualPositions -/// Move forward or back by words -case words -/// Move up or down lines (wrapped lines) -case displayLines -/// Move to either end of a line -case displayLineEnds -/// Move up or down paragraphs (newline-ended lines) -case paragraphs -/// Move to either end of a paragraph -case paragraphEnds -/// Move by pages -case pages -/// Move to ends of the buffer -case bufferEnds -/// Move horizontally by pages -case horizontalPages + case logicalPositions + /// Move left or right by graphemes + case visualPositions + /// Move forward or back by words + case words + /// Move up or down lines (wrapped lines) + case displayLines + /// Move to either end of a line + case displayLineEnds + /// Move up or down paragraphs (newline-ended lines) + case paragraphs + /// Move to either end of a paragraph + case paragraphEnds + /// Move by pages + case pages + /// Move to ends of the buffer + case bufferEnds + /// Move horizontally by pages + case horizontalPages public static var type: GType { - gtk_movement_step_get_type() -} + gtk_movement_step_get_type() + } public init(from gtkEnum: GtkMovementStep) { switch gtkEnum { case GTK_MOVEMENT_LOGICAL_POSITIONS: - self = .logicalPositions -case GTK_MOVEMENT_VISUAL_POSITIONS: - self = .visualPositions -case GTK_MOVEMENT_WORDS: - self = .words -case GTK_MOVEMENT_DISPLAY_LINES: - self = .displayLines -case GTK_MOVEMENT_DISPLAY_LINE_ENDS: - self = .displayLineEnds -case GTK_MOVEMENT_PARAGRAPHS: - self = .paragraphs -case GTK_MOVEMENT_PARAGRAPH_ENDS: - self = .paragraphEnds -case GTK_MOVEMENT_PAGES: - self = .pages -case GTK_MOVEMENT_BUFFER_ENDS: - self = .bufferEnds -case GTK_MOVEMENT_HORIZONTAL_PAGES: - self = .horizontalPages + self = .logicalPositions + case GTK_MOVEMENT_VISUAL_POSITIONS: + self = .visualPositions + case GTK_MOVEMENT_WORDS: + self = .words + case GTK_MOVEMENT_DISPLAY_LINES: + self = .displayLines + case GTK_MOVEMENT_DISPLAY_LINE_ENDS: + self = .displayLineEnds + case GTK_MOVEMENT_PARAGRAPHS: + self = .paragraphs + case GTK_MOVEMENT_PARAGRAPH_ENDS: + self = .paragraphEnds + case GTK_MOVEMENT_PAGES: + self = .pages + case GTK_MOVEMENT_BUFFER_ENDS: + self = .bufferEnds + case GTK_MOVEMENT_HORIZONTAL_PAGES: + self = .horizontalPages default: fatalError("Unsupported GtkMovementStep enum value: \(gtkEnum.rawValue)") } @@ -60,25 +60,25 @@ case GTK_MOVEMENT_HORIZONTAL_PAGES: public func toGtk() -> GtkMovementStep { switch self { case .logicalPositions: - return GTK_MOVEMENT_LOGICAL_POSITIONS -case .visualPositions: - return GTK_MOVEMENT_VISUAL_POSITIONS -case .words: - return GTK_MOVEMENT_WORDS -case .displayLines: - return GTK_MOVEMENT_DISPLAY_LINES -case .displayLineEnds: - return GTK_MOVEMENT_DISPLAY_LINE_ENDS -case .paragraphs: - return GTK_MOVEMENT_PARAGRAPHS -case .paragraphEnds: - return GTK_MOVEMENT_PARAGRAPH_ENDS -case .pages: - return GTK_MOVEMENT_PAGES -case .bufferEnds: - return GTK_MOVEMENT_BUFFER_ENDS -case .horizontalPages: - return GTK_MOVEMENT_HORIZONTAL_PAGES + return GTK_MOVEMENT_LOGICAL_POSITIONS + case .visualPositions: + return GTK_MOVEMENT_VISUAL_POSITIONS + case .words: + return GTK_MOVEMENT_WORDS + case .displayLines: + return GTK_MOVEMENT_DISPLAY_LINES + case .displayLineEnds: + return GTK_MOVEMENT_DISPLAY_LINE_ENDS + case .paragraphs: + return GTK_MOVEMENT_PARAGRAPHS + case .paragraphEnds: + return GTK_MOVEMENT_PARAGRAPH_ENDS + case .pages: + return GTK_MOVEMENT_PAGES + case .bufferEnds: + return GTK_MOVEMENT_BUFFER_ENDS + case .horizontalPages: + return GTK_MOVEMENT_HORIZONTAL_PAGES } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Native.swift b/Sources/Gtk/Generated/Native.swift index 3decd0c521..df37f3f405 100644 --- a/Sources/Gtk/Generated/Native.swift +++ b/Sources/Gtk/Generated/Native.swift @@ -1,21 +1,19 @@ import CGtk /// An interface for widgets that have their own [class@Gdk.Surface]. -/// +/// /// The obvious example of a `GtkNative` is `GtkWindow`. -/// +/// /// Every widget that is not itself a `GtkNative` is contained in one, /// and you can get it with [method@Gtk.Widget.get_native]. -/// +/// /// To get the surface of a `GtkNative`, use [method@Gtk.Native.get_surface]. /// It is also possible to find the `GtkNative` to which a surface /// belongs, with [func@Gtk.Native.get_for_surface]. -/// +/// /// In addition to a [class@Gdk.Surface], a `GtkNative` also provides /// a [class@Gsk.Renderer] for rendering on that surface. To get the /// renderer, use [method@Gtk.Native.get_renderer]. public protocol Native: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/NativeDialog.swift b/Sources/Gtk/Generated/NativeDialog.swift index 052aa5d409..1f7e967650 100644 --- a/Sources/Gtk/Generated/NativeDialog.swift +++ b/Sources/Gtk/Generated/NativeDialog.swift @@ -1,105 +1,109 @@ import CGtk /// Base class for platform dialogs that don't use `GtkDialog`. -/// +/// /// Native dialogs are used in order to integrate better with a platform, /// by looking the same as other native applications and supporting /// platform specific features. -/// +/// /// The [class@Gtk.Dialog] functions cannot be used on such objects, /// but we need a similar API in order to drive them. The `GtkNativeDialog` /// object is an API that allows you to do this. It allows you to set /// various common properties on the dialog, as well as show and hide /// it and get a [signal@Gtk.NativeDialog::response] signal when the user /// finished with the dialog. -/// +/// /// Note that unlike `GtkDialog`, `GtkNativeDialog` objects are not /// toplevel widgets, and GTK does not keep them alive. It is your /// responsibility to keep a reference until you are done with the /// object. open class NativeDialog: GObject { - public override func registerSignals() { - super.registerSignals() - - let handler0: @convention(c) (UnsafeMutableRawPointer, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "response", handler: gCallback(handler0)) { [weak self] (param0: Int) in - guard let self = self else { return } - self.response?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::modal", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyModal?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::title", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTitle?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + super.registerSignals() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "response", handler: gCallback(handler0)) { [weak self] (param0: Int) in + guard let self = self else { return } + self.response?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::modal", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyModal?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::title", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTitle?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::transient-for", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTransientFor?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::visible", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyVisible?(self, param0) + } } -addSignal(name: "notify::transient-for", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTransientFor?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::visible", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyVisible?(self, param0) -} -} - /// Whether the window should be modal with respect to its transient parent. -@GObjectProperty(named: "modal") public var modal: Bool - -/// The title of the dialog window -@GObjectProperty(named: "title") public var title: String? - -/// Whether the window is currently visible. -@GObjectProperty(named: "visible") public var visible: Bool + @GObjectProperty(named: "modal") public var modal: Bool -/// Emitted when the user responds to the dialog. -/// -/// When this is called the dialog has been hidden. -/// -/// If you call [method@Gtk.NativeDialog.hide] before the user -/// responds to the dialog this signal will not be emitted. -public var response: ((NativeDialog, Int) -> Void)? + /// The title of the dialog window + @GObjectProperty(named: "title") public var title: String? + /// Whether the window is currently visible. + @GObjectProperty(named: "visible") public var visible: Bool -public var notifyModal: ((NativeDialog, OpaquePointer) -> Void)? + /// Emitted when the user responds to the dialog. + /// + /// When this is called the dialog has been hidden. + /// + /// If you call [method@Gtk.NativeDialog.hide] before the user + /// responds to the dialog this signal will not be emitted. + public var response: ((NativeDialog, Int) -> Void)? + public var notifyModal: ((NativeDialog, OpaquePointer) -> Void)? -public var notifyTitle: ((NativeDialog, OpaquePointer) -> Void)? + public var notifyTitle: ((NativeDialog, OpaquePointer) -> Void)? + public var notifyTransientFor: ((NativeDialog, OpaquePointer) -> Void)? -public var notifyTransientFor: ((NativeDialog, OpaquePointer) -> Void)? - - -public var notifyVisible: ((NativeDialog, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyVisible: ((NativeDialog, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/NotebookTab.swift b/Sources/Gtk/Generated/NotebookTab.swift index ad7ee8720b..3c521e29d5 100644 --- a/Sources/Gtk/Generated/NotebookTab.swift +++ b/Sources/Gtk/Generated/NotebookTab.swift @@ -5,20 +5,20 @@ public enum NotebookTab: GValueRepresentableEnum { public typealias GtkEnum = GtkNotebookTab /// The first tab in the notebook -case first -/// The last tab in the notebook -case last + case first + /// The last tab in the notebook + case last public static var type: GType { - gtk_notebook_tab_get_type() -} + gtk_notebook_tab_get_type() + } public init(from gtkEnum: GtkNotebookTab) { switch gtkEnum { case GTK_NOTEBOOK_TAB_FIRST: - self = .first -case GTK_NOTEBOOK_TAB_LAST: - self = .last + self = .first + case GTK_NOTEBOOK_TAB_LAST: + self = .last default: fatalError("Unsupported GtkNotebookTab enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ case GTK_NOTEBOOK_TAB_LAST: public func toGtk() -> GtkNotebookTab { switch self { case .first: - return GTK_NOTEBOOK_TAB_FIRST -case .last: - return GTK_NOTEBOOK_TAB_LAST + return GTK_NOTEBOOK_TAB_FIRST + case .last: + return GTK_NOTEBOOK_TAB_LAST } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/NumberUpLayout.swift b/Sources/Gtk/Generated/NumberUpLayout.swift index 4d8fdd0b28..5d81e7641e 100644 --- a/Sources/Gtk/Generated/NumberUpLayout.swift +++ b/Sources/Gtk/Generated/NumberUpLayout.swift @@ -6,44 +6,44 @@ public enum NumberUpLayout: GValueRepresentableEnum { public typealias GtkEnum = GtkNumberUpLayout /// ![](layout-lrtb.png) -case lrtb -/// ![](layout-lrbt.png) -case lrbt -/// ![](layout-rltb.png) -case rltb -/// ![](layout-rlbt.png) -case rlbt -/// ![](layout-tblr.png) -case tblr -/// ![](layout-tbrl.png) -case tbrl -/// ![](layout-btlr.png) -case btlr -/// ![](layout-btrl.png) -case btrl + case lrtb + /// ![](layout-lrbt.png) + case lrbt + /// ![](layout-rltb.png) + case rltb + /// ![](layout-rlbt.png) + case rlbt + /// ![](layout-tblr.png) + case tblr + /// ![](layout-tbrl.png) + case tbrl + /// ![](layout-btlr.png) + case btlr + /// ![](layout-btrl.png) + case btrl public static var type: GType { - gtk_number_up_layout_get_type() -} + gtk_number_up_layout_get_type() + } public init(from gtkEnum: GtkNumberUpLayout) { switch gtkEnum { case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM: - self = .lrtb -case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP: - self = .lrbt -case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM: - self = .rltb -case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP: - self = .rlbt -case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT: - self = .tblr -case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT: - self = .tbrl -case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT: - self = .btlr -case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT: - self = .btrl + self = .lrtb + case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP: + self = .lrbt + case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM: + self = .rltb + case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP: + self = .rlbt + case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT: + self = .tblr + case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT: + self = .tbrl + case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT: + self = .btlr + case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT: + self = .btrl default: fatalError("Unsupported GtkNumberUpLayout enum value: \(gtkEnum.rawValue)") } @@ -52,21 +52,21 @@ case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT: public func toGtk() -> GtkNumberUpLayout { switch self { case .lrtb: - return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM -case .lrbt: - return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP -case .rltb: - return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM -case .rlbt: - return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP -case .tblr: - return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT -case .tbrl: - return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT -case .btlr: - return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT -case .btrl: - return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT + return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM + case .lrbt: + return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP + case .rltb: + return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM + case .rlbt: + return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP + case .tblr: + return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT + case .tbrl: + return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT + case .btlr: + return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT + case .btrl: + return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Ordering.swift b/Sources/Gtk/Generated/Ordering.swift index 65bc101c37..ac58f25c48 100644 --- a/Sources/Gtk/Generated/Ordering.swift +++ b/Sources/Gtk/Generated/Ordering.swift @@ -1,7 +1,7 @@ import CGtk /// Describes the way two values can be compared. -/// +/// /// These values can be used with a [callback@GLib.CompareFunc]. However, /// a `GCompareFunc` is allowed to return any integer values. /// For converting such a value to a `GtkOrdering` value, use @@ -10,24 +10,24 @@ public enum Ordering: GValueRepresentableEnum { public typealias GtkEnum = GtkOrdering /// The first value is smaller than the second -case smaller -/// The two values are equal -case equal -/// The first value is larger than the second -case larger + case smaller + /// The two values are equal + case equal + /// The first value is larger than the second + case larger public static var type: GType { - gtk_ordering_get_type() -} + gtk_ordering_get_type() + } public init(from gtkEnum: GtkOrdering) { switch gtkEnum { case GTK_ORDERING_SMALLER: - self = .smaller -case GTK_ORDERING_EQUAL: - self = .equal -case GTK_ORDERING_LARGER: - self = .larger + self = .smaller + case GTK_ORDERING_EQUAL: + self = .equal + case GTK_ORDERING_LARGER: + self = .larger default: fatalError("Unsupported GtkOrdering enum value: \(gtkEnum.rawValue)") } @@ -36,11 +36,11 @@ case GTK_ORDERING_LARGER: public func toGtk() -> GtkOrdering { switch self { case .smaller: - return GTK_ORDERING_SMALLER -case .equal: - return GTK_ORDERING_EQUAL -case .larger: - return GTK_ORDERING_LARGER + return GTK_ORDERING_SMALLER + case .equal: + return GTK_ORDERING_EQUAL + case .larger: + return GTK_ORDERING_LARGER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Orientation.swift b/Sources/Gtk/Generated/Orientation.swift index e323c5d837..15d9fbac6f 100644 --- a/Sources/Gtk/Generated/Orientation.swift +++ b/Sources/Gtk/Generated/Orientation.swift @@ -1,26 +1,26 @@ import CGtk /// Represents the orientation of widgets and other objects. -/// +/// /// Typical examples are [class@Box] or [class@GesturePan]. public enum Orientation: GValueRepresentableEnum { public typealias GtkEnum = GtkOrientation /// The element is in horizontal orientation. -case horizontal -/// The element is in vertical orientation. -case vertical + case horizontal + /// The element is in vertical orientation. + case vertical public static var type: GType { - gtk_orientation_get_type() -} + gtk_orientation_get_type() + } public init(from gtkEnum: GtkOrientation) { switch gtkEnum { case GTK_ORIENTATION_HORIZONTAL: - self = .horizontal -case GTK_ORIENTATION_VERTICAL: - self = .vertical + self = .horizontal + case GTK_ORIENTATION_VERTICAL: + self = .vertical default: fatalError("Unsupported GtkOrientation enum value: \(gtkEnum.rawValue)") } @@ -29,9 +29,9 @@ case GTK_ORIENTATION_VERTICAL: public func toGtk() -> GtkOrientation { switch self { case .horizontal: - return GTK_ORIENTATION_HORIZONTAL -case .vertical: - return GTK_ORIENTATION_VERTICAL + return GTK_ORIENTATION_HORIZONTAL + case .vertical: + return GTK_ORIENTATION_VERTICAL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Overflow.swift b/Sources/Gtk/Generated/Overflow.swift index ef8e4379ec..d28097d9c1 100644 --- a/Sources/Gtk/Generated/Overflow.swift +++ b/Sources/Gtk/Generated/Overflow.swift @@ -1,7 +1,7 @@ import CGtk /// Defines how content overflowing a given area should be handled. -/// +/// /// This is used in [method@Gtk.Widget.set_overflow]. The /// [property@Gtk.Widget:overflow] property is modeled after the /// CSS overflow property, but implements it only partially. @@ -9,22 +9,22 @@ public enum Overflow: GValueRepresentableEnum { public typealias GtkEnum = GtkOverflow /// No change is applied. Content is drawn at the specified -/// position. -case visible -/// Content is clipped to the bounds of the area. Content -/// outside the area is not drawn and cannot be interacted with. -case hidden + /// position. + case visible + /// Content is clipped to the bounds of the area. Content + /// outside the area is not drawn and cannot be interacted with. + case hidden public static var type: GType { - gtk_overflow_get_type() -} + gtk_overflow_get_type() + } public init(from gtkEnum: GtkOverflow) { switch gtkEnum { case GTK_OVERFLOW_VISIBLE: - self = .visible -case GTK_OVERFLOW_HIDDEN: - self = .hidden + self = .visible + case GTK_OVERFLOW_HIDDEN: + self = .hidden default: fatalError("Unsupported GtkOverflow enum value: \(gtkEnum.rawValue)") } @@ -33,9 +33,9 @@ case GTK_OVERFLOW_HIDDEN: public func toGtk() -> GtkOverflow { switch self { case .visible: - return GTK_OVERFLOW_VISIBLE -case .hidden: - return GTK_OVERFLOW_HIDDEN + return GTK_OVERFLOW_VISIBLE + case .hidden: + return GTK_OVERFLOW_HIDDEN } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PackType.swift b/Sources/Gtk/Generated/PackType.swift index fd74570593..283619f764 100644 --- a/Sources/Gtk/Generated/PackType.swift +++ b/Sources/Gtk/Generated/PackType.swift @@ -1,26 +1,26 @@ import CGtk /// Represents the packing location of a children in its parent. -/// +/// /// See [class@WindowControls] for example. public enum PackType: GValueRepresentableEnum { public typealias GtkEnum = GtkPackType /// The child is packed into the start of the widget -case start -/// The child is packed into the end of the widget -case end + case start + /// The child is packed into the end of the widget + case end public static var type: GType { - gtk_pack_type_get_type() -} + gtk_pack_type_get_type() + } public init(from gtkEnum: GtkPackType) { switch gtkEnum { case GTK_PACK_START: - self = .start -case GTK_PACK_END: - self = .end + self = .start + case GTK_PACK_END: + self = .end default: fatalError("Unsupported GtkPackType enum value: \(gtkEnum.rawValue)") } @@ -29,9 +29,9 @@ case GTK_PACK_END: public func toGtk() -> GtkPackType { switch self { case .start: - return GTK_PACK_START -case .end: - return GTK_PACK_END + return GTK_PACK_START + case .end: + return GTK_PACK_END } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PadActionType.swift b/Sources/Gtk/Generated/PadActionType.swift index c77e3cf20f..27a2db8783 100644 --- a/Sources/Gtk/Generated/PadActionType.swift +++ b/Sources/Gtk/Generated/PadActionType.swift @@ -5,24 +5,24 @@ public enum PadActionType: GValueRepresentableEnum { public typealias GtkEnum = GtkPadActionType /// Action is triggered by a pad button -case button -/// Action is triggered by a pad ring -case ring -/// Action is triggered by a pad strip -case strip + case button + /// Action is triggered by a pad ring + case ring + /// Action is triggered by a pad strip + case strip public static var type: GType { - gtk_pad_action_type_get_type() -} + gtk_pad_action_type_get_type() + } public init(from gtkEnum: GtkPadActionType) { switch gtkEnum { case GTK_PAD_ACTION_BUTTON: - self = .button -case GTK_PAD_ACTION_RING: - self = .ring -case GTK_PAD_ACTION_STRIP: - self = .strip + self = .button + case GTK_PAD_ACTION_RING: + self = .ring + case GTK_PAD_ACTION_STRIP: + self = .strip default: fatalError("Unsupported GtkPadActionType enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ case GTK_PAD_ACTION_STRIP: public func toGtk() -> GtkPadActionType { switch self { case .button: - return GTK_PAD_ACTION_BUTTON -case .ring: - return GTK_PAD_ACTION_RING -case .strip: - return GTK_PAD_ACTION_STRIP + return GTK_PAD_ACTION_BUTTON + case .ring: + return GTK_PAD_ACTION_RING + case .strip: + return GTK_PAD_ACTION_STRIP } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PageOrientation.swift b/Sources/Gtk/Generated/PageOrientation.swift index 11056e7960..c58cf50992 100644 --- a/Sources/Gtk/Generated/PageOrientation.swift +++ b/Sources/Gtk/Generated/PageOrientation.swift @@ -5,28 +5,28 @@ public enum PageOrientation: GValueRepresentableEnum { public typealias GtkEnum = GtkPageOrientation /// Portrait mode. -case portrait -/// Landscape mode. -case landscape -/// Reverse portrait mode. -case reversePortrait -/// Reverse landscape mode. -case reverseLandscape + case portrait + /// Landscape mode. + case landscape + /// Reverse portrait mode. + case reversePortrait + /// Reverse landscape mode. + case reverseLandscape public static var type: GType { - gtk_page_orientation_get_type() -} + gtk_page_orientation_get_type() + } public init(from gtkEnum: GtkPageOrientation) { switch gtkEnum { case GTK_PAGE_ORIENTATION_PORTRAIT: - self = .portrait -case GTK_PAGE_ORIENTATION_LANDSCAPE: - self = .landscape -case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT: - self = .reversePortrait -case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE: - self = .reverseLandscape + self = .portrait + case GTK_PAGE_ORIENTATION_LANDSCAPE: + self = .landscape + case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT: + self = .reversePortrait + case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE: + self = .reverseLandscape default: fatalError("Unsupported GtkPageOrientation enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE: public func toGtk() -> GtkPageOrientation { switch self { case .portrait: - return GTK_PAGE_ORIENTATION_PORTRAIT -case .landscape: - return GTK_PAGE_ORIENTATION_LANDSCAPE -case .reversePortrait: - return GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT -case .reverseLandscape: - return GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE + return GTK_PAGE_ORIENTATION_PORTRAIT + case .landscape: + return GTK_PAGE_ORIENTATION_LANDSCAPE + case .reversePortrait: + return GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT + case .reverseLandscape: + return GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PageSet.swift b/Sources/Gtk/Generated/PageSet.swift index 74cc516b41..be8ebed1e7 100644 --- a/Sources/Gtk/Generated/PageSet.swift +++ b/Sources/Gtk/Generated/PageSet.swift @@ -5,24 +5,24 @@ public enum PageSet: GValueRepresentableEnum { public typealias GtkEnum = GtkPageSet /// All pages. -case all -/// Even pages. -case even -/// Odd pages. -case odd + case all + /// Even pages. + case even + /// Odd pages. + case odd public static var type: GType { - gtk_page_set_get_type() -} + gtk_page_set_get_type() + } public init(from gtkEnum: GtkPageSet) { switch gtkEnum { case GTK_PAGE_SET_ALL: - self = .all -case GTK_PAGE_SET_EVEN: - self = .even -case GTK_PAGE_SET_ODD: - self = .odd + self = .all + case GTK_PAGE_SET_EVEN: + self = .even + case GTK_PAGE_SET_ODD: + self = .odd default: fatalError("Unsupported GtkPageSet enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ case GTK_PAGE_SET_ODD: public func toGtk() -> GtkPageSet { switch self { case .all: - return GTK_PAGE_SET_ALL -case .even: - return GTK_PAGE_SET_EVEN -case .odd: - return GTK_PAGE_SET_ODD + return GTK_PAGE_SET_ALL + case .even: + return GTK_PAGE_SET_EVEN + case .odd: + return GTK_PAGE_SET_ODD } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PanDirection.swift b/Sources/Gtk/Generated/PanDirection.swift index 6c0f476926..671e76d754 100644 --- a/Sources/Gtk/Generated/PanDirection.swift +++ b/Sources/Gtk/Generated/PanDirection.swift @@ -5,28 +5,28 @@ public enum PanDirection: GValueRepresentableEnum { public typealias GtkEnum = GtkPanDirection /// Panned towards the left -case left -/// Panned towards the right -case right -/// Panned upwards -case up -/// Panned downwards -case down + case left + /// Panned towards the right + case right + /// Panned upwards + case up + /// Panned downwards + case down public static var type: GType { - gtk_pan_direction_get_type() -} + gtk_pan_direction_get_type() + } public init(from gtkEnum: GtkPanDirection) { switch gtkEnum { case GTK_PAN_DIRECTION_LEFT: - self = .left -case GTK_PAN_DIRECTION_RIGHT: - self = .right -case GTK_PAN_DIRECTION_UP: - self = .up -case GTK_PAN_DIRECTION_DOWN: - self = .down + self = .left + case GTK_PAN_DIRECTION_RIGHT: + self = .right + case GTK_PAN_DIRECTION_UP: + self = .up + case GTK_PAN_DIRECTION_DOWN: + self = .down default: fatalError("Unsupported GtkPanDirection enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_PAN_DIRECTION_DOWN: public func toGtk() -> GtkPanDirection { switch self { case .left: - return GTK_PAN_DIRECTION_LEFT -case .right: - return GTK_PAN_DIRECTION_RIGHT -case .up: - return GTK_PAN_DIRECTION_UP -case .down: - return GTK_PAN_DIRECTION_DOWN + return GTK_PAN_DIRECTION_LEFT + case .right: + return GTK_PAN_DIRECTION_RIGHT + case .up: + return GTK_PAN_DIRECTION_UP + case .down: + return GTK_PAN_DIRECTION_DOWN } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Picture.swift b/Sources/Gtk/Generated/Picture.swift index b75884c0a8..641cd3ecf3 100644 --- a/Sources/Gtk/Generated/Picture.swift +++ b/Sources/Gtk/Generated/Picture.swift @@ -1,34 +1,34 @@ import CGtk /// Displays a `GdkPaintable`. -/// +/// /// picture>An example GtkPicture -/// +/// /// Many convenience functions are provided to make pictures simple to use. /// For example, if you want to load an image from a file, and then display /// it, there’s a convenience function to do this: -/// +/// /// ```c /// GtkWidget *widget = gtk_picture_new_for_filename ("myfile.png"); /// ``` -/// +/// /// If the file isn’t loaded successfully, the picture will contain a /// “broken image” icon similar to that used in many web browsers. /// If you want to handle errors in loading the file yourself, /// for example by displaying an error message, then load the image with /// and image loading framework such as libglycin, then create the `GtkPicture` /// with [ctor@Gtk.Picture.new_for_paintable]. -/// +/// /// Sometimes an application will want to avoid depending on external data /// files, such as image files. See the documentation of `GResource` for details. /// In this case, [ctor@Gtk.Picture.new_for_resource] and /// [method@Gtk.Picture.set_resource] should be used. -/// +/// /// `GtkPicture` displays an image at its natural size. See [class@Gtk.Image] /// if you want to display a fixed-size image, such as an icon. -/// +/// /// ## Sizing the paintable -/// +/// /// You can influence how the paintable is displayed inside the `GtkPicture` /// by changing [property@Gtk.Picture:content-fit]. See [enum@Gtk.ContentFit] /// for details. [property@Gtk.Picture:can-shrink] can be unset to make sure @@ -38,144 +38,150 @@ import CGtk /// grow larger than the screen. And [property@Gtk.Widget:halign] and /// [property@Gtk.Widget:valign] can be used to make sure the paintable doesn't /// fill all available space but is instead displayed at its original size. -/// +/// /// ## CSS nodes -/// +/// /// `GtkPicture` has a single CSS node with the name `picture`. -/// +/// /// ## Accessibility -/// +/// /// `GtkPicture` uses the [enum@Gtk.AccessibleRole.img] role. open class Picture: Widget { /// Creates a new empty `GtkPicture` widget. -public convenience init() { - self.init( - gtk_picture_new() - ) -} - -/// Creates a new `GtkPicture` displaying the file @filename. -/// -/// This is a utility function that calls [ctor@Gtk.Picture.new_for_file]. -/// See that function for details. -public convenience init(filename: String) { - self.init( - gtk_picture_new_for_filename(filename) - ) -} - -/// Creates a new `GtkPicture` displaying @paintable. -/// -/// The `GtkPicture` will track changes to the @paintable and update -/// its size and contents in response to it. -public convenience init(paintable: OpaquePointer) { - self.init( - gtk_picture_new_for_paintable(paintable) - ) -} - -/// Creates a new `GtkPicture` displaying the resource at @resource_path. -/// -/// This is a utility function that calls [ctor@Gtk.Picture.new_for_file]. -/// See that function for details. -public convenience init(resourcePath: String) { - self.init( - gtk_picture_new_for_resource(resourcePath) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_picture_new() + ) } -addSignal(name: "notify::alternative-text", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAlternativeText?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new `GtkPicture` displaying the file @filename. + /// + /// This is a utility function that calls [ctor@Gtk.Picture.new_for_file]. + /// See that function for details. + public convenience init(filename: String) { + self.init( + gtk_picture_new_for_filename(filename) + ) } -addSignal(name: "notify::can-shrink", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCanShrink?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new `GtkPicture` displaying @paintable. + /// + /// The `GtkPicture` will track changes to the @paintable and update + /// its size and contents in response to it. + public convenience init(paintable: OpaquePointer) { + self.init( + gtk_picture_new_for_paintable(paintable) + ) } -addSignal(name: "notify::content-fit", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContentFit?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new `GtkPicture` displaying the resource at @resource_path. + /// + /// This is a utility function that calls [ctor@Gtk.Picture.new_for_file]. + /// See that function for details. + public convenience init(resourcePath: String) { + self.init( + gtk_picture_new_for_resource(resourcePath) + ) } -addSignal(name: "notify::file", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFile?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::keep-aspect-ratio", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyKeepAspectRatio?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::alternative-text", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAlternativeText?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::can-shrink", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCanShrink?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::content-fit", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContentFit?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::file", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFile?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::keep-aspect-ratio", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyKeepAspectRatio?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::paintable", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPaintable?(self, param0) + } } -addSignal(name: "notify::paintable", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPaintable?(self, param0) -} -} - /// The alternative textual description for the picture. -@GObjectProperty(named: "alternative-text") public var alternativeText: String? + @GObjectProperty(named: "alternative-text") public var alternativeText: String? -/// If the `GtkPicture` can be made smaller than the natural size of its contents. -@GObjectProperty(named: "can-shrink") public var canShrink: Bool + /// If the `GtkPicture` can be made smaller than the natural size of its contents. + @GObjectProperty(named: "can-shrink") public var canShrink: Bool -/// Whether the GtkPicture will render its contents trying to preserve the aspect -/// ratio. -@GObjectProperty(named: "keep-aspect-ratio") public var keepAspectRatio: Bool + /// Whether the GtkPicture will render its contents trying to preserve the aspect + /// ratio. + @GObjectProperty(named: "keep-aspect-ratio") public var keepAspectRatio: Bool -/// The `GdkPaintable` to be displayed by this `GtkPicture`. -@GObjectProperty(named: "paintable") public var paintable: OpaquePointer? + /// The `GdkPaintable` to be displayed by this `GtkPicture`. + @GObjectProperty(named: "paintable") public var paintable: OpaquePointer? + public var notifyAlternativeText: ((Picture, OpaquePointer) -> Void)? -public var notifyAlternativeText: ((Picture, OpaquePointer) -> Void)? + public var notifyCanShrink: ((Picture, OpaquePointer) -> Void)? + public var notifyContentFit: ((Picture, OpaquePointer) -> Void)? -public var notifyCanShrink: ((Picture, OpaquePointer) -> Void)? + public var notifyFile: ((Picture, OpaquePointer) -> Void)? + public var notifyKeepAspectRatio: ((Picture, OpaquePointer) -> Void)? -public var notifyContentFit: ((Picture, OpaquePointer) -> Void)? - - -public var notifyFile: ((Picture, OpaquePointer) -> Void)? - - -public var notifyKeepAspectRatio: ((Picture, OpaquePointer) -> Void)? - - -public var notifyPaintable: ((Picture, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyPaintable: ((Picture, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/PolicyType.swift b/Sources/Gtk/Generated/PolicyType.swift index 723782bc54..6c8b2f3718 100644 --- a/Sources/Gtk/Generated/PolicyType.swift +++ b/Sources/Gtk/Generated/PolicyType.swift @@ -6,33 +6,33 @@ public enum PolicyType: GValueRepresentableEnum { public typealias GtkEnum = GtkPolicyType /// The scrollbar is always visible. The view size is -/// independent of the content. -case always -/// The scrollbar will appear and disappear as necessary. -/// For example, when all of a `GtkTreeView` can not be seen. -case automatic -/// The scrollbar should never appear. In this mode the -/// content determines the size. -case never -/// Don't show a scrollbar, but don't force the -/// size to follow the content. This can be used e.g. to make multiple -/// scrolled windows share a scrollbar. -case external + /// independent of the content. + case always + /// The scrollbar will appear and disappear as necessary. + /// For example, when all of a `GtkTreeView` can not be seen. + case automatic + /// The scrollbar should never appear. In this mode the + /// content determines the size. + case never + /// Don't show a scrollbar, but don't force the + /// size to follow the content. This can be used e.g. to make multiple + /// scrolled windows share a scrollbar. + case external public static var type: GType { - gtk_policy_type_get_type() -} + gtk_policy_type_get_type() + } public init(from gtkEnum: GtkPolicyType) { switch gtkEnum { case GTK_POLICY_ALWAYS: - self = .always -case GTK_POLICY_AUTOMATIC: - self = .automatic -case GTK_POLICY_NEVER: - self = .never -case GTK_POLICY_EXTERNAL: - self = .external + self = .always + case GTK_POLICY_AUTOMATIC: + self = .automatic + case GTK_POLICY_NEVER: + self = .never + case GTK_POLICY_EXTERNAL: + self = .external default: fatalError("Unsupported GtkPolicyType enum value: \(gtkEnum.rawValue)") } @@ -41,13 +41,13 @@ case GTK_POLICY_EXTERNAL: public func toGtk() -> GtkPolicyType { switch self { case .always: - return GTK_POLICY_ALWAYS -case .automatic: - return GTK_POLICY_AUTOMATIC -case .never: - return GTK_POLICY_NEVER -case .external: - return GTK_POLICY_EXTERNAL + return GTK_POLICY_ALWAYS + case .automatic: + return GTK_POLICY_AUTOMATIC + case .never: + return GTK_POLICY_NEVER + case .external: + return GTK_POLICY_EXTERNAL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Popover.swift b/Sources/Gtk/Generated/Popover.swift index 7095c5824c..0a68d9b281 100644 --- a/Sources/Gtk/Generated/Popover.swift +++ b/Sources/Gtk/Generated/Popover.swift @@ -1,9 +1,9 @@ import CGtk /// Presents a bubble-like popup. -/// +/// /// An example GtkPopover -/// +/// /// It is primarily meant to provide context-dependent information /// or options. Popovers are attached to a parent widget. The parent widget /// must support popover children, as [class@Gtk.MenuButton] and @@ -11,62 +11,62 @@ import CGtk /// has an attached popover, you need to call [method@Gtk.Popover.present] /// in your [vfunc@Gtk.Widget.size_allocate] vfunc, in order to update the /// positioning of the popover. -/// +/// /// The position of a popover relative to the widget it is attached to /// can also be changed with [method@Gtk.Popover.set_position]. By default, /// it points to the whole widget area, but it can be made to point to /// a specific area using [method@Gtk.Popover.set_pointing_to]. -/// +/// /// By default, `GtkPopover` performs a grab, in order to ensure input /// events get redirected to it while it is shown, and also so the popover /// is dismissed in the expected situations (clicks outside the popover, /// or the Escape key being pressed). If no such modal behavior is desired /// on a popover, [method@Gtk.Popover.set_autohide] may be called on it to /// tweak its behavior. -/// +/// /// ## GtkPopover as menu replacement -/// +/// /// `GtkPopover` is often used to replace menus. The best way to do this /// is to use the [class@Gtk.PopoverMenu] subclass which supports being /// populated from a `GMenuModel` with [ctor@Gtk.PopoverMenu.new_from_model]. -/// +/// /// ```xml ///
horizontal-buttonsCutapp.cutedit-cut-symbolicCopyapp.copyedit-copy-symbolicPasteapp.pasteedit-paste-symbolic
/// ``` -/// +/// /// # Shortcuts and Gestures -/// +/// /// `GtkPopover` supports the following keyboard shortcuts: -/// +/// /// - Escape closes the popover. /// - Alt makes the mnemonics visible. -/// +/// /// The following signals have default keybindings: -/// +/// /// - [signal@Gtk.Popover::activate-default] -/// +/// /// # CSS nodes -/// +/// /// ``` /// popover.background[.menu] /// ├── arrow /// ╰── contents /// ╰── /// ``` -/// +/// /// `GtkPopover` has a main node with name `popover`, an arrow with name `arrow`, /// and another node for the content named `contents`. The `popover` node always /// gets the `.background` style class. It also gets the `.menu` style class /// if the popover is menu-like, e.g. is a [class@Gtk.PopoverMenu]. -/// +/// /// Particular uses of `GtkPopover`, such as touch selection popups or /// magnifiers in `GtkEntry` or `GtkTextView` get style classes like /// `.touch-selection` or `.magnifier` to differentiate from plain popovers. -/// +/// /// When styling a popover directly, the `popover` node should usually /// not have any background. The visible part of the popover can have /// a shadow. To specify it in CSS, set the box-shadow of the `contents` node. -/// +/// /// Note that, in order to accomplish appropriate arrow visuals, `GtkPopover` /// uses custom drawing for the `arrow` node. This makes it possible for the /// arrow to change its shape dynamically, but it also limits the possibilities @@ -78,154 +78,162 @@ import CGtk /// used) and no box-shadow. open class Popover: Widget, Native, ShortcutManager { /// Creates a new `GtkPopover`. -public convenience init() { - self.init( - gtk_popover_new() - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate-default") { [weak self] () in - guard let self = self else { return } - self.activateDefault?(self) -} - -addSignal(name: "closed") { [weak self] () in - guard let self = self else { return } - self.closed?(self) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_popover_new() + ) } -addSignal(name: "notify::autohide", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAutohide?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate-default") { [weak self] () in + guard let self = self else { return } + self.activateDefault?(self) + } + + addSignal(name: "closed") { [weak self] () in + guard let self = self else { return } + self.closed?(self) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::autohide", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAutohide?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::cascade-popdown", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCascadePopdown?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::child", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyChild?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::default-widget", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDefaultWidget?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::has-arrow", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasArrow?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::mnemonics-visible", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMnemonicsVisible?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::pointing-to", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPointingTo?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::position", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPosition?(self, param0) + } } -addSignal(name: "notify::cascade-popdown", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCascadePopdown?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::child", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyChild?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::default-widget", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDefaultWidget?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::has-arrow", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasArrow?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::mnemonics-visible", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMnemonicsVisible?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::pointing-to", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPointingTo?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::position", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPosition?(self, param0) -} -} - /// Whether to dismiss the popover on outside clicks. -@GObjectProperty(named: "autohide") public var autohide: Bool - -/// Whether the popover pops down after a child popover. -/// -/// This is used to implement the expected behavior of submenus. -@GObjectProperty(named: "cascade-popdown") public var cascadePopdown: Bool - -/// Whether to draw an arrow. -@GObjectProperty(named: "has-arrow") public var hasArrow: Bool - -/// Whether mnemonics are currently visible in this popover. -@GObjectProperty(named: "mnemonics-visible") public var mnemonicsVisible: Bool - -/// How to place the popover, relative to its parent. -@GObjectProperty(named: "position") public var position: PositionType + @GObjectProperty(named: "autohide") public var autohide: Bool -/// Emitted whend the user activates the default widget. -/// -/// This is a [keybinding signal](class.SignalAction.html). -/// -/// The default binding for this signal is Enter. -public var activateDefault: ((Popover) -> Void)? + /// Whether the popover pops down after a child popover. + /// + /// This is used to implement the expected behavior of submenus. + @GObjectProperty(named: "cascade-popdown") public var cascadePopdown: Bool -/// Emitted when the popover is closed. -public var closed: ((Popover) -> Void)? + /// Whether to draw an arrow. + @GObjectProperty(named: "has-arrow") public var hasArrow: Bool + /// Whether mnemonics are currently visible in this popover. + @GObjectProperty(named: "mnemonics-visible") public var mnemonicsVisible: Bool -public var notifyAutohide: ((Popover, OpaquePointer) -> Void)? + /// How to place the popover, relative to its parent. + @GObjectProperty(named: "position") public var position: PositionType + /// Emitted whend the user activates the default widget. + /// + /// This is a [keybinding signal](class.SignalAction.html). + /// + /// The default binding for this signal is Enter. + public var activateDefault: ((Popover) -> Void)? -public var notifyCascadePopdown: ((Popover, OpaquePointer) -> Void)? + /// Emitted when the popover is closed. + public var closed: ((Popover) -> Void)? + public var notifyAutohide: ((Popover, OpaquePointer) -> Void)? -public var notifyChild: ((Popover, OpaquePointer) -> Void)? + public var notifyCascadePopdown: ((Popover, OpaquePointer) -> Void)? + public var notifyChild: ((Popover, OpaquePointer) -> Void)? -public var notifyDefaultWidget: ((Popover, OpaquePointer) -> Void)? + public var notifyDefaultWidget: ((Popover, OpaquePointer) -> Void)? + public var notifyHasArrow: ((Popover, OpaquePointer) -> Void)? -public var notifyHasArrow: ((Popover, OpaquePointer) -> Void)? + public var notifyMnemonicsVisible: ((Popover, OpaquePointer) -> Void)? + public var notifyPointingTo: ((Popover, OpaquePointer) -> Void)? -public var notifyMnemonicsVisible: ((Popover, OpaquePointer) -> Void)? - - -public var notifyPointingTo: ((Popover, OpaquePointer) -> Void)? - - -public var notifyPosition: ((Popover, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyPosition: ((Popover, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/PositionType.swift b/Sources/Gtk/Generated/PositionType.swift index 1ae80235e0..cd0c7bcd4e 100644 --- a/Sources/Gtk/Generated/PositionType.swift +++ b/Sources/Gtk/Generated/PositionType.swift @@ -1,35 +1,35 @@ import CGtk /// Describes which edge of a widget a certain feature is positioned at. -/// +/// /// For examples, see the tabs of a [class@Notebook], or the label /// of a [class@Scale]. public enum PositionType: GValueRepresentableEnum { public typealias GtkEnum = GtkPositionType /// The feature is at the left edge. -case left -/// The feature is at the right edge. -case right -/// The feature is at the top edge. -case top -/// The feature is at the bottom edge. -case bottom + case left + /// The feature is at the right edge. + case right + /// The feature is at the top edge. + case top + /// The feature is at the bottom edge. + case bottom public static var type: GType { - gtk_position_type_get_type() -} + gtk_position_type_get_type() + } public init(from gtkEnum: GtkPositionType) { switch gtkEnum { case GTK_POS_LEFT: - self = .left -case GTK_POS_RIGHT: - self = .right -case GTK_POS_TOP: - self = .top -case GTK_POS_BOTTOM: - self = .bottom + self = .left + case GTK_POS_RIGHT: + self = .right + case GTK_POS_TOP: + self = .top + case GTK_POS_BOTTOM: + self = .bottom default: fatalError("Unsupported GtkPositionType enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ case GTK_POS_BOTTOM: public func toGtk() -> GtkPositionType { switch self { case .left: - return GTK_POS_LEFT -case .right: - return GTK_POS_RIGHT -case .top: - return GTK_POS_TOP -case .bottom: - return GTK_POS_BOTTOM + return GTK_POS_LEFT + case .right: + return GTK_POS_RIGHT + case .top: + return GTK_POS_TOP + case .bottom: + return GTK_POS_BOTTOM } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PrintDuplex.swift b/Sources/Gtk/Generated/PrintDuplex.swift index 8d59014fc4..fdf4854f27 100644 --- a/Sources/Gtk/Generated/PrintDuplex.swift +++ b/Sources/Gtk/Generated/PrintDuplex.swift @@ -5,24 +5,24 @@ public enum PrintDuplex: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintDuplex /// No duplex. -case simplex -/// Horizontal duplex. -case horizontal -/// Vertical duplex. -case vertical + case simplex + /// Horizontal duplex. + case horizontal + /// Vertical duplex. + case vertical public static var type: GType { - gtk_print_duplex_get_type() -} + gtk_print_duplex_get_type() + } public init(from gtkEnum: GtkPrintDuplex) { switch gtkEnum { case GTK_PRINT_DUPLEX_SIMPLEX: - self = .simplex -case GTK_PRINT_DUPLEX_HORIZONTAL: - self = .horizontal -case GTK_PRINT_DUPLEX_VERTICAL: - self = .vertical + self = .simplex + case GTK_PRINT_DUPLEX_HORIZONTAL: + self = .horizontal + case GTK_PRINT_DUPLEX_VERTICAL: + self = .vertical default: fatalError("Unsupported GtkPrintDuplex enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ case GTK_PRINT_DUPLEX_VERTICAL: public func toGtk() -> GtkPrintDuplex { switch self { case .simplex: - return GTK_PRINT_DUPLEX_SIMPLEX -case .horizontal: - return GTK_PRINT_DUPLEX_HORIZONTAL -case .vertical: - return GTK_PRINT_DUPLEX_VERTICAL + return GTK_PRINT_DUPLEX_SIMPLEX + case .horizontal: + return GTK_PRINT_DUPLEX_HORIZONTAL + case .vertical: + return GTK_PRINT_DUPLEX_VERTICAL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PrintError.swift b/Sources/Gtk/Generated/PrintError.swift index b61a09f4ab..c4397c6f19 100644 --- a/Sources/Gtk/Generated/PrintError.swift +++ b/Sources/Gtk/Generated/PrintError.swift @@ -6,29 +6,29 @@ public enum PrintError: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintError /// An unspecified error occurred. -case general -/// An internal error occurred. -case internalError -/// A memory allocation failed. -case nomem -/// An error occurred while loading a page setup -/// or paper size from a key file. -case invalidFile + case general + /// An internal error occurred. + case internalError + /// A memory allocation failed. + case nomem + /// An error occurred while loading a page setup + /// or paper size from a key file. + case invalidFile public static var type: GType { - gtk_print_error_get_type() -} + gtk_print_error_get_type() + } public init(from gtkEnum: GtkPrintError) { switch gtkEnum { case GTK_PRINT_ERROR_GENERAL: - self = .general -case GTK_PRINT_ERROR_INTERNAL_ERROR: - self = .internalError -case GTK_PRINT_ERROR_NOMEM: - self = .nomem -case GTK_PRINT_ERROR_INVALID_FILE: - self = .invalidFile + self = .general + case GTK_PRINT_ERROR_INTERNAL_ERROR: + self = .internalError + case GTK_PRINT_ERROR_NOMEM: + self = .nomem + case GTK_PRINT_ERROR_INVALID_FILE: + self = .invalidFile default: fatalError("Unsupported GtkPrintError enum value: \(gtkEnum.rawValue)") } @@ -37,13 +37,13 @@ case GTK_PRINT_ERROR_INVALID_FILE: public func toGtk() -> GtkPrintError { switch self { case .general: - return GTK_PRINT_ERROR_GENERAL -case .internalError: - return GTK_PRINT_ERROR_INTERNAL_ERROR -case .nomem: - return GTK_PRINT_ERROR_NOMEM -case .invalidFile: - return GTK_PRINT_ERROR_INVALID_FILE + return GTK_PRINT_ERROR_GENERAL + case .internalError: + return GTK_PRINT_ERROR_INTERNAL_ERROR + case .nomem: + return GTK_PRINT_ERROR_NOMEM + case .invalidFile: + return GTK_PRINT_ERROR_INVALID_FILE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PrintOperationAction.swift b/Sources/Gtk/Generated/PrintOperationAction.swift index 3c4579d6cd..dc3be60a12 100644 --- a/Sources/Gtk/Generated/PrintOperationAction.swift +++ b/Sources/Gtk/Generated/PrintOperationAction.swift @@ -1,37 +1,37 @@ import CGtk /// Determines what action the print operation should perform. -/// +/// /// A parameter of this typs is passed to [method@Gtk.PrintOperation.run]. public enum PrintOperationAction: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintOperationAction /// Show the print dialog. -case printDialog -/// Start to print without showing -/// the print dialog, based on the current print settings, if possible. -/// Depending on the platform, a print dialog might appear anyway. -case print -/// Show the print preview. -case preview -/// Export to a file. This requires -/// the export-filename property to be set. -case export + case printDialog + /// Start to print without showing + /// the print dialog, based on the current print settings, if possible. + /// Depending on the platform, a print dialog might appear anyway. + case print + /// Show the print preview. + case preview + /// Export to a file. This requires + /// the export-filename property to be set. + case export public static var type: GType { - gtk_print_operation_action_get_type() -} + gtk_print_operation_action_get_type() + } public init(from gtkEnum: GtkPrintOperationAction) { switch gtkEnum { case GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG: - self = .printDialog -case GTK_PRINT_OPERATION_ACTION_PRINT: - self = .print -case GTK_PRINT_OPERATION_ACTION_PREVIEW: - self = .preview -case GTK_PRINT_OPERATION_ACTION_EXPORT: - self = .export + self = .printDialog + case GTK_PRINT_OPERATION_ACTION_PRINT: + self = .print + case GTK_PRINT_OPERATION_ACTION_PREVIEW: + self = .preview + case GTK_PRINT_OPERATION_ACTION_EXPORT: + self = .export default: fatalError("Unsupported GtkPrintOperationAction enum value: \(gtkEnum.rawValue)") } @@ -40,13 +40,13 @@ case GTK_PRINT_OPERATION_ACTION_EXPORT: public func toGtk() -> GtkPrintOperationAction { switch self { case .printDialog: - return GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG -case .print: - return GTK_PRINT_OPERATION_ACTION_PRINT -case .preview: - return GTK_PRINT_OPERATION_ACTION_PREVIEW -case .export: - return GTK_PRINT_OPERATION_ACTION_EXPORT + return GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG + case .print: + return GTK_PRINT_OPERATION_ACTION_PRINT + case .preview: + return GTK_PRINT_OPERATION_ACTION_PREVIEW + case .export: + return GTK_PRINT_OPERATION_ACTION_EXPORT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PrintOperationResult.swift b/Sources/Gtk/Generated/PrintOperationResult.swift index 46bf28eb4d..07a29bb38e 100644 --- a/Sources/Gtk/Generated/PrintOperationResult.swift +++ b/Sources/Gtk/Generated/PrintOperationResult.swift @@ -1,36 +1,36 @@ import CGtk /// The result of a print operation. -/// +/// /// A value of this type is returned by [method@Gtk.PrintOperation.run]. public enum PrintOperationResult: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintOperationResult /// An error has occurred. -case error -/// The print settings should be stored. -case apply -/// The print operation has been canceled, -/// the print settings should not be stored. -case cancel -/// The print operation is not complete -/// yet. This value will only be returned when running asynchronously. -case inProgress + case error + /// The print settings should be stored. + case apply + /// The print operation has been canceled, + /// the print settings should not be stored. + case cancel + /// The print operation is not complete + /// yet. This value will only be returned when running asynchronously. + case inProgress public static var type: GType { - gtk_print_operation_result_get_type() -} + gtk_print_operation_result_get_type() + } public init(from gtkEnum: GtkPrintOperationResult) { switch gtkEnum { case GTK_PRINT_OPERATION_RESULT_ERROR: - self = .error -case GTK_PRINT_OPERATION_RESULT_APPLY: - self = .apply -case GTK_PRINT_OPERATION_RESULT_CANCEL: - self = .cancel -case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS: - self = .inProgress + self = .error + case GTK_PRINT_OPERATION_RESULT_APPLY: + self = .apply + case GTK_PRINT_OPERATION_RESULT_CANCEL: + self = .cancel + case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS: + self = .inProgress default: fatalError("Unsupported GtkPrintOperationResult enum value: \(gtkEnum.rawValue)") } @@ -39,13 +39,13 @@ case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS: public func toGtk() -> GtkPrintOperationResult { switch self { case .error: - return GTK_PRINT_OPERATION_RESULT_ERROR -case .apply: - return GTK_PRINT_OPERATION_RESULT_APPLY -case .cancel: - return GTK_PRINT_OPERATION_RESULT_CANCEL -case .inProgress: - return GTK_PRINT_OPERATION_RESULT_IN_PROGRESS + return GTK_PRINT_OPERATION_RESULT_ERROR + case .apply: + return GTK_PRINT_OPERATION_RESULT_APPLY + case .cancel: + return GTK_PRINT_OPERATION_RESULT_CANCEL + case .inProgress: + return GTK_PRINT_OPERATION_RESULT_IN_PROGRESS } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PrintPages.swift b/Sources/Gtk/Generated/PrintPages.swift index 0daf9facdb..6806476cf3 100644 --- a/Sources/Gtk/Generated/PrintPages.swift +++ b/Sources/Gtk/Generated/PrintPages.swift @@ -5,28 +5,28 @@ public enum PrintPages: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintPages /// All pages. -case all -/// Current page. -case current -/// Range of pages. -case ranges -/// Selected pages. -case selection + case all + /// Current page. + case current + /// Range of pages. + case ranges + /// Selected pages. + case selection public static var type: GType { - gtk_print_pages_get_type() -} + gtk_print_pages_get_type() + } public init(from gtkEnum: GtkPrintPages) { switch gtkEnum { case GTK_PRINT_PAGES_ALL: - self = .all -case GTK_PRINT_PAGES_CURRENT: - self = .current -case GTK_PRINT_PAGES_RANGES: - self = .ranges -case GTK_PRINT_PAGES_SELECTION: - self = .selection + self = .all + case GTK_PRINT_PAGES_CURRENT: + self = .current + case GTK_PRINT_PAGES_RANGES: + self = .ranges + case GTK_PRINT_PAGES_SELECTION: + self = .selection default: fatalError("Unsupported GtkPrintPages enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_PRINT_PAGES_SELECTION: public func toGtk() -> GtkPrintPages { switch self { case .all: - return GTK_PRINT_PAGES_ALL -case .current: - return GTK_PRINT_PAGES_CURRENT -case .ranges: - return GTK_PRINT_PAGES_RANGES -case .selection: - return GTK_PRINT_PAGES_SELECTION + return GTK_PRINT_PAGES_ALL + case .current: + return GTK_PRINT_PAGES_CURRENT + case .ranges: + return GTK_PRINT_PAGES_RANGES + case .selection: + return GTK_PRINT_PAGES_SELECTION } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PrintQuality.swift b/Sources/Gtk/Generated/PrintQuality.swift index 66848c3d9c..08c785ae17 100644 --- a/Sources/Gtk/Generated/PrintQuality.swift +++ b/Sources/Gtk/Generated/PrintQuality.swift @@ -5,28 +5,28 @@ public enum PrintQuality: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintQuality /// Low quality. -case low -/// Normal quality. -case normal -/// High quality. -case high -/// Draft quality. -case draft + case low + /// Normal quality. + case normal + /// High quality. + case high + /// Draft quality. + case draft public static var type: GType { - gtk_print_quality_get_type() -} + gtk_print_quality_get_type() + } public init(from gtkEnum: GtkPrintQuality) { switch gtkEnum { case GTK_PRINT_QUALITY_LOW: - self = .low -case GTK_PRINT_QUALITY_NORMAL: - self = .normal -case GTK_PRINT_QUALITY_HIGH: - self = .high -case GTK_PRINT_QUALITY_DRAFT: - self = .draft + self = .low + case GTK_PRINT_QUALITY_NORMAL: + self = .normal + case GTK_PRINT_QUALITY_HIGH: + self = .high + case GTK_PRINT_QUALITY_DRAFT: + self = .draft default: fatalError("Unsupported GtkPrintQuality enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_PRINT_QUALITY_DRAFT: public func toGtk() -> GtkPrintQuality { switch self { case .low: - return GTK_PRINT_QUALITY_LOW -case .normal: - return GTK_PRINT_QUALITY_NORMAL -case .high: - return GTK_PRINT_QUALITY_HIGH -case .draft: - return GTK_PRINT_QUALITY_DRAFT + return GTK_PRINT_QUALITY_LOW + case .normal: + return GTK_PRINT_QUALITY_NORMAL + case .high: + return GTK_PRINT_QUALITY_HIGH + case .draft: + return GTK_PRINT_QUALITY_DRAFT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PrintStatus.swift b/Sources/Gtk/Generated/PrintStatus.swift index 9409b327c4..5078e9369f 100644 --- a/Sources/Gtk/Generated/PrintStatus.swift +++ b/Sources/Gtk/Generated/PrintStatus.swift @@ -6,54 +6,54 @@ public enum PrintStatus: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintStatus /// The printing has not started yet; this -/// status is set initially, and while the print dialog is shown. -case initial -/// This status is set while the begin-print -/// signal is emitted and during pagination. -case preparing -/// This status is set while the -/// pages are being rendered. -case generatingData -/// The print job is being sent off to the -/// printer. -case sendingData -/// The print job has been sent to the printer, -/// but is not printed for some reason, e.g. the printer may be stopped. -case pending -/// Some problem has occurred during -/// printing, e.g. a paper jam. -case pendingIssue -/// The printer is processing the print job. -case printing -/// The printing has been completed successfully. -case finished -/// The printing has been aborted. -case finishedAborted + /// status is set initially, and while the print dialog is shown. + case initial + /// This status is set while the begin-print + /// signal is emitted and during pagination. + case preparing + /// This status is set while the + /// pages are being rendered. + case generatingData + /// The print job is being sent off to the + /// printer. + case sendingData + /// The print job has been sent to the printer, + /// but is not printed for some reason, e.g. the printer may be stopped. + case pending + /// Some problem has occurred during + /// printing, e.g. a paper jam. + case pendingIssue + /// The printer is processing the print job. + case printing + /// The printing has been completed successfully. + case finished + /// The printing has been aborted. + case finishedAborted public static var type: GType { - gtk_print_status_get_type() -} + gtk_print_status_get_type() + } public init(from gtkEnum: GtkPrintStatus) { switch gtkEnum { case GTK_PRINT_STATUS_INITIAL: - self = .initial -case GTK_PRINT_STATUS_PREPARING: - self = .preparing -case GTK_PRINT_STATUS_GENERATING_DATA: - self = .generatingData -case GTK_PRINT_STATUS_SENDING_DATA: - self = .sendingData -case GTK_PRINT_STATUS_PENDING: - self = .pending -case GTK_PRINT_STATUS_PENDING_ISSUE: - self = .pendingIssue -case GTK_PRINT_STATUS_PRINTING: - self = .printing -case GTK_PRINT_STATUS_FINISHED: - self = .finished -case GTK_PRINT_STATUS_FINISHED_ABORTED: - self = .finishedAborted + self = .initial + case GTK_PRINT_STATUS_PREPARING: + self = .preparing + case GTK_PRINT_STATUS_GENERATING_DATA: + self = .generatingData + case GTK_PRINT_STATUS_SENDING_DATA: + self = .sendingData + case GTK_PRINT_STATUS_PENDING: + self = .pending + case GTK_PRINT_STATUS_PENDING_ISSUE: + self = .pendingIssue + case GTK_PRINT_STATUS_PRINTING: + self = .printing + case GTK_PRINT_STATUS_FINISHED: + self = .finished + case GTK_PRINT_STATUS_FINISHED_ABORTED: + self = .finishedAborted default: fatalError("Unsupported GtkPrintStatus enum value: \(gtkEnum.rawValue)") } @@ -62,23 +62,23 @@ case GTK_PRINT_STATUS_FINISHED_ABORTED: public func toGtk() -> GtkPrintStatus { switch self { case .initial: - return GTK_PRINT_STATUS_INITIAL -case .preparing: - return GTK_PRINT_STATUS_PREPARING -case .generatingData: - return GTK_PRINT_STATUS_GENERATING_DATA -case .sendingData: - return GTK_PRINT_STATUS_SENDING_DATA -case .pending: - return GTK_PRINT_STATUS_PENDING -case .pendingIssue: - return GTK_PRINT_STATUS_PENDING_ISSUE -case .printing: - return GTK_PRINT_STATUS_PRINTING -case .finished: - return GTK_PRINT_STATUS_FINISHED -case .finishedAborted: - return GTK_PRINT_STATUS_FINISHED_ABORTED + return GTK_PRINT_STATUS_INITIAL + case .preparing: + return GTK_PRINT_STATUS_PREPARING + case .generatingData: + return GTK_PRINT_STATUS_GENERATING_DATA + case .sendingData: + return GTK_PRINT_STATUS_SENDING_DATA + case .pending: + return GTK_PRINT_STATUS_PENDING + case .pendingIssue: + return GTK_PRINT_STATUS_PENDING_ISSUE + case .printing: + return GTK_PRINT_STATUS_PRINTING + case .finished: + return GTK_PRINT_STATUS_FINISHED + case .finishedAborted: + return GTK_PRINT_STATUS_FINISHED_ABORTED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ProgressBar.swift b/Sources/Gtk/Generated/ProgressBar.swift index 23d464f7d1..65796c4396 100644 --- a/Sources/Gtk/Generated/ProgressBar.swift +++ b/Sources/Gtk/Generated/ProgressBar.swift @@ -1,39 +1,39 @@ import CGtk /// Displays the progress of a long-running operation. -/// +/// /// `GtkProgressBar` provides a visual clue that processing is underway. /// It can be used in two different modes: percentage mode and activity mode. -/// +/// /// An example GtkProgressBar -/// +/// /// When an application can determine how much work needs to take place /// (e.g. read a fixed number of bytes from a file) and can monitor its /// progress, it can use the `GtkProgressBar` in percentage mode and the /// user sees a growing bar indicating the percentage of the work that /// has been completed. In this mode, the application is required to call /// [method@Gtk.ProgressBar.set_fraction] periodically to update the progress bar. -/// +/// /// When an application has no accurate way of knowing the amount of work /// to do, it can use the `GtkProgressBar` in activity mode, which shows /// activity by a block moving back and forth within the progress area. In /// this mode, the application is required to call [method@Gtk.ProgressBar.pulse] /// periodically to update the progress bar. -/// +/// /// There is quite a bit of flexibility provided to control the appearance /// of the `GtkProgressBar`. Functions are provided to control the orientation /// of the bar, optional text can be displayed along with the bar, and the /// step size used in activity mode can be set. -/// +/// /// # CSS nodes -/// +/// /// ``` /// progressbar[.osd] /// ├── [text] /// ╰── trough[.empty][.full] /// ╰── progress[.pulse] /// ``` -/// +/// /// `GtkProgressBar` has a main CSS node with name progressbar and subnodes with /// names text and trough, of which the latter has a subnode named progress. The /// text subnode is only present if text is shown. The progress subnode has the @@ -41,137 +41,144 @@ import CGtk /// .right, .top or .bottom added when the progress 'touches' the corresponding /// end of the GtkProgressBar. The .osd class on the progressbar node is for use /// in overlays like the one Epiphany has for page loading progress. -/// +/// /// # Accessibility -/// +/// /// `GtkProgressBar` uses the [enum@Gtk.AccessibleRole.progress_bar] role. open class ProgressBar: Widget, Orientable { /// Creates a new `GtkProgressBar`. -public convenience init() { - self.init( - gtk_progress_bar_new() - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::ellipsize", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEllipsize?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::fraction", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFraction?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::inverted", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInverted?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::pulse-step", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPulseStep?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_progress_bar_new() + ) } -addSignal(name: "notify::show-text", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowText?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::ellipsize", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEllipsize?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::fraction", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFraction?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::inverted", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInverted?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::pulse-step", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPulseStep?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::show-text", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowText?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::text", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyText?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::orientation", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyOrientation?(self, param0) + } } -addSignal(name: "notify::text", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyText?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::orientation", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyOrientation?(self, param0) -} -} - /// The fraction of total work that has been completed. -@GObjectProperty(named: "fraction") public var fraction: Double - -/// Invert the direction in which the progress bar grows. -@GObjectProperty(named: "inverted") public var inverted: Bool - -/// The fraction of total progress to move the bounding block when pulsed. -@GObjectProperty(named: "pulse-step") public var pulseStep: Double - -/// Sets whether the progress bar will show a text in addition -/// to the bar itself. -/// -/// The shown text is either the value of the [property@Gtk.ProgressBar:text] -/// property or, if that is %NULL, the [property@Gtk.ProgressBar:fraction] -/// value, as a percentage. -/// -/// To make a progress bar that is styled and sized suitably for showing text -/// (even if the actual text is blank), set [property@Gtk.ProgressBar:show-text] -/// to %TRUE and [property@Gtk.ProgressBar:text] to the empty string (not %NULL). -@GObjectProperty(named: "show-text") public var showText: Bool - -/// Text to be displayed in the progress bar. -@GObjectProperty(named: "text") public var text: String? + @GObjectProperty(named: "fraction") public var fraction: Double -/// The orientation of the orientable. -@GObjectProperty(named: "orientation") public var orientation: Orientation + /// Invert the direction in which the progress bar grows. + @GObjectProperty(named: "inverted") public var inverted: Bool + /// The fraction of total progress to move the bounding block when pulsed. + @GObjectProperty(named: "pulse-step") public var pulseStep: Double -public var notifyEllipsize: ((ProgressBar, OpaquePointer) -> Void)? + /// Sets whether the progress bar will show a text in addition + /// to the bar itself. + /// + /// The shown text is either the value of the [property@Gtk.ProgressBar:text] + /// property or, if that is %NULL, the [property@Gtk.ProgressBar:fraction] + /// value, as a percentage. + /// + /// To make a progress bar that is styled and sized suitably for showing text + /// (even if the actual text is blank), set [property@Gtk.ProgressBar:show-text] + /// to %TRUE and [property@Gtk.ProgressBar:text] to the empty string (not %NULL). + @GObjectProperty(named: "show-text") public var showText: Bool + /// Text to be displayed in the progress bar. + @GObjectProperty(named: "text") public var text: String? -public var notifyFraction: ((ProgressBar, OpaquePointer) -> Void)? + /// The orientation of the orientable. + @GObjectProperty(named: "orientation") public var orientation: Orientation + public var notifyEllipsize: ((ProgressBar, OpaquePointer) -> Void)? -public var notifyInverted: ((ProgressBar, OpaquePointer) -> Void)? + public var notifyFraction: ((ProgressBar, OpaquePointer) -> Void)? + public var notifyInverted: ((ProgressBar, OpaquePointer) -> Void)? -public var notifyPulseStep: ((ProgressBar, OpaquePointer) -> Void)? + public var notifyPulseStep: ((ProgressBar, OpaquePointer) -> Void)? + public var notifyShowText: ((ProgressBar, OpaquePointer) -> Void)? -public var notifyShowText: ((ProgressBar, OpaquePointer) -> Void)? + public var notifyText: ((ProgressBar, OpaquePointer) -> Void)? - -public var notifyText: ((ProgressBar, OpaquePointer) -> Void)? - - -public var notifyOrientation: ((ProgressBar, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyOrientation: ((ProgressBar, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/PropagationLimit.swift b/Sources/Gtk/Generated/PropagationLimit.swift index 9b818c7b7f..47544d5c1e 100644 --- a/Sources/Gtk/Generated/PropagationLimit.swift +++ b/Sources/Gtk/Generated/PropagationLimit.swift @@ -6,24 +6,24 @@ public enum PropagationLimit: GValueRepresentableEnum { public typealias GtkEnum = GtkPropagationLimit /// Events are handled regardless of what their -/// target is. -case none -/// Events are only handled if their target is in -/// the same [iface@Native] (or widget with [property@Gtk.Widget:limit-events] -/// set) as the event controllers widget. -/// Note that some event types have two targets (origin and destination). -case sameNative + /// target is. + case none + /// Events are only handled if their target is in + /// the same [iface@Native] (or widget with [property@Gtk.Widget:limit-events] + /// set) as the event controllers widget. + /// Note that some event types have two targets (origin and destination). + case sameNative public static var type: GType { - gtk_propagation_limit_get_type() -} + gtk_propagation_limit_get_type() + } public init(from gtkEnum: GtkPropagationLimit) { switch gtkEnum { case GTK_LIMIT_NONE: - self = .none -case GTK_LIMIT_SAME_NATIVE: - self = .sameNative + self = .none + case GTK_LIMIT_SAME_NATIVE: + self = .sameNative default: fatalError("Unsupported GtkPropagationLimit enum value: \(gtkEnum.rawValue)") } @@ -32,9 +32,9 @@ case GTK_LIMIT_SAME_NATIVE: public func toGtk() -> GtkPropagationLimit { switch self { case .none: - return GTK_LIMIT_NONE -case .sameNative: - return GTK_LIMIT_SAME_NATIVE + return GTK_LIMIT_NONE + case .sameNative: + return GTK_LIMIT_SAME_NATIVE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/PropagationPhase.swift b/Sources/Gtk/Generated/PropagationPhase.swift index c863676051..fad15a5c44 100644 --- a/Sources/Gtk/Generated/PropagationPhase.swift +++ b/Sources/Gtk/Generated/PropagationPhase.swift @@ -5,35 +5,35 @@ public enum PropagationPhase: GValueRepresentableEnum { public typealias GtkEnum = GtkPropagationPhase /// Events are not delivered. -case none -/// Events are delivered in the capture phase. The -/// capture phase happens before the bubble phase, runs from the toplevel down -/// to the event widget. This option should only be used on containers that -/// might possibly handle events before their children do. -case capture -/// Events are delivered in the bubble phase. The bubble -/// phase happens after the capture phase, and before the default handlers -/// are run. This phase runs from the event widget, up to the toplevel. -case bubble -/// Events are delivered in the default widget event handlers, -/// note that widget implementations must chain up on button, motion, touch and -/// grab broken handlers for controllers in this phase to be run. -case target + case none + /// Events are delivered in the capture phase. The + /// capture phase happens before the bubble phase, runs from the toplevel down + /// to the event widget. This option should only be used on containers that + /// might possibly handle events before their children do. + case capture + /// Events are delivered in the bubble phase. The bubble + /// phase happens after the capture phase, and before the default handlers + /// are run. This phase runs from the event widget, up to the toplevel. + case bubble + /// Events are delivered in the default widget event handlers, + /// note that widget implementations must chain up on button, motion, touch and + /// grab broken handlers for controllers in this phase to be run. + case target public static var type: GType { - gtk_propagation_phase_get_type() -} + gtk_propagation_phase_get_type() + } public init(from gtkEnum: GtkPropagationPhase) { switch gtkEnum { case GTK_PHASE_NONE: - self = .none -case GTK_PHASE_CAPTURE: - self = .capture -case GTK_PHASE_BUBBLE: - self = .bubble -case GTK_PHASE_TARGET: - self = .target + self = .none + case GTK_PHASE_CAPTURE: + self = .capture + case GTK_PHASE_BUBBLE: + self = .bubble + case GTK_PHASE_TARGET: + self = .target default: fatalError("Unsupported GtkPropagationPhase enum value: \(gtkEnum.rawValue)") } @@ -42,13 +42,13 @@ case GTK_PHASE_TARGET: public func toGtk() -> GtkPropagationPhase { switch self { case .none: - return GTK_PHASE_NONE -case .capture: - return GTK_PHASE_CAPTURE -case .bubble: - return GTK_PHASE_BUBBLE -case .target: - return GTK_PHASE_TARGET + return GTK_PHASE_NONE + case .capture: + return GTK_PHASE_CAPTURE + case .bubble: + return GTK_PHASE_BUBBLE + case .target: + return GTK_PHASE_TARGET } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Range.swift b/Sources/Gtk/Generated/Range.swift index de54f2c7d4..8bb7e472c1 100644 --- a/Sources/Gtk/Generated/Range.swift +++ b/Sources/Gtk/Generated/Range.swift @@ -1,198 +1,211 @@ import CGtk /// Base class for widgets which visualize an adjustment. -/// +/// /// Widgets that are derived from `GtkRange` include /// [class@Gtk.Scale] and [class@Gtk.Scrollbar]. -/// +/// /// Apart from signals for monitoring the parameters of the adjustment, /// `GtkRange` provides properties and methods for setting a /// “fill level” on range widgets. See [method@Gtk.Range.set_fill_level]. -/// +/// /// # Shortcuts and Gestures -/// +/// /// The `GtkRange` slider is draggable. Holding the Shift key while /// dragging, or initiating the drag with a long-press will enable the /// fine-tuning mode. open class Range: Widget, Orientable { - - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: @convention(c) (UnsafeMutableRawPointer, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "adjust-bounds", handler: gCallback(handler0)) { [weak self] (param0: Double) in - guard let self = self else { return } - self.adjustBounds?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, GtkScrollType, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - -addSignal(name: "change-value", handler: gCallback(handler1)) { [weak self] (param0: GtkScrollType, param1: Double) in - guard let self = self else { return } - self.changeValue?(self, param0, param1) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, GtkScrollType, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "move-slider", handler: gCallback(handler2)) { [weak self] (param0: GtkScrollType) in - guard let self = self else { return } - self.moveSlider?(self, param0) -} - -addSignal(name: "value-changed") { [weak self] () in - guard let self = self else { return } - self.valueChanged?(self) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::adjustment", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAdjustment?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::fill-level", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFillLevel?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::inverted", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInverted?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "adjust-bounds", handler: gCallback(handler0)) { + [weak self] (param0: Double) in + guard let self = self else { return } + self.adjustBounds?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, GtkScrollType, Double, UnsafeMutableRawPointer) + -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "change-value", handler: gCallback(handler1)) { + [weak self] (param0: GtkScrollType, param1: Double) in + guard let self = self else { return } + self.changeValue?(self, param0, param1) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, GtkScrollType, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "move-slider", handler: gCallback(handler2)) { + [weak self] (param0: GtkScrollType) in + guard let self = self else { return } + self.moveSlider?(self, param0) + } + + addSignal(name: "value-changed") { [weak self] () in + guard let self = self else { return } + self.valueChanged?(self) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::adjustment", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAdjustment?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::fill-level", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFillLevel?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::inverted", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInverted?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::restrict-to-fill-level", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyRestrictToFillLevel?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::round-digits", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyRoundDigits?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::show-fill-level", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowFillLevel?(self, param0) + } + + let handler10: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::orientation", handler: gCallback(handler10)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyOrientation?(self, param0) + } } -addSignal(name: "notify::restrict-to-fill-level", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyRestrictToFillLevel?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::round-digits", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyRoundDigits?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::show-fill-level", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowFillLevel?(self, param0) -} - -let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::orientation", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyOrientation?(self, param0) -} -} - /// The fill level (e.g. prebuffering of a network stream). -@GObjectProperty(named: "fill-level") public var fillLevel: Double - -/// If %TRUE, the direction in which the slider moves is inverted. -@GObjectProperty(named: "inverted") public var inverted: Bool - -/// Controls whether slider movement is restricted to an -/// upper boundary set by the fill level. -@GObjectProperty(named: "restrict-to-fill-level") public var restrictToFillLevel: Bool + @GObjectProperty(named: "fill-level") public var fillLevel: Double -/// The number of digits to round the value to when -/// it changes. -/// -/// See [signal@Gtk.Range::change-value]. -@GObjectProperty(named: "round-digits") public var roundDigits: Int + /// If %TRUE, the direction in which the slider moves is inverted. + @GObjectProperty(named: "inverted") public var inverted: Bool -/// Controls whether fill level indicator graphics are displayed -/// on the trough. -@GObjectProperty(named: "show-fill-level") public var showFillLevel: Bool + /// Controls whether slider movement is restricted to an + /// upper boundary set by the fill level. + @GObjectProperty(named: "restrict-to-fill-level") public var restrictToFillLevel: Bool -/// The orientation of the orientable. -@GObjectProperty(named: "orientation") public var orientation: Orientation + /// The number of digits to round the value to when + /// it changes. + /// + /// See [signal@Gtk.Range::change-value]. + @GObjectProperty(named: "round-digits") public var roundDigits: Int -/// Emitted before clamping a value, to give the application a -/// chance to adjust the bounds. -public var adjustBounds: ((Range, Double) -> Void)? + /// Controls whether fill level indicator graphics are displayed + /// on the trough. + @GObjectProperty(named: "show-fill-level") public var showFillLevel: Bool -/// Emitted when a scroll action is performed on a range. -/// -/// It allows an application to determine the type of scroll event -/// that occurred and the resultant new value. The application can -/// handle the event itself and return %TRUE to prevent further -/// processing. Or, by returning %FALSE, it can pass the event to -/// other handlers until the default GTK handler is reached. -/// -/// The value parameter is unrounded. An application that overrides -/// the ::change-value signal is responsible for clamping the value -/// to the desired number of decimal digits; the default GTK -/// handler clamps the value based on [property@Gtk.Range:round-digits]. -public var changeValue: ((Range, GtkScrollType, Double) -> Void)? + /// The orientation of the orientable. + @GObjectProperty(named: "orientation") public var orientation: Orientation -/// Virtual function that moves the slider. -/// -/// Used for keybindings. -public var moveSlider: ((Range, GtkScrollType) -> Void)? + /// Emitted before clamping a value, to give the application a + /// chance to adjust the bounds. + public var adjustBounds: ((Range, Double) -> Void)? -/// Emitted when the range value changes. -public var valueChanged: ((Range) -> Void)? + /// Emitted when a scroll action is performed on a range. + /// + /// It allows an application to determine the type of scroll event + /// that occurred and the resultant new value. The application can + /// handle the event itself and return %TRUE to prevent further + /// processing. Or, by returning %FALSE, it can pass the event to + /// other handlers until the default GTK handler is reached. + /// + /// The value parameter is unrounded. An application that overrides + /// the ::change-value signal is responsible for clamping the value + /// to the desired number of decimal digits; the default GTK + /// handler clamps the value based on [property@Gtk.Range:round-digits]. + public var changeValue: ((Range, GtkScrollType, Double) -> Void)? + /// Virtual function that moves the slider. + /// + /// Used for keybindings. + public var moveSlider: ((Range, GtkScrollType) -> Void)? -public var notifyAdjustment: ((Range, OpaquePointer) -> Void)? + /// Emitted when the range value changes. + public var valueChanged: ((Range) -> Void)? + public var notifyAdjustment: ((Range, OpaquePointer) -> Void)? -public var notifyFillLevel: ((Range, OpaquePointer) -> Void)? + public var notifyFillLevel: ((Range, OpaquePointer) -> Void)? + public var notifyInverted: ((Range, OpaquePointer) -> Void)? -public var notifyInverted: ((Range, OpaquePointer) -> Void)? + public var notifyRestrictToFillLevel: ((Range, OpaquePointer) -> Void)? + public var notifyRoundDigits: ((Range, OpaquePointer) -> Void)? -public var notifyRestrictToFillLevel: ((Range, OpaquePointer) -> Void)? + public var notifyShowFillLevel: ((Range, OpaquePointer) -> Void)? - -public var notifyRoundDigits: ((Range, OpaquePointer) -> Void)? - - -public var notifyShowFillLevel: ((Range, OpaquePointer) -> Void)? - - -public var notifyOrientation: ((Range, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyOrientation: ((Range, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/RecentManagerError.swift b/Sources/Gtk/Generated/RecentManagerError.swift index 2770a426a1..f6dfdfa16f 100644 --- a/Sources/Gtk/Generated/RecentManagerError.swift +++ b/Sources/Gtk/Generated/RecentManagerError.swift @@ -5,45 +5,45 @@ public enum RecentManagerError: GValueRepresentableEnum { public typealias GtkEnum = GtkRecentManagerError /// The URI specified does not exists in -/// the recently used resources list. -case notFound -/// The URI specified is not valid. -case invalidUri -/// The supplied string is not -/// UTF-8 encoded. -case invalidEncoding -/// No application has registered -/// the specified item. -case notRegistered -/// Failure while reading the recently used -/// resources file. -case read -/// Failure while writing the recently used -/// resources file. -case write -/// Unspecified error. -case unknown + /// the recently used resources list. + case notFound + /// The URI specified is not valid. + case invalidUri + /// The supplied string is not + /// UTF-8 encoded. + case invalidEncoding + /// No application has registered + /// the specified item. + case notRegistered + /// Failure while reading the recently used + /// resources file. + case read + /// Failure while writing the recently used + /// resources file. + case write + /// Unspecified error. + case unknown public static var type: GType { - gtk_recent_manager_error_get_type() -} + gtk_recent_manager_error_get_type() + } public init(from gtkEnum: GtkRecentManagerError) { switch gtkEnum { case GTK_RECENT_MANAGER_ERROR_NOT_FOUND: - self = .notFound -case GTK_RECENT_MANAGER_ERROR_INVALID_URI: - self = .invalidUri -case GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING: - self = .invalidEncoding -case GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED: - self = .notRegistered -case GTK_RECENT_MANAGER_ERROR_READ: - self = .read -case GTK_RECENT_MANAGER_ERROR_WRITE: - self = .write -case GTK_RECENT_MANAGER_ERROR_UNKNOWN: - self = .unknown + self = .notFound + case GTK_RECENT_MANAGER_ERROR_INVALID_URI: + self = .invalidUri + case GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING: + self = .invalidEncoding + case GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED: + self = .notRegistered + case GTK_RECENT_MANAGER_ERROR_READ: + self = .read + case GTK_RECENT_MANAGER_ERROR_WRITE: + self = .write + case GTK_RECENT_MANAGER_ERROR_UNKNOWN: + self = .unknown default: fatalError("Unsupported GtkRecentManagerError enum value: \(gtkEnum.rawValue)") } @@ -52,19 +52,19 @@ case GTK_RECENT_MANAGER_ERROR_UNKNOWN: public func toGtk() -> GtkRecentManagerError { switch self { case .notFound: - return GTK_RECENT_MANAGER_ERROR_NOT_FOUND -case .invalidUri: - return GTK_RECENT_MANAGER_ERROR_INVALID_URI -case .invalidEncoding: - return GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING -case .notRegistered: - return GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED -case .read: - return GTK_RECENT_MANAGER_ERROR_READ -case .write: - return GTK_RECENT_MANAGER_ERROR_WRITE -case .unknown: - return GTK_RECENT_MANAGER_ERROR_UNKNOWN + return GTK_RECENT_MANAGER_ERROR_NOT_FOUND + case .invalidUri: + return GTK_RECENT_MANAGER_ERROR_INVALID_URI + case .invalidEncoding: + return GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING + case .notRegistered: + return GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED + case .read: + return GTK_RECENT_MANAGER_ERROR_READ + case .write: + return GTK_RECENT_MANAGER_ERROR_WRITE + case .unknown: + return GTK_RECENT_MANAGER_ERROR_UNKNOWN } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ResponseType.swift b/Sources/Gtk/Generated/ResponseType.swift index 3c68948d07..3fd9f7cffc 100644 --- a/Sources/Gtk/Generated/ResponseType.swift +++ b/Sources/Gtk/Generated/ResponseType.swift @@ -1,64 +1,64 @@ import CGtk /// Predefined values for use as response ids in gtk_dialog_add_button(). -/// +/// /// All predefined values are negative; GTK leaves values of 0 or greater for /// application-defined response ids. public enum ResponseType: GValueRepresentableEnum { public typealias GtkEnum = GtkResponseType /// Returned if an action widget has no response id, -/// or if the dialog gets programmatically hidden or destroyed -case none -/// Generic response id, not used by GTK dialogs -case reject -/// Generic response id, not used by GTK dialogs -case accept -/// Returned if the dialog is deleted -case deleteEvent -/// Returned by OK buttons in GTK dialogs -case ok -/// Returned by Cancel buttons in GTK dialogs -case cancel -/// Returned by Close buttons in GTK dialogs -case close -/// Returned by Yes buttons in GTK dialogs -case yes -/// Returned by No buttons in GTK dialogs -case no -/// Returned by Apply buttons in GTK dialogs -case apply -/// Returned by Help buttons in GTK dialogs -case help + /// or if the dialog gets programmatically hidden or destroyed + case none + /// Generic response id, not used by GTK dialogs + case reject + /// Generic response id, not used by GTK dialogs + case accept + /// Returned if the dialog is deleted + case deleteEvent + /// Returned by OK buttons in GTK dialogs + case ok + /// Returned by Cancel buttons in GTK dialogs + case cancel + /// Returned by Close buttons in GTK dialogs + case close + /// Returned by Yes buttons in GTK dialogs + case yes + /// Returned by No buttons in GTK dialogs + case no + /// Returned by Apply buttons in GTK dialogs + case apply + /// Returned by Help buttons in GTK dialogs + case help public static var type: GType { - gtk_response_type_get_type() -} + gtk_response_type_get_type() + } public init(from gtkEnum: GtkResponseType) { switch gtkEnum { case GTK_RESPONSE_NONE: - self = .none -case GTK_RESPONSE_REJECT: - self = .reject -case GTK_RESPONSE_ACCEPT: - self = .accept -case GTK_RESPONSE_DELETE_EVENT: - self = .deleteEvent -case GTK_RESPONSE_OK: - self = .ok -case GTK_RESPONSE_CANCEL: - self = .cancel -case GTK_RESPONSE_CLOSE: - self = .close -case GTK_RESPONSE_YES: - self = .yes -case GTK_RESPONSE_NO: - self = .no -case GTK_RESPONSE_APPLY: - self = .apply -case GTK_RESPONSE_HELP: - self = .help + self = .none + case GTK_RESPONSE_REJECT: + self = .reject + case GTK_RESPONSE_ACCEPT: + self = .accept + case GTK_RESPONSE_DELETE_EVENT: + self = .deleteEvent + case GTK_RESPONSE_OK: + self = .ok + case GTK_RESPONSE_CANCEL: + self = .cancel + case GTK_RESPONSE_CLOSE: + self = .close + case GTK_RESPONSE_YES: + self = .yes + case GTK_RESPONSE_NO: + self = .no + case GTK_RESPONSE_APPLY: + self = .apply + case GTK_RESPONSE_HELP: + self = .help default: fatalError("Unsupported GtkResponseType enum value: \(gtkEnum.rawValue)") } @@ -67,27 +67,27 @@ case GTK_RESPONSE_HELP: public func toGtk() -> GtkResponseType { switch self { case .none: - return GTK_RESPONSE_NONE -case .reject: - return GTK_RESPONSE_REJECT -case .accept: - return GTK_RESPONSE_ACCEPT -case .deleteEvent: - return GTK_RESPONSE_DELETE_EVENT -case .ok: - return GTK_RESPONSE_OK -case .cancel: - return GTK_RESPONSE_CANCEL -case .close: - return GTK_RESPONSE_CLOSE -case .yes: - return GTK_RESPONSE_YES -case .no: - return GTK_RESPONSE_NO -case .apply: - return GTK_RESPONSE_APPLY -case .help: - return GTK_RESPONSE_HELP + return GTK_RESPONSE_NONE + case .reject: + return GTK_RESPONSE_REJECT + case .accept: + return GTK_RESPONSE_ACCEPT + case .deleteEvent: + return GTK_RESPONSE_DELETE_EVENT + case .ok: + return GTK_RESPONSE_OK + case .cancel: + return GTK_RESPONSE_CANCEL + case .close: + return GTK_RESPONSE_CLOSE + case .yes: + return GTK_RESPONSE_YES + case .no: + return GTK_RESPONSE_NO + case .apply: + return GTK_RESPONSE_APPLY + case .help: + return GTK_RESPONSE_HELP } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/RevealerTransitionType.swift b/Sources/Gtk/Generated/RevealerTransitionType.swift index 3762a6d618..d7908fc3a2 100644 --- a/Sources/Gtk/Generated/RevealerTransitionType.swift +++ b/Sources/Gtk/Generated/RevealerTransitionType.swift @@ -6,52 +6,52 @@ public enum RevealerTransitionType: GValueRepresentableEnum { public typealias GtkEnum = GtkRevealerTransitionType /// No transition -case none -/// Fade in -case crossfade -/// Slide in from the left -case slideRight -/// Slide in from the right -case slideLeft -/// Slide in from the bottom -case slideUp -/// Slide in from the top -case slideDown -/// Floop in from the left -case swingRight -/// Floop in from the right -case swingLeft -/// Floop in from the bottom -case swingUp -/// Floop in from the top -case swingDown + case none + /// Fade in + case crossfade + /// Slide in from the left + case slideRight + /// Slide in from the right + case slideLeft + /// Slide in from the bottom + case slideUp + /// Slide in from the top + case slideDown + /// Floop in from the left + case swingRight + /// Floop in from the right + case swingLeft + /// Floop in from the bottom + case swingUp + /// Floop in from the top + case swingDown public static var type: GType { - gtk_revealer_transition_type_get_type() -} + gtk_revealer_transition_type_get_type() + } public init(from gtkEnum: GtkRevealerTransitionType) { switch gtkEnum { case GTK_REVEALER_TRANSITION_TYPE_NONE: - self = .none -case GTK_REVEALER_TRANSITION_TYPE_CROSSFADE: - self = .crossfade -case GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT: - self = .slideRight -case GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT: - self = .slideLeft -case GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP: - self = .slideUp -case GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN: - self = .slideDown -case GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT: - self = .swingRight -case GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT: - self = .swingLeft -case GTK_REVEALER_TRANSITION_TYPE_SWING_UP: - self = .swingUp -case GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN: - self = .swingDown + self = .none + case GTK_REVEALER_TRANSITION_TYPE_CROSSFADE: + self = .crossfade + case GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT: + self = .slideRight + case GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT: + self = .slideLeft + case GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP: + self = .slideUp + case GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN: + self = .slideDown + case GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT: + self = .swingRight + case GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT: + self = .swingLeft + case GTK_REVEALER_TRANSITION_TYPE_SWING_UP: + self = .swingUp + case GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN: + self = .swingDown default: fatalError("Unsupported GtkRevealerTransitionType enum value: \(gtkEnum.rawValue)") } @@ -60,25 +60,25 @@ case GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN: public func toGtk() -> GtkRevealerTransitionType { switch self { case .none: - return GTK_REVEALER_TRANSITION_TYPE_NONE -case .crossfade: - return GTK_REVEALER_TRANSITION_TYPE_CROSSFADE -case .slideRight: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT -case .slideLeft: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT -case .slideUp: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP -case .slideDown: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN -case .swingRight: - return GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT -case .swingLeft: - return GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT -case .swingUp: - return GTK_REVEALER_TRANSITION_TYPE_SWING_UP -case .swingDown: - return GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN + return GTK_REVEALER_TRANSITION_TYPE_NONE + case .crossfade: + return GTK_REVEALER_TRANSITION_TYPE_CROSSFADE + case .slideRight: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT + case .slideLeft: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT + case .slideUp: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP + case .slideDown: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN + case .swingRight: + return GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT + case .swingLeft: + return GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT + case .swingUp: + return GTK_REVEALER_TRANSITION_TYPE_SWING_UP + case .swingDown: + return GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Root.swift b/Sources/Gtk/Generated/Root.swift index b398cdbd3c..c2dd7d45e0 100644 --- a/Sources/Gtk/Generated/Root.swift +++ b/Sources/Gtk/Generated/Root.swift @@ -1,20 +1,18 @@ import CGtk /// An interface for widgets that can act as the root of a widget hierarchy. -/// +/// /// The root widget takes care of providing the connection to the windowing /// system and manages layout, drawing and event delivery for its widget /// hierarchy. -/// +/// /// The obvious example of a `GtkRoot` is `GtkWindow`. -/// +/// /// To get the display to which a `GtkRoot` belongs, use /// [method@Gtk.Root.get_display]. -/// +/// /// `GtkRoot` also maintains the location of keyboard focus inside its widget /// hierarchy, with [method@Gtk.Root.set_focus] and [method@Gtk.Root.get_focus]. public protocol Root: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Scale.swift b/Sources/Gtk/Generated/Scale.swift index c73941ef80..7d9d13b964 100644 --- a/Sources/Gtk/Generated/Scale.swift +++ b/Sources/Gtk/Generated/Scale.swift @@ -1,40 +1,40 @@ import CGtk /// Allows to select a numeric value with a slider control. -/// +/// /// An example GtkScale -/// +/// /// To use it, you’ll probably want to investigate the methods on its base /// class, [class@Gtk.Range], in addition to the methods for `GtkScale` itself. /// To set the value of a scale, you would normally use [method@Gtk.Range.set_value]. /// To detect changes to the value, you would normally use the /// [signal@Gtk.Range::value-changed] signal. -/// +/// /// Note that using the same upper and lower bounds for the `GtkScale` (through /// the `GtkRange` methods) will hide the slider itself. This is useful for /// applications that want to show an undeterminate value on the scale, without /// changing the layout of the application (such as movie or music players). -/// +/// /// # GtkScale as GtkBuildable -/// +/// /// `GtkScale` supports a custom `` element, which can contain multiple /// `` elements. The “value” and “position” attributes have the same /// meaning as [method@Gtk.Scale.add_mark] parameters of the same name. If /// the element is not empty, its content is taken as the markup to show at /// the mark. It can be translated with the usual ”translatable” and /// “context” attributes. -/// +/// /// # Shortcuts and Gestures -/// +/// /// `GtkPopoverMenu` supports the following keyboard shortcuts: -/// +/// /// - Arrow keys, + and - will increment or decrement /// by step, or by page when combined with Ctrl. /// - PgUp and PgDn will increment or decrement by page. /// - Home and End will set the minimum or maximum value. -/// +/// /// # CSS nodes -/// +/// /// ``` /// scale[.fine-tune][.marks-before][.marks-after] /// ├── [value][.top][.right][.bottom][.left] @@ -55,130 +55,138 @@ import CGtk /// ├── [highlight] /// ╰── slider /// ``` -/// +/// /// `GtkScale` has a main CSS node with name scale and a subnode for its contents, /// with subnodes named trough and slider. -/// +/// /// The main node gets the style class .fine-tune added when the scale is in /// 'fine-tuning' mode. -/// +/// /// If the scale has an origin (see [method@Gtk.Scale.set_has_origin]), there is /// a subnode with name highlight below the trough node that is used for rendering /// the highlighted part of the trough. -/// +/// /// If the scale is showing a fill level (see [method@Gtk.Range.set_show_fill_level]), /// there is a subnode with name fill below the trough node that is used for /// rendering the filled in part of the trough. -/// +/// /// If marks are present, there is a marks subnode before or after the trough /// node, below which each mark gets a node with name mark. The marks nodes get /// either the .top or .bottom style class. -/// +/// /// The mark node has a subnode named indicator. If the mark has text, it also /// has a subnode named label. When the mark is either above or left of the /// scale, the label subnode is the first when present. Otherwise, the indicator /// subnode is the first. -/// +/// /// The main CSS node gets the 'marks-before' and/or 'marks-after' style classes /// added depending on what marks are present. -/// +/// /// If the scale is displaying the value (see [property@Gtk.Scale:draw-value]), /// there is subnode with name value. This node will get the .top or .bottom style /// classes similar to the marks node. -/// +/// /// # Accessibility -/// +/// /// `GtkScale` uses the [enum@Gtk.AccessibleRole.slider] role. open class Scale: Range { /// Creates a new `GtkScale`. -public convenience init(orientation: GtkOrientation, adjustment: UnsafeMutablePointer!) { - self.init( - gtk_scale_new(orientation, adjustment) - ) -} - -/// Creates a new scale widget with a range from @min to @max. -/// -/// The returns scale will have the given orientation and will let the -/// user input a number between @min and @max (including @min and @max) -/// with the increment @step. @step must be nonzero; it’s the distance -/// the slider moves when using the arrow keys to adjust the scale -/// value. -/// -/// Note that the way in which the precision is derived works best if -/// @step is a power of ten. If the resulting precision is not suitable -/// for your needs, use [method@Gtk.Scale.set_digits] to correct it. -public convenience init(range orientation: GtkOrientation, min: Double, max: Double, step: Double) { - self.init( - gtk_scale_new_with_range(orientation, min, max, step) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init( + orientation: GtkOrientation, adjustment: UnsafeMutablePointer! + ) { + self.init( + gtk_scale_new(orientation, adjustment) + ) } -addSignal(name: "notify::digits", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDigits?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new scale widget with a range from @min to @max. + /// + /// The returns scale will have the given orientation and will let the + /// user input a number between @min and @max (including @min and @max) + /// with the increment @step. @step must be nonzero; it’s the distance + /// the slider moves when using the arrow keys to adjust the scale + /// value. + /// + /// Note that the way in which the precision is derived works best if + /// @step is a power of ten. If the resulting precision is not suitable + /// for your needs, use [method@Gtk.Scale.set_digits] to correct it. + public convenience init( + range orientation: GtkOrientation, min: Double, max: Double, step: Double + ) { + self.init( + gtk_scale_new_with_range(orientation, min, max, step) + ) } -addSignal(name: "notify::draw-value", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDrawValue?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::digits", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDigits?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::draw-value", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDrawValue?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::has-origin", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasOrigin?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::value-pos", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyValuePos?(self, param0) + } } -addSignal(name: "notify::has-origin", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasOrigin?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::value-pos", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyValuePos?(self, param0) -} -} - /// The number of decimal places that are displayed in the value. -@GObjectProperty(named: "digits") public var digits: Int + @GObjectProperty(named: "digits") public var digits: Int -/// Whether the current value is displayed as a string next to the slider. -@GObjectProperty(named: "draw-value") public var drawValue: Bool + /// Whether the current value is displayed as a string next to the slider. + @GObjectProperty(named: "draw-value") public var drawValue: Bool -/// Whether the scale has an origin. -@GObjectProperty(named: "has-origin") public var hasOrigin: Bool + /// Whether the scale has an origin. + @GObjectProperty(named: "has-origin") public var hasOrigin: Bool -/// The position in which the current value is displayed. -@GObjectProperty(named: "value-pos") public var valuePos: PositionType + /// The position in which the current value is displayed. + @GObjectProperty(named: "value-pos") public var valuePos: PositionType + public var notifyDigits: ((Scale, OpaquePointer) -> Void)? -public var notifyDigits: ((Scale, OpaquePointer) -> Void)? + public var notifyDrawValue: ((Scale, OpaquePointer) -> Void)? + public var notifyHasOrigin: ((Scale, OpaquePointer) -> Void)? -public var notifyDrawValue: ((Scale, OpaquePointer) -> Void)? - - -public var notifyHasOrigin: ((Scale, OpaquePointer) -> Void)? - - -public var notifyValuePos: ((Scale, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyValuePos: ((Scale, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/ScrollStep.swift b/Sources/Gtk/Generated/ScrollStep.swift index 4b408bad16..0432f12244 100644 --- a/Sources/Gtk/Generated/ScrollStep.swift +++ b/Sources/Gtk/Generated/ScrollStep.swift @@ -5,36 +5,36 @@ public enum ScrollStep: GValueRepresentableEnum { public typealias GtkEnum = GtkScrollStep /// Scroll in steps. -case steps -/// Scroll by pages. -case pages -/// Scroll to ends. -case ends -/// Scroll in horizontal steps. -case horizontalSteps -/// Scroll by horizontal pages. -case horizontalPages -/// Scroll to the horizontal ends. -case horizontalEnds + case steps + /// Scroll by pages. + case pages + /// Scroll to ends. + case ends + /// Scroll in horizontal steps. + case horizontalSteps + /// Scroll by horizontal pages. + case horizontalPages + /// Scroll to the horizontal ends. + case horizontalEnds public static var type: GType { - gtk_scroll_step_get_type() -} + gtk_scroll_step_get_type() + } public init(from gtkEnum: GtkScrollStep) { switch gtkEnum { case GTK_SCROLL_STEPS: - self = .steps -case GTK_SCROLL_PAGES: - self = .pages -case GTK_SCROLL_ENDS: - self = .ends -case GTK_SCROLL_HORIZONTAL_STEPS: - self = .horizontalSteps -case GTK_SCROLL_HORIZONTAL_PAGES: - self = .horizontalPages -case GTK_SCROLL_HORIZONTAL_ENDS: - self = .horizontalEnds + self = .steps + case GTK_SCROLL_PAGES: + self = .pages + case GTK_SCROLL_ENDS: + self = .ends + case GTK_SCROLL_HORIZONTAL_STEPS: + self = .horizontalSteps + case GTK_SCROLL_HORIZONTAL_PAGES: + self = .horizontalPages + case GTK_SCROLL_HORIZONTAL_ENDS: + self = .horizontalEnds default: fatalError("Unsupported GtkScrollStep enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ case GTK_SCROLL_HORIZONTAL_ENDS: public func toGtk() -> GtkScrollStep { switch self { case .steps: - return GTK_SCROLL_STEPS -case .pages: - return GTK_SCROLL_PAGES -case .ends: - return GTK_SCROLL_ENDS -case .horizontalSteps: - return GTK_SCROLL_HORIZONTAL_STEPS -case .horizontalPages: - return GTK_SCROLL_HORIZONTAL_PAGES -case .horizontalEnds: - return GTK_SCROLL_HORIZONTAL_ENDS + return GTK_SCROLL_STEPS + case .pages: + return GTK_SCROLL_PAGES + case .ends: + return GTK_SCROLL_ENDS + case .horizontalSteps: + return GTK_SCROLL_HORIZONTAL_STEPS + case .horizontalPages: + return GTK_SCROLL_HORIZONTAL_PAGES + case .horizontalEnds: + return GTK_SCROLL_HORIZONTAL_ENDS } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ScrollType.swift b/Sources/Gtk/Generated/ScrollType.swift index d952af8897..88054fa724 100644 --- a/Sources/Gtk/Generated/ScrollType.swift +++ b/Sources/Gtk/Generated/ScrollType.swift @@ -5,76 +5,76 @@ public enum ScrollType: GValueRepresentableEnum { public typealias GtkEnum = GtkScrollType /// No scrolling. -case none -/// Jump to new location. -case jump -/// Step backward. -case stepBackward -/// Step forward. -case stepForward -/// Page backward. -case pageBackward -/// Page forward. -case pageForward -/// Step up. -case stepUp -/// Step down. -case stepDown -/// Page up. -case pageUp -/// Page down. -case pageDown -/// Step to the left. -case stepLeft -/// Step to the right. -case stepRight -/// Page to the left. -case pageLeft -/// Page to the right. -case pageRight -/// Scroll to start. -case start -/// Scroll to end. -case end + case none + /// Jump to new location. + case jump + /// Step backward. + case stepBackward + /// Step forward. + case stepForward + /// Page backward. + case pageBackward + /// Page forward. + case pageForward + /// Step up. + case stepUp + /// Step down. + case stepDown + /// Page up. + case pageUp + /// Page down. + case pageDown + /// Step to the left. + case stepLeft + /// Step to the right. + case stepRight + /// Page to the left. + case pageLeft + /// Page to the right. + case pageRight + /// Scroll to start. + case start + /// Scroll to end. + case end public static var type: GType { - gtk_scroll_type_get_type() -} + gtk_scroll_type_get_type() + } public init(from gtkEnum: GtkScrollType) { switch gtkEnum { case GTK_SCROLL_NONE: - self = .none -case GTK_SCROLL_JUMP: - self = .jump -case GTK_SCROLL_STEP_BACKWARD: - self = .stepBackward -case GTK_SCROLL_STEP_FORWARD: - self = .stepForward -case GTK_SCROLL_PAGE_BACKWARD: - self = .pageBackward -case GTK_SCROLL_PAGE_FORWARD: - self = .pageForward -case GTK_SCROLL_STEP_UP: - self = .stepUp -case GTK_SCROLL_STEP_DOWN: - self = .stepDown -case GTK_SCROLL_PAGE_UP: - self = .pageUp -case GTK_SCROLL_PAGE_DOWN: - self = .pageDown -case GTK_SCROLL_STEP_LEFT: - self = .stepLeft -case GTK_SCROLL_STEP_RIGHT: - self = .stepRight -case GTK_SCROLL_PAGE_LEFT: - self = .pageLeft -case GTK_SCROLL_PAGE_RIGHT: - self = .pageRight -case GTK_SCROLL_START: - self = .start -case GTK_SCROLL_END: - self = .end + self = .none + case GTK_SCROLL_JUMP: + self = .jump + case GTK_SCROLL_STEP_BACKWARD: + self = .stepBackward + case GTK_SCROLL_STEP_FORWARD: + self = .stepForward + case GTK_SCROLL_PAGE_BACKWARD: + self = .pageBackward + case GTK_SCROLL_PAGE_FORWARD: + self = .pageForward + case GTK_SCROLL_STEP_UP: + self = .stepUp + case GTK_SCROLL_STEP_DOWN: + self = .stepDown + case GTK_SCROLL_PAGE_UP: + self = .pageUp + case GTK_SCROLL_PAGE_DOWN: + self = .pageDown + case GTK_SCROLL_STEP_LEFT: + self = .stepLeft + case GTK_SCROLL_STEP_RIGHT: + self = .stepRight + case GTK_SCROLL_PAGE_LEFT: + self = .pageLeft + case GTK_SCROLL_PAGE_RIGHT: + self = .pageRight + case GTK_SCROLL_START: + self = .start + case GTK_SCROLL_END: + self = .end default: fatalError("Unsupported GtkScrollType enum value: \(gtkEnum.rawValue)") } @@ -83,37 +83,37 @@ case GTK_SCROLL_END: public func toGtk() -> GtkScrollType { switch self { case .none: - return GTK_SCROLL_NONE -case .jump: - return GTK_SCROLL_JUMP -case .stepBackward: - return GTK_SCROLL_STEP_BACKWARD -case .stepForward: - return GTK_SCROLL_STEP_FORWARD -case .pageBackward: - return GTK_SCROLL_PAGE_BACKWARD -case .pageForward: - return GTK_SCROLL_PAGE_FORWARD -case .stepUp: - return GTK_SCROLL_STEP_UP -case .stepDown: - return GTK_SCROLL_STEP_DOWN -case .pageUp: - return GTK_SCROLL_PAGE_UP -case .pageDown: - return GTK_SCROLL_PAGE_DOWN -case .stepLeft: - return GTK_SCROLL_STEP_LEFT -case .stepRight: - return GTK_SCROLL_STEP_RIGHT -case .pageLeft: - return GTK_SCROLL_PAGE_LEFT -case .pageRight: - return GTK_SCROLL_PAGE_RIGHT -case .start: - return GTK_SCROLL_START -case .end: - return GTK_SCROLL_END + return GTK_SCROLL_NONE + case .jump: + return GTK_SCROLL_JUMP + case .stepBackward: + return GTK_SCROLL_STEP_BACKWARD + case .stepForward: + return GTK_SCROLL_STEP_FORWARD + case .pageBackward: + return GTK_SCROLL_PAGE_BACKWARD + case .pageForward: + return GTK_SCROLL_PAGE_FORWARD + case .stepUp: + return GTK_SCROLL_STEP_UP + case .stepDown: + return GTK_SCROLL_STEP_DOWN + case .pageUp: + return GTK_SCROLL_PAGE_UP + case .pageDown: + return GTK_SCROLL_PAGE_DOWN + case .stepLeft: + return GTK_SCROLL_STEP_LEFT + case .stepRight: + return GTK_SCROLL_STEP_RIGHT + case .pageLeft: + return GTK_SCROLL_PAGE_LEFT + case .pageRight: + return GTK_SCROLL_PAGE_RIGHT + case .start: + return GTK_SCROLL_START + case .end: + return GTK_SCROLL_END } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Scrollable.swift b/Sources/Gtk/Generated/Scrollable.swift index 9e9cf83579..10f42ccffd 100644 --- a/Sources/Gtk/Generated/Scrollable.swift +++ b/Sources/Gtk/Generated/Scrollable.swift @@ -1,39 +1,38 @@ import CGtk /// An interface for widgets with native scrolling ability. -/// +/// /// To implement this interface you should override the /// [property@Gtk.Scrollable:hadjustment] and /// [property@Gtk.Scrollable:vadjustment] properties. -/// +/// /// ## Creating a scrollable widget -/// +/// /// All scrollable widgets should do the following. -/// +/// /// - When a parent widget sets the scrollable child widget’s adjustments, /// the widget should connect to the [signal@Gtk.Adjustment::value-changed] /// signal. The child widget should then populate the adjustments’ properties /// as soon as possible, which usually means queueing an allocation right away /// and populating the properties in the [vfunc@Gtk.Widget.size_allocate] /// implementation. -/// +/// /// - Because its preferred size is the size for a fully expanded widget, /// the scrollable widget must be able to cope with underallocations. /// This means that it must accept any value passed to its /// [vfunc@Gtk.Widget.size_allocate] implementation. -/// +/// /// - When the parent allocates space to the scrollable child widget, /// the widget must ensure the adjustments’ property values are correct and up /// to date, for example using [method@Gtk.Adjustment.configure]. -/// +/// /// - When any of the adjustments emits the [signal@Gtk.Adjustment::value-changed] /// signal, the scrollable widget should scroll its contents. public protocol Scrollable: GObjectRepresentable { /// Determines when horizontal scrolling should start. -var hscrollPolicy: ScrollablePolicy { get set } + var hscrollPolicy: ScrollablePolicy { get set } -/// Determines when vertical scrolling should start. -var vscrollPolicy: ScrollablePolicy { get set } + /// Determines when vertical scrolling should start. + var vscrollPolicy: ScrollablePolicy { get set } - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ScrollablePolicy.swift b/Sources/Gtk/Generated/ScrollablePolicy.swift index 5b2f2cd335..1e47fa44d0 100644 --- a/Sources/Gtk/Generated/ScrollablePolicy.swift +++ b/Sources/Gtk/Generated/ScrollablePolicy.swift @@ -6,20 +6,20 @@ public enum ScrollablePolicy: GValueRepresentableEnum { public typealias GtkEnum = GtkScrollablePolicy /// Scrollable adjustments are based on the minimum size -case minimum -/// Scrollable adjustments are based on the natural size -case natural + case minimum + /// Scrollable adjustments are based on the natural size + case natural public static var type: GType { - gtk_scrollable_policy_get_type() -} + gtk_scrollable_policy_get_type() + } public init(from gtkEnum: GtkScrollablePolicy) { switch gtkEnum { case GTK_SCROLL_MINIMUM: - self = .minimum -case GTK_SCROLL_NATURAL: - self = .natural + self = .minimum + case GTK_SCROLL_NATURAL: + self = .natural default: fatalError("Unsupported GtkScrollablePolicy enum value: \(gtkEnum.rawValue)") } @@ -28,9 +28,9 @@ case GTK_SCROLL_NATURAL: public func toGtk() -> GtkScrollablePolicy { switch self { case .minimum: - return GTK_SCROLL_MINIMUM -case .natural: - return GTK_SCROLL_NATURAL + return GTK_SCROLL_MINIMUM + case .natural: + return GTK_SCROLL_NATURAL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/SelectionMode.swift b/Sources/Gtk/Generated/SelectionMode.swift index 594b4d82d9..c97d0a94b3 100644 --- a/Sources/Gtk/Generated/SelectionMode.swift +++ b/Sources/Gtk/Generated/SelectionMode.swift @@ -5,36 +5,36 @@ public enum SelectionMode: GValueRepresentableEnum { public typealias GtkEnum = GtkSelectionMode /// No selection is possible. -case none -/// Zero or one element may be selected. -case single -/// Exactly one element is selected. -/// In some circumstances, such as initially or during a search -/// operation, it’s possible for no element to be selected with -/// %GTK_SELECTION_BROWSE. What is really enforced is that the user -/// can’t deselect a currently selected element except by selecting -/// another element. -case browse -/// Any number of elements may be selected. -/// The Ctrl key may be used to enlarge the selection, and Shift -/// key to select between the focus and the child pointed to. -/// Some widgets may also allow Click-drag to select a range of elements. -case multiple + case none + /// Zero or one element may be selected. + case single + /// Exactly one element is selected. + /// In some circumstances, such as initially or during a search + /// operation, it’s possible for no element to be selected with + /// %GTK_SELECTION_BROWSE. What is really enforced is that the user + /// can’t deselect a currently selected element except by selecting + /// another element. + case browse + /// Any number of elements may be selected. + /// The Ctrl key may be used to enlarge the selection, and Shift + /// key to select between the focus and the child pointed to. + /// Some widgets may also allow Click-drag to select a range of elements. + case multiple public static var type: GType { - gtk_selection_mode_get_type() -} + gtk_selection_mode_get_type() + } public init(from gtkEnum: GtkSelectionMode) { switch gtkEnum { case GTK_SELECTION_NONE: - self = .none -case GTK_SELECTION_SINGLE: - self = .single -case GTK_SELECTION_BROWSE: - self = .browse -case GTK_SELECTION_MULTIPLE: - self = .multiple + self = .none + case GTK_SELECTION_SINGLE: + self = .single + case GTK_SELECTION_BROWSE: + self = .browse + case GTK_SELECTION_MULTIPLE: + self = .multiple default: fatalError("Unsupported GtkSelectionMode enum value: \(gtkEnum.rawValue)") } @@ -43,13 +43,13 @@ case GTK_SELECTION_MULTIPLE: public func toGtk() -> GtkSelectionMode { switch self { case .none: - return GTK_SELECTION_NONE -case .single: - return GTK_SELECTION_SINGLE -case .browse: - return GTK_SELECTION_BROWSE -case .multiple: - return GTK_SELECTION_MULTIPLE + return GTK_SELECTION_NONE + case .single: + return GTK_SELECTION_SINGLE + case .browse: + return GTK_SELECTION_BROWSE + case .multiple: + return GTK_SELECTION_MULTIPLE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/SelectionModel.swift b/Sources/Gtk/Generated/SelectionModel.swift index fd59aa71c9..4b401bb239 100644 --- a/Sources/Gtk/Generated/SelectionModel.swift +++ b/Sources/Gtk/Generated/SelectionModel.swift @@ -1,14 +1,14 @@ import CGtk /// An interface that adds support for selection to list models. -/// +/// /// This support is then used by widgets using list models to add the ability /// to select and unselect various items. -/// +/// /// GTK provides default implementations of the most common selection modes such /// as [class@Gtk.SingleSelection], so you will only need to implement this /// interface if you want detailed control about how selections should be handled. -/// +/// /// A `GtkSelectionModel` supports a single boolean per item indicating if an item is /// selected or not. This can be queried via [method@Gtk.SelectionModel.is_selected]. /// When the selected state of one or more items changes, the model will emit the @@ -18,33 +18,32 @@ import CGtk /// requirement. If new items added to the model via the /// [signal@Gio.ListModel::items-changed] signal are selected or not is up to the /// implementation. -/// +/// /// Note that items added via [signal@Gio.ListModel::items-changed] may already /// be selected and no [signal@Gtk.SelectionModel::selection-changed] will be /// emitted for them. So to track which items are selected, it is necessary to /// listen to both signals. -/// +/// /// Additionally, the interface can expose functionality to select and unselect /// items. If these functions are implemented, GTK's list widgets will allow users /// to select and unselect items. However, `GtkSelectionModel`s are free to only /// implement them partially or not at all. In that case the widgets will not /// support the unimplemented operations. -/// +/// /// When selecting or unselecting is supported by a model, the return values of /// the selection functions do *not* indicate if selection or unselection happened. /// They are only meant to indicate complete failure, like when this mode of /// selecting is not supported by the model. -/// +/// /// Selections may happen asynchronously, so the only reliable way to find out /// when an item was selected is to listen to the signals that indicate selection. public protocol SelectionModel: GObjectRepresentable { - /// Emitted when the selection state of some of the items in @model changes. -/// -/// Note that this signal does not specify the new selection state of the -/// items, they need to be queried manually. It is also not necessary for -/// a model to change the selection state of any of the items in the selection -/// model, though it would be rather useless to emit such a signal. -var selectionChanged: ((Self, UInt, UInt) -> Void)? { get set } -} \ No newline at end of file + /// + /// Note that this signal does not specify the new selection state of the + /// items, they need to be queried manually. It is also not necessary for + /// a model to change the selection state of any of the items in the selection + /// model, though it would be rather useless to emit such a signal. + var selectionChanged: ((Self, UInt, UInt) -> Void)? { get set } +} diff --git a/Sources/Gtk/Generated/SensitivityType.swift b/Sources/Gtk/Generated/SensitivityType.swift index edff95c786..df5c24ecb6 100644 --- a/Sources/Gtk/Generated/SensitivityType.swift +++ b/Sources/Gtk/Generated/SensitivityType.swift @@ -6,25 +6,25 @@ public enum SensitivityType: GValueRepresentableEnum { public typealias GtkEnum = GtkSensitivityType /// The control is made insensitive if no -/// action can be triggered -case auto -/// The control is always sensitive -case on -/// The control is always insensitive -case off + /// action can be triggered + case auto + /// The control is always sensitive + case on + /// The control is always insensitive + case off public static var type: GType { - gtk_sensitivity_type_get_type() -} + gtk_sensitivity_type_get_type() + } public init(from gtkEnum: GtkSensitivityType) { switch gtkEnum { case GTK_SENSITIVITY_AUTO: - self = .auto -case GTK_SENSITIVITY_ON: - self = .on -case GTK_SENSITIVITY_OFF: - self = .off + self = .auto + case GTK_SENSITIVITY_ON: + self = .on + case GTK_SENSITIVITY_OFF: + self = .off default: fatalError("Unsupported GtkSensitivityType enum value: \(gtkEnum.rawValue)") } @@ -33,11 +33,11 @@ case GTK_SENSITIVITY_OFF: public func toGtk() -> GtkSensitivityType { switch self { case .auto: - return GTK_SENSITIVITY_AUTO -case .on: - return GTK_SENSITIVITY_ON -case .off: - return GTK_SENSITIVITY_OFF + return GTK_SENSITIVITY_AUTO + case .on: + return GTK_SENSITIVITY_ON + case .off: + return GTK_SENSITIVITY_OFF } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ShortcutManager.swift b/Sources/Gtk/Generated/ShortcutManager.swift index 9faa713766..793602901d 100644 --- a/Sources/Gtk/Generated/ShortcutManager.swift +++ b/Sources/Gtk/Generated/ShortcutManager.swift @@ -1,18 +1,16 @@ import CGtk /// An interface that is used to implement shortcut scopes. -/// +/// /// This is important for [iface@Gtk.Native] widgets that have their /// own surface, since the event controllers that are used to implement /// managed and global scopes are limited to the same native. -/// +/// /// Examples for widgets implementing `GtkShortcutManager` are /// [class@Gtk.Window] and [class@Gtk.Popover]. -/// +/// /// Every widget that implements `GtkShortcutManager` will be used as a /// `GTK_SHORTCUT_SCOPE_MANAGED`. public protocol ShortcutManager: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ShortcutScope.swift b/Sources/Gtk/Generated/ShortcutScope.swift index 5f52020322..52c905c929 100644 --- a/Sources/Gtk/Generated/ShortcutScope.swift +++ b/Sources/Gtk/Generated/ShortcutScope.swift @@ -6,27 +6,27 @@ public enum ShortcutScope: GValueRepresentableEnum { public typealias GtkEnum = GtkShortcutScope /// Shortcuts are handled inside -/// the widget the controller belongs to. -case local -/// Shortcuts are handled by -/// the first ancestor that is a [iface@ShortcutManager] -case managed -/// Shortcuts are handled by -/// the root widget. -case global + /// the widget the controller belongs to. + case local + /// Shortcuts are handled by + /// the first ancestor that is a [iface@ShortcutManager] + case managed + /// Shortcuts are handled by + /// the root widget. + case global public static var type: GType { - gtk_shortcut_scope_get_type() -} + gtk_shortcut_scope_get_type() + } public init(from gtkEnum: GtkShortcutScope) { switch gtkEnum { case GTK_SHORTCUT_SCOPE_LOCAL: - self = .local -case GTK_SHORTCUT_SCOPE_MANAGED: - self = .managed -case GTK_SHORTCUT_SCOPE_GLOBAL: - self = .global + self = .local + case GTK_SHORTCUT_SCOPE_MANAGED: + self = .managed + case GTK_SHORTCUT_SCOPE_GLOBAL: + self = .global default: fatalError("Unsupported GtkShortcutScope enum value: \(gtkEnum.rawValue)") } @@ -35,11 +35,11 @@ case GTK_SHORTCUT_SCOPE_GLOBAL: public func toGtk() -> GtkShortcutScope { switch self { case .local: - return GTK_SHORTCUT_SCOPE_LOCAL -case .managed: - return GTK_SHORTCUT_SCOPE_MANAGED -case .global: - return GTK_SHORTCUT_SCOPE_GLOBAL + return GTK_SHORTCUT_SCOPE_LOCAL + case .managed: + return GTK_SHORTCUT_SCOPE_MANAGED + case .global: + return GTK_SHORTCUT_SCOPE_GLOBAL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/ShortcutType.swift b/Sources/Gtk/Generated/ShortcutType.swift index a3d57b53c7..8461c30a95 100644 --- a/Sources/Gtk/Generated/ShortcutType.swift +++ b/Sources/Gtk/Generated/ShortcutType.swift @@ -1,60 +1,60 @@ import CGtk /// GtkShortcutType specifies the kind of shortcut that is being described. -/// +/// /// More values may be added to this enumeration over time. public enum ShortcutType: GValueRepresentableEnum { public typealias GtkEnum = GtkShortcutType /// The shortcut is a keyboard accelerator. The GtkShortcutsShortcut:accelerator -/// property will be used. -case accelerator -/// The shortcut is a pinch gesture. GTK provides an icon and subtitle. -case gesturePinch -/// The shortcut is a stretch gesture. GTK provides an icon and subtitle. -case gestureStretch -/// The shortcut is a clockwise rotation gesture. GTK provides an icon and subtitle. -case gestureRotateClockwise -/// The shortcut is a counterclockwise rotation gesture. GTK provides an icon and subtitle. -case gestureRotateCounterclockwise -/// The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle. -case gestureTwoFingerSwipeLeft -/// The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle. -case gestureTwoFingerSwipeRight -/// The shortcut is a gesture. The GtkShortcutsShortcut:icon property will be -/// used. -case gesture -/// The shortcut is a swipe gesture. GTK provides an icon and subtitle. -case gestureSwipeLeft -/// The shortcut is a swipe gesture. GTK provides an icon and subtitle. -case gestureSwipeRight + /// property will be used. + case accelerator + /// The shortcut is a pinch gesture. GTK provides an icon and subtitle. + case gesturePinch + /// The shortcut is a stretch gesture. GTK provides an icon and subtitle. + case gestureStretch + /// The shortcut is a clockwise rotation gesture. GTK provides an icon and subtitle. + case gestureRotateClockwise + /// The shortcut is a counterclockwise rotation gesture. GTK provides an icon and subtitle. + case gestureRotateCounterclockwise + /// The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle. + case gestureTwoFingerSwipeLeft + /// The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle. + case gestureTwoFingerSwipeRight + /// The shortcut is a gesture. The GtkShortcutsShortcut:icon property will be + /// used. + case gesture + /// The shortcut is a swipe gesture. GTK provides an icon and subtitle. + case gestureSwipeLeft + /// The shortcut is a swipe gesture. GTK provides an icon and subtitle. + case gestureSwipeRight public static var type: GType { - gtk_shortcut_type_get_type() -} + gtk_shortcut_type_get_type() + } public init(from gtkEnum: GtkShortcutType) { switch gtkEnum { case GTK_SHORTCUT_ACCELERATOR: - self = .accelerator -case GTK_SHORTCUT_GESTURE_PINCH: - self = .gesturePinch -case GTK_SHORTCUT_GESTURE_STRETCH: - self = .gestureStretch -case GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE: - self = .gestureRotateClockwise -case GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE: - self = .gestureRotateCounterclockwise -case GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT: - self = .gestureTwoFingerSwipeLeft -case GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT: - self = .gestureTwoFingerSwipeRight -case GTK_SHORTCUT_GESTURE: - self = .gesture -case GTK_SHORTCUT_GESTURE_SWIPE_LEFT: - self = .gestureSwipeLeft -case GTK_SHORTCUT_GESTURE_SWIPE_RIGHT: - self = .gestureSwipeRight + self = .accelerator + case GTK_SHORTCUT_GESTURE_PINCH: + self = .gesturePinch + case GTK_SHORTCUT_GESTURE_STRETCH: + self = .gestureStretch + case GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE: + self = .gestureRotateClockwise + case GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE: + self = .gestureRotateCounterclockwise + case GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT: + self = .gestureTwoFingerSwipeLeft + case GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT: + self = .gestureTwoFingerSwipeRight + case GTK_SHORTCUT_GESTURE: + self = .gesture + case GTK_SHORTCUT_GESTURE_SWIPE_LEFT: + self = .gestureSwipeLeft + case GTK_SHORTCUT_GESTURE_SWIPE_RIGHT: + self = .gestureSwipeRight default: fatalError("Unsupported GtkShortcutType enum value: \(gtkEnum.rawValue)") } @@ -63,25 +63,25 @@ case GTK_SHORTCUT_GESTURE_SWIPE_RIGHT: public func toGtk() -> GtkShortcutType { switch self { case .accelerator: - return GTK_SHORTCUT_ACCELERATOR -case .gesturePinch: - return GTK_SHORTCUT_GESTURE_PINCH -case .gestureStretch: - return GTK_SHORTCUT_GESTURE_STRETCH -case .gestureRotateClockwise: - return GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE -case .gestureRotateCounterclockwise: - return GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE -case .gestureTwoFingerSwipeLeft: - return GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT -case .gestureTwoFingerSwipeRight: - return GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT -case .gesture: - return GTK_SHORTCUT_GESTURE -case .gestureSwipeLeft: - return GTK_SHORTCUT_GESTURE_SWIPE_LEFT -case .gestureSwipeRight: - return GTK_SHORTCUT_GESTURE_SWIPE_RIGHT + return GTK_SHORTCUT_ACCELERATOR + case .gesturePinch: + return GTK_SHORTCUT_GESTURE_PINCH + case .gestureStretch: + return GTK_SHORTCUT_GESTURE_STRETCH + case .gestureRotateClockwise: + return GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE + case .gestureRotateCounterclockwise: + return GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE + case .gestureTwoFingerSwipeLeft: + return GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT + case .gestureTwoFingerSwipeRight: + return GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT + case .gesture: + return GTK_SHORTCUT_GESTURE + case .gestureSwipeLeft: + return GTK_SHORTCUT_GESTURE_SWIPE_LEFT + case .gestureSwipeRight: + return GTK_SHORTCUT_GESTURE_SWIPE_RIGHT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/SizeGroupMode.swift b/Sources/Gtk/Generated/SizeGroupMode.swift index bd98e748f7..5a4a684fbd 100644 --- a/Sources/Gtk/Generated/SizeGroupMode.swift +++ b/Sources/Gtk/Generated/SizeGroupMode.swift @@ -6,28 +6,28 @@ public enum SizeGroupMode: GValueRepresentableEnum { public typealias GtkEnum = GtkSizeGroupMode /// Group has no effect -case none -/// Group affects horizontal requisition -case horizontal -/// Group affects vertical requisition -case vertical -/// Group affects both horizontal and vertical requisition -case both + case none + /// Group affects horizontal requisition + case horizontal + /// Group affects vertical requisition + case vertical + /// Group affects both horizontal and vertical requisition + case both public static var type: GType { - gtk_size_group_mode_get_type() -} + gtk_size_group_mode_get_type() + } public init(from gtkEnum: GtkSizeGroupMode) { switch gtkEnum { case GTK_SIZE_GROUP_NONE: - self = .none -case GTK_SIZE_GROUP_HORIZONTAL: - self = .horizontal -case GTK_SIZE_GROUP_VERTICAL: - self = .vertical -case GTK_SIZE_GROUP_BOTH: - self = .both + self = .none + case GTK_SIZE_GROUP_HORIZONTAL: + self = .horizontal + case GTK_SIZE_GROUP_VERTICAL: + self = .vertical + case GTK_SIZE_GROUP_BOTH: + self = .both default: fatalError("Unsupported GtkSizeGroupMode enum value: \(gtkEnum.rawValue)") } @@ -36,13 +36,13 @@ case GTK_SIZE_GROUP_BOTH: public func toGtk() -> GtkSizeGroupMode { switch self { case .none: - return GTK_SIZE_GROUP_NONE -case .horizontal: - return GTK_SIZE_GROUP_HORIZONTAL -case .vertical: - return GTK_SIZE_GROUP_VERTICAL -case .both: - return GTK_SIZE_GROUP_BOTH + return GTK_SIZE_GROUP_NONE + case .horizontal: + return GTK_SIZE_GROUP_HORIZONTAL + case .vertical: + return GTK_SIZE_GROUP_VERTICAL + case .both: + return GTK_SIZE_GROUP_BOTH } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/SizeRequestMode.swift b/Sources/Gtk/Generated/SizeRequestMode.swift index 14b590f8e2..4ed9def07c 100644 --- a/Sources/Gtk/Generated/SizeRequestMode.swift +++ b/Sources/Gtk/Generated/SizeRequestMode.swift @@ -6,24 +6,24 @@ public enum SizeRequestMode: GValueRepresentableEnum { public typealias GtkEnum = GtkSizeRequestMode /// Prefer height-for-width geometry management -case heightForWidth -/// Prefer width-for-height geometry management -case widthForHeight -/// Don’t trade height-for-width or width-for-height -case constantSize + case heightForWidth + /// Prefer width-for-height geometry management + case widthForHeight + /// Don’t trade height-for-width or width-for-height + case constantSize public static var type: GType { - gtk_size_request_mode_get_type() -} + gtk_size_request_mode_get_type() + } public init(from gtkEnum: GtkSizeRequestMode) { switch gtkEnum { case GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH: - self = .heightForWidth -case GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT: - self = .widthForHeight -case GTK_SIZE_REQUEST_CONSTANT_SIZE: - self = .constantSize + self = .heightForWidth + case GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT: + self = .widthForHeight + case GTK_SIZE_REQUEST_CONSTANT_SIZE: + self = .constantSize default: fatalError("Unsupported GtkSizeRequestMode enum value: \(gtkEnum.rawValue)") } @@ -32,11 +32,11 @@ case GTK_SIZE_REQUEST_CONSTANT_SIZE: public func toGtk() -> GtkSizeRequestMode { switch self { case .heightForWidth: - return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH -case .widthForHeight: - return GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT -case .constantSize: - return GTK_SIZE_REQUEST_CONSTANT_SIZE + return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH + case .widthForHeight: + return GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT + case .constantSize: + return GTK_SIZE_REQUEST_CONSTANT_SIZE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/SortType.swift b/Sources/Gtk/Generated/SortType.swift index 78d4dab6ae..2a19d30b89 100644 --- a/Sources/Gtk/Generated/SortType.swift +++ b/Sources/Gtk/Generated/SortType.swift @@ -5,20 +5,20 @@ public enum SortType: GValueRepresentableEnum { public typealias GtkEnum = GtkSortType /// Sorting is in ascending order. -case ascending -/// Sorting is in descending order. -case descending + case ascending + /// Sorting is in descending order. + case descending public static var type: GType { - gtk_sort_type_get_type() -} + gtk_sort_type_get_type() + } public init(from gtkEnum: GtkSortType) { switch gtkEnum { case GTK_SORT_ASCENDING: - self = .ascending -case GTK_SORT_DESCENDING: - self = .descending + self = .ascending + case GTK_SORT_DESCENDING: + self = .descending default: fatalError("Unsupported GtkSortType enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ case GTK_SORT_DESCENDING: public func toGtk() -> GtkSortType { switch self { case .ascending: - return GTK_SORT_ASCENDING -case .descending: - return GTK_SORT_DESCENDING + return GTK_SORT_ASCENDING + case .descending: + return GTK_SORT_DESCENDING } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/SorterChange.swift b/Sources/Gtk/Generated/SorterChange.swift index 1624530ab0..a7cf38e399 100644 --- a/Sources/Gtk/Generated/SorterChange.swift +++ b/Sources/Gtk/Generated/SorterChange.swift @@ -6,33 +6,33 @@ public enum SorterChange: GValueRepresentableEnum { public typealias GtkEnum = GtkSorterChange /// The sorter change cannot be described -/// by any of the other enumeration values -case different -/// The sort order was inverted. Comparisons -/// that returned %GTK_ORDERING_SMALLER now return %GTK_ORDERING_LARGER -/// and vice versa. Other comparisons return the same values as before. -case inverted -/// The sorter is less strict: Comparisons -/// may now return %GTK_ORDERING_EQUAL that did not do so before. -case lessStrict -/// The sorter is more strict: Comparisons -/// that did return %GTK_ORDERING_EQUAL may not do so anymore. -case moreStrict + /// by any of the other enumeration values + case different + /// The sort order was inverted. Comparisons + /// that returned %GTK_ORDERING_SMALLER now return %GTK_ORDERING_LARGER + /// and vice versa. Other comparisons return the same values as before. + case inverted + /// The sorter is less strict: Comparisons + /// may now return %GTK_ORDERING_EQUAL that did not do so before. + case lessStrict + /// The sorter is more strict: Comparisons + /// that did return %GTK_ORDERING_EQUAL may not do so anymore. + case moreStrict public static var type: GType { - gtk_sorter_change_get_type() -} + gtk_sorter_change_get_type() + } public init(from gtkEnum: GtkSorterChange) { switch gtkEnum { case GTK_SORTER_CHANGE_DIFFERENT: - self = .different -case GTK_SORTER_CHANGE_INVERTED: - self = .inverted -case GTK_SORTER_CHANGE_LESS_STRICT: - self = .lessStrict -case GTK_SORTER_CHANGE_MORE_STRICT: - self = .moreStrict + self = .different + case GTK_SORTER_CHANGE_INVERTED: + self = .inverted + case GTK_SORTER_CHANGE_LESS_STRICT: + self = .lessStrict + case GTK_SORTER_CHANGE_MORE_STRICT: + self = .moreStrict default: fatalError("Unsupported GtkSorterChange enum value: \(gtkEnum.rawValue)") } @@ -41,13 +41,13 @@ case GTK_SORTER_CHANGE_MORE_STRICT: public func toGtk() -> GtkSorterChange { switch self { case .different: - return GTK_SORTER_CHANGE_DIFFERENT -case .inverted: - return GTK_SORTER_CHANGE_INVERTED -case .lessStrict: - return GTK_SORTER_CHANGE_LESS_STRICT -case .moreStrict: - return GTK_SORTER_CHANGE_MORE_STRICT + return GTK_SORTER_CHANGE_DIFFERENT + case .inverted: + return GTK_SORTER_CHANGE_INVERTED + case .lessStrict: + return GTK_SORTER_CHANGE_LESS_STRICT + case .moreStrict: + return GTK_SORTER_CHANGE_MORE_STRICT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/SorterOrder.swift b/Sources/Gtk/Generated/SorterOrder.swift index 4fb6394d40..193596801b 100644 --- a/Sources/Gtk/Generated/SorterOrder.swift +++ b/Sources/Gtk/Generated/SorterOrder.swift @@ -5,27 +5,27 @@ public enum SorterOrder: GValueRepresentableEnum { public typealias GtkEnum = GtkSorterOrder /// A partial order. Any `GtkOrdering` is possible. -case partial -/// No order, all elements are considered equal. -/// gtk_sorter_compare() will only return %GTK_ORDERING_EQUAL. -case none -/// A total order. gtk_sorter_compare() will only -/// return %GTK_ORDERING_EQUAL if an item is compared with itself. Two -/// different items will never cause this value to be returned. -case total + case partial + /// No order, all elements are considered equal. + /// gtk_sorter_compare() will only return %GTK_ORDERING_EQUAL. + case none + /// A total order. gtk_sorter_compare() will only + /// return %GTK_ORDERING_EQUAL if an item is compared with itself. Two + /// different items will never cause this value to be returned. + case total public static var type: GType { - gtk_sorter_order_get_type() -} + gtk_sorter_order_get_type() + } public init(from gtkEnum: GtkSorterOrder) { switch gtkEnum { case GTK_SORTER_ORDER_PARTIAL: - self = .partial -case GTK_SORTER_ORDER_NONE: - self = .none -case GTK_SORTER_ORDER_TOTAL: - self = .total + self = .partial + case GTK_SORTER_ORDER_NONE: + self = .none + case GTK_SORTER_ORDER_TOTAL: + self = .total default: fatalError("Unsupported GtkSorterOrder enum value: \(gtkEnum.rawValue)") } @@ -34,11 +34,11 @@ case GTK_SORTER_ORDER_TOTAL: public func toGtk() -> GtkSorterOrder { switch self { case .partial: - return GTK_SORTER_ORDER_PARTIAL -case .none: - return GTK_SORTER_ORDER_NONE -case .total: - return GTK_SORTER_ORDER_TOTAL + return GTK_SORTER_ORDER_PARTIAL + case .none: + return GTK_SORTER_ORDER_NONE + case .total: + return GTK_SORTER_ORDER_TOTAL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/SpinButtonUpdatePolicy.swift b/Sources/Gtk/Generated/SpinButtonUpdatePolicy.swift index 14e0410ba8..f2064ada87 100644 --- a/Sources/Gtk/Generated/SpinButtonUpdatePolicy.swift +++ b/Sources/Gtk/Generated/SpinButtonUpdatePolicy.swift @@ -2,29 +2,29 @@ import CGtk /// Determines whether the spin button displays values outside the adjustment /// bounds. -/// +/// /// See [method@Gtk.SpinButton.set_update_policy]. public enum SpinButtonUpdatePolicy: GValueRepresentableEnum { public typealias GtkEnum = GtkSpinButtonUpdatePolicy /// When refreshing your `GtkSpinButton`, the value is -/// always displayed -case always -/// When refreshing your `GtkSpinButton`, the value is -/// only displayed if it is valid within the bounds of the spin button's -/// adjustment -case ifValid + /// always displayed + case always + /// When refreshing your `GtkSpinButton`, the value is + /// only displayed if it is valid within the bounds of the spin button's + /// adjustment + case ifValid public static var type: GType { - gtk_spin_button_update_policy_get_type() -} + gtk_spin_button_update_policy_get_type() + } public init(from gtkEnum: GtkSpinButtonUpdatePolicy) { switch gtkEnum { case GTK_UPDATE_ALWAYS: - self = .always -case GTK_UPDATE_IF_VALID: - self = .ifValid + self = .always + case GTK_UPDATE_IF_VALID: + self = .ifValid default: fatalError("Unsupported GtkSpinButtonUpdatePolicy enum value: \(gtkEnum.rawValue)") } @@ -33,9 +33,9 @@ case GTK_UPDATE_IF_VALID: public func toGtk() -> GtkSpinButtonUpdatePolicy { switch self { case .always: - return GTK_UPDATE_ALWAYS -case .ifValid: - return GTK_UPDATE_IF_VALID + return GTK_UPDATE_ALWAYS + case .ifValid: + return GTK_UPDATE_IF_VALID } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/SpinType.swift b/Sources/Gtk/Generated/SpinType.swift index da575388ec..495515dffa 100644 --- a/Sources/Gtk/Generated/SpinType.swift +++ b/Sources/Gtk/Generated/SpinType.swift @@ -6,40 +6,40 @@ public enum SpinType: GValueRepresentableEnum { public typealias GtkEnum = GtkSpinType /// Increment by the adjustments step increment. -case stepForward -/// Decrement by the adjustments step increment. -case stepBackward -/// Increment by the adjustments page increment. -case pageForward -/// Decrement by the adjustments page increment. -case pageBackward -/// Go to the adjustments lower bound. -case home -/// Go to the adjustments upper bound. -case end -/// Change by a specified amount. -case userDefined + case stepForward + /// Decrement by the adjustments step increment. + case stepBackward + /// Increment by the adjustments page increment. + case pageForward + /// Decrement by the adjustments page increment. + case pageBackward + /// Go to the adjustments lower bound. + case home + /// Go to the adjustments upper bound. + case end + /// Change by a specified amount. + case userDefined public static var type: GType { - gtk_spin_type_get_type() -} + gtk_spin_type_get_type() + } public init(from gtkEnum: GtkSpinType) { switch gtkEnum { case GTK_SPIN_STEP_FORWARD: - self = .stepForward -case GTK_SPIN_STEP_BACKWARD: - self = .stepBackward -case GTK_SPIN_PAGE_FORWARD: - self = .pageForward -case GTK_SPIN_PAGE_BACKWARD: - self = .pageBackward -case GTK_SPIN_HOME: - self = .home -case GTK_SPIN_END: - self = .end -case GTK_SPIN_USER_DEFINED: - self = .userDefined + self = .stepForward + case GTK_SPIN_STEP_BACKWARD: + self = .stepBackward + case GTK_SPIN_PAGE_FORWARD: + self = .pageForward + case GTK_SPIN_PAGE_BACKWARD: + self = .pageBackward + case GTK_SPIN_HOME: + self = .home + case GTK_SPIN_END: + self = .end + case GTK_SPIN_USER_DEFINED: + self = .userDefined default: fatalError("Unsupported GtkSpinType enum value: \(gtkEnum.rawValue)") } @@ -48,19 +48,19 @@ case GTK_SPIN_USER_DEFINED: public func toGtk() -> GtkSpinType { switch self { case .stepForward: - return GTK_SPIN_STEP_FORWARD -case .stepBackward: - return GTK_SPIN_STEP_BACKWARD -case .pageForward: - return GTK_SPIN_PAGE_FORWARD -case .pageBackward: - return GTK_SPIN_PAGE_BACKWARD -case .home: - return GTK_SPIN_HOME -case .end: - return GTK_SPIN_END -case .userDefined: - return GTK_SPIN_USER_DEFINED + return GTK_SPIN_STEP_FORWARD + case .stepBackward: + return GTK_SPIN_STEP_BACKWARD + case .pageForward: + return GTK_SPIN_PAGE_FORWARD + case .pageBackward: + return GTK_SPIN_PAGE_BACKWARD + case .home: + return GTK_SPIN_HOME + case .end: + return GTK_SPIN_END + case .userDefined: + return GTK_SPIN_USER_DEFINED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Spinner.swift b/Sources/Gtk/Generated/Spinner.swift index b3394a0ac2..3ba1db393c 100644 --- a/Sources/Gtk/Generated/Spinner.swift +++ b/Sources/Gtk/Generated/Spinner.swift @@ -1,45 +1,46 @@ import CGtk /// Displays an icon-size spinning animation. -/// +/// /// It is often used as an alternative to a [class@Gtk.ProgressBar] /// for displaying indefinite activity, instead of actual progress. -/// +/// /// An example GtkSpinner -/// +/// /// To start the animation, use [method@Gtk.Spinner.start], to stop it /// use [method@Gtk.Spinner.stop]. -/// +/// /// # CSS nodes -/// +/// /// `GtkSpinner` has a single CSS node with the name spinner. /// When the animation is active, the :checked pseudoclass is /// added to this node. open class Spinner: Widget { /// Returns a new spinner widget. Not yet started. -public convenience init() { - self.init( - gtk_spinner_new() - ) -} + public convenience init() { + self.init( + gtk_spinner_new() + ) + } - override func didMoveToParent() { - super.didMoveToParent() + override func didMoveToParent() { + super.didMoveToParent() - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } -addSignal(name: "notify::spinning", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySpinning?(self, param0) -} -} + addSignal(name: "notify::spinning", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySpinning?(self, param0) + } + } /// Whether the spinner is spinning -@GObjectProperty(named: "spinning") public var spinning: Bool + @GObjectProperty(named: "spinning") public var spinning: Bool - -public var notifySpinning: ((Spinner, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifySpinning: ((Spinner, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/StackTransitionType.swift b/Sources/Gtk/Generated/StackTransitionType.swift index 6c06a23b37..670e993e87 100644 --- a/Sources/Gtk/Generated/StackTransitionType.swift +++ b/Sources/Gtk/Generated/StackTransitionType.swift @@ -1,110 +1,110 @@ import CGtk /// Possible transitions between pages in a `GtkStack` widget. -/// +/// /// New values may be added to this enumeration over time. public enum StackTransitionType: GValueRepresentableEnum { public typealias GtkEnum = GtkStackTransitionType /// No transition -case none -/// A cross-fade -case crossfade -/// Slide from left to right -case slideRight -/// Slide from right to left -case slideLeft -/// Slide from bottom up -case slideUp -/// Slide from top down -case slideDown -/// Slide from left or right according to the children order -case slideLeftRight -/// Slide from top down or bottom up according to the order -case slideUpDown -/// Cover the old page by sliding up -case overUp -/// Cover the old page by sliding down -case overDown -/// Cover the old page by sliding to the left -case overLeft -/// Cover the old page by sliding to the right -case overRight -/// Uncover the new page by sliding up -case underUp -/// Uncover the new page by sliding down -case underDown -/// Uncover the new page by sliding to the left -case underLeft -/// Uncover the new page by sliding to the right -case underRight -/// Cover the old page sliding up or uncover the new page sliding down, according to order -case overUpDown -/// Cover the old page sliding down or uncover the new page sliding up, according to order -case overDownUp -/// Cover the old page sliding left or uncover the new page sliding right, according to order -case overLeftRight -/// Cover the old page sliding right or uncover the new page sliding left, according to order -case overRightLeft -/// Pretend the pages are sides of a cube and rotate that cube to the left -case rotateLeft -/// Pretend the pages are sides of a cube and rotate that cube to the right -case rotateRight -/// Pretend the pages are sides of a cube and rotate that cube to the left or right according to the children order -case rotateLeftRight + case none + /// A cross-fade + case crossfade + /// Slide from left to right + case slideRight + /// Slide from right to left + case slideLeft + /// Slide from bottom up + case slideUp + /// Slide from top down + case slideDown + /// Slide from left or right according to the children order + case slideLeftRight + /// Slide from top down or bottom up according to the order + case slideUpDown + /// Cover the old page by sliding up + case overUp + /// Cover the old page by sliding down + case overDown + /// Cover the old page by sliding to the left + case overLeft + /// Cover the old page by sliding to the right + case overRight + /// Uncover the new page by sliding up + case underUp + /// Uncover the new page by sliding down + case underDown + /// Uncover the new page by sliding to the left + case underLeft + /// Uncover the new page by sliding to the right + case underRight + /// Cover the old page sliding up or uncover the new page sliding down, according to order + case overUpDown + /// Cover the old page sliding down or uncover the new page sliding up, according to order + case overDownUp + /// Cover the old page sliding left or uncover the new page sliding right, according to order + case overLeftRight + /// Cover the old page sliding right or uncover the new page sliding left, according to order + case overRightLeft + /// Pretend the pages are sides of a cube and rotate that cube to the left + case rotateLeft + /// Pretend the pages are sides of a cube and rotate that cube to the right + case rotateRight + /// Pretend the pages are sides of a cube and rotate that cube to the left or right according to the children order + case rotateLeftRight public static var type: GType { - gtk_stack_transition_type_get_type() -} + gtk_stack_transition_type_get_type() + } public init(from gtkEnum: GtkStackTransitionType) { switch gtkEnum { case GTK_STACK_TRANSITION_TYPE_NONE: - self = .none -case GTK_STACK_TRANSITION_TYPE_CROSSFADE: - self = .crossfade -case GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT: - self = .slideRight -case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT: - self = .slideLeft -case GTK_STACK_TRANSITION_TYPE_SLIDE_UP: - self = .slideUp -case GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN: - self = .slideDown -case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT: - self = .slideLeftRight -case GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN: - self = .slideUpDown -case GTK_STACK_TRANSITION_TYPE_OVER_UP: - self = .overUp -case GTK_STACK_TRANSITION_TYPE_OVER_DOWN: - self = .overDown -case GTK_STACK_TRANSITION_TYPE_OVER_LEFT: - self = .overLeft -case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT: - self = .overRight -case GTK_STACK_TRANSITION_TYPE_UNDER_UP: - self = .underUp -case GTK_STACK_TRANSITION_TYPE_UNDER_DOWN: - self = .underDown -case GTK_STACK_TRANSITION_TYPE_UNDER_LEFT: - self = .underLeft -case GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT: - self = .underRight -case GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN: - self = .overUpDown -case GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP: - self = .overDownUp -case GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT: - self = .overLeftRight -case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT: - self = .overRightLeft -case GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT: - self = .rotateLeft -case GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT: - self = .rotateRight -case GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT: - self = .rotateLeftRight + self = .none + case GTK_STACK_TRANSITION_TYPE_CROSSFADE: + self = .crossfade + case GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT: + self = .slideRight + case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT: + self = .slideLeft + case GTK_STACK_TRANSITION_TYPE_SLIDE_UP: + self = .slideUp + case GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN: + self = .slideDown + case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT: + self = .slideLeftRight + case GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN: + self = .slideUpDown + case GTK_STACK_TRANSITION_TYPE_OVER_UP: + self = .overUp + case GTK_STACK_TRANSITION_TYPE_OVER_DOWN: + self = .overDown + case GTK_STACK_TRANSITION_TYPE_OVER_LEFT: + self = .overLeft + case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT: + self = .overRight + case GTK_STACK_TRANSITION_TYPE_UNDER_UP: + self = .underUp + case GTK_STACK_TRANSITION_TYPE_UNDER_DOWN: + self = .underDown + case GTK_STACK_TRANSITION_TYPE_UNDER_LEFT: + self = .underLeft + case GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT: + self = .underRight + case GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN: + self = .overUpDown + case GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP: + self = .overDownUp + case GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT: + self = .overLeftRight + case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT: + self = .overRightLeft + case GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT: + self = .rotateLeft + case GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT: + self = .rotateRight + case GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT: + self = .rotateLeftRight default: fatalError("Unsupported GtkStackTransitionType enum value: \(gtkEnum.rawValue)") } @@ -113,51 +113,51 @@ case GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT: public func toGtk() -> GtkStackTransitionType { switch self { case .none: - return GTK_STACK_TRANSITION_TYPE_NONE -case .crossfade: - return GTK_STACK_TRANSITION_TYPE_CROSSFADE -case .slideRight: - return GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT -case .slideLeft: - return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT -case .slideUp: - return GTK_STACK_TRANSITION_TYPE_SLIDE_UP -case .slideDown: - return GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN -case .slideLeftRight: - return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT -case .slideUpDown: - return GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN -case .overUp: - return GTK_STACK_TRANSITION_TYPE_OVER_UP -case .overDown: - return GTK_STACK_TRANSITION_TYPE_OVER_DOWN -case .overLeft: - return GTK_STACK_TRANSITION_TYPE_OVER_LEFT -case .overRight: - return GTK_STACK_TRANSITION_TYPE_OVER_RIGHT -case .underUp: - return GTK_STACK_TRANSITION_TYPE_UNDER_UP -case .underDown: - return GTK_STACK_TRANSITION_TYPE_UNDER_DOWN -case .underLeft: - return GTK_STACK_TRANSITION_TYPE_UNDER_LEFT -case .underRight: - return GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT -case .overUpDown: - return GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN -case .overDownUp: - return GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP -case .overLeftRight: - return GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT -case .overRightLeft: - return GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT -case .rotateLeft: - return GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT -case .rotateRight: - return GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT -case .rotateLeftRight: - return GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT + return GTK_STACK_TRANSITION_TYPE_NONE + case .crossfade: + return GTK_STACK_TRANSITION_TYPE_CROSSFADE + case .slideRight: + return GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT + case .slideLeft: + return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT + case .slideUp: + return GTK_STACK_TRANSITION_TYPE_SLIDE_UP + case .slideDown: + return GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN + case .slideLeftRight: + return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT + case .slideUpDown: + return GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN + case .overUp: + return GTK_STACK_TRANSITION_TYPE_OVER_UP + case .overDown: + return GTK_STACK_TRANSITION_TYPE_OVER_DOWN + case .overLeft: + return GTK_STACK_TRANSITION_TYPE_OVER_LEFT + case .overRight: + return GTK_STACK_TRANSITION_TYPE_OVER_RIGHT + case .underUp: + return GTK_STACK_TRANSITION_TYPE_UNDER_UP + case .underDown: + return GTK_STACK_TRANSITION_TYPE_UNDER_DOWN + case .underLeft: + return GTK_STACK_TRANSITION_TYPE_UNDER_LEFT + case .underRight: + return GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT + case .overUpDown: + return GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN + case .overDownUp: + return GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP + case .overLeftRight: + return GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT + case .overRightLeft: + return GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT + case .rotateLeft: + return GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT + case .rotateRight: + return GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT + case .rotateLeftRight: + return GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/StringFilterMatchMode.swift b/Sources/Gtk/Generated/StringFilterMatchMode.swift index 97dcadcf51..c0b77f93d6 100644 --- a/Sources/Gtk/Generated/StringFilterMatchMode.swift +++ b/Sources/Gtk/Generated/StringFilterMatchMode.swift @@ -5,27 +5,27 @@ public enum StringFilterMatchMode: GValueRepresentableEnum { public typealias GtkEnum = GtkStringFilterMatchMode /// The search string and -/// text must match exactly -case exact -/// The search string -/// must be contained as a substring inside the text -case substring -/// The text must begin -/// with the search string -case prefix + /// text must match exactly + case exact + /// The search string + /// must be contained as a substring inside the text + case substring + /// The text must begin + /// with the search string + case prefix public static var type: GType { - gtk_string_filter_match_mode_get_type() -} + gtk_string_filter_match_mode_get_type() + } public init(from gtkEnum: GtkStringFilterMatchMode) { switch gtkEnum { case GTK_STRING_FILTER_MATCH_MODE_EXACT: - self = .exact -case GTK_STRING_FILTER_MATCH_MODE_SUBSTRING: - self = .substring -case GTK_STRING_FILTER_MATCH_MODE_PREFIX: - self = .prefix + self = .exact + case GTK_STRING_FILTER_MATCH_MODE_SUBSTRING: + self = .substring + case GTK_STRING_FILTER_MATCH_MODE_PREFIX: + self = .prefix default: fatalError("Unsupported GtkStringFilterMatchMode enum value: \(gtkEnum.rawValue)") } @@ -34,11 +34,11 @@ case GTK_STRING_FILTER_MATCH_MODE_PREFIX: public func toGtk() -> GtkStringFilterMatchMode { switch self { case .exact: - return GTK_STRING_FILTER_MATCH_MODE_EXACT -case .substring: - return GTK_STRING_FILTER_MATCH_MODE_SUBSTRING -case .prefix: - return GTK_STRING_FILTER_MATCH_MODE_PREFIX + return GTK_STRING_FILTER_MATCH_MODE_EXACT + case .substring: + return GTK_STRING_FILTER_MATCH_MODE_SUBSTRING + case .prefix: + return GTK_STRING_FILTER_MATCH_MODE_PREFIX } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/StyleProvider.swift b/Sources/Gtk/Generated/StyleProvider.swift index 9318cb5a4b..d5587188a7 100644 --- a/Sources/Gtk/Generated/StyleProvider.swift +++ b/Sources/Gtk/Generated/StyleProvider.swift @@ -1,16 +1,14 @@ import CGtk /// An interface for style information used by [class@Gtk.StyleContext]. -/// +/// /// See [method@Gtk.StyleContext.add_provider] and /// [func@Gtk.StyleContext.add_provider_for_display] for /// adding `GtkStyleProviders`. -/// +/// /// GTK uses the `GtkStyleProvider` implementation for CSS in /// [class@Gtk.CssProvider]. public protocol StyleProvider: GObjectRepresentable { - - -var gtkPrivateChanged: ((Self) -> Void)? { get set } -} \ No newline at end of file + var gtkPrivateChanged: ((Self) -> Void)? { get set } +} diff --git a/Sources/Gtk/Generated/Switch.swift b/Sources/Gtk/Generated/Switch.swift index 00b294198a..e4145d8e1e 100644 --- a/Sources/Gtk/Generated/Switch.swift +++ b/Sources/Gtk/Generated/Switch.swift @@ -1,152 +1,157 @@ import CGtk /// Shows a "light switch" that has two states: on or off. -/// +/// /// An example GtkSwitch -/// +/// /// The user can control which state should be active by clicking the /// empty area, or by dragging the slider. -/// +/// /// `GtkSwitch` can also express situations where the underlying state changes /// with a delay. In this case, the slider position indicates the user's recent /// change (represented by the [property@Gtk.Switch:active] property), while the /// trough color indicates the present underlying state (represented by the /// [property@Gtk.Switch:state] property). -/// +/// /// GtkSwitch with delayed state change -/// +/// /// See [signal@Gtk.Switch::state-set] for details. -/// +/// /// # Shortcuts and Gestures -/// +/// /// `GtkSwitch` supports pan and drag gestures to move the slider. -/// +/// /// # CSS nodes -/// +/// /// ``` /// switch /// ├── image /// ├── image /// ╰── slider /// ``` -/// +/// /// `GtkSwitch` has four css nodes, the main node with the name switch and /// subnodes for the slider and the on and off images. Neither of them is /// using any style classes. -/// +/// /// # Accessibility -/// +/// /// `GtkSwitch` uses the [enum@Gtk.AccessibleRole.switch] role. open class Switch: Widget, Actionable { /// Creates a new `GtkSwitch` widget. -public convenience init() { - self.init( - gtk_switch_new() - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, Bool, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "state-set", handler: gCallback(handler1)) { [weak self] (param0: Bool) in - guard let self = self else { return } - self.stateSet?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_switch_new() + ) } -addSignal(name: "notify::active", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActive?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, Bool, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "state-set", handler: gCallback(handler1)) { [weak self] (param0: Bool) in + guard let self = self else { return } + self.stateSet?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::active", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActive?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::state", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyState?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::action-name", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionName?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::action-target", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActionTarget?(self, param0) + } } -addSignal(name: "notify::state", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyState?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::action-name", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionName?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::action-target", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActionTarget?(self, param0) -} -} - /// Whether the `GtkSwitch` widget is in its on or off state. -@GObjectProperty(named: "active") public var active: Bool - -/// The backend state that is controlled by the switch. -/// -/// Applications should usually set the [property@Gtk.Switch:active] property, -/// except when indicating a change to the backend state which occurs -/// separately from the user's interaction. -/// -/// See [signal@Gtk.Switch::state-set] for details. -@GObjectProperty(named: "state") public var state: Bool - -/// The name of the action with which this widget should be associated. -@GObjectProperty(named: "action-name") public var actionName: String? - -/// Emitted to animate the switch. -/// -/// Applications should never connect to this signal, -/// but use the [property@Gtk.Switch:active] property. -public var activate: ((Switch) -> Void)? - -/// Emitted to change the underlying state. -/// -/// The ::state-set signal is emitted when the user changes the switch -/// position. The default handler calls [method@Gtk.Switch.set_state] with the -/// value of @state. -/// -/// To implement delayed state change, applications can connect to this -/// signal, initiate the change of the underlying state, and call -/// [method@Gtk.Switch.set_state] when the underlying state change is -/// complete. The signal handler should return %TRUE to prevent the -/// default handler from running. -public var stateSet: ((Switch, Bool) -> Void)? - - -public var notifyActive: ((Switch, OpaquePointer) -> Void)? - - -public var notifyState: ((Switch, OpaquePointer) -> Void)? - - -public var notifyActionName: ((Switch, OpaquePointer) -> Void)? - - -public var notifyActionTarget: ((Switch, OpaquePointer) -> Void)? -} \ No newline at end of file + @GObjectProperty(named: "active") public var active: Bool + + /// The backend state that is controlled by the switch. + /// + /// Applications should usually set the [property@Gtk.Switch:active] property, + /// except when indicating a change to the backend state which occurs + /// separately from the user's interaction. + /// + /// See [signal@Gtk.Switch::state-set] for details. + @GObjectProperty(named: "state") public var state: Bool + + /// The name of the action with which this widget should be associated. + @GObjectProperty(named: "action-name") public var actionName: String? + + /// Emitted to animate the switch. + /// + /// Applications should never connect to this signal, + /// but use the [property@Gtk.Switch:active] property. + public var activate: ((Switch) -> Void)? + + /// Emitted to change the underlying state. + /// + /// The ::state-set signal is emitted when the user changes the switch + /// position. The default handler calls [method@Gtk.Switch.set_state] with the + /// value of @state. + /// + /// To implement delayed state change, applications can connect to this + /// signal, initiate the change of the underlying state, and call + /// [method@Gtk.Switch.set_state] when the underlying state change is + /// complete. The signal handler should return %TRUE to prevent the + /// default handler from running. + public var stateSet: ((Switch, Bool) -> Void)? + + public var notifyActive: ((Switch, OpaquePointer) -> Void)? + + public var notifyState: ((Switch, OpaquePointer) -> Void)? + + public var notifyActionName: ((Switch, OpaquePointer) -> Void)? + + public var notifyActionTarget: ((Switch, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk/Generated/SystemSetting.swift b/Sources/Gtk/Generated/SystemSetting.swift index 69a3b88a13..ca7b9b4d36 100644 --- a/Sources/Gtk/Generated/SystemSetting.swift +++ b/Sources/Gtk/Generated/SystemSetting.swift @@ -2,50 +2,50 @@ import CGtk /// Values that can be passed to the [vfunc@Gtk.Widget.system_setting_changed] /// vfunc. -/// +/// /// The values indicate which system setting has changed. /// Widgets may need to drop caches, or react otherwise. -/// +/// /// Most of the values correspond to [class@Settings] properties. -/// +/// /// More values may be added over time. public enum SystemSetting: GValueRepresentableEnum { public typealias GtkEnum = GtkSystemSetting /// The [property@Gtk.Settings:gtk-xft-dpi] setting has changed -case dpi -/// The [property@Gtk.Settings:gtk-font-name] setting has changed -case fontName -/// The font configuration has changed in a way that -/// requires text to be redrawn. This can be any of the -/// [property@Gtk.Settings:gtk-xft-antialias], -/// [property@Gtk.Settings:gtk-xft-hinting], -/// [property@Gtk.Settings:gtk-xft-hintstyle], -/// [property@Gtk.Settings:gtk-xft-rgba] or -/// [property@Gtk.Settings:gtk-fontconfig-timestamp] settings -case fontConfig -/// The display has changed -case display -/// The icon theme has changed in a way that requires -/// icons to be looked up again -case iconTheme + case dpi + /// The [property@Gtk.Settings:gtk-font-name] setting has changed + case fontName + /// The font configuration has changed in a way that + /// requires text to be redrawn. This can be any of the + /// [property@Gtk.Settings:gtk-xft-antialias], + /// [property@Gtk.Settings:gtk-xft-hinting], + /// [property@Gtk.Settings:gtk-xft-hintstyle], + /// [property@Gtk.Settings:gtk-xft-rgba] or + /// [property@Gtk.Settings:gtk-fontconfig-timestamp] settings + case fontConfig + /// The display has changed + case display + /// The icon theme has changed in a way that requires + /// icons to be looked up again + case iconTheme public static var type: GType { - gtk_system_setting_get_type() -} + gtk_system_setting_get_type() + } public init(from gtkEnum: GtkSystemSetting) { switch gtkEnum { case GTK_SYSTEM_SETTING_DPI: - self = .dpi -case GTK_SYSTEM_SETTING_FONT_NAME: - self = .fontName -case GTK_SYSTEM_SETTING_FONT_CONFIG: - self = .fontConfig -case GTK_SYSTEM_SETTING_DISPLAY: - self = .display -case GTK_SYSTEM_SETTING_ICON_THEME: - self = .iconTheme + self = .dpi + case GTK_SYSTEM_SETTING_FONT_NAME: + self = .fontName + case GTK_SYSTEM_SETTING_FONT_CONFIG: + self = .fontConfig + case GTK_SYSTEM_SETTING_DISPLAY: + self = .display + case GTK_SYSTEM_SETTING_ICON_THEME: + self = .iconTheme default: fatalError("Unsupported GtkSystemSetting enum value: \(gtkEnum.rawValue)") } @@ -54,15 +54,15 @@ case GTK_SYSTEM_SETTING_ICON_THEME: public func toGtk() -> GtkSystemSetting { switch self { case .dpi: - return GTK_SYSTEM_SETTING_DPI -case .fontName: - return GTK_SYSTEM_SETTING_FONT_NAME -case .fontConfig: - return GTK_SYSTEM_SETTING_FONT_CONFIG -case .display: - return GTK_SYSTEM_SETTING_DISPLAY -case .iconTheme: - return GTK_SYSTEM_SETTING_ICON_THEME + return GTK_SYSTEM_SETTING_DPI + case .fontName: + return GTK_SYSTEM_SETTING_FONT_NAME + case .fontConfig: + return GTK_SYSTEM_SETTING_FONT_CONFIG + case .display: + return GTK_SYSTEM_SETTING_DISPLAY + case .iconTheme: + return GTK_SYSTEM_SETTING_ICON_THEME } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/TextDirection.swift b/Sources/Gtk/Generated/TextDirection.swift index 8c3b951114..1ab684b607 100644 --- a/Sources/Gtk/Generated/TextDirection.swift +++ b/Sources/Gtk/Generated/TextDirection.swift @@ -5,24 +5,24 @@ public enum TextDirection: GValueRepresentableEnum { public typealias GtkEnum = GtkTextDirection /// No direction. -case none -/// Left to right text direction. -case ltr -/// Right to left text direction. -case rtl + case none + /// Left to right text direction. + case ltr + /// Right to left text direction. + case rtl public static var type: GType { - gtk_text_direction_get_type() -} + gtk_text_direction_get_type() + } public init(from gtkEnum: GtkTextDirection) { switch gtkEnum { case GTK_TEXT_DIR_NONE: - self = .none -case GTK_TEXT_DIR_LTR: - self = .ltr -case GTK_TEXT_DIR_RTL: - self = .rtl + self = .none + case GTK_TEXT_DIR_LTR: + self = .ltr + case GTK_TEXT_DIR_RTL: + self = .rtl default: fatalError("Unsupported GtkTextDirection enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ case GTK_TEXT_DIR_RTL: public func toGtk() -> GtkTextDirection { switch self { case .none: - return GTK_TEXT_DIR_NONE -case .ltr: - return GTK_TEXT_DIR_LTR -case .rtl: - return GTK_TEXT_DIR_RTL + return GTK_TEXT_DIR_NONE + case .ltr: + return GTK_TEXT_DIR_LTR + case .rtl: + return GTK_TEXT_DIR_RTL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/TextExtendSelection.swift b/Sources/Gtk/Generated/TextExtendSelection.swift index 9883a0b27e..c83f57ecec 100644 --- a/Sources/Gtk/Generated/TextExtendSelection.swift +++ b/Sources/Gtk/Generated/TextExtendSelection.swift @@ -6,22 +6,22 @@ public enum TextExtendSelection: GValueRepresentableEnum { public typealias GtkEnum = GtkTextExtendSelection /// Selects the current word. It is triggered by -/// a double-click for example. -case word -/// Selects the current line. It is triggered by -/// a triple-click for example. -case line + /// a double-click for example. + case word + /// Selects the current line. It is triggered by + /// a triple-click for example. + case line public static var type: GType { - gtk_text_extend_selection_get_type() -} + gtk_text_extend_selection_get_type() + } public init(from gtkEnum: GtkTextExtendSelection) { switch gtkEnum { case GTK_TEXT_EXTEND_SELECTION_WORD: - self = .word -case GTK_TEXT_EXTEND_SELECTION_LINE: - self = .line + self = .word + case GTK_TEXT_EXTEND_SELECTION_LINE: + self = .line default: fatalError("Unsupported GtkTextExtendSelection enum value: \(gtkEnum.rawValue)") } @@ -30,9 +30,9 @@ case GTK_TEXT_EXTEND_SELECTION_LINE: public func toGtk() -> GtkTextExtendSelection { switch self { case .word: - return GTK_TEXT_EXTEND_SELECTION_WORD -case .line: - return GTK_TEXT_EXTEND_SELECTION_LINE + return GTK_TEXT_EXTEND_SELECTION_WORD + case .line: + return GTK_TEXT_EXTEND_SELECTION_LINE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/TextViewLayer.swift b/Sources/Gtk/Generated/TextViewLayer.swift index ee137729f9..bd391ea8bd 100644 --- a/Sources/Gtk/Generated/TextViewLayer.swift +++ b/Sources/Gtk/Generated/TextViewLayer.swift @@ -6,20 +6,20 @@ public enum TextViewLayer: GValueRepresentableEnum { public typealias GtkEnum = GtkTextViewLayer /// The layer rendered below the text (but above the background). -case belowText -/// The layer rendered above the text. -case aboveText + case belowText + /// The layer rendered above the text. + case aboveText public static var type: GType { - gtk_text_view_layer_get_type() -} + gtk_text_view_layer_get_type() + } public init(from gtkEnum: GtkTextViewLayer) { switch gtkEnum { case GTK_TEXT_VIEW_LAYER_BELOW_TEXT: - self = .belowText -case GTK_TEXT_VIEW_LAYER_ABOVE_TEXT: - self = .aboveText + self = .belowText + case GTK_TEXT_VIEW_LAYER_ABOVE_TEXT: + self = .aboveText default: fatalError("Unsupported GtkTextViewLayer enum value: \(gtkEnum.rawValue)") } @@ -28,9 +28,9 @@ case GTK_TEXT_VIEW_LAYER_ABOVE_TEXT: public func toGtk() -> GtkTextViewLayer { switch self { case .belowText: - return GTK_TEXT_VIEW_LAYER_BELOW_TEXT -case .aboveText: - return GTK_TEXT_VIEW_LAYER_ABOVE_TEXT + return GTK_TEXT_VIEW_LAYER_BELOW_TEXT + case .aboveText: + return GTK_TEXT_VIEW_LAYER_ABOVE_TEXT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/TextWindowType.swift b/Sources/Gtk/Generated/TextWindowType.swift index 96fbb93dfa..2457d73e97 100644 --- a/Sources/Gtk/Generated/TextWindowType.swift +++ b/Sources/Gtk/Generated/TextWindowType.swift @@ -5,36 +5,36 @@ public enum TextWindowType: GValueRepresentableEnum { public typealias GtkEnum = GtkTextWindowType /// Window that floats over scrolling areas. -case widget -/// Scrollable text window. -case text -/// Left side border window. -case left -/// Right side border window. -case right -/// Top border window. -case top -/// Bottom border window. -case bottom + case widget + /// Scrollable text window. + case text + /// Left side border window. + case left + /// Right side border window. + case right + /// Top border window. + case top + /// Bottom border window. + case bottom public static var type: GType { - gtk_text_window_type_get_type() -} + gtk_text_window_type_get_type() + } public init(from gtkEnum: GtkTextWindowType) { switch gtkEnum { case GTK_TEXT_WINDOW_WIDGET: - self = .widget -case GTK_TEXT_WINDOW_TEXT: - self = .text -case GTK_TEXT_WINDOW_LEFT: - self = .left -case GTK_TEXT_WINDOW_RIGHT: - self = .right -case GTK_TEXT_WINDOW_TOP: - self = .top -case GTK_TEXT_WINDOW_BOTTOM: - self = .bottom + self = .widget + case GTK_TEXT_WINDOW_TEXT: + self = .text + case GTK_TEXT_WINDOW_LEFT: + self = .left + case GTK_TEXT_WINDOW_RIGHT: + self = .right + case GTK_TEXT_WINDOW_TOP: + self = .top + case GTK_TEXT_WINDOW_BOTTOM: + self = .bottom default: fatalError("Unsupported GtkTextWindowType enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ case GTK_TEXT_WINDOW_BOTTOM: public func toGtk() -> GtkTextWindowType { switch self { case .widget: - return GTK_TEXT_WINDOW_WIDGET -case .text: - return GTK_TEXT_WINDOW_TEXT -case .left: - return GTK_TEXT_WINDOW_LEFT -case .right: - return GTK_TEXT_WINDOW_RIGHT -case .top: - return GTK_TEXT_WINDOW_TOP -case .bottom: - return GTK_TEXT_WINDOW_BOTTOM + return GTK_TEXT_WINDOW_WIDGET + case .text: + return GTK_TEXT_WINDOW_TEXT + case .left: + return GTK_TEXT_WINDOW_LEFT + case .right: + return GTK_TEXT_WINDOW_RIGHT + case .top: + return GTK_TEXT_WINDOW_TOP + case .bottom: + return GTK_TEXT_WINDOW_BOTTOM } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/TreeDragDest.swift b/Sources/Gtk/Generated/TreeDragDest.swift index f7da7eae8f..c10b696543 100644 --- a/Sources/Gtk/Generated/TreeDragDest.swift +++ b/Sources/Gtk/Generated/TreeDragDest.swift @@ -2,7 +2,5 @@ import CGtk /// Interface for Drag-and-Drop destinations in `GtkTreeView`. public protocol TreeDragDest: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/TreeDragSource.swift b/Sources/Gtk/Generated/TreeDragSource.swift index 4176d40441..6541757be8 100644 --- a/Sources/Gtk/Generated/TreeDragSource.swift +++ b/Sources/Gtk/Generated/TreeDragSource.swift @@ -2,7 +2,5 @@ import CGtk /// Interface for Drag-and-Drop destinations in `GtkTreeView`. public protocol TreeDragSource: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/TreeSortable.swift b/Sources/Gtk/Generated/TreeSortable.swift index 3f202bafd4..289b07112c 100644 --- a/Sources/Gtk/Generated/TreeSortable.swift +++ b/Sources/Gtk/Generated/TreeSortable.swift @@ -1,15 +1,14 @@ import CGtk /// The interface for sortable models used by GtkTreeView -/// +/// /// `GtkTreeSortable` is an interface to be implemented by tree models which /// support sorting. The `GtkTreeView` uses the methods provided by this interface /// to sort the model. public protocol TreeSortable: GObjectRepresentable { - /// The ::sort-column-changed signal is emitted when the sort column -/// or sort order of @sortable is changed. The signal is emitted before -/// the contents of @sortable are resorted. -var sortColumnChanged: ((Self) -> Void)? { get set } -} \ No newline at end of file + /// or sort order of @sortable is changed. The signal is emitted before + /// the contents of @sortable are resorted. + var sortColumnChanged: ((Self) -> Void)? { get set } +} diff --git a/Sources/Gtk/Generated/TreeViewColumnSizing.swift b/Sources/Gtk/Generated/TreeViewColumnSizing.swift index 325e951105..05b581761f 100644 --- a/Sources/Gtk/Generated/TreeViewColumnSizing.swift +++ b/Sources/Gtk/Generated/TreeViewColumnSizing.swift @@ -7,24 +7,24 @@ public enum TreeViewColumnSizing: GValueRepresentableEnum { public typealias GtkEnum = GtkTreeViewColumnSizing /// Columns only get bigger in reaction to changes in the model -case growOnly -/// Columns resize to be the optimal size every time the model changes. -case autosize -/// Columns are a fixed numbers of pixels wide. -case fixed + case growOnly + /// Columns resize to be the optimal size every time the model changes. + case autosize + /// Columns are a fixed numbers of pixels wide. + case fixed public static var type: GType { - gtk_tree_view_column_sizing_get_type() -} + gtk_tree_view_column_sizing_get_type() + } public init(from gtkEnum: GtkTreeViewColumnSizing) { switch gtkEnum { case GTK_TREE_VIEW_COLUMN_GROW_ONLY: - self = .growOnly -case GTK_TREE_VIEW_COLUMN_AUTOSIZE: - self = .autosize -case GTK_TREE_VIEW_COLUMN_FIXED: - self = .fixed + self = .growOnly + case GTK_TREE_VIEW_COLUMN_AUTOSIZE: + self = .autosize + case GTK_TREE_VIEW_COLUMN_FIXED: + self = .fixed default: fatalError("Unsupported GtkTreeViewColumnSizing enum value: \(gtkEnum.rawValue)") } @@ -33,11 +33,11 @@ case GTK_TREE_VIEW_COLUMN_FIXED: public func toGtk() -> GtkTreeViewColumnSizing { switch self { case .growOnly: - return GTK_TREE_VIEW_COLUMN_GROW_ONLY -case .autosize: - return GTK_TREE_VIEW_COLUMN_AUTOSIZE -case .fixed: - return GTK_TREE_VIEW_COLUMN_FIXED + return GTK_TREE_VIEW_COLUMN_GROW_ONLY + case .autosize: + return GTK_TREE_VIEW_COLUMN_AUTOSIZE + case .fixed: + return GTK_TREE_VIEW_COLUMN_FIXED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/TreeViewDropPosition.swift b/Sources/Gtk/Generated/TreeViewDropPosition.swift index 24b116d9ae..d86aa2ce20 100644 --- a/Sources/Gtk/Generated/TreeViewDropPosition.swift +++ b/Sources/Gtk/Generated/TreeViewDropPosition.swift @@ -5,28 +5,28 @@ public enum TreeViewDropPosition: GValueRepresentableEnum { public typealias GtkEnum = GtkTreeViewDropPosition /// Dropped row is inserted before -case before -/// Dropped row is inserted after -case after -/// Dropped row becomes a child or is inserted before -case intoOrBefore -/// Dropped row becomes a child or is inserted after -case intoOrAfter + case before + /// Dropped row is inserted after + case after + /// Dropped row becomes a child or is inserted before + case intoOrBefore + /// Dropped row becomes a child or is inserted after + case intoOrAfter public static var type: GType { - gtk_tree_view_drop_position_get_type() -} + gtk_tree_view_drop_position_get_type() + } public init(from gtkEnum: GtkTreeViewDropPosition) { switch gtkEnum { case GTK_TREE_VIEW_DROP_BEFORE: - self = .before -case GTK_TREE_VIEW_DROP_AFTER: - self = .after -case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: - self = .intoOrBefore -case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: - self = .intoOrAfter + self = .before + case GTK_TREE_VIEW_DROP_AFTER: + self = .after + case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: + self = .intoOrBefore + case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: + self = .intoOrAfter default: fatalError("Unsupported GtkTreeViewDropPosition enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: public func toGtk() -> GtkTreeViewDropPosition { switch self { case .before: - return GTK_TREE_VIEW_DROP_BEFORE -case .after: - return GTK_TREE_VIEW_DROP_AFTER -case .intoOrBefore: - return GTK_TREE_VIEW_DROP_INTO_OR_BEFORE -case .intoOrAfter: - return GTK_TREE_VIEW_DROP_INTO_OR_AFTER + return GTK_TREE_VIEW_DROP_BEFORE + case .after: + return GTK_TREE_VIEW_DROP_AFTER + case .intoOrBefore: + return GTK_TREE_VIEW_DROP_INTO_OR_BEFORE + case .intoOrAfter: + return GTK_TREE_VIEW_DROP_INTO_OR_AFTER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/TreeViewGridLines.swift b/Sources/Gtk/Generated/TreeViewGridLines.swift index e6a64dee59..7c03e8ce3e 100644 --- a/Sources/Gtk/Generated/TreeViewGridLines.swift +++ b/Sources/Gtk/Generated/TreeViewGridLines.swift @@ -5,28 +5,28 @@ public enum TreeViewGridLines: GValueRepresentableEnum { public typealias GtkEnum = GtkTreeViewGridLines /// No grid lines. -case none -/// Horizontal grid lines. -case horizontal -/// Vertical grid lines. -case vertical -/// Horizontal and vertical grid lines. -case both + case none + /// Horizontal grid lines. + case horizontal + /// Vertical grid lines. + case vertical + /// Horizontal and vertical grid lines. + case both public static var type: GType { - gtk_tree_view_grid_lines_get_type() -} + gtk_tree_view_grid_lines_get_type() + } public init(from gtkEnum: GtkTreeViewGridLines) { switch gtkEnum { case GTK_TREE_VIEW_GRID_LINES_NONE: - self = .none -case GTK_TREE_VIEW_GRID_LINES_HORIZONTAL: - self = .horizontal -case GTK_TREE_VIEW_GRID_LINES_VERTICAL: - self = .vertical -case GTK_TREE_VIEW_GRID_LINES_BOTH: - self = .both + self = .none + case GTK_TREE_VIEW_GRID_LINES_HORIZONTAL: + self = .horizontal + case GTK_TREE_VIEW_GRID_LINES_VERTICAL: + self = .vertical + case GTK_TREE_VIEW_GRID_LINES_BOTH: + self = .both default: fatalError("Unsupported GtkTreeViewGridLines enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_TREE_VIEW_GRID_LINES_BOTH: public func toGtk() -> GtkTreeViewGridLines { switch self { case .none: - return GTK_TREE_VIEW_GRID_LINES_NONE -case .horizontal: - return GTK_TREE_VIEW_GRID_LINES_HORIZONTAL -case .vertical: - return GTK_TREE_VIEW_GRID_LINES_VERTICAL -case .both: - return GTK_TREE_VIEW_GRID_LINES_BOTH + return GTK_TREE_VIEW_GRID_LINES_NONE + case .horizontal: + return GTK_TREE_VIEW_GRID_LINES_HORIZONTAL + case .vertical: + return GTK_TREE_VIEW_GRID_LINES_VERTICAL + case .both: + return GTK_TREE_VIEW_GRID_LINES_BOTH } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/Unit.swift b/Sources/Gtk/Generated/Unit.swift index 4d301c3f0f..f67046e8f4 100644 --- a/Sources/Gtk/Generated/Unit.swift +++ b/Sources/Gtk/Generated/Unit.swift @@ -5,28 +5,28 @@ public enum Unit: GValueRepresentableEnum { public typealias GtkEnum = GtkUnit /// No units. -case none -/// Dimensions in points. -case points -/// Dimensions in inches. -case inch -/// Dimensions in millimeters -case mm + case none + /// Dimensions in points. + case points + /// Dimensions in inches. + case inch + /// Dimensions in millimeters + case mm public static var type: GType { - gtk_unit_get_type() -} + gtk_unit_get_type() + } public init(from gtkEnum: GtkUnit) { switch gtkEnum { case GTK_UNIT_NONE: - self = .none -case GTK_UNIT_POINTS: - self = .points -case GTK_UNIT_INCH: - self = .inch -case GTK_UNIT_MM: - self = .mm + self = .none + case GTK_UNIT_POINTS: + self = .points + case GTK_UNIT_INCH: + self = .inch + case GTK_UNIT_MM: + self = .mm default: fatalError("Unsupported GtkUnit enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_UNIT_MM: public func toGtk() -> GtkUnit { switch self { case .none: - return GTK_UNIT_NONE -case .points: - return GTK_UNIT_POINTS -case .inch: - return GTK_UNIT_INCH -case .mm: - return GTK_UNIT_MM + return GTK_UNIT_NONE + case .points: + return GTK_UNIT_POINTS + case .inch: + return GTK_UNIT_INCH + case .mm: + return GTK_UNIT_MM } } -} \ No newline at end of file +} diff --git a/Sources/Gtk/Generated/WrapMode.swift b/Sources/Gtk/Generated/WrapMode.swift index 130400c5f3..2c48a3a945 100644 --- a/Sources/Gtk/Generated/WrapMode.swift +++ b/Sources/Gtk/Generated/WrapMode.swift @@ -5,31 +5,31 @@ public enum WrapMode: GValueRepresentableEnum { public typealias GtkEnum = GtkWrapMode /// Do not wrap lines; just make the text area wider -case none -/// Wrap text, breaking lines anywhere the cursor can -/// appear (between characters, usually - if you want to be technical, -/// between graphemes, see pango_get_log_attrs()) -case character -/// Wrap text, breaking lines in between words -case word -/// Wrap text, breaking lines in between words, or if -/// that is not enough, also between graphemes -case wordCharacter + case none + /// Wrap text, breaking lines anywhere the cursor can + /// appear (between characters, usually - if you want to be technical, + /// between graphemes, see pango_get_log_attrs()) + case character + /// Wrap text, breaking lines in between words + case word + /// Wrap text, breaking lines in between words, or if + /// that is not enough, also between graphemes + case wordCharacter public static var type: GType { - gtk_wrap_mode_get_type() -} + gtk_wrap_mode_get_type() + } public init(from gtkEnum: GtkWrapMode) { switch gtkEnum { case GTK_WRAP_NONE: - self = .none -case GTK_WRAP_CHAR: - self = .character -case GTK_WRAP_WORD: - self = .word -case GTK_WRAP_WORD_CHAR: - self = .wordCharacter + self = .none + case GTK_WRAP_CHAR: + self = .character + case GTK_WRAP_WORD: + self = .word + case GTK_WRAP_WORD_CHAR: + self = .wordCharacter default: fatalError("Unsupported GtkWrapMode enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ case GTK_WRAP_WORD_CHAR: public func toGtk() -> GtkWrapMode { switch self { case .none: - return GTK_WRAP_NONE -case .character: - return GTK_WRAP_CHAR -case .word: - return GTK_WRAP_WORD -case .wordCharacter: - return GTK_WRAP_WORD_CHAR + return GTK_WRAP_NONE + case .character: + return GTK_WRAP_CHAR + case .word: + return GTK_WRAP_WORD + case .wordCharacter: + return GTK_WRAP_WORD_CHAR } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/Activatable.swift b/Sources/Gtk3/Generated/Activatable.swift index 30d78be929..0a0f5fa24b 100644 --- a/Sources/Gtk3/Generated/Activatable.swift +++ b/Sources/Gtk3/Generated/Activatable.swift @@ -4,9 +4,9 @@ import CGtk3 /// the state of its action. A #GtkActivatable can also provide feedback /// through its action, as they are responsible for activating their /// related actions. -/// +/// /// # Implementing GtkActivatable -/// +/// /// When extending a class that is already #GtkActivatable; it is only /// necessary to implement the #GtkActivatable->sync_action_properties() /// and #GtkActivatable->update() methods and chain up to the parent @@ -17,29 +17,29 @@ import CGtk3 /// the action pointer and boolean flag on your instance, and calling /// gtk_activatable_do_set_related_action() and /// gtk_activatable_sync_action_properties() at the appropriate times. -/// +/// /// ## A class fragment implementing #GtkActivatable -/// +/// /// |[ -/// +/// /// enum { /// ... -/// +/// /// PROP_ACTIVATABLE_RELATED_ACTION, /// PROP_ACTIVATABLE_USE_ACTION_APPEARANCE /// } -/// +/// /// struct _FooBarPrivate /// { -/// +/// /// ... -/// +/// /// GtkAction *action; /// gboolean use_action_appearance; /// }; -/// +/// /// ... -/// +/// /// static void foo_bar_activatable_interface_init (GtkActivatableIface *iface); /// static void foo_bar_activatable_update (GtkActivatable *activatable, /// GtkAction *action, @@ -47,38 +47,38 @@ import CGtk3 /// static void foo_bar_activatable_sync_action_properties (GtkActivatable *activatable, /// GtkAction *action); /// ... -/// -/// +/// +/// /// static void /// foo_bar_class_init (FooBarClass *klass) /// { -/// +/// /// ... -/// +/// /// g_object_class_override_property (gobject_class, PROP_ACTIVATABLE_RELATED_ACTION, "related-action"); /// g_object_class_override_property (gobject_class, PROP_ACTIVATABLE_USE_ACTION_APPEARANCE, "use-action-appearance"); -/// +/// /// ... /// } -/// -/// +/// +/// /// static void /// foo_bar_activatable_interface_init (GtkActivatableIface *iface) /// { /// iface->update = foo_bar_activatable_update; /// iface->sync_action_properties = foo_bar_activatable_sync_action_properties; /// } -/// +/// /// ... Break the reference using gtk_activatable_do_set_related_action()... -/// +/// /// static void /// foo_bar_dispose (GObject *object) /// { /// FooBar *bar = FOO_BAR (object); /// FooBarPrivate *priv = FOO_BAR_GET_PRIVATE (bar); -/// +/// /// ... -/// +/// /// if (priv->action) /// { /// gtk_activatable_do_set_related_action (GTK_ACTIVATABLE (bar), NULL); @@ -86,9 +86,9 @@ import CGtk3 /// } /// G_OBJECT_CLASS (foo_bar_parent_class)->dispose (object); /// } -/// +/// /// ... Handle the “related-action” and “use-action-appearance” properties ... -/// +/// /// static void /// foo_bar_set_property (GObject *object, /// guint prop_id, @@ -97,12 +97,12 @@ import CGtk3 /// { /// FooBar *bar = FOO_BAR (object); /// FooBarPrivate *priv = FOO_BAR_GET_PRIVATE (bar); -/// +/// /// switch (prop_id) /// { -/// +/// /// ... -/// +/// /// case PROP_ACTIVATABLE_RELATED_ACTION: /// foo_bar_set_related_action (bar, g_value_get_object (value)); /// break; @@ -114,7 +114,7 @@ import CGtk3 /// break; /// } /// } -/// +/// /// static void /// foo_bar_get_property (GObject *object, /// guint prop_id, @@ -123,12 +123,12 @@ import CGtk3 /// { /// FooBar *bar = FOO_BAR (object); /// FooBarPrivate *priv = FOO_BAR_GET_PRIVATE (bar); -/// +/// /// switch (prop_id) /// { -/// +/// /// ... -/// +/// /// case PROP_ACTIVATABLE_RELATED_ACTION: /// g_value_set_object (value, priv->action); /// break; @@ -140,22 +140,22 @@ import CGtk3 /// break; /// } /// } -/// -/// +/// +/// /// static void /// foo_bar_set_use_action_appearance (FooBar *bar, /// gboolean use_appearance) /// { /// FooBarPrivate *priv = FOO_BAR_GET_PRIVATE (bar); -/// +/// /// if (priv->use_action_appearance != use_appearance) /// { /// priv->use_action_appearance = use_appearance; -/// +/// /// gtk_activatable_sync_action_properties (GTK_ACTIVATABLE (bar), priv->action); /// } /// } -/// +/// /// ... call gtk_activatable_do_set_related_action() and then assign the action pointer, /// no need to reference the action here since gtk_activatable_do_set_related_action() already /// holds a reference here for you... @@ -164,53 +164,53 @@ import CGtk3 /// GtkAction *action) /// { /// FooBarPrivate *priv = FOO_BAR_GET_PRIVATE (bar); -/// +/// /// if (priv->action == action) /// return; -/// +/// /// gtk_activatable_do_set_related_action (GTK_ACTIVATABLE (bar), action); -/// +/// /// priv->action = action; /// } -/// +/// /// ... Selectively reset and update activatable depending on the use-action-appearance property ... /// static void /// gtk_button_activatable_sync_action_properties (GtkActivatable *activatable, /// GtkAction *action) /// { /// GtkButtonPrivate *priv = GTK_BUTTON_GET_PRIVATE (activatable); -/// +/// /// if (!action) /// return; -/// +/// /// if (gtk_action_is_visible (action)) /// gtk_widget_show (GTK_WIDGET (activatable)); /// else /// gtk_widget_hide (GTK_WIDGET (activatable)); -/// +/// /// gtk_widget_set_sensitive (GTK_WIDGET (activatable), gtk_action_is_sensitive (action)); -/// +/// /// ... -/// +/// /// if (priv->use_action_appearance) /// { /// if (gtk_action_get_stock_id (action)) /// foo_bar_set_stock (button, gtk_action_get_stock_id (action)); /// else if (gtk_action_get_label (action)) /// foo_bar_set_label (button, gtk_action_get_label (action)); -/// +/// /// ... -/// +/// /// } /// } -/// +/// /// static void /// foo_bar_activatable_update (GtkActivatable *activatable, /// GtkAction *action, /// const gchar *property_name) /// { /// FooBarPrivate *priv = FOO_BAR_GET_PRIVATE (activatable); -/// +/// /// if (strcmp (property_name, "visible") == 0) /// { /// if (gtk_action_is_visible (action)) @@ -220,22 +220,20 @@ import CGtk3 /// } /// else if (strcmp (property_name, "sensitive") == 0) /// gtk_widget_set_sensitive (GTK_WIDGET (activatable), gtk_action_is_sensitive (action)); -/// +/// /// ... -/// +/// /// if (!priv->use_action_appearance) /// return; -/// +/// /// if (strcmp (property_name, "stock-id") == 0) /// foo_bar_set_stock (button, gtk_action_get_stock_id (action)); /// else if (strcmp (property_name, "label") == 0) /// foo_bar_set_label (button, gtk_action_get_label (action)); -/// +/// /// ... /// } /// ]| public protocol Activatable: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/Align.swift b/Sources/Gtk3/Generated/Align.swift index 91e31bd57b..770c4eed6a 100644 --- a/Sources/Gtk3/Generated/Align.swift +++ b/Sources/Gtk3/Generated/Align.swift @@ -2,17 +2,17 @@ import CGtk3 /// Controls how a widget deals with extra space in a single (x or y) /// dimension. -/// +/// /// Alignment only matters if the widget receives a “too large” allocation, /// for example if you packed the widget with the #GtkWidget:expand /// flag inside a #GtkBox, then the widget might get extra space. If /// you have for example a 16x16 icon inside a 32x32 space, the icon /// could be scaled and stretched, it could be centered, or it could be /// positioned to one side of the space. -/// +/// /// Note that in horizontal context @GTK_ALIGN_START and @GTK_ALIGN_END /// are interpreted relative to text direction. -/// +/// /// GTK_ALIGN_BASELINE support for it is optional for containers and widgets, and /// it is only supported for vertical alignment. When its not supported by /// a child or a container it is treated as @GTK_ALIGN_FILL. @@ -20,32 +20,32 @@ public enum Align: GValueRepresentableEnum { public typealias GtkEnum = GtkAlign /// Stretch to fill all space if possible, center if -/// no meaningful way to stretch -case fill -/// Snap to left or top side, leaving space on right -/// or bottom -case start -/// Snap to right or bottom side, leaving space on left -/// or top -case end -/// Center natural width of widget inside the -/// allocation -case center + /// no meaningful way to stretch + case fill + /// Snap to left or top side, leaving space on right + /// or bottom + case start + /// Snap to right or bottom side, leaving space on left + /// or top + case end + /// Center natural width of widget inside the + /// allocation + case center public static var type: GType { - gtk_align_get_type() -} + gtk_align_get_type() + } public init(from gtkEnum: GtkAlign) { switch gtkEnum { case GTK_ALIGN_FILL: - self = .fill -case GTK_ALIGN_START: - self = .start -case GTK_ALIGN_END: - self = .end -case GTK_ALIGN_CENTER: - self = .center + self = .fill + case GTK_ALIGN_START: + self = .start + case GTK_ALIGN_END: + self = .end + case GTK_ALIGN_CENTER: + self = .center default: fatalError("Unsupported GtkAlign enum value: \(gtkEnum.rawValue)") } @@ -54,13 +54,13 @@ case GTK_ALIGN_CENTER: public func toGtk() -> GtkAlign { switch self { case .fill: - return GTK_ALIGN_FILL -case .start: - return GTK_ALIGN_START -case .end: - return GTK_ALIGN_END -case .center: - return GTK_ALIGN_CENTER + return GTK_ALIGN_FILL + case .start: + return GTK_ALIGN_START + case .end: + return GTK_ALIGN_END + case .center: + return GTK_ALIGN_CENTER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/AppChooser.swift b/Sources/Gtk3/Generated/AppChooser.swift index f3001c334c..a0fdc1fe31 100644 --- a/Sources/Gtk3/Generated/AppChooser.swift +++ b/Sources/Gtk3/Generated/AppChooser.swift @@ -4,7 +4,7 @@ import CGtk3 /// allow the user to choose an application (typically for the purpose of /// opening a file). The main objects that implement this interface are /// #GtkAppChooserWidget, #GtkAppChooserDialog and #GtkAppChooserButton. -/// +/// /// Applications are represented by GIO #GAppInfo objects here. /// GIO has a concept of recommended and fallback applications for a /// given content type. Recommended applications are those that claim @@ -14,15 +14,14 @@ import CGtk3 /// type. The #GtkAppChooserWidget provides detailed control over /// whether the shown list of applications should include default, /// recommended or fallback applications. -/// +/// /// To obtain the application that has been selected in a #GtkAppChooser, /// use gtk_app_chooser_get_app_info(). public protocol AppChooser: GObjectRepresentable { /// The content type of the #GtkAppChooser object. -/// -/// See [GContentType][gio-GContentType] -/// for more information about content types. -var contentType: String { get set } + /// + /// See [GContentType][gio-GContentType] + /// for more information about content types. + var contentType: String { get set } - -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/ArrowPlacement.swift b/Sources/Gtk3/Generated/ArrowPlacement.swift index 5c7a1cd61f..ac390d8a7d 100644 --- a/Sources/Gtk3/Generated/ArrowPlacement.swift +++ b/Sources/Gtk3/Generated/ArrowPlacement.swift @@ -5,24 +5,24 @@ public enum ArrowPlacement: GValueRepresentableEnum { public typealias GtkEnum = GtkArrowPlacement /// Place one arrow on each end of the menu. -case both -/// Place both arrows at the top of the menu. -case start -/// Place both arrows at the bottom of the menu. -case end + case both + /// Place both arrows at the top of the menu. + case start + /// Place both arrows at the bottom of the menu. + case end public static var type: GType { - gtk_arrow_placement_get_type() -} + gtk_arrow_placement_get_type() + } public init(from gtkEnum: GtkArrowPlacement) { switch gtkEnum { case GTK_ARROWS_BOTH: - self = .both -case GTK_ARROWS_START: - self = .start -case GTK_ARROWS_END: - self = .end + self = .both + case GTK_ARROWS_START: + self = .start + case GTK_ARROWS_END: + self = .end default: fatalError("Unsupported GtkArrowPlacement enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ case GTK_ARROWS_END: public func toGtk() -> GtkArrowPlacement { switch self { case .both: - return GTK_ARROWS_BOTH -case .start: - return GTK_ARROWS_START -case .end: - return GTK_ARROWS_END + return GTK_ARROWS_BOTH + case .start: + return GTK_ARROWS_START + case .end: + return GTK_ARROWS_END } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/ArrowType.swift b/Sources/Gtk3/Generated/ArrowType.swift index f0d1ee7180..5f09e23030 100644 --- a/Sources/Gtk3/Generated/ArrowType.swift +++ b/Sources/Gtk3/Generated/ArrowType.swift @@ -5,28 +5,28 @@ public enum ArrowType: GValueRepresentableEnum { public typealias GtkEnum = GtkArrowType /// Represents an upward pointing arrow. -case up -/// Represents a downward pointing arrow. -case down -/// Represents a left pointing arrow. -case left -/// Represents a right pointing arrow. -case right + case up + /// Represents a downward pointing arrow. + case down + /// Represents a left pointing arrow. + case left + /// Represents a right pointing arrow. + case right public static var type: GType { - gtk_arrow_type_get_type() -} + gtk_arrow_type_get_type() + } public init(from gtkEnum: GtkArrowType) { switch gtkEnum { case GTK_ARROW_UP: - self = .up -case GTK_ARROW_DOWN: - self = .down -case GTK_ARROW_LEFT: - self = .left -case GTK_ARROW_RIGHT: - self = .right + self = .up + case GTK_ARROW_DOWN: + self = .down + case GTK_ARROW_LEFT: + self = .left + case GTK_ARROW_RIGHT: + self = .right default: fatalError("Unsupported GtkArrowType enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_ARROW_RIGHT: public func toGtk() -> GtkArrowType { switch self { case .up: - return GTK_ARROW_UP -case .down: - return GTK_ARROW_DOWN -case .left: - return GTK_ARROW_LEFT -case .right: - return GTK_ARROW_RIGHT + return GTK_ARROW_UP + case .down: + return GTK_ARROW_DOWN + case .left: + return GTK_ARROW_LEFT + case .right: + return GTK_ARROW_RIGHT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/AssistantPageType.swift b/Sources/Gtk3/Generated/AssistantPageType.swift index ce95f8d607..2d4ffb924b 100644 --- a/Sources/Gtk3/Generated/AssistantPageType.swift +++ b/Sources/Gtk3/Generated/AssistantPageType.swift @@ -2,56 +2,56 @@ import CGtk3 /// An enum for determining the page role inside the #GtkAssistant. It's /// used to handle buttons sensitivity and visibility. -/// +/// /// Note that an assistant needs to end its page flow with a page of type /// %GTK_ASSISTANT_PAGE_CONFIRM, %GTK_ASSISTANT_PAGE_SUMMARY or /// %GTK_ASSISTANT_PAGE_PROGRESS to be correct. -/// +/// /// The Cancel button will only be shown if the page isn’t “committed”. /// See gtk_assistant_commit() for details. public enum AssistantPageType: GValueRepresentableEnum { public typealias GtkEnum = GtkAssistantPageType /// The page has regular contents. Both the -/// Back and forward buttons will be shown. -case content -/// The page contains an introduction to the -/// assistant task. Only the Forward button will be shown if there is a -/// next page. -case intro -/// The page lets the user confirm or deny the -/// changes. The Back and Apply buttons will be shown. -case confirm -/// The page informs the user of the changes -/// done. Only the Close button will be shown. -case summary -/// Used for tasks that take a long time to -/// complete, blocks the assistant until the page is marked as complete. -/// Only the back button will be shown. -case progress -/// Used for when other page types are not -/// appropriate. No buttons will be shown, and the application must -/// add its own buttons through gtk_assistant_add_action_widget(). -case custom + /// Back and forward buttons will be shown. + case content + /// The page contains an introduction to the + /// assistant task. Only the Forward button will be shown if there is a + /// next page. + case intro + /// The page lets the user confirm or deny the + /// changes. The Back and Apply buttons will be shown. + case confirm + /// The page informs the user of the changes + /// done. Only the Close button will be shown. + case summary + /// Used for tasks that take a long time to + /// complete, blocks the assistant until the page is marked as complete. + /// Only the back button will be shown. + case progress + /// Used for when other page types are not + /// appropriate. No buttons will be shown, and the application must + /// add its own buttons through gtk_assistant_add_action_widget(). + case custom public static var type: GType { - gtk_assistant_page_type_get_type() -} + gtk_assistant_page_type_get_type() + } public init(from gtkEnum: GtkAssistantPageType) { switch gtkEnum { case GTK_ASSISTANT_PAGE_CONTENT: - self = .content -case GTK_ASSISTANT_PAGE_INTRO: - self = .intro -case GTK_ASSISTANT_PAGE_CONFIRM: - self = .confirm -case GTK_ASSISTANT_PAGE_SUMMARY: - self = .summary -case GTK_ASSISTANT_PAGE_PROGRESS: - self = .progress -case GTK_ASSISTANT_PAGE_CUSTOM: - self = .custom + self = .content + case GTK_ASSISTANT_PAGE_INTRO: + self = .intro + case GTK_ASSISTANT_PAGE_CONFIRM: + self = .confirm + case GTK_ASSISTANT_PAGE_SUMMARY: + self = .summary + case GTK_ASSISTANT_PAGE_PROGRESS: + self = .progress + case GTK_ASSISTANT_PAGE_CUSTOM: + self = .custom default: fatalError("Unsupported GtkAssistantPageType enum value: \(gtkEnum.rawValue)") } @@ -60,17 +60,17 @@ case GTK_ASSISTANT_PAGE_CUSTOM: public func toGtk() -> GtkAssistantPageType { switch self { case .content: - return GTK_ASSISTANT_PAGE_CONTENT -case .intro: - return GTK_ASSISTANT_PAGE_INTRO -case .confirm: - return GTK_ASSISTANT_PAGE_CONFIRM -case .summary: - return GTK_ASSISTANT_PAGE_SUMMARY -case .progress: - return GTK_ASSISTANT_PAGE_PROGRESS -case .custom: - return GTK_ASSISTANT_PAGE_CUSTOM + return GTK_ASSISTANT_PAGE_CONTENT + case .intro: + return GTK_ASSISTANT_PAGE_INTRO + case .confirm: + return GTK_ASSISTANT_PAGE_CONFIRM + case .summary: + return GTK_ASSISTANT_PAGE_SUMMARY + case .progress: + return GTK_ASSISTANT_PAGE_PROGRESS + case .custom: + return GTK_ASSISTANT_PAGE_CUSTOM } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/BorderStyle.swift b/Sources/Gtk3/Generated/BorderStyle.swift index 44d5061148..f936509138 100644 --- a/Sources/Gtk3/Generated/BorderStyle.swift +++ b/Sources/Gtk3/Generated/BorderStyle.swift @@ -5,52 +5,52 @@ public enum BorderStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkBorderStyle /// No visible border -case none -/// A single line segment -case solid -/// Looks as if the content is sunken into the canvas -case inset -/// Looks as if the content is coming out of the canvas -case outset -/// Same as @GTK_BORDER_STYLE_NONE -case hidden -/// A series of round dots -case dotted -/// A series of square-ended dashes -case dashed -/// Two parallel lines with some space between them -case double -/// Looks as if it were carved in the canvas -case groove -/// Looks as if it were coming out of the canvas -case ridge + case none + /// A single line segment + case solid + /// Looks as if the content is sunken into the canvas + case inset + /// Looks as if the content is coming out of the canvas + case outset + /// Same as @GTK_BORDER_STYLE_NONE + case hidden + /// A series of round dots + case dotted + /// A series of square-ended dashes + case dashed + /// Two parallel lines with some space between them + case double + /// Looks as if it were carved in the canvas + case groove + /// Looks as if it were coming out of the canvas + case ridge public static var type: GType { - gtk_border_style_get_type() -} + gtk_border_style_get_type() + } public init(from gtkEnum: GtkBorderStyle) { switch gtkEnum { case GTK_BORDER_STYLE_NONE: - self = .none -case GTK_BORDER_STYLE_SOLID: - self = .solid -case GTK_BORDER_STYLE_INSET: - self = .inset -case GTK_BORDER_STYLE_OUTSET: - self = .outset -case GTK_BORDER_STYLE_HIDDEN: - self = .hidden -case GTK_BORDER_STYLE_DOTTED: - self = .dotted -case GTK_BORDER_STYLE_DASHED: - self = .dashed -case GTK_BORDER_STYLE_DOUBLE: - self = .double -case GTK_BORDER_STYLE_GROOVE: - self = .groove -case GTK_BORDER_STYLE_RIDGE: - self = .ridge + self = .none + case GTK_BORDER_STYLE_SOLID: + self = .solid + case GTK_BORDER_STYLE_INSET: + self = .inset + case GTK_BORDER_STYLE_OUTSET: + self = .outset + case GTK_BORDER_STYLE_HIDDEN: + self = .hidden + case GTK_BORDER_STYLE_DOTTED: + self = .dotted + case GTK_BORDER_STYLE_DASHED: + self = .dashed + case GTK_BORDER_STYLE_DOUBLE: + self = .double + case GTK_BORDER_STYLE_GROOVE: + self = .groove + case GTK_BORDER_STYLE_RIDGE: + self = .ridge default: fatalError("Unsupported GtkBorderStyle enum value: \(gtkEnum.rawValue)") } @@ -59,25 +59,25 @@ case GTK_BORDER_STYLE_RIDGE: public func toGtk() -> GtkBorderStyle { switch self { case .none: - return GTK_BORDER_STYLE_NONE -case .solid: - return GTK_BORDER_STYLE_SOLID -case .inset: - return GTK_BORDER_STYLE_INSET -case .outset: - return GTK_BORDER_STYLE_OUTSET -case .hidden: - return GTK_BORDER_STYLE_HIDDEN -case .dotted: - return GTK_BORDER_STYLE_DOTTED -case .dashed: - return GTK_BORDER_STYLE_DASHED -case .double: - return GTK_BORDER_STYLE_DOUBLE -case .groove: - return GTK_BORDER_STYLE_GROOVE -case .ridge: - return GTK_BORDER_STYLE_RIDGE + return GTK_BORDER_STYLE_NONE + case .solid: + return GTK_BORDER_STYLE_SOLID + case .inset: + return GTK_BORDER_STYLE_INSET + case .outset: + return GTK_BORDER_STYLE_OUTSET + case .hidden: + return GTK_BORDER_STYLE_HIDDEN + case .dotted: + return GTK_BORDER_STYLE_DOTTED + case .dashed: + return GTK_BORDER_STYLE_DASHED + case .double: + return GTK_BORDER_STYLE_DOUBLE + case .groove: + return GTK_BORDER_STYLE_GROOVE + case .ridge: + return GTK_BORDER_STYLE_RIDGE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/Buildable.swift b/Sources/Gtk3/Generated/Buildable.swift index d182346df3..a5b23b8147 100644 --- a/Sources/Gtk3/Generated/Buildable.swift +++ b/Sources/Gtk3/Generated/Buildable.swift @@ -4,16 +4,14 @@ import CGtk3 /// from [GtkBuilder UI descriptions][BUILDER-UI]. /// The interface includes methods for setting names and properties of objects, /// parsing custom tags and constructing child objects. -/// +/// /// The GtkBuildable interface is implemented by all widgets and /// many of the non-widget objects that are provided by GTK+. The /// main user of this interface is #GtkBuilder. There should be /// very little need for applications to call any of these functions directly. -/// +/// /// An object only needs to implement this interface if it needs to extend the /// #GtkBuilder format or run any extra routines at deserialization time. public protocol Buildable: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/BuilderError.swift b/Sources/Gtk3/Generated/BuilderError.swift index eac88a005d..75f34e2ec0 100644 --- a/Sources/Gtk3/Generated/BuilderError.swift +++ b/Sources/Gtk3/Generated/BuilderError.swift @@ -6,77 +6,77 @@ public enum BuilderError: GValueRepresentableEnum { public typealias GtkEnum = GtkBuilderError /// A type-func attribute didn’t name -/// a function that returns a #GType. -case invalidTypeFunction -/// The input contained a tag that #GtkBuilder -/// can’t handle. -case unhandledTag -/// An attribute that is required by -/// #GtkBuilder was missing. -case missingAttribute -/// #GtkBuilder found an attribute that -/// it doesn’t understand. -case invalidAttribute -/// #GtkBuilder found a tag that -/// it doesn’t understand. -case invalidTag -/// A required property value was -/// missing. -case missingPropertyValue -/// #GtkBuilder couldn’t parse -/// some attribute value. -case invalidValue -/// The input file requires a newer version -/// of GTK+. -case versionMismatch -/// An object id occurred twice. -case duplicateId -/// A specified object type is of the same type or -/// derived from the type of the composite class being extended with builder XML. -case objectTypeRefused -/// The wrong type was specified in a composite class’s template XML -case templateMismatch -/// The specified property is unknown for the object class. -case invalidProperty -/// The specified signal is unknown for the object class. -case invalidSignal -/// An object id is unknown -case invalidId + /// a function that returns a #GType. + case invalidTypeFunction + /// The input contained a tag that #GtkBuilder + /// can’t handle. + case unhandledTag + /// An attribute that is required by + /// #GtkBuilder was missing. + case missingAttribute + /// #GtkBuilder found an attribute that + /// it doesn’t understand. + case invalidAttribute + /// #GtkBuilder found a tag that + /// it doesn’t understand. + case invalidTag + /// A required property value was + /// missing. + case missingPropertyValue + /// #GtkBuilder couldn’t parse + /// some attribute value. + case invalidValue + /// The input file requires a newer version + /// of GTK+. + case versionMismatch + /// An object id occurred twice. + case duplicateId + /// A specified object type is of the same type or + /// derived from the type of the composite class being extended with builder XML. + case objectTypeRefused + /// The wrong type was specified in a composite class’s template XML + case templateMismatch + /// The specified property is unknown for the object class. + case invalidProperty + /// The specified signal is unknown for the object class. + case invalidSignal + /// An object id is unknown + case invalidId public static var type: GType { - gtk_builder_error_get_type() -} + gtk_builder_error_get_type() + } public init(from gtkEnum: GtkBuilderError) { switch gtkEnum { case GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION: - self = .invalidTypeFunction -case GTK_BUILDER_ERROR_UNHANDLED_TAG: - self = .unhandledTag -case GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: - self = .missingAttribute -case GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: - self = .invalidAttribute -case GTK_BUILDER_ERROR_INVALID_TAG: - self = .invalidTag -case GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: - self = .missingPropertyValue -case GTK_BUILDER_ERROR_INVALID_VALUE: - self = .invalidValue -case GTK_BUILDER_ERROR_VERSION_MISMATCH: - self = .versionMismatch -case GTK_BUILDER_ERROR_DUPLICATE_ID: - self = .duplicateId -case GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED: - self = .objectTypeRefused -case GTK_BUILDER_ERROR_TEMPLATE_MISMATCH: - self = .templateMismatch -case GTK_BUILDER_ERROR_INVALID_PROPERTY: - self = .invalidProperty -case GTK_BUILDER_ERROR_INVALID_SIGNAL: - self = .invalidSignal -case GTK_BUILDER_ERROR_INVALID_ID: - self = .invalidId + self = .invalidTypeFunction + case GTK_BUILDER_ERROR_UNHANDLED_TAG: + self = .unhandledTag + case GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: + self = .missingAttribute + case GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: + self = .invalidAttribute + case GTK_BUILDER_ERROR_INVALID_TAG: + self = .invalidTag + case GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: + self = .missingPropertyValue + case GTK_BUILDER_ERROR_INVALID_VALUE: + self = .invalidValue + case GTK_BUILDER_ERROR_VERSION_MISMATCH: + self = .versionMismatch + case GTK_BUILDER_ERROR_DUPLICATE_ID: + self = .duplicateId + case GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED: + self = .objectTypeRefused + case GTK_BUILDER_ERROR_TEMPLATE_MISMATCH: + self = .templateMismatch + case GTK_BUILDER_ERROR_INVALID_PROPERTY: + self = .invalidProperty + case GTK_BUILDER_ERROR_INVALID_SIGNAL: + self = .invalidSignal + case GTK_BUILDER_ERROR_INVALID_ID: + self = .invalidId default: fatalError("Unsupported GtkBuilderError enum value: \(gtkEnum.rawValue)") } @@ -85,33 +85,33 @@ case GTK_BUILDER_ERROR_INVALID_ID: public func toGtk() -> GtkBuilderError { switch self { case .invalidTypeFunction: - return GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION -case .unhandledTag: - return GTK_BUILDER_ERROR_UNHANDLED_TAG -case .missingAttribute: - return GTK_BUILDER_ERROR_MISSING_ATTRIBUTE -case .invalidAttribute: - return GTK_BUILDER_ERROR_INVALID_ATTRIBUTE -case .invalidTag: - return GTK_BUILDER_ERROR_INVALID_TAG -case .missingPropertyValue: - return GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE -case .invalidValue: - return GTK_BUILDER_ERROR_INVALID_VALUE -case .versionMismatch: - return GTK_BUILDER_ERROR_VERSION_MISMATCH -case .duplicateId: - return GTK_BUILDER_ERROR_DUPLICATE_ID -case .objectTypeRefused: - return GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED -case .templateMismatch: - return GTK_BUILDER_ERROR_TEMPLATE_MISMATCH -case .invalidProperty: - return GTK_BUILDER_ERROR_INVALID_PROPERTY -case .invalidSignal: - return GTK_BUILDER_ERROR_INVALID_SIGNAL -case .invalidId: - return GTK_BUILDER_ERROR_INVALID_ID + return GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION + case .unhandledTag: + return GTK_BUILDER_ERROR_UNHANDLED_TAG + case .missingAttribute: + return GTK_BUILDER_ERROR_MISSING_ATTRIBUTE + case .invalidAttribute: + return GTK_BUILDER_ERROR_INVALID_ATTRIBUTE + case .invalidTag: + return GTK_BUILDER_ERROR_INVALID_TAG + case .missingPropertyValue: + return GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE + case .invalidValue: + return GTK_BUILDER_ERROR_INVALID_VALUE + case .versionMismatch: + return GTK_BUILDER_ERROR_VERSION_MISMATCH + case .duplicateId: + return GTK_BUILDER_ERROR_DUPLICATE_ID + case .objectTypeRefused: + return GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED + case .templateMismatch: + return GTK_BUILDER_ERROR_TEMPLATE_MISMATCH + case .invalidProperty: + return GTK_BUILDER_ERROR_INVALID_PROPERTY + case .invalidSignal: + return GTK_BUILDER_ERROR_INVALID_SIGNAL + case .invalidId: + return GTK_BUILDER_ERROR_INVALID_ID } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/Button.swift b/Sources/Gtk3/Generated/Button.swift index 37bfd15f4d..59a967469c 100644 --- a/Sources/Gtk3/Generated/Button.swift +++ b/Sources/Gtk3/Generated/Button.swift @@ -3,275 +3,282 @@ import CGtk3 /// The #GtkButton widget is generally used to trigger a callback function that is /// called when the button is pressed. The various signals and how to use them /// are outlined below. -/// +/// /// The #GtkButton widget can hold any valid child widget. That is, it can hold /// almost any other standard #GtkWidget. The most commonly used child is the /// #GtkLabel. -/// +/// /// # CSS nodes -/// +/// /// GtkButton has a single CSS node with name button. The node will get the /// style classes .image-button or .text-button, if the content is just an /// image or label, respectively. It may also receive the .flat style class. -/// +/// /// Other style classes that are commonly used with GtkButton include /// .suggested-action and .destructive-action. In special cases, buttons /// can be made round by adding the .circular style class. -/// +/// /// Button-like widgets like #GtkToggleButton, #GtkMenuButton, #GtkVolumeButton, /// #GtkLockButton, #GtkColorButton, #GtkFontButton or #GtkFileChooserButton use /// style classes such as .toggle, .popup, .scale, .lock, .color, .font, .file /// to differentiate themselves from a plain GtkButton. open class Button: Bin, Activatable { /// Creates a new #GtkButton widget. To add a child widget to the button, -/// use gtk_container_add(). -public convenience init() { - self.init( - gtk_button_new() - ) -} - -/// Creates a new button containing an icon from the current icon theme. -/// -/// If the icon name isn’t known, a “broken image” icon will be -/// displayed instead. If the current icon theme is changed, the icon -/// will be updated appropriately. -/// -/// This function is a convenience wrapper around gtk_button_new() and -/// gtk_button_set_image(). -public convenience init(iconName: String, size: GtkIconSize) { - self.init( - gtk_button_new_from_icon_name(iconName, size) - ) -} - -/// Creates a #GtkButton widget with a #GtkLabel child containing the given -/// text. -public convenience init(label: String) { - self.init( - gtk_button_new_with_label(label) - ) -} - -/// Creates a new #GtkButton containing a label. -/// If characters in @label are preceded by an underscore, they are underlined. -/// If you need a literal underscore character in a label, use “__” (two -/// underscores). The first underlined character represents a keyboard -/// accelerator called a mnemonic. -/// Pressing Alt and that key activates the button. -public convenience init(mnemonic label: String) { - self.init( - gtk_button_new_with_mnemonic(label) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) -} - -addSignal(name: "clicked") { [weak self] () in - guard let self = self else { return } - self.clicked?(self) -} - -addSignal(name: "enter") { [weak self] () in - guard let self = self else { return } - self.enter?(self) -} - -addSignal(name: "leave") { [weak self] () in - guard let self = self else { return } - self.leave?(self) -} - -addSignal(name: "pressed") { [weak self] () in - guard let self = self else { return } - self.pressed?(self) -} - -addSignal(name: "released") { [weak self] () in - guard let self = self else { return } - self.released?(self) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// use gtk_container_add(). + public convenience init() { + self.init( + gtk_button_new() + ) } -addSignal(name: "notify::always-show-image", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAlwaysShowImage?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new button containing an icon from the current icon theme. + /// + /// If the icon name isn’t known, a “broken image” icon will be + /// displayed instead. If the current icon theme is changed, the icon + /// will be updated appropriately. + /// + /// This function is a convenience wrapper around gtk_button_new() and + /// gtk_button_set_image(). + public convenience init(iconName: String, size: GtkIconSize) { + self.init( + gtk_button_new_from_icon_name(iconName, size) + ) } -addSignal(name: "notify::image", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyImage?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a #GtkButton widget with a #GtkLabel child containing the given + /// text. + public convenience init(label: String) { + self.init( + gtk_button_new_with_label(label) + ) } -addSignal(name: "notify::image-position", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyImagePosition?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new #GtkButton containing a label. + /// If characters in @label are preceded by an underscore, they are underlined. + /// If you need a literal underscore character in a label, use “__” (two + /// underscores). The first underlined character represents a keyboard + /// accelerator called a mnemonic. + /// Pressing Alt and that key activates the button. + public convenience init(mnemonic label: String) { + self.init( + gtk_button_new_with_mnemonic(label) + ) } -addSignal(name: "notify::label", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLabel?(self, param0) -} - -let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) + } + + addSignal(name: "clicked") { [weak self] () in + guard let self = self else { return } + self.clicked?(self) + } + + addSignal(name: "enter") { [weak self] () in + guard let self = self else { return } + self.enter?(self) + } + + addSignal(name: "leave") { [weak self] () in + guard let self = self else { return } + self.leave?(self) + } + + addSignal(name: "pressed") { [weak self] () in + guard let self = self else { return } + self.pressed?(self) + } + + addSignal(name: "released") { [weak self] () in + guard let self = self else { return } + self.released?(self) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::always-show-image", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAlwaysShowImage?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::image", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyImage?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::image-position", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyImagePosition?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::label", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLabel?(self, param0) + } + + let handler10: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::relief", handler: gCallback(handler10)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyRelief?(self, param0) + } + + let handler11: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-stock", handler: gCallback(handler11)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseStock?(self, param0) + } + + let handler12: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-underline", handler: gCallback(handler12)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseUnderline?(self, param0) + } + + let handler13: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::xalign", handler: gCallback(handler13)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyXalign?(self, param0) + } + + let handler14: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::yalign", handler: gCallback(handler14)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyYalign?(self, param0) + } + + let handler15: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::related-action", handler: gCallback(handler15)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyRelatedAction?(self, param0) + } + + let handler16: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-action-appearance", handler: gCallback(handler16)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseActionAppearance?(self, param0) + } } -addSignal(name: "notify::relief", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyRelief?(self, param0) -} + @GObjectProperty(named: "label") public var label: String -let handler11: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + @GObjectProperty(named: "relief") public var relief: ReliefStyle -addSignal(name: "notify::use-stock", handler: gCallback(handler11)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseStock?(self, param0) -} + @GObjectProperty(named: "use-stock") public var useStock: Bool -let handler12: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + @GObjectProperty(named: "use-underline") public var useUnderline: Bool -addSignal(name: "notify::use-underline", handler: gCallback(handler12)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseUnderline?(self, param0) -} + /// The ::activate signal on GtkButton is an action signal and + /// emitting it causes the button to animate press then release. + /// Applications should never connect to this signal, but use the + /// #GtkButton::clicked signal. + public var activate: ((Button) -> Void)? -let handler13: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + /// Emitted when the button has been activated (pressed and released). + public var clicked: ((Button) -> Void)? -addSignal(name: "notify::xalign", handler: gCallback(handler13)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyXalign?(self, param0) -} - -let handler14: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::yalign", handler: gCallback(handler14)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyYalign?(self, param0) -} - -let handler15: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::related-action", handler: gCallback(handler15)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyRelatedAction?(self, param0) -} - -let handler16: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::use-action-appearance", handler: gCallback(handler16)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseActionAppearance?(self, param0) -} -} - - -@GObjectProperty(named: "label") public var label: String - - -@GObjectProperty(named: "relief") public var relief: ReliefStyle - - -@GObjectProperty(named: "use-stock") public var useStock: Bool + /// Emitted when the pointer enters the button. + public var enter: ((Button) -> Void)? + /// Emitted when the pointer leaves the button. + public var leave: ((Button) -> Void)? -@GObjectProperty(named: "use-underline") public var useUnderline: Bool + /// Emitted when the button is pressed. + public var pressed: ((Button) -> Void)? -/// The ::activate signal on GtkButton is an action signal and -/// emitting it causes the button to animate press then release. -/// Applications should never connect to this signal, but use the -/// #GtkButton::clicked signal. -public var activate: ((Button) -> Void)? + /// Emitted when the button is released. + public var released: ((Button) -> Void)? -/// Emitted when the button has been activated (pressed and released). -public var clicked: ((Button) -> Void)? + public var notifyAlwaysShowImage: ((Button, OpaquePointer) -> Void)? -/// Emitted when the pointer enters the button. -public var enter: ((Button) -> Void)? + public var notifyImage: ((Button, OpaquePointer) -> Void)? -/// Emitted when the pointer leaves the button. -public var leave: ((Button) -> Void)? + public var notifyImagePosition: ((Button, OpaquePointer) -> Void)? -/// Emitted when the button is pressed. -public var pressed: ((Button) -> Void)? + public var notifyLabel: ((Button, OpaquePointer) -> Void)? -/// Emitted when the button is released. -public var released: ((Button) -> Void)? + public var notifyRelief: ((Button, OpaquePointer) -> Void)? + public var notifyUseStock: ((Button, OpaquePointer) -> Void)? -public var notifyAlwaysShowImage: ((Button, OpaquePointer) -> Void)? + public var notifyUseUnderline: ((Button, OpaquePointer) -> Void)? + public var notifyXalign: ((Button, OpaquePointer) -> Void)? -public var notifyImage: ((Button, OpaquePointer) -> Void)? + public var notifyYalign: ((Button, OpaquePointer) -> Void)? + public var notifyRelatedAction: ((Button, OpaquePointer) -> Void)? -public var notifyImagePosition: ((Button, OpaquePointer) -> Void)? - - -public var notifyLabel: ((Button, OpaquePointer) -> Void)? - - -public var notifyRelief: ((Button, OpaquePointer) -> Void)? - - -public var notifyUseStock: ((Button, OpaquePointer) -> Void)? - - -public var notifyUseUnderline: ((Button, OpaquePointer) -> Void)? - - -public var notifyXalign: ((Button, OpaquePointer) -> Void)? - - -public var notifyYalign: ((Button, OpaquePointer) -> Void)? - - -public var notifyRelatedAction: ((Button, OpaquePointer) -> Void)? - - -public var notifyUseActionAppearance: ((Button, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyUseActionAppearance: ((Button, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk3/Generated/ButtonBoxStyle.swift b/Sources/Gtk3/Generated/ButtonBoxStyle.swift index 77fc269bea..5eb0a30447 100644 --- a/Sources/Gtk3/Generated/ButtonBoxStyle.swift +++ b/Sources/Gtk3/Generated/ButtonBoxStyle.swift @@ -6,30 +6,30 @@ public enum ButtonBoxStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkButtonBoxStyle /// Buttons are evenly spread across the box. -case spread -/// Buttons are placed at the edges of the box. -case edge -/// Buttons are grouped towards the start of the box, -/// (on the left for a HBox, or the top for a VBox). -case start -/// Buttons are grouped towards the end of the box, -/// (on the right for a HBox, or the bottom for a VBox). -case end + case spread + /// Buttons are placed at the edges of the box. + case edge + /// Buttons are grouped towards the start of the box, + /// (on the left for a HBox, or the top for a VBox). + case start + /// Buttons are grouped towards the end of the box, + /// (on the right for a HBox, or the bottom for a VBox). + case end public static var type: GType { - gtk_button_box_style_get_type() -} + gtk_button_box_style_get_type() + } public init(from gtkEnum: GtkButtonBoxStyle) { switch gtkEnum { case GTK_BUTTONBOX_SPREAD: - self = .spread -case GTK_BUTTONBOX_EDGE: - self = .edge -case GTK_BUTTONBOX_START: - self = .start -case GTK_BUTTONBOX_END: - self = .end + self = .spread + case GTK_BUTTONBOX_EDGE: + self = .edge + case GTK_BUTTONBOX_START: + self = .start + case GTK_BUTTONBOX_END: + self = .end default: fatalError("Unsupported GtkButtonBoxStyle enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ case GTK_BUTTONBOX_END: public func toGtk() -> GtkButtonBoxStyle { switch self { case .spread: - return GTK_BUTTONBOX_SPREAD -case .edge: - return GTK_BUTTONBOX_EDGE -case .start: - return GTK_BUTTONBOX_START -case .end: - return GTK_BUTTONBOX_END + return GTK_BUTTONBOX_SPREAD + case .edge: + return GTK_BUTTONBOX_EDGE + case .start: + return GTK_BUTTONBOX_START + case .end: + return GTK_BUTTONBOX_END } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/ButtonRole.swift b/Sources/Gtk3/Generated/ButtonRole.swift index 587cb7b181..7250dfdc76 100644 --- a/Sources/Gtk3/Generated/ButtonRole.swift +++ b/Sources/Gtk3/Generated/ButtonRole.swift @@ -5,24 +5,24 @@ public enum ButtonRole: GValueRepresentableEnum { public typealias GtkEnum = GtkButtonRole /// A plain button -case normal -/// A check button -case check -/// A radio button -case radio + case normal + /// A check button + case check + /// A radio button + case radio public static var type: GType { - gtk_button_role_get_type() -} + gtk_button_role_get_type() + } public init(from gtkEnum: GtkButtonRole) { switch gtkEnum { case GTK_BUTTON_ROLE_NORMAL: - self = .normal -case GTK_BUTTON_ROLE_CHECK: - self = .check -case GTK_BUTTON_ROLE_RADIO: - self = .radio + self = .normal + case GTK_BUTTON_ROLE_CHECK: + self = .check + case GTK_BUTTON_ROLE_RADIO: + self = .radio default: fatalError("Unsupported GtkButtonRole enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ case GTK_BUTTON_ROLE_RADIO: public func toGtk() -> GtkButtonRole { switch self { case .normal: - return GTK_BUTTON_ROLE_NORMAL -case .check: - return GTK_BUTTON_ROLE_CHECK -case .radio: - return GTK_BUTTON_ROLE_RADIO + return GTK_BUTTON_ROLE_NORMAL + case .check: + return GTK_BUTTON_ROLE_CHECK + case .radio: + return GTK_BUTTON_ROLE_RADIO } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/ButtonsType.swift b/Sources/Gtk3/Generated/ButtonsType.swift index 84ed314282..e32ccf9b4e 100644 --- a/Sources/Gtk3/Generated/ButtonsType.swift +++ b/Sources/Gtk3/Generated/ButtonsType.swift @@ -3,7 +3,7 @@ import CGtk3 /// Prebuilt sets of buttons for the dialog. If /// none of these choices are appropriate, simply use %GTK_BUTTONS_NONE /// then call gtk_dialog_add_buttons(). -/// +/// /// > Please note that %GTK_BUTTONS_OK, %GTK_BUTTONS_YES_NO /// > and %GTK_BUTTONS_OK_CANCEL are discouraged by the /// > [GNOME Human Interface Guidelines](http://library.gnome.org/devel/hig-book/stable/). @@ -11,36 +11,36 @@ public enum ButtonsType: GValueRepresentableEnum { public typealias GtkEnum = GtkButtonsType /// No buttons at all -case none -/// An OK button -case ok -/// A Close button -case close -/// A Cancel button -case cancel -/// Yes and No buttons -case yesNo -/// OK and Cancel buttons -case okCancel + case none + /// An OK button + case ok + /// A Close button + case close + /// A Cancel button + case cancel + /// Yes and No buttons + case yesNo + /// OK and Cancel buttons + case okCancel public static var type: GType { - gtk_buttons_type_get_type() -} + gtk_buttons_type_get_type() + } public init(from gtkEnum: GtkButtonsType) { switch gtkEnum { case GTK_BUTTONS_NONE: - self = .none -case GTK_BUTTONS_OK: - self = .ok -case GTK_BUTTONS_CLOSE: - self = .close -case GTK_BUTTONS_CANCEL: - self = .cancel -case GTK_BUTTONS_YES_NO: - self = .yesNo -case GTK_BUTTONS_OK_CANCEL: - self = .okCancel + self = .none + case GTK_BUTTONS_OK: + self = .ok + case GTK_BUTTONS_CLOSE: + self = .close + case GTK_BUTTONS_CANCEL: + self = .cancel + case GTK_BUTTONS_YES_NO: + self = .yesNo + case GTK_BUTTONS_OK_CANCEL: + self = .okCancel default: fatalError("Unsupported GtkButtonsType enum value: \(gtkEnum.rawValue)") } @@ -49,17 +49,17 @@ case GTK_BUTTONS_OK_CANCEL: public func toGtk() -> GtkButtonsType { switch self { case .none: - return GTK_BUTTONS_NONE -case .ok: - return GTK_BUTTONS_OK -case .close: - return GTK_BUTTONS_CLOSE -case .cancel: - return GTK_BUTTONS_CANCEL -case .yesNo: - return GTK_BUTTONS_YES_NO -case .okCancel: - return GTK_BUTTONS_OK_CANCEL + return GTK_BUTTONS_NONE + case .ok: + return GTK_BUTTONS_OK + case .close: + return GTK_BUTTONS_CLOSE + case .cancel: + return GTK_BUTTONS_CANCEL + case .yesNo: + return GTK_BUTTONS_YES_NO + case .okCancel: + return GTK_BUTTONS_OK_CANCEL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/CellAccessibleParent.swift b/Sources/Gtk3/Generated/CellAccessibleParent.swift index 8f72277f87..527bde9245 100644 --- a/Sources/Gtk3/Generated/CellAccessibleParent.swift +++ b/Sources/Gtk3/Generated/CellAccessibleParent.swift @@ -1,8 +1,5 @@ import CGtk3 - public protocol CellAccessibleParent: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/CellEditable.swift b/Sources/Gtk3/Generated/CellEditable.swift index 6bcd43497c..182b69007f 100644 --- a/Sources/Gtk3/Generated/CellEditable.swift +++ b/Sources/Gtk3/Generated/CellEditable.swift @@ -4,32 +4,31 @@ import CGtk3 /// to edit the contents of a #GtkTreeView cell. It provides a way to specify how /// temporary widgets should be configured for editing, get the new value, etc. public protocol CellEditable: GObjectRepresentable { - /// This signal is a sign for the cell renderer to update its -/// value from the @cell_editable. -/// -/// Implementations of #GtkCellEditable are responsible for -/// emitting this signal when they are done editing, e.g. -/// #GtkEntry emits this signal when the user presses Enter. Typical things to -/// do in a handler for ::editing-done are to capture the edited value, -/// disconnect the @cell_editable from signals on the #GtkCellRenderer, etc. -/// -/// gtk_cell_editable_editing_done() is a convenience method -/// for emitting #GtkCellEditable::editing-done. -var editingDone: ((Self) -> Void)? { get set } + /// value from the @cell_editable. + /// + /// Implementations of #GtkCellEditable are responsible for + /// emitting this signal when they are done editing, e.g. + /// #GtkEntry emits this signal when the user presses Enter. Typical things to + /// do in a handler for ::editing-done are to capture the edited value, + /// disconnect the @cell_editable from signals on the #GtkCellRenderer, etc. + /// + /// gtk_cell_editable_editing_done() is a convenience method + /// for emitting #GtkCellEditable::editing-done. + var editingDone: ((Self) -> Void)? { get set } -/// This signal is meant to indicate that the cell is finished -/// editing, and the @cell_editable widget is being removed and may -/// subsequently be destroyed. -/// -/// Implementations of #GtkCellEditable are responsible for -/// emitting this signal when they are done editing. It must -/// be emitted after the #GtkCellEditable::editing-done signal, -/// to give the cell renderer a chance to update the cell's value -/// before the widget is removed. -/// -/// gtk_cell_editable_remove_widget() is a convenience method -/// for emitting #GtkCellEditable::remove-widget. -var removeWidget: ((Self) -> Void)? { get set } -} \ No newline at end of file + /// This signal is meant to indicate that the cell is finished + /// editing, and the @cell_editable widget is being removed and may + /// subsequently be destroyed. + /// + /// Implementations of #GtkCellEditable are responsible for + /// emitting this signal when they are done editing. It must + /// be emitted after the #GtkCellEditable::editing-done signal, + /// to give the cell renderer a chance to update the cell's value + /// before the widget is removed. + /// + /// gtk_cell_editable_remove_widget() is a convenience method + /// for emitting #GtkCellEditable::remove-widget. + var removeWidget: ((Self) -> Void)? { get set } +} diff --git a/Sources/Gtk3/Generated/CellLayout.swift b/Sources/Gtk3/Generated/CellLayout.swift index 3befa11280..fafc2455c0 100644 --- a/Sources/Gtk3/Generated/CellLayout.swift +++ b/Sources/Gtk3/Generated/CellLayout.swift @@ -3,7 +3,7 @@ import CGtk3 /// #GtkCellLayout is an interface to be implemented by all objects which /// want to provide a #GtkTreeViewColumn like API for packing cells, /// setting attributes and data funcs. -/// +/// /// One of the notable features provided by implementations of /// GtkCellLayout are attributes. Attributes let you set the properties /// in flexible ways. They can just be set to constant values like regular @@ -13,9 +13,9 @@ import CGtk3 /// the cell renderer. Finally, it is possible to specify a function with /// gtk_cell_layout_set_cell_data_func() that is called to determine the /// value of the attribute for each cell that is rendered. -/// +/// /// # GtkCellLayouts as GtkBuildable -/// +/// /// Implementations of GtkCellLayout which also implement the GtkBuildable /// interface (#GtkCellView, #GtkIconView, #GtkComboBox, /// #GtkEntryCompletion, #GtkTreeViewColumn) accept GtkCellRenderer objects @@ -24,35 +24,35 @@ import CGtk3 /// elements. Each `` element has a name attribute which specifies /// a property of the cell renderer; the content of the element is the /// attribute value. -/// +/// /// This is an example of a UI definition fragment specifying attributes: -/// +/// /// |[0 /// ]| -/// +/// /// Furthermore for implementations of GtkCellLayout that use a #GtkCellArea /// to lay out cells (all GtkCellLayouts in GTK+ use a GtkCellArea) /// [cell properties][cell-properties] can also be defined in the format by /// specifying the custom `` attribute which can contain multiple /// `` elements defined in the normal way. -/// +/// /// Here is a UI definition fragment specifying cell properties: -/// +/// /// |[TrueFalse /// ]| -/// +/// /// # Subclassing GtkCellLayout implementations -/// +/// /// When subclassing a widget that implements #GtkCellLayout like /// #GtkIconView or #GtkComboBox, there are some considerations related /// to the fact that these widgets internally use a #GtkCellArea. /// The cell area is exposed as a construct-only property by these /// widgets. This means that it is possible to e.g. do -/// +/// /// |[ /// combo = g_object_new (GTK_TYPE_COMBO_BOX, "cell-area", my_cell_area, NULL); /// ]| -/// +/// /// to use a custom cell area with a combo box. But construct properties /// are only initialized after instance init() /// functions have run, which means that using functions which rely on @@ -60,20 +60,20 @@ import CGtk3 /// cause the default cell area to be instantiated. In this case, a provided /// construct property value will be ignored (with a warning, to alert /// you to the problem). -/// +/// /// |[ /// static void /// my_combo_box_init (MyComboBox *b) /// { /// GtkCellRenderer *cell; -/// +/// /// cell = gtk_cell_renderer_pixbuf_new (); /// // The following call causes the default cell area for combo boxes, /// // a GtkCellAreaBox, to be instantiated /// gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (b), cell, FALSE); /// ... /// } -/// +/// /// GtkWidget * /// my_combo_box_new (GtkCellArea *area) /// { @@ -81,14 +81,12 @@ import CGtk3 /// return g_object_new (MY_TYPE_COMBO_BOX, "cell-area", area, NULL); /// } /// ]| -/// +/// /// If supporting alternative cell areas with your derived widget is /// not important, then this does not have to concern you. If you want /// to support alternative cell areas, you can do so by moving the /// problematic calls out of init() and into a constructor() /// for your class. public protocol CellLayout: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/CellRendererAccelMode.swift b/Sources/Gtk3/Generated/CellRendererAccelMode.swift index 194fa232b4..8ed09566d0 100644 --- a/Sources/Gtk3/Generated/CellRendererAccelMode.swift +++ b/Sources/Gtk3/Generated/CellRendererAccelMode.swift @@ -8,20 +8,20 @@ public enum CellRendererAccelMode: GValueRepresentableEnum { public typealias GtkEnum = GtkCellRendererAccelMode /// GTK+ accelerators mode -case gtk -/// Other accelerator mode -case other + case gtk + /// Other accelerator mode + case other public static var type: GType { - gtk_cell_renderer_accel_mode_get_type() -} + gtk_cell_renderer_accel_mode_get_type() + } public init(from gtkEnum: GtkCellRendererAccelMode) { switch gtkEnum { case GTK_CELL_RENDERER_ACCEL_MODE_GTK: - self = .gtk -case GTK_CELL_RENDERER_ACCEL_MODE_OTHER: - self = .other + self = .gtk + case GTK_CELL_RENDERER_ACCEL_MODE_OTHER: + self = .other default: fatalError("Unsupported GtkCellRendererAccelMode enum value: \(gtkEnum.rawValue)") } @@ -30,9 +30,9 @@ case GTK_CELL_RENDERER_ACCEL_MODE_OTHER: public func toGtk() -> GtkCellRendererAccelMode { switch self { case .gtk: - return GTK_CELL_RENDERER_ACCEL_MODE_GTK -case .other: - return GTK_CELL_RENDERER_ACCEL_MODE_OTHER + return GTK_CELL_RENDERER_ACCEL_MODE_GTK + case .other: + return GTK_CELL_RENDERER_ACCEL_MODE_OTHER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/CellRendererMode.swift b/Sources/Gtk3/Generated/CellRendererMode.swift index 283a6c69a3..3b62bd4d9a 100644 --- a/Sources/Gtk3/Generated/CellRendererMode.swift +++ b/Sources/Gtk3/Generated/CellRendererMode.swift @@ -5,27 +5,27 @@ public enum CellRendererMode: GValueRepresentableEnum { public typealias GtkEnum = GtkCellRendererMode /// The cell is just for display -/// and cannot be interacted with. Note that this doesn’t mean that eg. the -/// row being drawn can’t be selected -- just that a particular element of -/// it cannot be individually modified. -case inert -/// The cell can be clicked. -case activatable -/// The cell can be edited or otherwise modified. -case editable + /// and cannot be interacted with. Note that this doesn’t mean that eg. the + /// row being drawn can’t be selected -- just that a particular element of + /// it cannot be individually modified. + case inert + /// The cell can be clicked. + case activatable + /// The cell can be edited or otherwise modified. + case editable public static var type: GType { - gtk_cell_renderer_mode_get_type() -} + gtk_cell_renderer_mode_get_type() + } public init(from gtkEnum: GtkCellRendererMode) { switch gtkEnum { case GTK_CELL_RENDERER_MODE_INERT: - self = .inert -case GTK_CELL_RENDERER_MODE_ACTIVATABLE: - self = .activatable -case GTK_CELL_RENDERER_MODE_EDITABLE: - self = .editable + self = .inert + case GTK_CELL_RENDERER_MODE_ACTIVATABLE: + self = .activatable + case GTK_CELL_RENDERER_MODE_EDITABLE: + self = .editable default: fatalError("Unsupported GtkCellRendererMode enum value: \(gtkEnum.rawValue)") } @@ -34,11 +34,11 @@ case GTK_CELL_RENDERER_MODE_EDITABLE: public func toGtk() -> GtkCellRendererMode { switch self { case .inert: - return GTK_CELL_RENDERER_MODE_INERT -case .activatable: - return GTK_CELL_RENDERER_MODE_ACTIVATABLE -case .editable: - return GTK_CELL_RENDERER_MODE_EDITABLE + return GTK_CELL_RENDERER_MODE_INERT + case .activatable: + return GTK_CELL_RENDERER_MODE_ACTIVATABLE + case .editable: + return GTK_CELL_RENDERER_MODE_EDITABLE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/CheckButton.swift b/Sources/Gtk3/Generated/CheckButton.swift index c28bc0088e..98396f79d2 100644 --- a/Sources/Gtk3/Generated/CheckButton.swift +++ b/Sources/Gtk3/Generated/CheckButton.swift @@ -3,55 +3,52 @@ import CGtk3 /// A #GtkCheckButton places a discrete #GtkToggleButton next to a widget, /// (usually a #GtkLabel). See the section on #GtkToggleButton widgets for /// more information about toggle/check buttons. -/// +/// /// The important signal ( #GtkToggleButton::toggled ) is also inherited from /// #GtkToggleButton. -/// +/// /// # CSS nodes -/// +/// /// |[ /// checkbutton /// ├── check /// ╰── /// ]| -/// +/// /// A GtkCheckButton with indicator (see gtk_toggle_button_set_mode()) has a /// main CSS node with name checkbutton and a subnode with name check. -/// +/// /// |[ /// button.check /// ├── check /// ╰── /// ]| -/// +/// /// A GtkCheckButton without indicator changes the name of its main node /// to button and adds a .check style class to it. The subnode is invisible /// in this case. open class CheckButton: ToggleButton { /// Creates a new #GtkCheckButton. -public convenience init() { - self.init( - gtk_check_button_new() - ) -} + public convenience init() { + self.init( + gtk_check_button_new() + ) + } -/// Creates a new #GtkCheckButton with a #GtkLabel to the right of it. -public convenience init(label: String) { - self.init( - gtk_check_button_new_with_label(label) - ) -} + /// Creates a new #GtkCheckButton with a #GtkLabel to the right of it. + public convenience init(label: String) { + self.init( + gtk_check_button_new_with_label(label) + ) + } -/// Creates a new #GtkCheckButton containing a label. The label -/// will be created using gtk_label_new_with_mnemonic(), so underscores -/// in @label indicate the mnemonic for the check button. -public convenience init(mnemonic label: String) { - self.init( - gtk_check_button_new_with_mnemonic(label) - ) -} + /// Creates a new #GtkCheckButton containing a label. The label + /// will be created using gtk_label_new_with_mnemonic(), so underscores + /// in @label indicate the mnemonic for the check button. + public convenience init(mnemonic label: String) { + self.init( + gtk_check_button_new_with_mnemonic(label) + ) + } - - - -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/CornerType.swift b/Sources/Gtk3/Generated/CornerType.swift index c83783b38c..8056218574 100644 --- a/Sources/Gtk3/Generated/CornerType.swift +++ b/Sources/Gtk3/Generated/CornerType.swift @@ -7,32 +7,32 @@ public enum CornerType: GValueRepresentableEnum { public typealias GtkEnum = GtkCornerType /// Place the scrollbars on the right and bottom of the -/// widget (default behaviour). -case topLeft -/// Place the scrollbars on the top and right of the -/// widget. -case bottomLeft -/// Place the scrollbars on the left and bottom of the -/// widget. -case topRight -/// Place the scrollbars on the top and left of the -/// widget. -case bottomRight + /// widget (default behaviour). + case topLeft + /// Place the scrollbars on the top and right of the + /// widget. + case bottomLeft + /// Place the scrollbars on the left and bottom of the + /// widget. + case topRight + /// Place the scrollbars on the top and left of the + /// widget. + case bottomRight public static var type: GType { - gtk_corner_type_get_type() -} + gtk_corner_type_get_type() + } public init(from gtkEnum: GtkCornerType) { switch gtkEnum { case GTK_CORNER_TOP_LEFT: - self = .topLeft -case GTK_CORNER_BOTTOM_LEFT: - self = .bottomLeft -case GTK_CORNER_TOP_RIGHT: - self = .topRight -case GTK_CORNER_BOTTOM_RIGHT: - self = .bottomRight + self = .topLeft + case GTK_CORNER_BOTTOM_LEFT: + self = .bottomLeft + case GTK_CORNER_TOP_RIGHT: + self = .topRight + case GTK_CORNER_BOTTOM_RIGHT: + self = .bottomRight default: fatalError("Unsupported GtkCornerType enum value: \(gtkEnum.rawValue)") } @@ -41,13 +41,13 @@ case GTK_CORNER_BOTTOM_RIGHT: public func toGtk() -> GtkCornerType { switch self { case .topLeft: - return GTK_CORNER_TOP_LEFT -case .bottomLeft: - return GTK_CORNER_BOTTOM_LEFT -case .topRight: - return GTK_CORNER_TOP_RIGHT -case .bottomRight: - return GTK_CORNER_BOTTOM_RIGHT + return GTK_CORNER_TOP_LEFT + case .bottomLeft: + return GTK_CORNER_BOTTOM_LEFT + case .topRight: + return GTK_CORNER_TOP_RIGHT + case .bottomRight: + return GTK_CORNER_BOTTOM_RIGHT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/CssProviderError.swift b/Sources/Gtk3/Generated/CssProviderError.swift index 52ec74bdc0..4f23f53a6a 100644 --- a/Sources/Gtk3/Generated/CssProviderError.swift +++ b/Sources/Gtk3/Generated/CssProviderError.swift @@ -5,36 +5,36 @@ public enum CssProviderError: GValueRepresentableEnum { public typealias GtkEnum = GtkCssProviderError /// Failed. -case failed -/// Syntax error. -case syntax -/// Import error. -case import_ -/// Name error. -case name -/// Deprecation error. -case deprecated -/// Unknown value. -case unknownValue + case failed + /// Syntax error. + case syntax + /// Import error. + case import_ + /// Name error. + case name + /// Deprecation error. + case deprecated + /// Unknown value. + case unknownValue public static var type: GType { - gtk_css_provider_error_get_type() -} + gtk_css_provider_error_get_type() + } public init(from gtkEnum: GtkCssProviderError) { switch gtkEnum { case GTK_CSS_PROVIDER_ERROR_FAILED: - self = .failed -case GTK_CSS_PROVIDER_ERROR_SYNTAX: - self = .syntax -case GTK_CSS_PROVIDER_ERROR_IMPORT: - self = .import_ -case GTK_CSS_PROVIDER_ERROR_NAME: - self = .name -case GTK_CSS_PROVIDER_ERROR_DEPRECATED: - self = .deprecated -case GTK_CSS_PROVIDER_ERROR_UNKNOWN_VALUE: - self = .unknownValue + self = .failed + case GTK_CSS_PROVIDER_ERROR_SYNTAX: + self = .syntax + case GTK_CSS_PROVIDER_ERROR_IMPORT: + self = .import_ + case GTK_CSS_PROVIDER_ERROR_NAME: + self = .name + case GTK_CSS_PROVIDER_ERROR_DEPRECATED: + self = .deprecated + case GTK_CSS_PROVIDER_ERROR_UNKNOWN_VALUE: + self = .unknownValue default: fatalError("Unsupported GtkCssProviderError enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ case GTK_CSS_PROVIDER_ERROR_UNKNOWN_VALUE: public func toGtk() -> GtkCssProviderError { switch self { case .failed: - return GTK_CSS_PROVIDER_ERROR_FAILED -case .syntax: - return GTK_CSS_PROVIDER_ERROR_SYNTAX -case .import_: - return GTK_CSS_PROVIDER_ERROR_IMPORT -case .name: - return GTK_CSS_PROVIDER_ERROR_NAME -case .deprecated: - return GTK_CSS_PROVIDER_ERROR_DEPRECATED -case .unknownValue: - return GTK_CSS_PROVIDER_ERROR_UNKNOWN_VALUE + return GTK_CSS_PROVIDER_ERROR_FAILED + case .syntax: + return GTK_CSS_PROVIDER_ERROR_SYNTAX + case .import_: + return GTK_CSS_PROVIDER_ERROR_IMPORT + case .name: + return GTK_CSS_PROVIDER_ERROR_NAME + case .deprecated: + return GTK_CSS_PROVIDER_ERROR_DEPRECATED + case .unknownValue: + return GTK_CSS_PROVIDER_ERROR_UNKNOWN_VALUE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/DeleteType.swift b/Sources/Gtk3/Generated/DeleteType.swift index 0cefb98518..451beff854 100644 --- a/Sources/Gtk3/Generated/DeleteType.swift +++ b/Sources/Gtk3/Generated/DeleteType.swift @@ -5,50 +5,50 @@ public enum DeleteType: GValueRepresentableEnum { public typealias GtkEnum = GtkDeleteType /// Delete characters. -case chars -/// Delete only the portion of the word to the -/// left/right of cursor if we’re in the middle of a word. -case wordEnds -/// Delete words. -case words -/// Delete display-lines. Display-lines -/// refers to the visible lines, with respect to to the current line -/// breaks. As opposed to paragraphs, which are defined by line -/// breaks in the input. -case displayLines -/// Delete only the portion of the -/// display-line to the left/right of cursor. -case displayLineEnds -/// Delete to the end of the -/// paragraph. Like C-k in Emacs (or its reverse). -case paragraphEnds -/// Delete entire line. Like C-k in pico. -case paragraphs -/// Delete only whitespace. Like M-\ in Emacs. -case whitespace + case chars + /// Delete only the portion of the word to the + /// left/right of cursor if we’re in the middle of a word. + case wordEnds + /// Delete words. + case words + /// Delete display-lines. Display-lines + /// refers to the visible lines, with respect to to the current line + /// breaks. As opposed to paragraphs, which are defined by line + /// breaks in the input. + case displayLines + /// Delete only the portion of the + /// display-line to the left/right of cursor. + case displayLineEnds + /// Delete to the end of the + /// paragraph. Like C-k in Emacs (or its reverse). + case paragraphEnds + /// Delete entire line. Like C-k in pico. + case paragraphs + /// Delete only whitespace. Like M-\ in Emacs. + case whitespace public static var type: GType { - gtk_delete_type_get_type() -} + gtk_delete_type_get_type() + } public init(from gtkEnum: GtkDeleteType) { switch gtkEnum { case GTK_DELETE_CHARS: - self = .chars -case GTK_DELETE_WORD_ENDS: - self = .wordEnds -case GTK_DELETE_WORDS: - self = .words -case GTK_DELETE_DISPLAY_LINES: - self = .displayLines -case GTK_DELETE_DISPLAY_LINE_ENDS: - self = .displayLineEnds -case GTK_DELETE_PARAGRAPH_ENDS: - self = .paragraphEnds -case GTK_DELETE_PARAGRAPHS: - self = .paragraphs -case GTK_DELETE_WHITESPACE: - self = .whitespace + self = .chars + case GTK_DELETE_WORD_ENDS: + self = .wordEnds + case GTK_DELETE_WORDS: + self = .words + case GTK_DELETE_DISPLAY_LINES: + self = .displayLines + case GTK_DELETE_DISPLAY_LINE_ENDS: + self = .displayLineEnds + case GTK_DELETE_PARAGRAPH_ENDS: + self = .paragraphEnds + case GTK_DELETE_PARAGRAPHS: + self = .paragraphs + case GTK_DELETE_WHITESPACE: + self = .whitespace default: fatalError("Unsupported GtkDeleteType enum value: \(gtkEnum.rawValue)") } @@ -57,21 +57,21 @@ case GTK_DELETE_WHITESPACE: public func toGtk() -> GtkDeleteType { switch self { case .chars: - return GTK_DELETE_CHARS -case .wordEnds: - return GTK_DELETE_WORD_ENDS -case .words: - return GTK_DELETE_WORDS -case .displayLines: - return GTK_DELETE_DISPLAY_LINES -case .displayLineEnds: - return GTK_DELETE_DISPLAY_LINE_ENDS -case .paragraphEnds: - return GTK_DELETE_PARAGRAPH_ENDS -case .paragraphs: - return GTK_DELETE_PARAGRAPHS -case .whitespace: - return GTK_DELETE_WHITESPACE + return GTK_DELETE_CHARS + case .wordEnds: + return GTK_DELETE_WORD_ENDS + case .words: + return GTK_DELETE_WORDS + case .displayLines: + return GTK_DELETE_DISPLAY_LINES + case .displayLineEnds: + return GTK_DELETE_DISPLAY_LINE_ENDS + case .paragraphEnds: + return GTK_DELETE_PARAGRAPH_ENDS + case .paragraphs: + return GTK_DELETE_PARAGRAPHS + case .whitespace: + return GTK_DELETE_WHITESPACE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/DirectionType.swift b/Sources/Gtk3/Generated/DirectionType.swift index 9a6dbe2c33..52d43e259b 100644 --- a/Sources/Gtk3/Generated/DirectionType.swift +++ b/Sources/Gtk3/Generated/DirectionType.swift @@ -5,36 +5,36 @@ public enum DirectionType: GValueRepresentableEnum { public typealias GtkEnum = GtkDirectionType /// Move forward. -case tabForward -/// Move backward. -case tabBackward -/// Move up. -case up -/// Move down. -case down -/// Move left. -case left -/// Move right. -case right + case tabForward + /// Move backward. + case tabBackward + /// Move up. + case up + /// Move down. + case down + /// Move left. + case left + /// Move right. + case right public static var type: GType { - gtk_direction_type_get_type() -} + gtk_direction_type_get_type() + } public init(from gtkEnum: GtkDirectionType) { switch gtkEnum { case GTK_DIR_TAB_FORWARD: - self = .tabForward -case GTK_DIR_TAB_BACKWARD: - self = .tabBackward -case GTK_DIR_UP: - self = .up -case GTK_DIR_DOWN: - self = .down -case GTK_DIR_LEFT: - self = .left -case GTK_DIR_RIGHT: - self = .right + self = .tabForward + case GTK_DIR_TAB_BACKWARD: + self = .tabBackward + case GTK_DIR_UP: + self = .up + case GTK_DIR_DOWN: + self = .down + case GTK_DIR_LEFT: + self = .left + case GTK_DIR_RIGHT: + self = .right default: fatalError("Unsupported GtkDirectionType enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ case GTK_DIR_RIGHT: public func toGtk() -> GtkDirectionType { switch self { case .tabForward: - return GTK_DIR_TAB_FORWARD -case .tabBackward: - return GTK_DIR_TAB_BACKWARD -case .up: - return GTK_DIR_UP -case .down: - return GTK_DIR_DOWN -case .left: - return GTK_DIR_LEFT -case .right: - return GTK_DIR_RIGHT + return GTK_DIR_TAB_FORWARD + case .tabBackward: + return GTK_DIR_TAB_BACKWARD + case .up: + return GTK_DIR_UP + case .down: + return GTK_DIR_DOWN + case .left: + return GTK_DIR_LEFT + case .right: + return GTK_DIR_RIGHT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/DragResult.swift b/Sources/Gtk3/Generated/DragResult.swift index 52c685dd86..5ac3c50d52 100644 --- a/Sources/Gtk3/Generated/DragResult.swift +++ b/Sources/Gtk3/Generated/DragResult.swift @@ -7,38 +7,38 @@ public enum DragResult: GValueRepresentableEnum { public typealias GtkEnum = GtkDragResult /// The drag operation was successful. -case success -/// No suitable drag target. -case noTarget -/// The user cancelled the drag operation. -case userCancelled -/// The drag operation timed out. -case timeoutExpired -/// The pointer or keyboard grab used -/// for the drag operation was broken. -case grabBroken -/// The drag operation failed due to some -/// unspecified error. -case error + case success + /// No suitable drag target. + case noTarget + /// The user cancelled the drag operation. + case userCancelled + /// The drag operation timed out. + case timeoutExpired + /// The pointer or keyboard grab used + /// for the drag operation was broken. + case grabBroken + /// The drag operation failed due to some + /// unspecified error. + case error public static var type: GType { - gtk_drag_result_get_type() -} + gtk_drag_result_get_type() + } public init(from gtkEnum: GtkDragResult) { switch gtkEnum { case GTK_DRAG_RESULT_SUCCESS: - self = .success -case GTK_DRAG_RESULT_NO_TARGET: - self = .noTarget -case GTK_DRAG_RESULT_USER_CANCELLED: - self = .userCancelled -case GTK_DRAG_RESULT_TIMEOUT_EXPIRED: - self = .timeoutExpired -case GTK_DRAG_RESULT_GRAB_BROKEN: - self = .grabBroken -case GTK_DRAG_RESULT_ERROR: - self = .error + self = .success + case GTK_DRAG_RESULT_NO_TARGET: + self = .noTarget + case GTK_DRAG_RESULT_USER_CANCELLED: + self = .userCancelled + case GTK_DRAG_RESULT_TIMEOUT_EXPIRED: + self = .timeoutExpired + case GTK_DRAG_RESULT_GRAB_BROKEN: + self = .grabBroken + case GTK_DRAG_RESULT_ERROR: + self = .error default: fatalError("Unsupported GtkDragResult enum value: \(gtkEnum.rawValue)") } @@ -47,17 +47,17 @@ case GTK_DRAG_RESULT_ERROR: public func toGtk() -> GtkDragResult { switch self { case .success: - return GTK_DRAG_RESULT_SUCCESS -case .noTarget: - return GTK_DRAG_RESULT_NO_TARGET -case .userCancelled: - return GTK_DRAG_RESULT_USER_CANCELLED -case .timeoutExpired: - return GTK_DRAG_RESULT_TIMEOUT_EXPIRED -case .grabBroken: - return GTK_DRAG_RESULT_GRAB_BROKEN -case .error: - return GTK_DRAG_RESULT_ERROR + return GTK_DRAG_RESULT_SUCCESS + case .noTarget: + return GTK_DRAG_RESULT_NO_TARGET + case .userCancelled: + return GTK_DRAG_RESULT_USER_CANCELLED + case .timeoutExpired: + return GTK_DRAG_RESULT_TIMEOUT_EXPIRED + case .grabBroken: + return GTK_DRAG_RESULT_GRAB_BROKEN + case .error: + return GTK_DRAG_RESULT_ERROR } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/DrawingArea.swift b/Sources/Gtk3/Generated/DrawingArea.swift index e9897c0eab..83fcce1090 100644 --- a/Sources/Gtk3/Generated/DrawingArea.swift +++ b/Sources/Gtk3/Generated/DrawingArea.swift @@ -3,32 +3,32 @@ import CGtk3 /// The #GtkDrawingArea widget is used for creating custom user interface /// elements. It’s essentially a blank widget; you can draw on it. After /// creating a drawing area, the application may want to connect to: -/// +/// /// - Mouse and button press signals to respond to input from /// the user. (Use gtk_widget_add_events() to enable events /// you wish to receive.) -/// +/// /// - The #GtkWidget::realize signal to take any necessary actions /// when the widget is instantiated on a particular display. /// (Create GDK resources in response to this signal.) -/// +/// /// - The #GtkWidget::size-allocate signal to take any necessary /// actions when the widget changes size. -/// +/// /// - The #GtkWidget::draw signal to handle redrawing the /// contents of the widget. -/// +/// /// The following code portion demonstrates using a drawing /// area to display a circle in the normal widget foreground /// color. -/// +/// /// Note that GDK automatically clears the exposed area before sending /// the expose event, and that drawing is implicitly clipped to the exposed /// area. If you want to have a theme-provided background, you need /// to call gtk_render_background() in your ::draw method. -/// +/// /// ## Simple GtkDrawingArea usage -/// +/// /// |[ /// gboolean /// draw_callback (GtkWidget *widget, cairo_t *cr, gpointer data) @@ -36,26 +36,26 @@ import CGtk3 /// guint width, height; /// GdkRGBA color; /// GtkStyleContext *context; -/// +/// /// context = gtk_widget_get_style_context (widget); -/// +/// /// width = gtk_widget_get_allocated_width (widget); /// height = gtk_widget_get_allocated_height (widget); -/// +/// /// gtk_render_background (context, cr, 0, 0, width, height); -/// +/// /// cairo_arc (cr, /// width / 2.0, height / 2.0, /// MIN (width, height) / 2.0, /// 0, 2 * G_PI); -/// +/// /// gtk_style_context_get_color (context, /// gtk_style_context_get_state (context), /// &color); /// gdk_cairo_set_source_rgba (cr, &color); -/// +/// /// cairo_fill (cr); -/// +/// /// return FALSE; /// } /// [...] @@ -64,18 +64,18 @@ import CGtk3 /// g_signal_connect (G_OBJECT (drawing_area), "draw", /// G_CALLBACK (draw_callback), NULL); /// ]| -/// +/// /// Draw signals are normally delivered when a drawing area first comes /// onscreen, or when it’s covered by another window and then uncovered. /// You can also force an expose event by adding to the “damage region” /// of the drawing area’s window; gtk_widget_queue_draw_area() and /// gdk_window_invalidate_rect() are equally good ways to do this. /// You’ll then get a draw signal for the invalid region. -/// +/// /// The available routines for drawing are documented on the /// [GDK Drawing Primitives][gdk3-Cairo-Interaction] page /// and the cairo documentation. -/// +/// /// To receive mouse events on a drawing area, you will need to enable /// them with gtk_widget_add_events(). To receive keyboard events, you /// will need to set the “can-focus” property on the drawing area, and you @@ -85,13 +85,10 @@ import CGtk3 /// gtk_render_focus() for one way to draw focus. open class DrawingArea: Widget { /// Creates a new drawing area. -public convenience init() { - self.init( - gtk_drawing_area_new() - ) -} - - + public convenience init() { + self.init( + gtk_drawing_area_new() + ) + } - -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/Editable.swift b/Sources/Gtk3/Generated/Editable.swift index 52eb6dbbd4..b7370b77e5 100644 --- a/Sources/Gtk3/Generated/Editable.swift +++ b/Sources/Gtk3/Generated/Editable.swift @@ -5,16 +5,16 @@ import CGtk3 /// for generically manipulating an editable widget, a large number of action /// signals used for key bindings, and several signals that an application can /// connect to to modify the behavior of a widget. -/// +/// /// As an example of the latter usage, by connecting /// the following handler to #GtkEditable::insert-text, an application /// can convert all entry into a widget into uppercase. -/// +/// /// ## Forcing entry to uppercase. -/// +/// /// |[ /// #include ; -/// +/// /// void /// insert_text_handler (GtkEditable *editable, /// const gchar *text, @@ -23,48 +23,47 @@ import CGtk3 /// gpointer data) /// { /// gchar *result = g_utf8_strup (text, length); -/// +/// /// g_signal_handlers_block_by_func (editable, /// (gpointer) insert_text_handler, data); /// gtk_editable_insert_text (editable, result, length, position); /// g_signal_handlers_unblock_by_func (editable, /// (gpointer) insert_text_handler, data); -/// +/// /// g_signal_stop_emission_by_name (editable, "insert_text"); -/// +/// /// g_free (result); /// } /// ]| public protocol Editable: GObjectRepresentable { - /// The ::changed signal is emitted at the end of a single -/// user-visible operation on the contents of the #GtkEditable. -/// -/// E.g., a paste operation that replaces the contents of the -/// selection will cause only one signal emission (even though it -/// is implemented by first deleting the selection, then inserting -/// the new content, and may cause multiple ::notify::text signals -/// to be emitted). -var changed: ((Self) -> Void)? { get set } + /// user-visible operation on the contents of the #GtkEditable. + /// + /// E.g., a paste operation that replaces the contents of the + /// selection will cause only one signal emission (even though it + /// is implemented by first deleting the selection, then inserting + /// the new content, and may cause multiple ::notify::text signals + /// to be emitted). + var changed: ((Self) -> Void)? { get set } -/// This signal is emitted when text is deleted from -/// the widget by the user. The default handler for -/// this signal will normally be responsible for deleting -/// the text, so by connecting to this signal and then -/// stopping the signal with g_signal_stop_emission(), it -/// is possible to modify the range of deleted text, or -/// prevent it from being deleted entirely. The @start_pos -/// and @end_pos parameters are interpreted as for -/// gtk_editable_delete_text(). -var deleteText: ((Self, Int, Int) -> Void)? { get set } + /// This signal is emitted when text is deleted from + /// the widget by the user. The default handler for + /// this signal will normally be responsible for deleting + /// the text, so by connecting to this signal and then + /// stopping the signal with g_signal_stop_emission(), it + /// is possible to modify the range of deleted text, or + /// prevent it from being deleted entirely. The @start_pos + /// and @end_pos parameters are interpreted as for + /// gtk_editable_delete_text(). + var deleteText: ((Self, Int, Int) -> Void)? { get set } -/// This signal is emitted when text is inserted into -/// the widget by the user. The default handler for -/// this signal will normally be responsible for inserting -/// the text, so by connecting to this signal and then -/// stopping the signal with g_signal_stop_emission(), it -/// is possible to modify the inserted text, or prevent -/// it from being inserted entirely. -var insertText: ((Self, UnsafePointer, Int, gpointer) -> Void)? { get set } -} \ No newline at end of file + /// This signal is emitted when text is inserted into + /// the widget by the user. The default handler for + /// this signal will normally be responsible for inserting + /// the text, so by connecting to this signal and then + /// stopping the signal with g_signal_stop_emission(), it + /// is possible to modify the inserted text, or prevent + /// it from being inserted entirely. + var insertText: ((Self, UnsafePointer, Int, gpointer) -> Void)? { get set } +} diff --git a/Sources/Gtk3/Generated/Entry.swift b/Sources/Gtk3/Generated/Entry.swift index 44b4343c77..a7982980d9 100644 --- a/Sources/Gtk3/Generated/Entry.swift +++ b/Sources/Gtk3/Generated/Entry.swift @@ -5,7 +5,7 @@ import CGtk3 /// by default. If the entered text is longer than the allocation /// of the widget, the widget will scroll so that the cursor /// position is visible. -/// +/// /// When using an entry for passwords and other sensitive information, /// it can be put into “password mode” using gtk_entry_set_visibility(). /// In this mode, entered text is displayed using a “invisible” character. @@ -15,11 +15,11 @@ import CGtk3 /// when Caps Lock or input methods might interfere with entering text in /// a password entry. The warning can be turned off with the /// #GtkEntry:caps-lock-warning property. -/// +/// /// Since 2.16, GtkEntry has the ability to display progress or activity /// information behind the text. To make an entry display such information, /// use gtk_entry_set_progress_fraction() or gtk_entry_set_progress_pulse_step(). -/// +/// /// Additionally, GtkEntry can show icons at either side of the entry. These /// icons can be activatable by clicking, can be set up as drag source and /// can have tooltips. To add an icon, use gtk_entry_set_icon_from_gicon() or @@ -29,15 +29,15 @@ import CGtk3 /// from an icon, use gtk_entry_set_icon_drag_source(). To set a tooltip on /// an icon, use gtk_entry_set_icon_tooltip_text() or the corresponding function /// for markup. -/// +/// /// Note that functionality or information that is only available by clicking /// on an icon in an entry may not be accessible at all to users which are not /// able to use a mouse or other pointing device. It is therefore recommended /// that any such functionality should also be available by other means, e.g. /// via the context menu of the entry. -/// +/// /// # CSS nodes -/// +/// /// |[ /// entry[.read-only][.flat][.warning][.error] /// ├── image.left @@ -48,25 +48,25 @@ import CGtk3 /// ├── [progress[.pulse]] /// ╰── [window.popup] /// ]| -/// +/// /// GtkEntry has a main node with the name entry. Depending on the properties /// of the entry, the style classes .read-only and .flat may appear. The style /// classes .warning and .error may also be used with entries. -/// +/// /// When the entry shows icons, it adds subnodes with the name image and the /// style class .left or .right, depending on where the icon appears. -/// +/// /// When the entry has a selection, it adds a subnode with the name selection. -/// +/// /// When the entry shows progress, it adds a subnode with the name progress. /// The node has the style class .pulse when the shown progress is pulsing. -/// +/// /// The CSS node for a context menu is added as a subnode below entry as well. -/// +/// /// The undershoot nodes are used to draw the underflow indication when content /// is scrolled out of view. These nodes get the .left and .right style classes /// added depending on where the indication is drawn. -/// +/// /// When touch is used and touch selection handles are shown, they are using /// CSS nodes with name cursor-handle. They get the .top or .bottom style class /// depending on where they are shown in relation to the selection. If there is @@ -74,1024 +74,1098 @@ import CGtk3 /// .insertion-cursor. open class Entry: Widget, CellEditable, Editable { /// Creates a new entry. -public convenience init() { - self.init( - gtk_entry_new() - ) -} - -/// Creates a new entry with the specified text buffer. -public convenience init(buffer: UnsafeMutablePointer!) { - self.init( - gtk_entry_new_with_buffer(buffer) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) -} - -addSignal(name: "backspace") { [weak self] () in - guard let self = self else { return } - self.backspace?(self) -} - -addSignal(name: "copy-clipboard") { [weak self] () in - guard let self = self else { return } - self.copyClipboard?(self) -} - -addSignal(name: "cut-clipboard") { [weak self] () in - guard let self = self else { return } - self.cutClipboard?(self) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, GtkDeleteType, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - -addSignal(name: "delete-from-cursor", handler: gCallback(handler4)) { [weak self] (param0: GtkDeleteType, param1: Int) in - guard let self = self else { return } - self.deleteFromCursor?(self, param0, param1) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, GdkEvent, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - -addSignal(name: "icon-press", handler: gCallback(handler5)) { [weak self] (param0: GtkEntryIconPosition, param1: GdkEvent) in - guard let self = self else { return } - self.iconPress?(self, param0, param1) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, GtkEntryIconPosition, GdkEvent, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - -addSignal(name: "icon-release", handler: gCallback(handler6)) { [weak self] (param0: GtkEntryIconPosition, param1: GdkEvent) in - guard let self = self else { return } - self.iconRelease?(self, param0, param1) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1>.run(data, value1) + public convenience init() { + self.init( + gtk_entry_new() + ) } -addSignal(name: "insert-at-cursor", handler: gCallback(handler7)) { [weak self] (param0: UnsafePointer) in - guard let self = self else { return } - self.insertAtCursor?(self, param0) -} - -addSignal(name: "insert-emoji") { [weak self] () in - guard let self = self else { return } - self.insertEmoji?(self) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, value3, data in - SignalBox3.run(data, value1, value2, value3) + /// Creates a new entry with the specified text buffer. + public convenience init(buffer: UnsafeMutablePointer!) { + self.init( + gtk_entry_new_with_buffer(buffer) + ) } -addSignal(name: "move-cursor", handler: gCallback(handler9)) { [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool) in - guard let self = self else { return } - self.moveCursor?(self, param0, param1, param2) -} - -addSignal(name: "paste-clipboard") { [weak self] () in - guard let self = self else { return } - self.pasteClipboard?(self) -} - -let handler11: @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1>.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) + } + + addSignal(name: "backspace") { [weak self] () in + guard let self = self else { return } + self.backspace?(self) + } + + addSignal(name: "copy-clipboard") { [weak self] () in + guard let self = self else { return } + self.copyClipboard?(self) + } + + addSignal(name: "cut-clipboard") { [weak self] () in + guard let self = self else { return } + self.cutClipboard?(self) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, GtkDeleteType, Int, UnsafeMutableRawPointer) -> + Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "delete-from-cursor", handler: gCallback(handler4)) { + [weak self] (param0: GtkDeleteType, param1: Int) in + guard let self = self else { return } + self.deleteFromCursor?(self, param0, param1) + } + + let handler5: + @convention(c) ( + UnsafeMutableRawPointer, GtkEntryIconPosition, GdkEvent, UnsafeMutableRawPointer + ) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "icon-press", handler: gCallback(handler5)) { + [weak self] (param0: GtkEntryIconPosition, param1: GdkEvent) in + guard let self = self else { return } + self.iconPress?(self, param0, param1) + } + + let handler6: + @convention(c) ( + UnsafeMutableRawPointer, GtkEntryIconPosition, GdkEvent, UnsafeMutableRawPointer + ) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "icon-release", handler: gCallback(handler6)) { + [weak self] (param0: GtkEntryIconPosition, param1: GdkEvent) in + guard let self = self else { return } + self.iconRelease?(self, param0, param1) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) + -> Void = + { _, value1, data in + SignalBox1>.run(data, value1) + } + + addSignal(name: "insert-at-cursor", handler: gCallback(handler7)) { + [weak self] (param0: UnsafePointer) in + guard let self = self else { return } + self.insertAtCursor?(self, param0) + } + + addSignal(name: "insert-emoji") { [weak self] () in + guard let self = self else { return } + self.insertEmoji?(self) + } + + let handler9: + @convention(c) ( + UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, UnsafeMutableRawPointer + ) -> Void = + { _, value1, value2, value3, data in + SignalBox3.run(data, value1, value2, value3) + } + + addSignal(name: "move-cursor", handler: gCallback(handler9)) { + [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool) in + guard let self = self else { return } + self.moveCursor?(self, param0, param1, param2) + } + + addSignal(name: "paste-clipboard") { [weak self] () in + guard let self = self else { return } + self.pasteClipboard?(self) + } + + let handler11: + @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) + -> Void = + { _, value1, data in + SignalBox1>.run(data, value1) + } + + addSignal(name: "preedit-changed", handler: gCallback(handler11)) { + [weak self] (param0: UnsafePointer) in + guard let self = self else { return } + self.preeditChanged?(self, param0) + } + + addSignal(name: "toggle-direction") { [weak self] () in + guard let self = self else { return } + self.toggleDirection?(self) + } + + addSignal(name: "toggle-overwrite") { [weak self] () in + guard let self = self else { return } + self.toggleOverwrite?(self) + } + + addSignal(name: "editing-done") { [weak self] () in + guard let self = self else { return } + self.editingDone?(self) + } + + addSignal(name: "remove-widget") { [weak self] () in + guard let self = self else { return } + self.removeWidget?(self) + } + + addSignal(name: "changed") { [weak self] () in + guard let self = self else { return } + self.changed?(self) + } + + let handler17: + @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "delete-text", handler: gCallback(handler17)) { + [weak self] (param0: Int, param1: Int) in + guard let self = self else { return } + self.deleteText?(self, param0, param1) + } + + let handler18: + @convention(c) ( + UnsafeMutableRawPointer, UnsafePointer, Int, gpointer, + UnsafeMutableRawPointer + ) -> Void = + { _, value1, value2, value3, data in + SignalBox3, Int, gpointer>.run( + data, value1, value2, value3) + } + + addSignal(name: "insert-text", handler: gCallback(handler18)) { + [weak self] (param0: UnsafePointer, param1: Int, param2: gpointer) in + guard let self = self else { return } + self.insertText?(self, param0, param1, param2) + } + + let handler19: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::activates-default", handler: gCallback(handler19)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActivatesDefault?(self, param0) + } + + let handler20: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::attributes", handler: gCallback(handler20)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAttributes?(self, param0) + } + + let handler21: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::buffer", handler: gCallback(handler21)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyBuffer?(self, param0) + } + + let handler22: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::caps-lock-warning", handler: gCallback(handler22)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCapsLockWarning?(self, param0) + } + + let handler23: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::completion", handler: gCallback(handler23)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCompletion?(self, param0) + } + + let handler24: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::cursor-position", handler: gCallback(handler24)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCursorPosition?(self, param0) + } + + let handler25: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::editable", handler: gCallback(handler25)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEditable?(self, param0) + } + + let handler26: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::enable-emoji-completion", handler: gCallback(handler26)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEnableEmojiCompletion?(self, param0) + } + + let handler27: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::has-frame", handler: gCallback(handler27)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasFrame?(self, param0) + } + + let handler28: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::im-module", handler: gCallback(handler28)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyImModule?(self, param0) + } + + let handler29: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::inner-border", handler: gCallback(handler29)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInnerBorder?(self, param0) + } + + let handler30: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::input-hints", handler: gCallback(handler30)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInputHints?(self, param0) + } + + let handler31: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::input-purpose", handler: gCallback(handler31)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInputPurpose?(self, param0) + } + + let handler32: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::invisible-char", handler: gCallback(handler32)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInvisibleCharacter?(self, param0) + } + + let handler33: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::invisible-char-set", handler: gCallback(handler33)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInvisibleCharacterSet?(self, param0) + } + + let handler34: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::max-length", handler: gCallback(handler34)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMaxLength?(self, param0) + } + + let handler35: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::max-width-chars", handler: gCallback(handler35)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMaxWidthChars?(self, param0) + } + + let handler36: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::overwrite-mode", handler: gCallback(handler36)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyOverwriteMode?(self, param0) + } + + let handler37: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::placeholder-text", handler: gCallback(handler37)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPlaceholderText?(self, param0) + } + + let handler38: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::populate-all", handler: gCallback(handler38)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPopulateAll?(self, param0) + } + + let handler39: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-activatable", handler: gCallback(handler39)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconActivatable?(self, param0) + } + + let handler40: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-gicon", handler: gCallback(handler40)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconGicon?(self, param0) + } + + let handler41: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-name", handler: gCallback(handler41)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconName?(self, param0) + } + + let handler42: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-pixbuf", handler: gCallback(handler42)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconPixbuf?(self, param0) + } + + let handler43: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-sensitive", handler: gCallback(handler43)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconSensitive?(self, param0) + } + + let handler44: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-stock", handler: gCallback(handler44)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconStock?(self, param0) + } + + let handler45: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-storage-type", handler: gCallback(handler45)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconStorageType?(self, param0) + } + + let handler46: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-tooltip-markup", handler: gCallback(handler46)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconTooltipMarkup?(self, param0) + } + + let handler47: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::primary-icon-tooltip-text", handler: gCallback(handler47)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPrimaryIconTooltipText?(self, param0) + } + + let handler48: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::progress-fraction", handler: gCallback(handler48)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyProgressFraction?(self, param0) + } + + let handler49: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::progress-pulse-step", handler: gCallback(handler49)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyProgressPulseStep?(self, param0) + } + + let handler50: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::scroll-offset", handler: gCallback(handler50)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyScrollOffset?(self, param0) + } + + let handler51: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-activatable", handler: gCallback(handler51)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconActivatable?(self, param0) + } + + let handler52: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-gicon", handler: gCallback(handler52)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconGicon?(self, param0) + } + + let handler53: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-name", handler: gCallback(handler53)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconName?(self, param0) + } + + let handler54: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-pixbuf", handler: gCallback(handler54)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconPixbuf?(self, param0) + } + + let handler55: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-sensitive", handler: gCallback(handler55)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconSensitive?(self, param0) + } + + let handler56: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-stock", handler: gCallback(handler56)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconStock?(self, param0) + } + + let handler57: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-storage-type", handler: gCallback(handler57)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconStorageType?(self, param0) + } + + let handler58: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-tooltip-markup", handler: gCallback(handler58)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconTooltipMarkup?(self, param0) + } + + let handler59: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::secondary-icon-tooltip-text", handler: gCallback(handler59)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySecondaryIconTooltipText?(self, param0) + } + + let handler60: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::selection-bound", handler: gCallback(handler60)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectionBound?(self, param0) + } + + let handler61: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::shadow-type", handler: gCallback(handler61)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShadowType?(self, param0) + } + + let handler62: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::show-emoji-icon", handler: gCallback(handler62)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowEmojiIcon?(self, param0) + } + + let handler63: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::tabs", handler: gCallback(handler63)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTabs?(self, param0) + } + + let handler64: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::text", handler: gCallback(handler64)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyText?(self, param0) + } + + let handler65: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::text-length", handler: gCallback(handler65)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTextLength?(self, param0) + } + + let handler66: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::truncate-multiline", handler: gCallback(handler66)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTruncateMultiline?(self, param0) + } + + let handler67: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::visibility", handler: gCallback(handler67)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyVisibility?(self, param0) + } + + let handler68: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::width-chars", handler: gCallback(handler68)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWidthChars?(self, param0) + } + + let handler69: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::xalign", handler: gCallback(handler69)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyXalign?(self, param0) + } + + let handler70: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::editing-canceled", handler: gCallback(handler70)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEditingCanceled?(self, param0) + } } -addSignal(name: "preedit-changed", handler: gCallback(handler11)) { [weak self] (param0: UnsafePointer) in - guard let self = self else { return } - self.preeditChanged?(self, param0) -} + @GObjectProperty(named: "activates-default") public var activatesDefault: Bool + + @GObjectProperty(named: "has-frame") public var hasFrame: Bool + + @GObjectProperty(named: "max-length") public var maxLength: Int + + /// The text that will be displayed in the #GtkEntry when it is empty + /// and unfocused. + @GObjectProperty(named: "placeholder-text") public var placeholderText: String + + @GObjectProperty(named: "text") public var text: String + + @GObjectProperty(named: "visibility") public var visibility: Bool + + @GObjectProperty(named: "width-chars") public var widthChars: Int + + /// The ::activate signal is emitted when the user hits + /// the Enter key. + /// + /// While this signal is used as a + /// [keybinding signal][GtkBindingSignal], + /// it is also commonly used by applications to intercept + /// activation of entries. + /// + /// The default bindings for this signal are all forms of the Enter key. + public var activate: ((Entry) -> Void)? + + /// The ::backspace signal is a + /// [keybinding signal][GtkBindingSignal] + /// which gets emitted when the user asks for it. + /// + /// The default bindings for this signal are + /// Backspace and Shift-Backspace. + public var backspace: ((Entry) -> Void)? + + /// The ::copy-clipboard signal is a + /// [keybinding signal][GtkBindingSignal] + /// which gets emitted to copy the selection to the clipboard. + /// + /// The default bindings for this signal are + /// Ctrl-c and Ctrl-Insert. + public var copyClipboard: ((Entry) -> Void)? + + /// The ::cut-clipboard signal is a + /// [keybinding signal][GtkBindingSignal] + /// which gets emitted to cut the selection to the clipboard. + /// + /// The default bindings for this signal are + /// Ctrl-x and Shift-Delete. + public var cutClipboard: ((Entry) -> Void)? + + /// The ::delete-from-cursor signal is a + /// [keybinding signal][GtkBindingSignal] + /// which gets emitted when the user initiates a text deletion. + /// + /// If the @type is %GTK_DELETE_CHARS, GTK+ deletes the selection + /// if there is one, otherwise it deletes the requested number + /// of characters. + /// + /// The default bindings for this signal are + /// Delete for deleting a character and Ctrl-Delete for + /// deleting a word. + public var deleteFromCursor: ((Entry, GtkDeleteType, Int) -> Void)? + + /// The ::icon-press signal is emitted when an activatable icon + /// is clicked. + public var iconPress: ((Entry, GtkEntryIconPosition, GdkEvent) -> Void)? + + /// The ::icon-release signal is emitted on the button release from a + /// mouse click over an activatable icon. + public var iconRelease: ((Entry, GtkEntryIconPosition, GdkEvent) -> Void)? + + /// The ::insert-at-cursor signal is a + /// [keybinding signal][GtkBindingSignal] + /// which gets emitted when the user initiates the insertion of a + /// fixed string at the cursor. + /// + /// This signal has no default bindings. + public var insertAtCursor: ((Entry, UnsafePointer) -> Void)? + + /// The ::insert-emoji signal is a + /// [keybinding signal][GtkBindingSignal] + /// which gets emitted to present the Emoji chooser for the @entry. + /// + /// The default bindings for this signal are Ctrl-. and Ctrl-; + public var insertEmoji: ((Entry) -> Void)? + + /// The ::move-cursor signal is a + /// [keybinding signal][GtkBindingSignal] + /// which gets emitted when the user initiates a cursor movement. + /// If the cursor is not visible in @entry, this signal causes + /// the viewport to be moved instead. + /// + /// Applications should not connect to it, but may emit it with + /// g_signal_emit_by_name() if they need to control the cursor + /// programmatically. + /// + /// The default bindings for this signal come in two variants, + /// the variant with the Shift modifier extends the selection, + /// the variant without the Shift modifer does not. + /// There are too many key combinations to list them all here. + /// - Arrow keys move by individual characters/lines + /// - Ctrl-arrow key combinations move by words/paragraphs + /// - Home/End keys move to the ends of the buffer + public var moveCursor: ((Entry, GtkMovementStep, Int, Bool) -> Void)? + + /// The ::paste-clipboard signal is a + /// [keybinding signal][GtkBindingSignal] + /// which gets emitted to paste the contents of the clipboard + /// into the text view. + /// + /// The default bindings for this signal are + /// Ctrl-v and Shift-Insert. + public var pasteClipboard: ((Entry) -> Void)? + + /// If an input method is used, the typed text will not immediately + /// be committed to the buffer. So if you are interested in the text, + /// connect to this signal. + public var preeditChanged: ((Entry, UnsafePointer) -> Void)? + + public var toggleDirection: ((Entry) -> Void)? + + /// The ::toggle-overwrite signal is a + /// [keybinding signal][GtkBindingSignal] + /// which gets emitted to toggle the overwrite mode of the entry. + /// + /// The default bindings for this signal is Insert. + public var toggleOverwrite: ((Entry) -> Void)? + + /// This signal is a sign for the cell renderer to update its + /// value from the @cell_editable. + /// + /// Implementations of #GtkCellEditable are responsible for + /// emitting this signal when they are done editing, e.g. + /// #GtkEntry emits this signal when the user presses Enter. Typical things to + /// do in a handler for ::editing-done are to capture the edited value, + /// disconnect the @cell_editable from signals on the #GtkCellRenderer, etc. + /// + /// gtk_cell_editable_editing_done() is a convenience method + /// for emitting #GtkCellEditable::editing-done. + public var editingDone: ((Entry) -> Void)? + + /// This signal is meant to indicate that the cell is finished + /// editing, and the @cell_editable widget is being removed and may + /// subsequently be destroyed. + /// + /// Implementations of #GtkCellEditable are responsible for + /// emitting this signal when they are done editing. It must + /// be emitted after the #GtkCellEditable::editing-done signal, + /// to give the cell renderer a chance to update the cell's value + /// before the widget is removed. + /// + /// gtk_cell_editable_remove_widget() is a convenience method + /// for emitting #GtkCellEditable::remove-widget. + public var removeWidget: ((Entry) -> Void)? -addSignal(name: "toggle-direction") { [weak self] () in - guard let self = self else { return } - self.toggleDirection?(self) -} + /// The ::changed signal is emitted at the end of a single + /// user-visible operation on the contents of the #GtkEditable. + /// + /// E.g., a paste operation that replaces the contents of the + /// selection will cause only one signal emission (even though it + /// is implemented by first deleting the selection, then inserting + /// the new content, and may cause multiple ::notify::text signals + /// to be emitted). + public var changed: ((Entry) -> Void)? -addSignal(name: "toggle-overwrite") { [weak self] () in - guard let self = self else { return } - self.toggleOverwrite?(self) -} + /// This signal is emitted when text is deleted from + /// the widget by the user. The default handler for + /// this signal will normally be responsible for deleting + /// the text, so by connecting to this signal and then + /// stopping the signal with g_signal_stop_emission(), it + /// is possible to modify the range of deleted text, or + /// prevent it from being deleted entirely. The @start_pos + /// and @end_pos parameters are interpreted as for + /// gtk_editable_delete_text(). + public var deleteText: ((Entry, Int, Int) -> Void)? -addSignal(name: "editing-done") { [weak self] () in - guard let self = self else { return } - self.editingDone?(self) -} + /// This signal is emitted when text is inserted into + /// the widget by the user. The default handler for + /// this signal will normally be responsible for inserting + /// the text, so by connecting to this signal and then + /// stopping the signal with g_signal_stop_emission(), it + /// is possible to modify the inserted text, or prevent + /// it from being inserted entirely. + public var insertText: ((Entry, UnsafePointer, Int, gpointer) -> Void)? -addSignal(name: "remove-widget") { [weak self] () in - guard let self = self else { return } - self.removeWidget?(self) -} + public var notifyActivatesDefault: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "changed") { [weak self] () in - guard let self = self else { return } - self.changed?(self) -} + public var notifyAttributes: ((Entry, OpaquePointer) -> Void)? -let handler17: @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } + public var notifyBuffer: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "delete-text", handler: gCallback(handler17)) { [weak self] (param0: Int, param1: Int) in - guard let self = self else { return } - self.deleteText?(self, param0, param1) -} - -let handler18: @convention(c) (UnsafeMutableRawPointer, UnsafePointer, Int, gpointer, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, value3, data in - SignalBox3, Int, gpointer>.run(data, value1, value2, value3) - } - -addSignal(name: "insert-text", handler: gCallback(handler18)) { [weak self] (param0: UnsafePointer, param1: Int, param2: gpointer) in - guard let self = self else { return } - self.insertText?(self, param0, param1, param2) -} - -let handler19: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::activates-default", handler: gCallback(handler19)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActivatesDefault?(self, param0) -} - -let handler20: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::attributes", handler: gCallback(handler20)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAttributes?(self, param0) -} - -let handler21: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::buffer", handler: gCallback(handler21)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyBuffer?(self, param0) -} - -let handler22: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::caps-lock-warning", handler: gCallback(handler22)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCapsLockWarning?(self, param0) -} - -let handler23: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::completion", handler: gCallback(handler23)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCompletion?(self, param0) -} - -let handler24: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::cursor-position", handler: gCallback(handler24)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCursorPosition?(self, param0) -} - -let handler25: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::editable", handler: gCallback(handler25)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEditable?(self, param0) -} - -let handler26: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::enable-emoji-completion", handler: gCallback(handler26)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEnableEmojiCompletion?(self, param0) -} - -let handler27: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::has-frame", handler: gCallback(handler27)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasFrame?(self, param0) -} - -let handler28: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::im-module", handler: gCallback(handler28)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyImModule?(self, param0) -} - -let handler29: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::inner-border", handler: gCallback(handler29)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInnerBorder?(self, param0) -} - -let handler30: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::input-hints", handler: gCallback(handler30)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInputHints?(self, param0) -} - -let handler31: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::input-purpose", handler: gCallback(handler31)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInputPurpose?(self, param0) -} - -let handler32: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::invisible-char", handler: gCallback(handler32)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInvisibleCharacter?(self, param0) -} - -let handler33: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::invisible-char-set", handler: gCallback(handler33)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInvisibleCharacterSet?(self, param0) -} - -let handler34: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::max-length", handler: gCallback(handler34)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMaxLength?(self, param0) -} - -let handler35: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::max-width-chars", handler: gCallback(handler35)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMaxWidthChars?(self, param0) -} - -let handler36: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::overwrite-mode", handler: gCallback(handler36)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyOverwriteMode?(self, param0) -} - -let handler37: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::placeholder-text", handler: gCallback(handler37)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPlaceholderText?(self, param0) -} - -let handler38: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::populate-all", handler: gCallback(handler38)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPopulateAll?(self, param0) -} - -let handler39: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-activatable", handler: gCallback(handler39)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconActivatable?(self, param0) -} - -let handler40: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-gicon", handler: gCallback(handler40)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconGicon?(self, param0) -} - -let handler41: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-name", handler: gCallback(handler41)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconName?(self, param0) -} - -let handler42: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-pixbuf", handler: gCallback(handler42)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconPixbuf?(self, param0) -} - -let handler43: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-sensitive", handler: gCallback(handler43)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconSensitive?(self, param0) -} - -let handler44: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-stock", handler: gCallback(handler44)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconStock?(self, param0) -} - -let handler45: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-storage-type", handler: gCallback(handler45)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconStorageType?(self, param0) -} - -let handler46: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::primary-icon-tooltip-markup", handler: gCallback(handler46)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconTooltipMarkup?(self, param0) -} + public var notifyCapsLockWarning: ((Entry, OpaquePointer) -> Void)? -let handler47: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyCompletion: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::primary-icon-tooltip-text", handler: gCallback(handler47)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPrimaryIconTooltipText?(self, param0) -} + public var notifyCursorPosition: ((Entry, OpaquePointer) -> Void)? -let handler48: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyEditable: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::progress-fraction", handler: gCallback(handler48)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyProgressFraction?(self, param0) -} + public var notifyEnableEmojiCompletion: ((Entry, OpaquePointer) -> Void)? -let handler49: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyHasFrame: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::progress-pulse-step", handler: gCallback(handler49)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyProgressPulseStep?(self, param0) -} + public var notifyImModule: ((Entry, OpaquePointer) -> Void)? -let handler50: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyInnerBorder: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::scroll-offset", handler: gCallback(handler50)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyScrollOffset?(self, param0) -} + public var notifyInputHints: ((Entry, OpaquePointer) -> Void)? -let handler51: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyInputPurpose: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::secondary-icon-activatable", handler: gCallback(handler51)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconActivatable?(self, param0) -} + public var notifyInvisibleCharacter: ((Entry, OpaquePointer) -> Void)? -let handler52: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyInvisibleCharacterSet: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::secondary-icon-gicon", handler: gCallback(handler52)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconGicon?(self, param0) -} + public var notifyMaxLength: ((Entry, OpaquePointer) -> Void)? -let handler53: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyMaxWidthChars: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::secondary-icon-name", handler: gCallback(handler53)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconName?(self, param0) -} + public var notifyOverwriteMode: ((Entry, OpaquePointer) -> Void)? -let handler54: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyPlaceholderText: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::secondary-icon-pixbuf", handler: gCallback(handler54)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconPixbuf?(self, param0) -} + public var notifyPopulateAll: ((Entry, OpaquePointer) -> Void)? -let handler55: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyPrimaryIconActivatable: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::secondary-icon-sensitive", handler: gCallback(handler55)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconSensitive?(self, param0) -} + public var notifyPrimaryIconGicon: ((Entry, OpaquePointer) -> Void)? -let handler56: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyPrimaryIconName: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::secondary-icon-stock", handler: gCallback(handler56)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconStock?(self, param0) -} + public var notifyPrimaryIconPixbuf: ((Entry, OpaquePointer) -> Void)? -let handler57: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyPrimaryIconSensitive: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::secondary-icon-storage-type", handler: gCallback(handler57)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconStorageType?(self, param0) -} + public var notifyPrimaryIconStock: ((Entry, OpaquePointer) -> Void)? -let handler58: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyPrimaryIconStorageType: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::secondary-icon-tooltip-markup", handler: gCallback(handler58)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconTooltipMarkup?(self, param0) -} + public var notifyPrimaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? -let handler59: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyPrimaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::secondary-icon-tooltip-text", handler: gCallback(handler59)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySecondaryIconTooltipText?(self, param0) -} + public var notifyProgressFraction: ((Entry, OpaquePointer) -> Void)? -let handler60: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyProgressPulseStep: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::selection-bound", handler: gCallback(handler60)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectionBound?(self, param0) -} + public var notifyScrollOffset: ((Entry, OpaquePointer) -> Void)? -let handler61: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifySecondaryIconActivatable: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::shadow-type", handler: gCallback(handler61)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShadowType?(self, param0) -} + public var notifySecondaryIconGicon: ((Entry, OpaquePointer) -> Void)? -let handler62: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifySecondaryIconName: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::show-emoji-icon", handler: gCallback(handler62)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowEmojiIcon?(self, param0) -} + public var notifySecondaryIconPixbuf: ((Entry, OpaquePointer) -> Void)? -let handler63: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifySecondaryIconSensitive: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::tabs", handler: gCallback(handler63)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTabs?(self, param0) -} + public var notifySecondaryIconStock: ((Entry, OpaquePointer) -> Void)? -let handler64: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifySecondaryIconStorageType: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::text", handler: gCallback(handler64)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyText?(self, param0) -} + public var notifySecondaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? -let handler65: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifySecondaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::text-length", handler: gCallback(handler65)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTextLength?(self, param0) -} + public var notifySelectionBound: ((Entry, OpaquePointer) -> Void)? -let handler66: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyShadowType: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::truncate-multiline", handler: gCallback(handler66)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTruncateMultiline?(self, param0) -} + public var notifyShowEmojiIcon: ((Entry, OpaquePointer) -> Void)? -let handler67: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyTabs: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::visibility", handler: gCallback(handler67)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyVisibility?(self, param0) -} + public var notifyText: ((Entry, OpaquePointer) -> Void)? -let handler68: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyTextLength: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::width-chars", handler: gCallback(handler68)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWidthChars?(self, param0) -} + public var notifyTruncateMultiline: ((Entry, OpaquePointer) -> Void)? -let handler69: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyVisibility: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::xalign", handler: gCallback(handler69)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyXalign?(self, param0) -} + public var notifyWidthChars: ((Entry, OpaquePointer) -> Void)? -let handler70: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyXalign: ((Entry, OpaquePointer) -> Void)? -addSignal(name: "notify::editing-canceled", handler: gCallback(handler70)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEditingCanceled?(self, param0) -} + public var notifyEditingCanceled: ((Entry, OpaquePointer) -> Void)? } - - -@GObjectProperty(named: "activates-default") public var activatesDefault: Bool - - -@GObjectProperty(named: "has-frame") public var hasFrame: Bool - - -@GObjectProperty(named: "max-length") public var maxLength: Int - -/// The text that will be displayed in the #GtkEntry when it is empty -/// and unfocused. -@GObjectProperty(named: "placeholder-text") public var placeholderText: String - - -@GObjectProperty(named: "text") public var text: String - - -@GObjectProperty(named: "visibility") public var visibility: Bool - - -@GObjectProperty(named: "width-chars") public var widthChars: Int - -/// The ::activate signal is emitted when the user hits -/// the Enter key. -/// -/// While this signal is used as a -/// [keybinding signal][GtkBindingSignal], -/// it is also commonly used by applications to intercept -/// activation of entries. -/// -/// The default bindings for this signal are all forms of the Enter key. -public var activate: ((Entry) -> Void)? - -/// The ::backspace signal is a -/// [keybinding signal][GtkBindingSignal] -/// which gets emitted when the user asks for it. -/// -/// The default bindings for this signal are -/// Backspace and Shift-Backspace. -public var backspace: ((Entry) -> Void)? - -/// The ::copy-clipboard signal is a -/// [keybinding signal][GtkBindingSignal] -/// which gets emitted to copy the selection to the clipboard. -/// -/// The default bindings for this signal are -/// Ctrl-c and Ctrl-Insert. -public var copyClipboard: ((Entry) -> Void)? - -/// The ::cut-clipboard signal is a -/// [keybinding signal][GtkBindingSignal] -/// which gets emitted to cut the selection to the clipboard. -/// -/// The default bindings for this signal are -/// Ctrl-x and Shift-Delete. -public var cutClipboard: ((Entry) -> Void)? - -/// The ::delete-from-cursor signal is a -/// [keybinding signal][GtkBindingSignal] -/// which gets emitted when the user initiates a text deletion. -/// -/// If the @type is %GTK_DELETE_CHARS, GTK+ deletes the selection -/// if there is one, otherwise it deletes the requested number -/// of characters. -/// -/// The default bindings for this signal are -/// Delete for deleting a character and Ctrl-Delete for -/// deleting a word. -public var deleteFromCursor: ((Entry, GtkDeleteType, Int) -> Void)? - -/// The ::icon-press signal is emitted when an activatable icon -/// is clicked. -public var iconPress: ((Entry, GtkEntryIconPosition, GdkEvent) -> Void)? - -/// The ::icon-release signal is emitted on the button release from a -/// mouse click over an activatable icon. -public var iconRelease: ((Entry, GtkEntryIconPosition, GdkEvent) -> Void)? - -/// The ::insert-at-cursor signal is a -/// [keybinding signal][GtkBindingSignal] -/// which gets emitted when the user initiates the insertion of a -/// fixed string at the cursor. -/// -/// This signal has no default bindings. -public var insertAtCursor: ((Entry, UnsafePointer) -> Void)? - -/// The ::insert-emoji signal is a -/// [keybinding signal][GtkBindingSignal] -/// which gets emitted to present the Emoji chooser for the @entry. -/// -/// The default bindings for this signal are Ctrl-. and Ctrl-; -public var insertEmoji: ((Entry) -> Void)? - -/// The ::move-cursor signal is a -/// [keybinding signal][GtkBindingSignal] -/// which gets emitted when the user initiates a cursor movement. -/// If the cursor is not visible in @entry, this signal causes -/// the viewport to be moved instead. -/// -/// Applications should not connect to it, but may emit it with -/// g_signal_emit_by_name() if they need to control the cursor -/// programmatically. -/// -/// The default bindings for this signal come in two variants, -/// the variant with the Shift modifier extends the selection, -/// the variant without the Shift modifer does not. -/// There are too many key combinations to list them all here. -/// - Arrow keys move by individual characters/lines -/// - Ctrl-arrow key combinations move by words/paragraphs -/// - Home/End keys move to the ends of the buffer -public var moveCursor: ((Entry, GtkMovementStep, Int, Bool) -> Void)? - -/// The ::paste-clipboard signal is a -/// [keybinding signal][GtkBindingSignal] -/// which gets emitted to paste the contents of the clipboard -/// into the text view. -/// -/// The default bindings for this signal are -/// Ctrl-v and Shift-Insert. -public var pasteClipboard: ((Entry) -> Void)? - -/// If an input method is used, the typed text will not immediately -/// be committed to the buffer. So if you are interested in the text, -/// connect to this signal. -public var preeditChanged: ((Entry, UnsafePointer) -> Void)? - - -public var toggleDirection: ((Entry) -> Void)? - -/// The ::toggle-overwrite signal is a -/// [keybinding signal][GtkBindingSignal] -/// which gets emitted to toggle the overwrite mode of the entry. -/// -/// The default bindings for this signal is Insert. -public var toggleOverwrite: ((Entry) -> Void)? - -/// This signal is a sign for the cell renderer to update its -/// value from the @cell_editable. -/// -/// Implementations of #GtkCellEditable are responsible for -/// emitting this signal when they are done editing, e.g. -/// #GtkEntry emits this signal when the user presses Enter. Typical things to -/// do in a handler for ::editing-done are to capture the edited value, -/// disconnect the @cell_editable from signals on the #GtkCellRenderer, etc. -/// -/// gtk_cell_editable_editing_done() is a convenience method -/// for emitting #GtkCellEditable::editing-done. -public var editingDone: ((Entry) -> Void)? - -/// This signal is meant to indicate that the cell is finished -/// editing, and the @cell_editable widget is being removed and may -/// subsequently be destroyed. -/// -/// Implementations of #GtkCellEditable are responsible for -/// emitting this signal when they are done editing. It must -/// be emitted after the #GtkCellEditable::editing-done signal, -/// to give the cell renderer a chance to update the cell's value -/// before the widget is removed. -/// -/// gtk_cell_editable_remove_widget() is a convenience method -/// for emitting #GtkCellEditable::remove-widget. -public var removeWidget: ((Entry) -> Void)? - -/// The ::changed signal is emitted at the end of a single -/// user-visible operation on the contents of the #GtkEditable. -/// -/// E.g., a paste operation that replaces the contents of the -/// selection will cause only one signal emission (even though it -/// is implemented by first deleting the selection, then inserting -/// the new content, and may cause multiple ::notify::text signals -/// to be emitted). -public var changed: ((Entry) -> Void)? - -/// This signal is emitted when text is deleted from -/// the widget by the user. The default handler for -/// this signal will normally be responsible for deleting -/// the text, so by connecting to this signal and then -/// stopping the signal with g_signal_stop_emission(), it -/// is possible to modify the range of deleted text, or -/// prevent it from being deleted entirely. The @start_pos -/// and @end_pos parameters are interpreted as for -/// gtk_editable_delete_text(). -public var deleteText: ((Entry, Int, Int) -> Void)? - -/// This signal is emitted when text is inserted into -/// the widget by the user. The default handler for -/// this signal will normally be responsible for inserting -/// the text, so by connecting to this signal and then -/// stopping the signal with g_signal_stop_emission(), it -/// is possible to modify the inserted text, or prevent -/// it from being inserted entirely. -public var insertText: ((Entry, UnsafePointer, Int, gpointer) -> Void)? - - -public var notifyActivatesDefault: ((Entry, OpaquePointer) -> Void)? - - -public var notifyAttributes: ((Entry, OpaquePointer) -> Void)? - - -public var notifyBuffer: ((Entry, OpaquePointer) -> Void)? - - -public var notifyCapsLockWarning: ((Entry, OpaquePointer) -> Void)? - - -public var notifyCompletion: ((Entry, OpaquePointer) -> Void)? - - -public var notifyCursorPosition: ((Entry, OpaquePointer) -> Void)? - - -public var notifyEditable: ((Entry, OpaquePointer) -> Void)? - - -public var notifyEnableEmojiCompletion: ((Entry, OpaquePointer) -> Void)? - - -public var notifyHasFrame: ((Entry, OpaquePointer) -> Void)? - - -public var notifyImModule: ((Entry, OpaquePointer) -> Void)? - - -public var notifyInnerBorder: ((Entry, OpaquePointer) -> Void)? - - -public var notifyInputHints: ((Entry, OpaquePointer) -> Void)? - - -public var notifyInputPurpose: ((Entry, OpaquePointer) -> Void)? - - -public var notifyInvisibleCharacter: ((Entry, OpaquePointer) -> Void)? - - -public var notifyInvisibleCharacterSet: ((Entry, OpaquePointer) -> Void)? - - -public var notifyMaxLength: ((Entry, OpaquePointer) -> Void)? - - -public var notifyMaxWidthChars: ((Entry, OpaquePointer) -> Void)? - - -public var notifyOverwriteMode: ((Entry, OpaquePointer) -> Void)? - - -public var notifyPlaceholderText: ((Entry, OpaquePointer) -> Void)? - - -public var notifyPopulateAll: ((Entry, OpaquePointer) -> Void)? - - -public var notifyPrimaryIconActivatable: ((Entry, OpaquePointer) -> Void)? - - -public var notifyPrimaryIconGicon: ((Entry, OpaquePointer) -> Void)? - - -public var notifyPrimaryIconName: ((Entry, OpaquePointer) -> Void)? - - -public var notifyPrimaryIconPixbuf: ((Entry, OpaquePointer) -> Void)? - - -public var notifyPrimaryIconSensitive: ((Entry, OpaquePointer) -> Void)? - - -public var notifyPrimaryIconStock: ((Entry, OpaquePointer) -> Void)? - - -public var notifyPrimaryIconStorageType: ((Entry, OpaquePointer) -> Void)? - - -public var notifyPrimaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? - - -public var notifyPrimaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? - - -public var notifyProgressFraction: ((Entry, OpaquePointer) -> Void)? - - -public var notifyProgressPulseStep: ((Entry, OpaquePointer) -> Void)? - - -public var notifyScrollOffset: ((Entry, OpaquePointer) -> Void)? - - -public var notifySecondaryIconActivatable: ((Entry, OpaquePointer) -> Void)? - - -public var notifySecondaryIconGicon: ((Entry, OpaquePointer) -> Void)? - - -public var notifySecondaryIconName: ((Entry, OpaquePointer) -> Void)? - - -public var notifySecondaryIconPixbuf: ((Entry, OpaquePointer) -> Void)? - - -public var notifySecondaryIconSensitive: ((Entry, OpaquePointer) -> Void)? - - -public var notifySecondaryIconStock: ((Entry, OpaquePointer) -> Void)? - - -public var notifySecondaryIconStorageType: ((Entry, OpaquePointer) -> Void)? - - -public var notifySecondaryIconTooltipMarkup: ((Entry, OpaquePointer) -> Void)? - - -public var notifySecondaryIconTooltipText: ((Entry, OpaquePointer) -> Void)? - - -public var notifySelectionBound: ((Entry, OpaquePointer) -> Void)? - - -public var notifyShadowType: ((Entry, OpaquePointer) -> Void)? - - -public var notifyShowEmojiIcon: ((Entry, OpaquePointer) -> Void)? - - -public var notifyTabs: ((Entry, OpaquePointer) -> Void)? - - -public var notifyText: ((Entry, OpaquePointer) -> Void)? - - -public var notifyTextLength: ((Entry, OpaquePointer) -> Void)? - - -public var notifyTruncateMultiline: ((Entry, OpaquePointer) -> Void)? - - -public var notifyVisibility: ((Entry, OpaquePointer) -> Void)? - - -public var notifyWidthChars: ((Entry, OpaquePointer) -> Void)? - - -public var notifyXalign: ((Entry, OpaquePointer) -> Void)? - - -public var notifyEditingCanceled: ((Entry, OpaquePointer) -> Void)? -} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/EventBox.swift b/Sources/Gtk3/Generated/EventBox.swift index 762b86ec53..a8a6766047 100644 --- a/Sources/Gtk3/Generated/EventBox.swift +++ b/Sources/Gtk3/Generated/EventBox.swift @@ -5,45 +5,45 @@ import CGtk3 /// which do not have their own window. open class EventBox: Bin { /// Creates a new #GtkEventBox. -public convenience init() { - self.init( - gtk_event_box_new() - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_event_box_new() + ) } -addSignal(name: "notify::above-child", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAboveChild?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::above-child", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAboveChild?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::visible-window", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyVisibleWindow?(self, param0) + } } -addSignal(name: "notify::visible-window", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyVisibleWindow?(self, param0) -} -} - - -@GObjectProperty(named: "above-child") public var aboveChild: Bool - + @GObjectProperty(named: "above-child") public var aboveChild: Bool -@GObjectProperty(named: "visible-window") public var visibleWindow: Bool + @GObjectProperty(named: "visible-window") public var visibleWindow: Bool + public var notifyAboveChild: ((EventBox, OpaquePointer) -> Void)? -public var notifyAboveChild: ((EventBox, OpaquePointer) -> Void)? - - -public var notifyVisibleWindow: ((EventBox, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyVisibleWindow: ((EventBox, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk3/Generated/EventController.swift b/Sources/Gtk3/Generated/EventController.swift index 9cbbd35142..f5897da2ab 100644 --- a/Sources/Gtk3/Generated/EventController.swift +++ b/Sources/Gtk3/Generated/EventController.swift @@ -4,35 +4,36 @@ import CGtk3 /// controllers. Those react to a series of #GdkEvents, and possibly trigger /// actions as a consequence of those. open class EventController: GObject { - public override func registerSignals() { - super.registerSignals() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + super.registerSignals() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::propagation-phase", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPropagationPhase?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::widget", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWidget?(self, param0) + } } -addSignal(name: "notify::propagation-phase", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPropagationPhase?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyPropagationPhase: ((EventController, OpaquePointer) -> Void)? -addSignal(name: "notify::widget", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWidget?(self, param0) + public var notifyWidget: ((EventController, OpaquePointer) -> Void)? } -} - - -public var notifyPropagationPhase: ((EventController, OpaquePointer) -> Void)? - - -public var notifyWidget: ((EventController, OpaquePointer) -> Void)? -} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ExpanderStyle.swift b/Sources/Gtk3/Generated/ExpanderStyle.swift index 6a698983f1..e6b3c21f65 100644 --- a/Sources/Gtk3/Generated/ExpanderStyle.swift +++ b/Sources/Gtk3/Generated/ExpanderStyle.swift @@ -5,28 +5,28 @@ public enum ExpanderStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkExpanderStyle /// The style used for a collapsed subtree. -case collapsed -/// Intermediate style used during animation. -case semiCollapsed -/// Intermediate style used during animation. -case semiExpanded -/// The style used for an expanded subtree. -case expanded + case collapsed + /// Intermediate style used during animation. + case semiCollapsed + /// Intermediate style used during animation. + case semiExpanded + /// The style used for an expanded subtree. + case expanded public static var type: GType { - gtk_expander_style_get_type() -} + gtk_expander_style_get_type() + } public init(from gtkEnum: GtkExpanderStyle) { switch gtkEnum { case GTK_EXPANDER_COLLAPSED: - self = .collapsed -case GTK_EXPANDER_SEMI_COLLAPSED: - self = .semiCollapsed -case GTK_EXPANDER_SEMI_EXPANDED: - self = .semiExpanded -case GTK_EXPANDER_EXPANDED: - self = .expanded + self = .collapsed + case GTK_EXPANDER_SEMI_COLLAPSED: + self = .semiCollapsed + case GTK_EXPANDER_SEMI_EXPANDED: + self = .semiExpanded + case GTK_EXPANDER_EXPANDED: + self = .expanded default: fatalError("Unsupported GtkExpanderStyle enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_EXPANDER_EXPANDED: public func toGtk() -> GtkExpanderStyle { switch self { case .collapsed: - return GTK_EXPANDER_COLLAPSED -case .semiCollapsed: - return GTK_EXPANDER_SEMI_COLLAPSED -case .semiExpanded: - return GTK_EXPANDER_SEMI_EXPANDED -case .expanded: - return GTK_EXPANDER_EXPANDED + return GTK_EXPANDER_COLLAPSED + case .semiCollapsed: + return GTK_EXPANDER_SEMI_COLLAPSED + case .semiExpanded: + return GTK_EXPANDER_SEMI_EXPANDED + case .expanded: + return GTK_EXPANDER_EXPANDED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/FileChooser.swift b/Sources/Gtk3/Generated/FileChooser.swift index d019ad473f..b05abdee60 100644 --- a/Sources/Gtk3/Generated/FileChooser.swift +++ b/Sources/Gtk3/Generated/FileChooser.swift @@ -7,25 +7,25 @@ import CGtk3 /// implements the #GtkFileChooser interface unless you are trying to /// adapt an existing file selector to expose a standard programming /// interface. -/// +/// /// #GtkFileChooser allows for shortcuts to various places in the filesystem. /// In the default implementation these are displayed in the left pane. It /// may be a bit confusing at first that these shortcuts come from various /// sources and in various flavours, so lets explain the terminology here: -/// +/// /// - Bookmarks: are created by the user, by dragging folders from the /// right pane to the left pane, or by using the “Add”. Bookmarks /// can be renamed and deleted by the user. -/// +/// /// - Shortcuts: can be provided by the application. For example, a Paint /// program may want to add a shortcut for a Clipart folder. Shortcuts /// cannot be modified by the user. -/// +/// /// - Volumes: are provided by the underlying filesystem abstraction. They are /// the “roots” of the filesystem. -/// +/// /// # File Names and Encodings -/// +/// /// When the user is finished selecting files in a /// #GtkFileChooser, your program can get the selected names /// either as filenames or as URIs. For URIs, the normal escaping @@ -35,7 +35,7 @@ import CGtk3 /// `G_FILENAME_ENCODING` environment variable. /// Please see the GLib documentation for more details about this /// variable. -/// +/// /// This means that while you can pass the result of /// gtk_file_chooser_get_filename() to g_open() or g_fopen(), /// you may not be able to directly set it as the text of a @@ -43,16 +43,16 @@ import CGtk3 /// which all GTK+ widgets expect. You should use g_filename_to_utf8() /// to convert filenames into strings that can be passed to GTK+ /// widgets. -/// +/// /// # Adding a Preview Widget -/// +/// /// You can add a custom preview widget to a file chooser and then /// get notification about when the preview needs to be updated. /// To install a preview widget, use /// gtk_file_chooser_set_preview_widget(). Then, connect to the /// #GtkFileChooser::update-preview signal to get notified when /// you need to update the contents of the preview. -/// +/// /// Your callback should use /// gtk_file_chooser_get_preview_filename() to see what needs /// previewing. Once you have generated the preview for the @@ -60,21 +60,21 @@ import CGtk3 /// gtk_file_chooser_set_preview_widget_active() with a boolean /// flag that indicates whether your callback could successfully /// generate a preview. -/// +/// /// ## Example: Using a Preview Widget ## {#gtkfilechooser-preview} /// |[ /// { /// GtkImage *preview; -/// +/// /// ... -/// +/// /// preview = gtk_image_new (); -/// +/// /// gtk_file_chooser_set_preview_widget (my_file_chooser, preview); /// g_signal_connect (my_file_chooser, "update-preview", /// G_CALLBACK (update_preview_cb), preview); /// } -/// +/// /// static void /// update_preview_cb (GtkFileChooser *file_chooser, gpointer data) /// { @@ -82,192 +82,187 @@ import CGtk3 /// char *filename; /// GdkPixbuf *pixbuf; /// gboolean have_preview; -/// +/// /// preview = GTK_WIDGET (data); /// filename = gtk_file_chooser_get_preview_filename (file_chooser); -/// +/// /// pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 128, 128, NULL); /// have_preview = (pixbuf != NULL); /// g_free (filename); -/// +/// /// gtk_image_set_from_pixbuf (GTK_IMAGE (preview), pixbuf); /// if (pixbuf) /// g_object_unref (pixbuf); -/// +/// /// gtk_file_chooser_set_preview_widget_active (file_chooser, have_preview); /// } /// ]| -/// +/// /// # Adding Extra Widgets -/// +/// /// You can add extra widgets to a file chooser to provide options /// that are not present in the default design. For example, you /// can add a toggle button to give the user the option to open a /// file in read-only mode. You can use /// gtk_file_chooser_set_extra_widget() to insert additional /// widgets in a file chooser. -/// +/// /// An example for adding extra widgets: /// |[ -/// +/// /// GtkWidget *toggle; -/// +/// /// ... -/// +/// /// toggle = gtk_check_button_new_with_label ("Open file read-only"); /// gtk_widget_show (toggle); /// gtk_file_chooser_set_extra_widget (my_file_chooser, toggle); /// } /// ]| -/// +/// /// If you want to set more than one extra widget in the file /// chooser, you can a container such as a #GtkBox or a #GtkGrid /// and include your widgets in it. Then, set the container as /// the whole extra widget. public protocol FileChooser: GObjectRepresentable { - -var action: FileChooserAction { get set } + var action: FileChooserAction { get set } -var localOnly: Bool { get set } + var localOnly: Bool { get set } + var previewWidgetActive: Bool { get set } -var previewWidgetActive: Bool { get set } + var selectMultiple: Bool { get set } + var showHidden: Bool { get set } -var selectMultiple: Bool { get set } - - -var showHidden: Bool { get set } - - -var usePreviewLabel: Bool { get set } + var usePreviewLabel: Bool { get set } /// This signal gets emitted whenever it is appropriate to present a -/// confirmation dialog when the user has selected a file name that -/// already exists. The signal only gets emitted when the file -/// chooser is in %GTK_FILE_CHOOSER_ACTION_SAVE mode. -/// -/// Most applications just need to turn on the -/// #GtkFileChooser:do-overwrite-confirmation property (or call the -/// gtk_file_chooser_set_do_overwrite_confirmation() function), and -/// they will automatically get a stock confirmation dialog. -/// Applications which need to customize this behavior should do -/// that, and also connect to the #GtkFileChooser::confirm-overwrite -/// signal. -/// -/// A signal handler for this signal must return a -/// #GtkFileChooserConfirmation value, which indicates the action to -/// take. If the handler determines that the user wants to select a -/// different filename, it should return -/// %GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN. If it determines -/// that the user is satisfied with his choice of file name, it -/// should return %GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME. -/// On the other hand, if it determines that the stock confirmation -/// dialog should be used, it should return -/// %GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM. The following example -/// illustrates this. -/// -/// ## Custom confirmation ## {#gtkfilechooser-confirmation} -/// -/// |[ -/// static GtkFileChooserConfirmation -/// confirm_overwrite_callback (GtkFileChooser *chooser, gpointer data) -/// { -/// char *uri; -/// -/// uri = gtk_file_chooser_get_uri (chooser); -/// -/// if (is_uri_read_only (uri)) -/// { -/// if (user_wants_to_replace_read_only_file (uri)) -/// return GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME; -/// else -/// return GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN; -/// } else -/// return GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM; // fall back to the default dialog -/// } -/// -/// ... -/// -/// chooser = gtk_file_chooser_dialog_new (...); -/// -/// gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); -/// g_signal_connect (chooser, "confirm-overwrite", -/// G_CALLBACK (confirm_overwrite_callback), NULL); -/// -/// if (gtk_dialog_run (chooser) == GTK_RESPONSE_ACCEPT) -/// save_to_file (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); -/// -/// gtk_widget_destroy (chooser); -/// ]| -var confirmOverwrite: ((Self) -> Void)? { get set } + /// confirmation dialog when the user has selected a file name that + /// already exists. The signal only gets emitted when the file + /// chooser is in %GTK_FILE_CHOOSER_ACTION_SAVE mode. + /// + /// Most applications just need to turn on the + /// #GtkFileChooser:do-overwrite-confirmation property (or call the + /// gtk_file_chooser_set_do_overwrite_confirmation() function), and + /// they will automatically get a stock confirmation dialog. + /// Applications which need to customize this behavior should do + /// that, and also connect to the #GtkFileChooser::confirm-overwrite + /// signal. + /// + /// A signal handler for this signal must return a + /// #GtkFileChooserConfirmation value, which indicates the action to + /// take. If the handler determines that the user wants to select a + /// different filename, it should return + /// %GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN. If it determines + /// that the user is satisfied with his choice of file name, it + /// should return %GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME. + /// On the other hand, if it determines that the stock confirmation + /// dialog should be used, it should return + /// %GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM. The following example + /// illustrates this. + /// + /// ## Custom confirmation ## {#gtkfilechooser-confirmation} + /// + /// |[ + /// static GtkFileChooserConfirmation + /// confirm_overwrite_callback (GtkFileChooser *chooser, gpointer data) + /// { + /// char *uri; + /// + /// uri = gtk_file_chooser_get_uri (chooser); + /// + /// if (is_uri_read_only (uri)) + /// { + /// if (user_wants_to_replace_read_only_file (uri)) + /// return GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME; + /// else + /// return GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN; + /// } else + /// return GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM; // fall back to the default dialog + /// } + /// + /// ... + /// + /// chooser = gtk_file_chooser_dialog_new (...); + /// + /// gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); + /// g_signal_connect (chooser, "confirm-overwrite", + /// G_CALLBACK (confirm_overwrite_callback), NULL); + /// + /// if (gtk_dialog_run (chooser) == GTK_RESPONSE_ACCEPT) + /// save_to_file (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); + /// + /// gtk_widget_destroy (chooser); + /// ]| + var confirmOverwrite: ((Self) -> Void)? { get set } -/// This signal is emitted when the current folder in a #GtkFileChooser -/// changes. This can happen due to the user performing some action that -/// changes folders, such as selecting a bookmark or visiting a folder on the -/// file list. It can also happen as a result of calling a function to -/// explicitly change the current folder in a file chooser. -/// -/// Normally you do not need to connect to this signal, unless you need to keep -/// track of which folder a file chooser is showing. -/// -/// See also: gtk_file_chooser_set_current_folder(), -/// gtk_file_chooser_get_current_folder(), -/// gtk_file_chooser_set_current_folder_uri(), -/// gtk_file_chooser_get_current_folder_uri(). -var currentFolderChanged: ((Self) -> Void)? { get set } + /// This signal is emitted when the current folder in a #GtkFileChooser + /// changes. This can happen due to the user performing some action that + /// changes folders, such as selecting a bookmark or visiting a folder on the + /// file list. It can also happen as a result of calling a function to + /// explicitly change the current folder in a file chooser. + /// + /// Normally you do not need to connect to this signal, unless you need to keep + /// track of which folder a file chooser is showing. + /// + /// See also: gtk_file_chooser_set_current_folder(), + /// gtk_file_chooser_get_current_folder(), + /// gtk_file_chooser_set_current_folder_uri(), + /// gtk_file_chooser_get_current_folder_uri(). + var currentFolderChanged: ((Self) -> Void)? { get set } -/// This signal is emitted when the user "activates" a file in the file -/// chooser. This can happen by double-clicking on a file in the file list, or -/// by pressing `Enter`. -/// -/// Normally you do not need to connect to this signal. It is used internally -/// by #GtkFileChooserDialog to know when to activate the default button in the -/// dialog. -/// -/// See also: gtk_file_chooser_get_filename(), -/// gtk_file_chooser_get_filenames(), gtk_file_chooser_get_uri(), -/// gtk_file_chooser_get_uris(). -var fileActivated: ((Self) -> Void)? { get set } + /// This signal is emitted when the user "activates" a file in the file + /// chooser. This can happen by double-clicking on a file in the file list, or + /// by pressing `Enter`. + /// + /// Normally you do not need to connect to this signal. It is used internally + /// by #GtkFileChooserDialog to know when to activate the default button in the + /// dialog. + /// + /// See also: gtk_file_chooser_get_filename(), + /// gtk_file_chooser_get_filenames(), gtk_file_chooser_get_uri(), + /// gtk_file_chooser_get_uris(). + var fileActivated: ((Self) -> Void)? { get set } -/// This signal is emitted when there is a change in the set of selected files -/// in a #GtkFileChooser. This can happen when the user modifies the selection -/// with the mouse or the keyboard, or when explicitly calling functions to -/// change the selection. -/// -/// Normally you do not need to connect to this signal, as it is easier to wait -/// for the file chooser to finish running, and then to get the list of -/// selected files using the functions mentioned below. -/// -/// See also: gtk_file_chooser_select_filename(), -/// gtk_file_chooser_unselect_filename(), gtk_file_chooser_get_filename(), -/// gtk_file_chooser_get_filenames(), gtk_file_chooser_select_uri(), -/// gtk_file_chooser_unselect_uri(), gtk_file_chooser_get_uri(), -/// gtk_file_chooser_get_uris(). -var selectionChanged: ((Self) -> Void)? { get set } + /// This signal is emitted when there is a change in the set of selected files + /// in a #GtkFileChooser. This can happen when the user modifies the selection + /// with the mouse or the keyboard, or when explicitly calling functions to + /// change the selection. + /// + /// Normally you do not need to connect to this signal, as it is easier to wait + /// for the file chooser to finish running, and then to get the list of + /// selected files using the functions mentioned below. + /// + /// See also: gtk_file_chooser_select_filename(), + /// gtk_file_chooser_unselect_filename(), gtk_file_chooser_get_filename(), + /// gtk_file_chooser_get_filenames(), gtk_file_chooser_select_uri(), + /// gtk_file_chooser_unselect_uri(), gtk_file_chooser_get_uri(), + /// gtk_file_chooser_get_uris(). + var selectionChanged: ((Self) -> Void)? { get set } -/// This signal is emitted when the preview in a file chooser should be -/// regenerated. For example, this can happen when the currently selected file -/// changes. You should use this signal if you want your file chooser to have -/// a preview widget. -/// -/// Once you have installed a preview widget with -/// gtk_file_chooser_set_preview_widget(), you should update it when this -/// signal is emitted. You can use the functions -/// gtk_file_chooser_get_preview_filename() or -/// gtk_file_chooser_get_preview_uri() to get the name of the file to preview. -/// Your widget may not be able to preview all kinds of files; your callback -/// must call gtk_file_chooser_set_preview_widget_active() to inform the file -/// chooser about whether the preview was generated successfully or not. -/// -/// Please see the example code in -/// [Using a Preview Widget][gtkfilechooser-preview]. -/// -/// See also: gtk_file_chooser_set_preview_widget(), -/// gtk_file_chooser_set_preview_widget_active(), -/// gtk_file_chooser_set_use_preview_label(), -/// gtk_file_chooser_get_preview_filename(), -/// gtk_file_chooser_get_preview_uri(). -var updatePreview: ((Self) -> Void)? { get set } -} \ No newline at end of file + /// This signal is emitted when the preview in a file chooser should be + /// regenerated. For example, this can happen when the currently selected file + /// changes. You should use this signal if you want your file chooser to have + /// a preview widget. + /// + /// Once you have installed a preview widget with + /// gtk_file_chooser_set_preview_widget(), you should update it when this + /// signal is emitted. You can use the functions + /// gtk_file_chooser_get_preview_filename() or + /// gtk_file_chooser_get_preview_uri() to get the name of the file to preview. + /// Your widget may not be able to preview all kinds of files; your callback + /// must call gtk_file_chooser_set_preview_widget_active() to inform the file + /// chooser about whether the preview was generated successfully or not. + /// + /// Please see the example code in + /// [Using a Preview Widget][gtkfilechooser-preview]. + /// + /// See also: gtk_file_chooser_set_preview_widget(), + /// gtk_file_chooser_set_preview_widget_active(), + /// gtk_file_chooser_set_use_preview_label(), + /// gtk_file_chooser_get_preview_filename(), + /// gtk_file_chooser_get_preview_uri(). + var updatePreview: ((Self) -> Void)? { get set } +} diff --git a/Sources/Gtk3/Generated/FileChooserAction.swift b/Sources/Gtk3/Generated/FileChooserAction.swift index af20d95f67..2b8313d5ef 100644 --- a/Sources/Gtk3/Generated/FileChooserAction.swift +++ b/Sources/Gtk3/Generated/FileChooserAction.swift @@ -6,35 +6,35 @@ public enum FileChooserAction: GValueRepresentableEnum { public typealias GtkEnum = GtkFileChooserAction /// Indicates open mode. The file chooser -/// will only let the user pick an existing file. -case open -/// Indicates save mode. The file chooser -/// will let the user pick an existing file, or type in a new -/// filename. -case save -/// Indicates an Open mode for -/// selecting folders. The file chooser will let the user pick an -/// existing folder. -case selectFolder -/// Indicates a mode for creating a -/// new folder. The file chooser will let the user name an existing or -/// new folder. -case createFolder + /// will only let the user pick an existing file. + case open + /// Indicates save mode. The file chooser + /// will let the user pick an existing file, or type in a new + /// filename. + case save + /// Indicates an Open mode for + /// selecting folders. The file chooser will let the user pick an + /// existing folder. + case selectFolder + /// Indicates a mode for creating a + /// new folder. The file chooser will let the user name an existing or + /// new folder. + case createFolder public static var type: GType { - gtk_file_chooser_action_get_type() -} + gtk_file_chooser_action_get_type() + } public init(from gtkEnum: GtkFileChooserAction) { switch gtkEnum { case GTK_FILE_CHOOSER_ACTION_OPEN: - self = .open -case GTK_FILE_CHOOSER_ACTION_SAVE: - self = .save -case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER: - self = .selectFolder -case GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER: - self = .createFolder + self = .open + case GTK_FILE_CHOOSER_ACTION_SAVE: + self = .save + case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER: + self = .selectFolder + case GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER: + self = .createFolder default: fatalError("Unsupported GtkFileChooserAction enum value: \(gtkEnum.rawValue)") } @@ -43,13 +43,13 @@ case GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER: public func toGtk() -> GtkFileChooserAction { switch self { case .open: - return GTK_FILE_CHOOSER_ACTION_OPEN -case .save: - return GTK_FILE_CHOOSER_ACTION_SAVE -case .selectFolder: - return GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER -case .createFolder: - return GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER + return GTK_FILE_CHOOSER_ACTION_OPEN + case .save: + return GTK_FILE_CHOOSER_ACTION_SAVE + case .selectFolder: + return GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER + case .createFolder: + return GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/FileChooserError.swift b/Sources/Gtk3/Generated/FileChooserError.swift index 3a82897fc2..8c5d908361 100644 --- a/Sources/Gtk3/Generated/FileChooserError.swift +++ b/Sources/Gtk3/Generated/FileChooserError.swift @@ -6,29 +6,29 @@ public enum FileChooserError: GValueRepresentableEnum { public typealias GtkEnum = GtkFileChooserError /// Indicates that a file does not exist. -case nonexistent -/// Indicates a malformed filename. -case badFilename -/// Indicates a duplicate path (e.g. when -/// adding a bookmark). -case alreadyExists -/// Indicates an incomplete hostname (e.g. "http://foo" without a slash after that). -case incompleteHostname + case nonexistent + /// Indicates a malformed filename. + case badFilename + /// Indicates a duplicate path (e.g. when + /// adding a bookmark). + case alreadyExists + /// Indicates an incomplete hostname (e.g. "http://foo" without a slash after that). + case incompleteHostname public static var type: GType { - gtk_file_chooser_error_get_type() -} + gtk_file_chooser_error_get_type() + } public init(from gtkEnum: GtkFileChooserError) { switch gtkEnum { case GTK_FILE_CHOOSER_ERROR_NONEXISTENT: - self = .nonexistent -case GTK_FILE_CHOOSER_ERROR_BAD_FILENAME: - self = .badFilename -case GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS: - self = .alreadyExists -case GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME: - self = .incompleteHostname + self = .nonexistent + case GTK_FILE_CHOOSER_ERROR_BAD_FILENAME: + self = .badFilename + case GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS: + self = .alreadyExists + case GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME: + self = .incompleteHostname default: fatalError("Unsupported GtkFileChooserError enum value: \(gtkEnum.rawValue)") } @@ -37,13 +37,13 @@ case GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME: public func toGtk() -> GtkFileChooserError { switch self { case .nonexistent: - return GTK_FILE_CHOOSER_ERROR_NONEXISTENT -case .badFilename: - return GTK_FILE_CHOOSER_ERROR_BAD_FILENAME -case .alreadyExists: - return GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS -case .incompleteHostname: - return GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME + return GTK_FILE_CHOOSER_ERROR_NONEXISTENT + case .badFilename: + return GTK_FILE_CHOOSER_ERROR_BAD_FILENAME + case .alreadyExists: + return GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS + case .incompleteHostname: + return GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/FileChooserNative.swift b/Sources/Gtk3/Generated/FileChooserNative.swift index 350943fc97..afdf0862ca 100644 --- a/Sources/Gtk3/Generated/FileChooserNative.swift +++ b/Sources/Gtk3/Generated/FileChooserNative.swift @@ -8,28 +8,28 @@ import CGtk3 /// sandboxed environment without direct filesystem access (such as Flatpak), /// #GtkFileChooserNative may call the proper APIs (portals) to let the user /// choose a file and make it available to the application. -/// +/// /// While the API of #GtkFileChooserNative closely mirrors #GtkFileChooserDialog, the main /// difference is that there is no access to any #GtkWindow or #GtkWidget for the dialog. /// This is required, as there may not be one in the case of a platform native dialog. /// Showing, hiding and running the dialog is handled by the #GtkNativeDialog functions. -/// +/// /// ## Typical usage ## {#gtkfilechoosernative-typical-usage} -/// +/// /// In the simplest of cases, you can the following code to use /// #GtkFileChooserDialog to select a file for opening: -/// +/// /// |[ /// GtkFileChooserNative *native; /// GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN; /// gint res; -/// +/// /// native = gtk_file_chooser_native_new ("Open File", /// parent_window, /// action, /// "_Open", /// "_Cancel"); -/// +/// /// res = gtk_native_dialog_run (GTK_NATIVE_DIALOG (native)); /// if (res == GTK_RESPONSE_ACCEPT) /// { @@ -39,480 +39,490 @@ import CGtk3 /// open_file (filename); /// g_free (filename); /// } -/// +/// /// g_object_unref (native); /// ]| -/// +/// /// To use a dialog for saving, you can use this: -/// +/// /// |[ /// GtkFileChooserNative *native; /// GtkFileChooser *chooser; /// GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SAVE; /// gint res; -/// +/// /// native = gtk_file_chooser_native_new ("Save File", /// parent_window, /// action, /// "_Save", /// "_Cancel"); /// chooser = GTK_FILE_CHOOSER (native); -/// +/// /// gtk_file_chooser_set_do_overwrite_confirmation (chooser, TRUE); -/// +/// /// if (user_edited_a_new_document) /// gtk_file_chooser_set_current_name (chooser, /// _("Untitled document")); /// else /// gtk_file_chooser_set_filename (chooser, /// existing_filename); -/// +/// /// res = gtk_native_dialog_run (GTK_NATIVE_DIALOG (native)); /// if (res == GTK_RESPONSE_ACCEPT) /// { /// char *filename; -/// +/// /// filename = gtk_file_chooser_get_filename (chooser); /// save_to_file (filename); /// g_free (filename); /// } -/// +/// /// g_object_unref (native); /// ]| -/// +/// /// For more information on how to best set up a file dialog, see #GtkFileChooserDialog. -/// +/// /// ## Response Codes ## {#gtkfilechooserdialognative-responses} -/// +/// /// #GtkFileChooserNative inherits from #GtkNativeDialog, which means it /// will return #GTK_RESPONSE_ACCEPT if the user accepted, and /// #GTK_RESPONSE_CANCEL if he pressed cancel. It can also return /// #GTK_RESPONSE_DELETE_EVENT if the window was unexpectedly closed. -/// +/// /// ## Differences from #GtkFileChooserDialog ## {#gtkfilechooserdialognative-differences} -/// +/// /// There are a few things in the GtkFileChooser API that are not /// possible to use with #GtkFileChooserNative, as such use would /// prohibit the use of a native dialog. -/// +/// /// There is no support for the signals that are emitted when the user /// navigates in the dialog, including: /// * #GtkFileChooser::current-folder-changed /// * #GtkFileChooser::selection-changed /// * #GtkFileChooser::file-activated /// * #GtkFileChooser::confirm-overwrite -/// +/// /// You can also not use the methods that directly control user navigation: /// * gtk_file_chooser_unselect_filename() /// * gtk_file_chooser_select_all() /// * gtk_file_chooser_unselect_all() -/// +/// /// If you need any of the above you will have to use #GtkFileChooserDialog directly. -/// +/// /// No operations that change the the dialog work while the dialog is /// visible. Set all the properties that are required before showing the dialog. -/// +/// /// ## Win32 details ## {#gtkfilechooserdialognative-win32} -/// +/// /// On windows the IFileDialog implementation (added in Windows Vista) is /// used. It supports many of the features that #GtkFileChooserDialog /// does, but there are some things it does not handle: -/// +/// /// * Extra widgets added with gtk_file_chooser_set_extra_widget(). -/// +/// /// * Use of custom previews by connecting to #GtkFileChooser::update-preview. -/// +/// /// * Any #GtkFileFilter added using a mimetype or custom filter. -/// +/// /// If any of these features are used the regular #GtkFileChooserDialog /// will be used in place of the native one. -/// +/// /// ## Portal details ## {#gtkfilechooserdialognative-portal} -/// +/// /// When the org.freedesktop.portal.FileChooser portal is available on the /// session bus, it is used to bring up an out-of-process file chooser. Depending /// on the kind of session the application is running in, this may or may not /// be a GTK+ file chooser. In this situation, the following things are not /// supported and will be silently ignored: -/// +/// /// * Extra widgets added with gtk_file_chooser_set_extra_widget(). -/// +/// /// * Use of custom previews by connecting to #GtkFileChooser::update-preview. -/// +/// /// * Any #GtkFileFilter added with a custom filter. -/// +/// /// ## macOS details ## {#gtkfilechooserdialognative-macos} -/// +/// /// On macOS the NSSavePanel and NSOpenPanel classes are used to provide native /// file chooser dialogs. Some features provided by #GtkFileChooserDialog are /// not supported: -/// +/// /// * Extra widgets added with gtk_file_chooser_set_extra_widget(), unless the /// widget is an instance of GtkLabel, in which case the label text will be used /// to set the NSSavePanel message instance property. -/// +/// /// * Use of custom previews by connecting to #GtkFileChooser::update-preview. -/// +/// /// * Any #GtkFileFilter added with a custom filter. -/// +/// /// * Shortcut folders. open class FileChooserNative: NativeDialog, FileChooser { /// Creates a new #GtkFileChooserNative. -public convenience init(title: String, parent: UnsafeMutablePointer!, action: GtkFileChooserAction, acceptLabel: String, cancelLabel: String) { - self.init( - gtk_file_chooser_native_new(title, parent, action, acceptLabel, cancelLabel) - ) -} - - public override func registerSignals() { - super.registerSignals() - - addSignal(name: "confirm-overwrite") { [weak self] () in - guard let self = self else { return } - self.confirmOverwrite?(self) -} - -addSignal(name: "current-folder-changed") { [weak self] () in - guard let self = self else { return } - self.currentFolderChanged?(self) -} - -addSignal(name: "file-activated") { [weak self] () in - guard let self = self else { return } - self.fileActivated?(self) -} - -addSignal(name: "selection-changed") { [weak self] () in - guard let self = self else { return } - self.selectionChanged?(self) -} - -addSignal(name: "update-preview") { [weak self] () in - guard let self = self else { return } - self.updatePreview?(self) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::accept-label", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAcceptLabel?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::cancel-label", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCancelLabel?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::action", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAction?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::create-folders", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCreateFolders?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::do-overwrite-confirmation", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDoOverwriteConfirmation?(self, param0) -} - -let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::extra-widget", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExtraWidget?(self, param0) -} - -let handler11: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::filter", handler: gCallback(handler11)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFilter?(self, param0) -} - -let handler12: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::local-only", handler: gCallback(handler12)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLocalOnly?(self, param0) -} - -let handler13: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::preview-widget", handler: gCallback(handler13)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPreviewWidget?(self, param0) -} - -let handler14: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::preview-widget-active", handler: gCallback(handler14)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPreviewWidgetActive?(self, param0) -} - -let handler15: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::select-multiple", handler: gCallback(handler15)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectMultiple?(self, param0) -} - -let handler16: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init( + title: String, parent: UnsafeMutablePointer!, action: GtkFileChooserAction, + acceptLabel: String, cancelLabel: String + ) { + self.init( + gtk_file_chooser_native_new(title, parent, action, acceptLabel, cancelLabel) + ) } -addSignal(name: "notify::show-hidden", handler: gCallback(handler16)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowHidden?(self, param0) -} - -let handler17: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public override func registerSignals() { + super.registerSignals() + + addSignal(name: "confirm-overwrite") { [weak self] () in + guard let self = self else { return } + self.confirmOverwrite?(self) + } + + addSignal(name: "current-folder-changed") { [weak self] () in + guard let self = self else { return } + self.currentFolderChanged?(self) + } + + addSignal(name: "file-activated") { [weak self] () in + guard let self = self else { return } + self.fileActivated?(self) + } + + addSignal(name: "selection-changed") { [weak self] () in + guard let self = self else { return } + self.selectionChanged?(self) + } + + addSignal(name: "update-preview") { [weak self] () in + guard let self = self else { return } + self.updatePreview?(self) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::accept-label", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAcceptLabel?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::cancel-label", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCancelLabel?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::action", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAction?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::create-folders", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCreateFolders?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::do-overwrite-confirmation", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDoOverwriteConfirmation?(self, param0) + } + + let handler10: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::extra-widget", handler: gCallback(handler10)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExtraWidget?(self, param0) + } + + let handler11: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::filter", handler: gCallback(handler11)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFilter?(self, param0) + } + + let handler12: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::local-only", handler: gCallback(handler12)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLocalOnly?(self, param0) + } + + let handler13: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::preview-widget", handler: gCallback(handler13)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPreviewWidget?(self, param0) + } + + let handler14: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::preview-widget-active", handler: gCallback(handler14)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPreviewWidgetActive?(self, param0) + } + + let handler15: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::select-multiple", handler: gCallback(handler15)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectMultiple?(self, param0) + } + + let handler16: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::show-hidden", handler: gCallback(handler16)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowHidden?(self, param0) + } + + let handler17: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-preview-label", handler: gCallback(handler17)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUsePreviewLabel?(self, param0) + } } -addSignal(name: "notify::use-preview-label", handler: gCallback(handler17)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUsePreviewLabel?(self, param0) -} -} - /// The text used for the label on the accept button in the dialog, or -/// %NULL to use the default text. -@GObjectProperty(named: "accept-label") public var acceptLabel: String? - -/// The text used for the label on the cancel button in the dialog, or -/// %NULL to use the default text. -@GObjectProperty(named: "cancel-label") public var cancelLabel: String? - - -@GObjectProperty(named: "action") public var action: FileChooserAction - - -@GObjectProperty(named: "local-only") public var localOnly: Bool - - -@GObjectProperty(named: "preview-widget-active") public var previewWidgetActive: Bool - - -@GObjectProperty(named: "select-multiple") public var selectMultiple: Bool - - -@GObjectProperty(named: "show-hidden") public var showHidden: Bool - - -@GObjectProperty(named: "use-preview-label") public var usePreviewLabel: Bool - -/// This signal gets emitted whenever it is appropriate to present a -/// confirmation dialog when the user has selected a file name that -/// already exists. The signal only gets emitted when the file -/// chooser is in %GTK_FILE_CHOOSER_ACTION_SAVE mode. -/// -/// Most applications just need to turn on the -/// #GtkFileChooser:do-overwrite-confirmation property (or call the -/// gtk_file_chooser_set_do_overwrite_confirmation() function), and -/// they will automatically get a stock confirmation dialog. -/// Applications which need to customize this behavior should do -/// that, and also connect to the #GtkFileChooser::confirm-overwrite -/// signal. -/// -/// A signal handler for this signal must return a -/// #GtkFileChooserConfirmation value, which indicates the action to -/// take. If the handler determines that the user wants to select a -/// different filename, it should return -/// %GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN. If it determines -/// that the user is satisfied with his choice of file name, it -/// should return %GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME. -/// On the other hand, if it determines that the stock confirmation -/// dialog should be used, it should return -/// %GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM. The following example -/// illustrates this. -/// -/// ## Custom confirmation ## {#gtkfilechooser-confirmation} -/// -/// |[ -/// static GtkFileChooserConfirmation -/// confirm_overwrite_callback (GtkFileChooser *chooser, gpointer data) -/// { -/// char *uri; -/// -/// uri = gtk_file_chooser_get_uri (chooser); -/// -/// if (is_uri_read_only (uri)) -/// { -/// if (user_wants_to_replace_read_only_file (uri)) -/// return GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME; -/// else -/// return GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN; -/// } else -/// return GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM; // fall back to the default dialog -/// } -/// -/// ... -/// -/// chooser = gtk_file_chooser_dialog_new (...); -/// -/// gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); -/// g_signal_connect (chooser, "confirm-overwrite", -/// G_CALLBACK (confirm_overwrite_callback), NULL); -/// -/// if (gtk_dialog_run (chooser) == GTK_RESPONSE_ACCEPT) -/// save_to_file (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); -/// -/// gtk_widget_destroy (chooser); -/// ]| -public var confirmOverwrite: ((FileChooserNative) -> Void)? - -/// This signal is emitted when the current folder in a #GtkFileChooser -/// changes. This can happen due to the user performing some action that -/// changes folders, such as selecting a bookmark or visiting a folder on the -/// file list. It can also happen as a result of calling a function to -/// explicitly change the current folder in a file chooser. -/// -/// Normally you do not need to connect to this signal, unless you need to keep -/// track of which folder a file chooser is showing. -/// -/// See also: gtk_file_chooser_set_current_folder(), -/// gtk_file_chooser_get_current_folder(), -/// gtk_file_chooser_set_current_folder_uri(), -/// gtk_file_chooser_get_current_folder_uri(). -public var currentFolderChanged: ((FileChooserNative) -> Void)? - -/// This signal is emitted when the user "activates" a file in the file -/// chooser. This can happen by double-clicking on a file in the file list, or -/// by pressing `Enter`. -/// -/// Normally you do not need to connect to this signal. It is used internally -/// by #GtkFileChooserDialog to know when to activate the default button in the -/// dialog. -/// -/// See also: gtk_file_chooser_get_filename(), -/// gtk_file_chooser_get_filenames(), gtk_file_chooser_get_uri(), -/// gtk_file_chooser_get_uris(). -public var fileActivated: ((FileChooserNative) -> Void)? - -/// This signal is emitted when there is a change in the set of selected files -/// in a #GtkFileChooser. This can happen when the user modifies the selection -/// with the mouse or the keyboard, or when explicitly calling functions to -/// change the selection. -/// -/// Normally you do not need to connect to this signal, as it is easier to wait -/// for the file chooser to finish running, and then to get the list of -/// selected files using the functions mentioned below. -/// -/// See also: gtk_file_chooser_select_filename(), -/// gtk_file_chooser_unselect_filename(), gtk_file_chooser_get_filename(), -/// gtk_file_chooser_get_filenames(), gtk_file_chooser_select_uri(), -/// gtk_file_chooser_unselect_uri(), gtk_file_chooser_get_uri(), -/// gtk_file_chooser_get_uris(). -public var selectionChanged: ((FileChooserNative) -> Void)? - -/// This signal is emitted when the preview in a file chooser should be -/// regenerated. For example, this can happen when the currently selected file -/// changes. You should use this signal if you want your file chooser to have -/// a preview widget. -/// -/// Once you have installed a preview widget with -/// gtk_file_chooser_set_preview_widget(), you should update it when this -/// signal is emitted. You can use the functions -/// gtk_file_chooser_get_preview_filename() or -/// gtk_file_chooser_get_preview_uri() to get the name of the file to preview. -/// Your widget may not be able to preview all kinds of files; your callback -/// must call gtk_file_chooser_set_preview_widget_active() to inform the file -/// chooser about whether the preview was generated successfully or not. -/// -/// Please see the example code in -/// [Using a Preview Widget][gtkfilechooser-preview]. -/// -/// See also: gtk_file_chooser_set_preview_widget(), -/// gtk_file_chooser_set_preview_widget_active(), -/// gtk_file_chooser_set_use_preview_label(), -/// gtk_file_chooser_get_preview_filename(), -/// gtk_file_chooser_get_preview_uri(). -public var updatePreview: ((FileChooserNative) -> Void)? - - -public var notifyAcceptLabel: ((FileChooserNative, OpaquePointer) -> Void)? - - -public var notifyCancelLabel: ((FileChooserNative, OpaquePointer) -> Void)? - - -public var notifyAction: ((FileChooserNative, OpaquePointer) -> Void)? - - -public var notifyCreateFolders: ((FileChooserNative, OpaquePointer) -> Void)? - - -public var notifyDoOverwriteConfirmation: ((FileChooserNative, OpaquePointer) -> Void)? - - -public var notifyExtraWidget: ((FileChooserNative, OpaquePointer) -> Void)? - - -public var notifyFilter: ((FileChooserNative, OpaquePointer) -> Void)? - - -public var notifyLocalOnly: ((FileChooserNative, OpaquePointer) -> Void)? - - -public var notifyPreviewWidget: ((FileChooserNative, OpaquePointer) -> Void)? - - -public var notifyPreviewWidgetActive: ((FileChooserNative, OpaquePointer) -> Void)? - - -public var notifySelectMultiple: ((FileChooserNative, OpaquePointer) -> Void)? - - -public var notifyShowHidden: ((FileChooserNative, OpaquePointer) -> Void)? - - -public var notifyUsePreviewLabel: ((FileChooserNative, OpaquePointer) -> Void)? -} \ No newline at end of file + /// %NULL to use the default text. + @GObjectProperty(named: "accept-label") public var acceptLabel: String? + + /// The text used for the label on the cancel button in the dialog, or + /// %NULL to use the default text. + @GObjectProperty(named: "cancel-label") public var cancelLabel: String? + + @GObjectProperty(named: "action") public var action: FileChooserAction + + @GObjectProperty(named: "local-only") public var localOnly: Bool + + @GObjectProperty(named: "preview-widget-active") public var previewWidgetActive: Bool + + @GObjectProperty(named: "select-multiple") public var selectMultiple: Bool + + @GObjectProperty(named: "show-hidden") public var showHidden: Bool + + @GObjectProperty(named: "use-preview-label") public var usePreviewLabel: Bool + + /// This signal gets emitted whenever it is appropriate to present a + /// confirmation dialog when the user has selected a file name that + /// already exists. The signal only gets emitted when the file + /// chooser is in %GTK_FILE_CHOOSER_ACTION_SAVE mode. + /// + /// Most applications just need to turn on the + /// #GtkFileChooser:do-overwrite-confirmation property (or call the + /// gtk_file_chooser_set_do_overwrite_confirmation() function), and + /// they will automatically get a stock confirmation dialog. + /// Applications which need to customize this behavior should do + /// that, and also connect to the #GtkFileChooser::confirm-overwrite + /// signal. + /// + /// A signal handler for this signal must return a + /// #GtkFileChooserConfirmation value, which indicates the action to + /// take. If the handler determines that the user wants to select a + /// different filename, it should return + /// %GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN. If it determines + /// that the user is satisfied with his choice of file name, it + /// should return %GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME. + /// On the other hand, if it determines that the stock confirmation + /// dialog should be used, it should return + /// %GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM. The following example + /// illustrates this. + /// + /// ## Custom confirmation ## {#gtkfilechooser-confirmation} + /// + /// |[ + /// static GtkFileChooserConfirmation + /// confirm_overwrite_callback (GtkFileChooser *chooser, gpointer data) + /// { + /// char *uri; + /// + /// uri = gtk_file_chooser_get_uri (chooser); + /// + /// if (is_uri_read_only (uri)) + /// { + /// if (user_wants_to_replace_read_only_file (uri)) + /// return GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME; + /// else + /// return GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN; + /// } else + /// return GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM; // fall back to the default dialog + /// } + /// + /// ... + /// + /// chooser = gtk_file_chooser_dialog_new (...); + /// + /// gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); + /// g_signal_connect (chooser, "confirm-overwrite", + /// G_CALLBACK (confirm_overwrite_callback), NULL); + /// + /// if (gtk_dialog_run (chooser) == GTK_RESPONSE_ACCEPT) + /// save_to_file (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); + /// + /// gtk_widget_destroy (chooser); + /// ]| + public var confirmOverwrite: ((FileChooserNative) -> Void)? + + /// This signal is emitted when the current folder in a #GtkFileChooser + /// changes. This can happen due to the user performing some action that + /// changes folders, such as selecting a bookmark or visiting a folder on the + /// file list. It can also happen as a result of calling a function to + /// explicitly change the current folder in a file chooser. + /// + /// Normally you do not need to connect to this signal, unless you need to keep + /// track of which folder a file chooser is showing. + /// + /// See also: gtk_file_chooser_set_current_folder(), + /// gtk_file_chooser_get_current_folder(), + /// gtk_file_chooser_set_current_folder_uri(), + /// gtk_file_chooser_get_current_folder_uri(). + public var currentFolderChanged: ((FileChooserNative) -> Void)? + + /// This signal is emitted when the user "activates" a file in the file + /// chooser. This can happen by double-clicking on a file in the file list, or + /// by pressing `Enter`. + /// + /// Normally you do not need to connect to this signal. It is used internally + /// by #GtkFileChooserDialog to know when to activate the default button in the + /// dialog. + /// + /// See also: gtk_file_chooser_get_filename(), + /// gtk_file_chooser_get_filenames(), gtk_file_chooser_get_uri(), + /// gtk_file_chooser_get_uris(). + public var fileActivated: ((FileChooserNative) -> Void)? + + /// This signal is emitted when there is a change in the set of selected files + /// in a #GtkFileChooser. This can happen when the user modifies the selection + /// with the mouse or the keyboard, or when explicitly calling functions to + /// change the selection. + /// + /// Normally you do not need to connect to this signal, as it is easier to wait + /// for the file chooser to finish running, and then to get the list of + /// selected files using the functions mentioned below. + /// + /// See also: gtk_file_chooser_select_filename(), + /// gtk_file_chooser_unselect_filename(), gtk_file_chooser_get_filename(), + /// gtk_file_chooser_get_filenames(), gtk_file_chooser_select_uri(), + /// gtk_file_chooser_unselect_uri(), gtk_file_chooser_get_uri(), + /// gtk_file_chooser_get_uris(). + public var selectionChanged: ((FileChooserNative) -> Void)? + + /// This signal is emitted when the preview in a file chooser should be + /// regenerated. For example, this can happen when the currently selected file + /// changes. You should use this signal if you want your file chooser to have + /// a preview widget. + /// + /// Once you have installed a preview widget with + /// gtk_file_chooser_set_preview_widget(), you should update it when this + /// signal is emitted. You can use the functions + /// gtk_file_chooser_get_preview_filename() or + /// gtk_file_chooser_get_preview_uri() to get the name of the file to preview. + /// Your widget may not be able to preview all kinds of files; your callback + /// must call gtk_file_chooser_set_preview_widget_active() to inform the file + /// chooser about whether the preview was generated successfully or not. + /// + /// Please see the example code in + /// [Using a Preview Widget][gtkfilechooser-preview]. + /// + /// See also: gtk_file_chooser_set_preview_widget(), + /// gtk_file_chooser_set_preview_widget_active(), + /// gtk_file_chooser_set_use_preview_label(), + /// gtk_file_chooser_get_preview_filename(), + /// gtk_file_chooser_get_preview_uri(). + public var updatePreview: ((FileChooserNative) -> Void)? + + public var notifyAcceptLabel: ((FileChooserNative, OpaquePointer) -> Void)? + + public var notifyCancelLabel: ((FileChooserNative, OpaquePointer) -> Void)? + + public var notifyAction: ((FileChooserNative, OpaquePointer) -> Void)? + + public var notifyCreateFolders: ((FileChooserNative, OpaquePointer) -> Void)? + + public var notifyDoOverwriteConfirmation: ((FileChooserNative, OpaquePointer) -> Void)? + + public var notifyExtraWidget: ((FileChooserNative, OpaquePointer) -> Void)? + + public var notifyFilter: ((FileChooserNative, OpaquePointer) -> Void)? + + public var notifyLocalOnly: ((FileChooserNative, OpaquePointer) -> Void)? + + public var notifyPreviewWidget: ((FileChooserNative, OpaquePointer) -> Void)? + + public var notifyPreviewWidgetActive: ((FileChooserNative, OpaquePointer) -> Void)? + + public var notifySelectMultiple: ((FileChooserNative, OpaquePointer) -> Void)? + + public var notifyShowHidden: ((FileChooserNative, OpaquePointer) -> Void)? + + public var notifyUsePreviewLabel: ((FileChooserNative, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk3/Generated/FontChooser.swift b/Sources/Gtk3/Generated/FontChooser.swift index 67b75b1365..be9cec7010 100644 --- a/Sources/Gtk3/Generated/FontChooser.swift +++ b/Sources/Gtk3/Generated/FontChooser.swift @@ -7,17 +7,17 @@ import CGtk3 /// has been introducted in GTK+ 3.2. public protocol FontChooser: GObjectRepresentable { /// The font description as a string, e.g. "Sans Italic 12". -var font: String? { get set } + var font: String? { get set } -/// The string with which to preview the font. -var previewText: String { get set } + /// The string with which to preview the font. + var previewText: String { get set } -/// Whether to show an entry to change the preview text. -var showPreviewEntry: Bool { get set } + /// Whether to show an entry to change the preview text. + var showPreviewEntry: Bool { get set } /// Emitted when a font is activated. -/// This usually happens when the user double clicks an item, -/// or an item is selected and the user presses one of the keys -/// Space, Shift+Space, Return or Enter. -var fontActivated: ((Self, UnsafePointer) -> Void)? { get set } -} \ No newline at end of file + /// This usually happens when the user double clicks an item, + /// or an item is selected and the user presses one of the keys + /// Space, Shift+Space, Return or Enter. + var fontActivated: ((Self, UnsafePointer) -> Void)? { get set } +} diff --git a/Sources/Gtk3/Generated/GLArea.swift b/Sources/Gtk3/Generated/GLArea.swift index 029441b839..0dec451dc6 100644 --- a/Sources/Gtk3/Generated/GLArea.swift +++ b/Sources/Gtk3/Generated/GLArea.swift @@ -1,36 +1,36 @@ import CGtk3 /// #GtkGLArea is a widget that allows drawing with OpenGL. -/// +/// /// #GtkGLArea sets up its own #GdkGLContext for the window it creates, and /// creates a custom GL framebuffer that the widget will do GL rendering onto. /// It also ensures that this framebuffer is the default GL rendering target /// when rendering. -/// +/// /// In order to draw, you have to connect to the #GtkGLArea::render signal, /// or subclass #GtkGLArea and override the @GtkGLAreaClass.render() virtual /// function. -/// +/// /// The #GtkGLArea widget ensures that the #GdkGLContext is associated with /// the widget's drawing area, and it is kept updated when the size and /// position of the drawing area changes. -/// +/// /// ## Drawing with GtkGLArea ## -/// +/// /// The simplest way to draw using OpenGL commands in a #GtkGLArea is to /// create a widget instance and connect to the #GtkGLArea::render signal: -/// +/// /// |[ /// // create a GtkGLArea instance /// GtkWidget *gl_area = gtk_gl_area_new (); -/// +/// /// // connect to the "render" signal /// g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL); /// ]| -/// +/// /// The `render()` function will be called when the #GtkGLArea is ready /// for you to draw its content: -/// +/// /// |[ /// static gboolean /// render (GtkGLArea *area, GdkGLContext *context) @@ -39,28 +39,28 @@ import CGtk3 /// // #GdkGLContext has been made current to the drawable /// // surface used by the #GtkGLArea and the viewport has /// // already been set to be the size of the allocation -/// +/// /// // we can start by clearing the buffer /// glClearColor (0, 0, 0, 0); /// glClear (GL_COLOR_BUFFER_BIT); -/// +/// /// // draw your object /// draw_an_object (); -/// +/// /// // we completed our drawing; the draw commands will be /// // flushed at the end of the signal emission chain, and /// // the buffers will be drawn on the window /// return TRUE; /// } /// ]| -/// +/// /// If you need to initialize OpenGL state, e.g. buffer objects or /// shaders, you should use the #GtkWidget::realize signal; you /// can use the #GtkWidget::unrealize signal to clean up. Since the /// #GdkGLContext creation and initialization may fail, you will /// need to check for errors, using gtk_gl_area_get_error(). An example /// of how to safely initialize the GL state is: -/// +/// /// |[ /// static void /// on_realize (GtkGLarea *area) @@ -68,13 +68,13 @@ import CGtk3 /// // We need to make the context current if we want to /// // call GL API /// gtk_gl_area_make_current (area); -/// +/// /// // If there were errors during the initialization or /// // when trying to make the context current, this /// // function will return a #GError for you to catch /// if (gtk_gl_area_get_error (area) != NULL) /// return; -/// +/// /// // You can also use gtk_gl_area_set_error() in order /// // to show eventual initialization errors on the /// // GtkGLArea widget itself @@ -86,7 +86,7 @@ import CGtk3 /// g_error_free (error); /// return; /// } -/// +/// /// init_shaders (&error); /// if (error != NULL) /// { @@ -96,150 +96,160 @@ import CGtk3 /// } /// } /// ]| -/// +/// /// If you need to change the options for creating the #GdkGLContext /// you should use the #GtkGLArea::create-context signal. open class GLArea: Widget { /// Creates a new #GtkGLArea widget. -public convenience init() { - self.init( - gtk_gl_area_new() - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "create-context") { [weak self] () in - guard let self = self else { return } - self.createContext?(self) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_gl_area_new() + ) } -addSignal(name: "render", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.render?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "create-context") { [weak self] () in + guard let self = self else { return } + self.createContext?(self) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "render", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.render?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, Int, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "resize", handler: gCallback(handler2)) { + [weak self] (param0: Int, param1: Int) in + guard let self = self else { return } + self.resize?(self, param0, param1) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::auto-render", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAutoRender?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::context", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyContext?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::has-alpha", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasAlpha?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::has-depth-buffer", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasDepthBuffer?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::has-stencil-buffer", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasStencilBuffer?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-es", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseEs?(self, param0) + } } -addSignal(name: "resize", handler: gCallback(handler2)) { [weak self] (param0: Int, param1: Int) in - guard let self = self else { return } - self.resize?(self, param0, param1) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::auto-render", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAutoRender?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::context", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyContext?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::has-alpha", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasAlpha?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::has-depth-buffer", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasDepthBuffer?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::has-stencil-buffer", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasStencilBuffer?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::use-es", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseEs?(self, param0) -} -} - /// The ::create-context signal is emitted when the widget is being -/// realized, and allows you to override how the GL context is -/// created. This is useful when you want to reuse an existing GL -/// context, or if you want to try creating different kinds of GL -/// options. -/// -/// If context creation fails then the signal handler can use -/// gtk_gl_area_set_error() to register a more detailed error -/// of how the construction failed. -public var createContext: ((GLArea) -> Void)? - -/// The ::render signal is emitted every time the contents -/// of the #GtkGLArea should be redrawn. -/// -/// The @context is bound to the @area prior to emitting this function, -/// and the buffers are painted to the window once the emission terminates. -public var render: ((GLArea, OpaquePointer) -> Void)? - -/// The ::resize signal is emitted once when the widget is realized, and -/// then each time the widget is changed while realized. This is useful -/// in order to keep GL state up to date with the widget size, like for -/// instance camera properties which may depend on the width/height ratio. -/// -/// The GL context for the area is guaranteed to be current when this signal -/// is emitted. -/// -/// The default handler sets up the GL viewport. -public var resize: ((GLArea, Int, Int) -> Void)? - - -public var notifyAutoRender: ((GLArea, OpaquePointer) -> Void)? - - -public var notifyContext: ((GLArea, OpaquePointer) -> Void)? - - -public var notifyHasAlpha: ((GLArea, OpaquePointer) -> Void)? - - -public var notifyHasDepthBuffer: ((GLArea, OpaquePointer) -> Void)? - - -public var notifyHasStencilBuffer: ((GLArea, OpaquePointer) -> Void)? - - -public var notifyUseEs: ((GLArea, OpaquePointer) -> Void)? -} \ No newline at end of file + /// realized, and allows you to override how the GL context is + /// created. This is useful when you want to reuse an existing GL + /// context, or if you want to try creating different kinds of GL + /// options. + /// + /// If context creation fails then the signal handler can use + /// gtk_gl_area_set_error() to register a more detailed error + /// of how the construction failed. + public var createContext: ((GLArea) -> Void)? + + /// The ::render signal is emitted every time the contents + /// of the #GtkGLArea should be redrawn. + /// + /// The @context is bound to the @area prior to emitting this function, + /// and the buffers are painted to the window once the emission terminates. + public var render: ((GLArea, OpaquePointer) -> Void)? + + /// The ::resize signal is emitted once when the widget is realized, and + /// then each time the widget is changed while realized. This is useful + /// in order to keep GL state up to date with the widget size, like for + /// instance camera properties which may depend on the width/height ratio. + /// + /// The GL context for the area is guaranteed to be current when this signal + /// is emitted. + /// + /// The default handler sets up the GL viewport. + public var resize: ((GLArea, Int, Int) -> Void)? + + public var notifyAutoRender: ((GLArea, OpaquePointer) -> Void)? + + public var notifyContext: ((GLArea, OpaquePointer) -> Void)? + + public var notifyHasAlpha: ((GLArea, OpaquePointer) -> Void)? + + public var notifyHasDepthBuffer: ((GLArea, OpaquePointer) -> Void)? + + public var notifyHasStencilBuffer: ((GLArea, OpaquePointer) -> Void)? + + public var notifyUseEs: ((GLArea, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk3/Generated/Gesture.swift b/Sources/Gtk3/Generated/Gesture.swift index 106ffb681d..fc44d23709 100644 --- a/Sources/Gtk3/Generated/Gesture.swift +++ b/Sources/Gtk3/Generated/Gesture.swift @@ -4,64 +4,64 @@ import CGtk3 /// object is quite generalized to serve as a base for multi-touch gestures, /// it is suitable to implement single-touch and pointer-based gestures (using /// the special %NULL #GdkEventSequence value for these). -/// +/// /// The number of touches that a #GtkGesture need to be recognized is controlled /// by the #GtkGesture:n-points property, if a gesture is keeping track of less /// or more than that number of sequences, it won't check wether the gesture /// is recognized. -/// +/// /// As soon as the gesture has the expected number of touches, the gesture will /// run the #GtkGesture::check signal regularly on input events until the gesture /// is recognized, the criteria to consider a gesture as "recognized" is left to /// #GtkGesture subclasses. -/// +/// /// A recognized gesture will then emit the following signals: /// - #GtkGesture::begin when the gesture is recognized. /// - A number of #GtkGesture::update, whenever an input event is processed. /// - #GtkGesture::end when the gesture is no longer recognized. -/// +/// /// ## Event propagation -/// +/// /// In order to receive events, a gesture needs to either set a propagation phase /// through gtk_event_controller_set_propagation_phase(), or feed those manually /// through gtk_event_controller_handle_event(). -/// +/// /// In the capture phase, events are propagated from the toplevel down to the /// target widget, and gestures that are attached to containers above the widget /// get a chance to interact with the event before it reaches the target. -/// +/// /// After the capture phase, GTK+ emits the traditional #GtkWidget::button-press-event, /// #GtkWidget::button-release-event, #GtkWidget::touch-event, etc signals. Gestures /// with the %GTK_PHASE_TARGET phase are fed events from the default #GtkWidget::event /// handlers. -/// +/// /// In the bubble phase, events are propagated up from the target widget to the /// toplevel, and gestures that are attached to containers above the widget get /// a chance to interact with events that have not been handled yet. -/// +/// /// ## States of a sequence # {#touch-sequence-states} -/// +/// /// Whenever input interaction happens, a single event may trigger a cascade of /// #GtkGestures, both across the parents of the widget receiving the event and /// in parallel within an individual widget. It is a responsibility of the /// widgets using those gestures to set the state of touch sequences accordingly /// in order to enable cooperation of gestures around the #GdkEventSequences /// triggering those. -/// +/// /// Within a widget, gestures can be grouped through gtk_gesture_group(), /// grouped gestures synchronize the state of sequences, so calling /// gtk_gesture_set_sequence_state() on one will effectively propagate /// the state throughout the group. -/// +/// /// By default, all sequences start out in the #GTK_EVENT_SEQUENCE_NONE state, /// sequences in this state trigger the gesture event handler, but event /// propagation will continue unstopped by gestures. -/// +/// /// If a sequence enters into the #GTK_EVENT_SEQUENCE_DENIED state, the gesture /// group will effectively ignore the sequence, letting events go unstopped /// through the gesture, but the "slot" will still remain occupied while /// the touch is active. -/// +/// /// If a sequence enters in the #GTK_EVENT_SEQUENCE_CLAIMED state, the gesture /// group will grab all interaction on the sequence, by: /// - Setting the same sequence to #GTK_EVENT_SEQUENCE_DENIED on every other gesture @@ -70,19 +70,19 @@ import CGtk3 /// - calling #GtkGesture::cancel on every gesture in widgets underneath in the /// propagation chain. /// - Stopping event propagation after the gesture group handles the event. -/// +/// /// Note: if a sequence is set early to #GTK_EVENT_SEQUENCE_CLAIMED on /// #GDK_TOUCH_BEGIN/#GDK_BUTTON_PRESS (so those events are captured before /// reaching the event widget, this implies #GTK_PHASE_CAPTURE), one similar /// event will emulated if the sequence changes to #GTK_EVENT_SEQUENCE_DENIED. /// This way event coherence is preserved before event propagation is unstopped /// again. -/// +/// /// Sequence states can't be changed freely, see gtk_gesture_set_sequence_state() /// to know about the possible lifetimes of a #GdkEventSequence. -/// +/// /// ## Touchpad gestures -/// +/// /// On the platforms that support it, #GtkGesture will handle transparently /// touchpad gesture events. The only precautions users of #GtkGesture should do /// to enable this support are: @@ -90,122 +90,136 @@ import CGtk3 /// - If the gesture has %GTK_PHASE_NONE, ensuring events of type /// %GDK_TOUCHPAD_SWIPE and %GDK_TOUCHPAD_PINCH are handled by the #GtkGesture open class Gesture: EventController { - public override func registerSignals() { - super.registerSignals() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "begin", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.begin?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + super.registerSignals() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "begin", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.begin?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "cancel", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.cancel?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "end", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.end?(self, param0) + } + + let handler3: + @convention(c) ( + UnsafeMutableRawPointer, OpaquePointer, GtkEventSequenceState, + UnsafeMutableRawPointer + ) -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "sequence-state-changed", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer, param1: GtkEventSequenceState) in + guard let self = self else { return } + self.sequenceStateChanged?(self, param0, param1) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "update", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.update?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::n-points", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyNPoints?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::window", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWindow?(self, param0) + } } -addSignal(name: "cancel", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.cancel?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "end", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.end?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, GtkEventSequenceState, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - -addSignal(name: "sequence-state-changed", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer, param1: GtkEventSequenceState) in - guard let self = self else { return } - self.sequenceStateChanged?(self, param0, param1) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "update", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.update?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::n-points", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyNPoints?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::window", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWindow?(self, param0) -} -} - /// This signal is emitted when the gesture is recognized. This means the -/// number of touch sequences matches #GtkGesture:n-points, and the #GtkGesture::check -/// handler(s) returned #TRUE. -/// -/// Note: These conditions may also happen when an extra touch (eg. a third touch -/// on a 2-touches gesture) is lifted, in that situation @sequence won't pertain -/// to the current set of active touches, so don't rely on this being true. -public var begin: ((Gesture, OpaquePointer) -> Void)? - -/// This signal is emitted whenever a sequence is cancelled. This usually -/// happens on active touches when gtk_event_controller_reset() is called -/// on @gesture (manually, due to grabs...), or the individual @sequence -/// was claimed by parent widgets' controllers (see gtk_gesture_set_sequence_state()). -/// -/// @gesture must forget everything about @sequence as a reaction to this signal. -public var cancel: ((Gesture, OpaquePointer) -> Void)? - -/// This signal is emitted when @gesture either stopped recognizing the event -/// sequences as something to be handled (the #GtkGesture::check handler returned -/// %FALSE), or the number of touch sequences became higher or lower than -/// #GtkGesture:n-points. -/// -/// Note: @sequence might not pertain to the group of sequences that were -/// previously triggering recognition on @gesture (ie. a just pressed touch -/// sequence that exceeds #GtkGesture:n-points). This situation may be detected -/// by checking through gtk_gesture_handles_sequence(). -public var end: ((Gesture, OpaquePointer) -> Void)? - -/// This signal is emitted whenever a sequence state changes. See -/// gtk_gesture_set_sequence_state() to know more about the expectable -/// sequence lifetimes. -public var sequenceStateChanged: ((Gesture, OpaquePointer, GtkEventSequenceState) -> Void)? - -/// This signal is emitted whenever an event is handled while the gesture is -/// recognized. @sequence is guaranteed to pertain to the set of active touches. -public var update: ((Gesture, OpaquePointer) -> Void)? - - -public var notifyNPoints: ((Gesture, OpaquePointer) -> Void)? - - -public var notifyWindow: ((Gesture, OpaquePointer) -> Void)? -} \ No newline at end of file + /// number of touch sequences matches #GtkGesture:n-points, and the #GtkGesture::check + /// handler(s) returned #TRUE. + /// + /// Note: These conditions may also happen when an extra touch (eg. a third touch + /// on a 2-touches gesture) is lifted, in that situation @sequence won't pertain + /// to the current set of active touches, so don't rely on this being true. + public var begin: ((Gesture, OpaquePointer) -> Void)? + + /// This signal is emitted whenever a sequence is cancelled. This usually + /// happens on active touches when gtk_event_controller_reset() is called + /// on @gesture (manually, due to grabs...), or the individual @sequence + /// was claimed by parent widgets' controllers (see gtk_gesture_set_sequence_state()). + /// + /// @gesture must forget everything about @sequence as a reaction to this signal. + public var cancel: ((Gesture, OpaquePointer) -> Void)? + + /// This signal is emitted when @gesture either stopped recognizing the event + /// sequences as something to be handled (the #GtkGesture::check handler returned + /// %FALSE), or the number of touch sequences became higher or lower than + /// #GtkGesture:n-points. + /// + /// Note: @sequence might not pertain to the group of sequences that were + /// previously triggering recognition on @gesture (ie. a just pressed touch + /// sequence that exceeds #GtkGesture:n-points). This situation may be detected + /// by checking through gtk_gesture_handles_sequence(). + public var end: ((Gesture, OpaquePointer) -> Void)? + + /// This signal is emitted whenever a sequence state changes. See + /// gtk_gesture_set_sequence_state() to know more about the expectable + /// sequence lifetimes. + public var sequenceStateChanged: ((Gesture, OpaquePointer, GtkEventSequenceState) -> Void)? + + /// This signal is emitted whenever an event is handled while the gesture is + /// recognized. @sequence is guaranteed to pertain to the set of active touches. + public var update: ((Gesture, OpaquePointer) -> Void)? + + public var notifyNPoints: ((Gesture, OpaquePointer) -> Void)? + + public var notifyWindow: ((Gesture, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk3/Generated/GestureLongPress.swift b/Sources/Gtk3/Generated/GestureLongPress.swift index 0b01a0996b..2a975cae63 100644 --- a/Sources/Gtk3/Generated/GestureLongPress.swift +++ b/Sources/Gtk3/Generated/GestureLongPress.swift @@ -3,55 +3,59 @@ import CGtk3 /// #GtkGestureLongPress is a #GtkGesture implementation able to recognize /// long presses, triggering the #GtkGestureLongPress::pressed after the /// timeout is exceeded. -/// +/// /// If the touchpoint is lifted before the timeout passes, or if it drifts /// too far of the initial press point, the #GtkGestureLongPress::cancelled /// signal will be emitted. open class GestureLongPress: GestureSingle { /// Returns a newly created #GtkGesture that recognizes long presses. -public convenience init(widget: UnsafeMutablePointer!) { - self.init( - gtk_gesture_long_press_new(widget) - ) -} - - public override func registerSignals() { - super.registerSignals() - - addSignal(name: "cancelled") { [weak self] () in - guard let self = self else { return } - self.cancelled?(self) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) + public convenience init(widget: UnsafeMutablePointer!) { + self.init( + gtk_gesture_long_press_new(widget) + ) } -addSignal(name: "pressed", handler: gCallback(handler1)) { [weak self] (param0: Double, param1: Double) in - guard let self = self else { return } - self.pressed?(self, param0, param1) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public override func registerSignals() { + super.registerSignals() + + addSignal(name: "cancelled") { [weak self] () in + guard let self = self else { return } + self.cancelled?(self) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, Double, Double, UnsafeMutableRawPointer) -> + Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "pressed", handler: gCallback(handler1)) { + [weak self] (param0: Double, param1: Double) in + guard let self = self else { return } + self.pressed?(self, param0, param1) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::delay-factor", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDelayFactor?(self, param0) + } } -addSignal(name: "notify::delay-factor", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDelayFactor?(self, param0) -} -} - /// This signal is emitted whenever a press moved too far, or was released -/// before #GtkGestureLongPress::pressed happened. -public var cancelled: ((GestureLongPress) -> Void)? - -/// This signal is emitted whenever a press goes unmoved/unreleased longer than -/// what the GTK+ defaults tell. -public var pressed: ((GestureLongPress, Double, Double) -> Void)? + /// before #GtkGestureLongPress::pressed happened. + public var cancelled: ((GestureLongPress) -> Void)? + /// This signal is emitted whenever a press goes unmoved/unreleased longer than + /// what the GTK+ defaults tell. + public var pressed: ((GestureLongPress, Double, Double) -> Void)? -public var notifyDelayFactor: ((GestureLongPress, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyDelayFactor: ((GestureLongPress, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk3/Generated/GestureSingle.swift b/Sources/Gtk3/Generated/GestureSingle.swift index 2240ef391c..f51f30dc77 100644 --- a/Sources/Gtk3/Generated/GestureSingle.swift +++ b/Sources/Gtk3/Generated/GestureSingle.swift @@ -5,7 +5,7 @@ import CGtk3 /// interaction, these gestures stick to the first interacting sequence, which /// is accessible through gtk_gesture_single_get_current_sequence() while the /// gesture is being interacted with. -/// +/// /// By default gestures react to both %GDK_BUTTON_PRIMARY and touch /// events, gtk_gesture_single_set_touch_only() can be used to change the /// touch behavior. Callers may also specify a different mouse button number @@ -13,48 +13,50 @@ import CGtk3 /// mouse button by setting 0. While the gesture is active, the button being /// currently pressed can be known through gtk_gesture_single_get_current_button(). open class GestureSingle: Gesture { - public override func registerSignals() { - super.registerSignals() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + super.registerSignals() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::button", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyButton?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::exclusive", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyExclusive?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::touch-only", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTouchOnly?(self, param0) + } } -addSignal(name: "notify::button", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyButton?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyButton: ((GestureSingle, OpaquePointer) -> Void)? -addSignal(name: "notify::exclusive", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyExclusive?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyExclusive: ((GestureSingle, OpaquePointer) -> Void)? -addSignal(name: "notify::touch-only", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTouchOnly?(self, param0) + public var notifyTouchOnly: ((GestureSingle, OpaquePointer) -> Void)? } -} - - -public var notifyButton: ((GestureSingle, OpaquePointer) -> Void)? - - -public var notifyExclusive: ((GestureSingle, OpaquePointer) -> Void)? - - -public var notifyTouchOnly: ((GestureSingle, OpaquePointer) -> Void)? -} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/IMPreeditStyle.swift b/Sources/Gtk3/Generated/IMPreeditStyle.swift index 96ca8cd13f..adc3ddfa79 100644 --- a/Sources/Gtk3/Generated/IMPreeditStyle.swift +++ b/Sources/Gtk3/Generated/IMPreeditStyle.swift @@ -6,24 +6,24 @@ public enum IMPreeditStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkIMPreeditStyle /// Deprecated -case nothing -/// Deprecated -case callback -/// Deprecated -case none + case nothing + /// Deprecated + case callback + /// Deprecated + case none public static var type: GType { - gtk_im_preedit_style_get_type() -} + gtk_im_preedit_style_get_type() + } public init(from gtkEnum: GtkIMPreeditStyle) { switch gtkEnum { case GTK_IM_PREEDIT_NOTHING: - self = .nothing -case GTK_IM_PREEDIT_CALLBACK: - self = .callback -case GTK_IM_PREEDIT_NONE: - self = .none + self = .nothing + case GTK_IM_PREEDIT_CALLBACK: + self = .callback + case GTK_IM_PREEDIT_NONE: + self = .none default: fatalError("Unsupported GtkIMPreeditStyle enum value: \(gtkEnum.rawValue)") } @@ -32,11 +32,11 @@ case GTK_IM_PREEDIT_NONE: public func toGtk() -> GtkIMPreeditStyle { switch self { case .nothing: - return GTK_IM_PREEDIT_NOTHING -case .callback: - return GTK_IM_PREEDIT_CALLBACK -case .none: - return GTK_IM_PREEDIT_NONE + return GTK_IM_PREEDIT_NOTHING + case .callback: + return GTK_IM_PREEDIT_CALLBACK + case .none: + return GTK_IM_PREEDIT_NONE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/IMStatusStyle.swift b/Sources/Gtk3/Generated/IMStatusStyle.swift index daf7e4012f..3fb252c4d4 100644 --- a/Sources/Gtk3/Generated/IMStatusStyle.swift +++ b/Sources/Gtk3/Generated/IMStatusStyle.swift @@ -6,24 +6,24 @@ public enum IMStatusStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkIMStatusStyle /// Deprecated -case nothing -/// Deprecated -case callback -/// Deprecated -case none + case nothing + /// Deprecated + case callback + /// Deprecated + case none public static var type: GType { - gtk_im_status_style_get_type() -} + gtk_im_status_style_get_type() + } public init(from gtkEnum: GtkIMStatusStyle) { switch gtkEnum { case GTK_IM_STATUS_NOTHING: - self = .nothing -case GTK_IM_STATUS_CALLBACK: - self = .callback -case GTK_IM_STATUS_NONE: - self = .none + self = .nothing + case GTK_IM_STATUS_CALLBACK: + self = .callback + case GTK_IM_STATUS_NONE: + self = .none default: fatalError("Unsupported GtkIMStatusStyle enum value: \(gtkEnum.rawValue)") } @@ -32,11 +32,11 @@ case GTK_IM_STATUS_NONE: public func toGtk() -> GtkIMStatusStyle { switch self { case .nothing: - return GTK_IM_STATUS_NOTHING -case .callback: - return GTK_IM_STATUS_CALLBACK -case .none: - return GTK_IM_STATUS_NONE + return GTK_IM_STATUS_NOTHING + case .callback: + return GTK_IM_STATUS_CALLBACK + case .none: + return GTK_IM_STATUS_NONE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/IconSize.swift b/Sources/Gtk3/Generated/IconSize.swift index 4b2cc2bf5d..7abab1a378 100644 --- a/Sources/Gtk3/Generated/IconSize.swift +++ b/Sources/Gtk3/Generated/IconSize.swift @@ -5,40 +5,40 @@ public enum IconSize: GValueRepresentableEnum { public typealias GtkEnum = GtkIconSize /// Invalid size. -case invalid -/// Size appropriate for menus (16px). -case menu -/// Size appropriate for small toolbars (16px). -case smallToolbar -/// Size appropriate for large toolbars (24px) -case largeToolbar -/// Size appropriate for buttons (16px) -case button -/// Size appropriate for drag and drop (32px) -case dnd -/// Size appropriate for dialogs (48px) -case dialog + case invalid + /// Size appropriate for menus (16px). + case menu + /// Size appropriate for small toolbars (16px). + case smallToolbar + /// Size appropriate for large toolbars (24px) + case largeToolbar + /// Size appropriate for buttons (16px) + case button + /// Size appropriate for drag and drop (32px) + case dnd + /// Size appropriate for dialogs (48px) + case dialog public static var type: GType { - gtk_icon_size_get_type() -} + gtk_icon_size_get_type() + } public init(from gtkEnum: GtkIconSize) { switch gtkEnum { case GTK_ICON_SIZE_INVALID: - self = .invalid -case GTK_ICON_SIZE_MENU: - self = .menu -case GTK_ICON_SIZE_SMALL_TOOLBAR: - self = .smallToolbar -case GTK_ICON_SIZE_LARGE_TOOLBAR: - self = .largeToolbar -case GTK_ICON_SIZE_BUTTON: - self = .button -case GTK_ICON_SIZE_DND: - self = .dnd -case GTK_ICON_SIZE_DIALOG: - self = .dialog + self = .invalid + case GTK_ICON_SIZE_MENU: + self = .menu + case GTK_ICON_SIZE_SMALL_TOOLBAR: + self = .smallToolbar + case GTK_ICON_SIZE_LARGE_TOOLBAR: + self = .largeToolbar + case GTK_ICON_SIZE_BUTTON: + self = .button + case GTK_ICON_SIZE_DND: + self = .dnd + case GTK_ICON_SIZE_DIALOG: + self = .dialog default: fatalError("Unsupported GtkIconSize enum value: \(gtkEnum.rawValue)") } @@ -47,19 +47,19 @@ case GTK_ICON_SIZE_DIALOG: public func toGtk() -> GtkIconSize { switch self { case .invalid: - return GTK_ICON_SIZE_INVALID -case .menu: - return GTK_ICON_SIZE_MENU -case .smallToolbar: - return GTK_ICON_SIZE_SMALL_TOOLBAR -case .largeToolbar: - return GTK_ICON_SIZE_LARGE_TOOLBAR -case .button: - return GTK_ICON_SIZE_BUTTON -case .dnd: - return GTK_ICON_SIZE_DND -case .dialog: - return GTK_ICON_SIZE_DIALOG + return GTK_ICON_SIZE_INVALID + case .menu: + return GTK_ICON_SIZE_MENU + case .smallToolbar: + return GTK_ICON_SIZE_SMALL_TOOLBAR + case .largeToolbar: + return GTK_ICON_SIZE_LARGE_TOOLBAR + case .button: + return GTK_ICON_SIZE_BUTTON + case .dnd: + return GTK_ICON_SIZE_DND + case .dialog: + return GTK_ICON_SIZE_DIALOG } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/IconThemeError.swift b/Sources/Gtk3/Generated/IconThemeError.swift index 14ef2fd915..c26e9f5703 100644 --- a/Sources/Gtk3/Generated/IconThemeError.swift +++ b/Sources/Gtk3/Generated/IconThemeError.swift @@ -5,20 +5,20 @@ public enum IconThemeError: GValueRepresentableEnum { public typealias GtkEnum = GtkIconThemeError /// The icon specified does not exist in the theme -case notFound -/// An unspecified error occurred. -case failed + case notFound + /// An unspecified error occurred. + case failed public static var type: GType { - gtk_icon_theme_error_get_type() -} + gtk_icon_theme_error_get_type() + } public init(from gtkEnum: GtkIconThemeError) { switch gtkEnum { case GTK_ICON_THEME_NOT_FOUND: - self = .notFound -case GTK_ICON_THEME_FAILED: - self = .failed + self = .notFound + case GTK_ICON_THEME_FAILED: + self = .failed default: fatalError("Unsupported GtkIconThemeError enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ case GTK_ICON_THEME_FAILED: public func toGtk() -> GtkIconThemeError { switch self { case .notFound: - return GTK_ICON_THEME_NOT_FOUND -case .failed: - return GTK_ICON_THEME_FAILED + return GTK_ICON_THEME_NOT_FOUND + case .failed: + return GTK_ICON_THEME_FAILED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/IconViewDropPosition.swift b/Sources/Gtk3/Generated/IconViewDropPosition.swift index 0c06738f27..4d3258affe 100644 --- a/Sources/Gtk3/Generated/IconViewDropPosition.swift +++ b/Sources/Gtk3/Generated/IconViewDropPosition.swift @@ -5,36 +5,36 @@ public enum IconViewDropPosition: GValueRepresentableEnum { public typealias GtkEnum = GtkIconViewDropPosition /// No drop possible -case noDrop -/// Dropped item replaces the item -case dropInto -/// Droppped item is inserted to the left -case dropLeft -/// Dropped item is inserted to the right -case dropRight -/// Dropped item is inserted above -case dropAbove -/// Dropped item is inserted below -case dropBelow + case noDrop + /// Dropped item replaces the item + case dropInto + /// Droppped item is inserted to the left + case dropLeft + /// Dropped item is inserted to the right + case dropRight + /// Dropped item is inserted above + case dropAbove + /// Dropped item is inserted below + case dropBelow public static var type: GType { - gtk_icon_view_drop_position_get_type() -} + gtk_icon_view_drop_position_get_type() + } public init(from gtkEnum: GtkIconViewDropPosition) { switch gtkEnum { case GTK_ICON_VIEW_NO_DROP: - self = .noDrop -case GTK_ICON_VIEW_DROP_INTO: - self = .dropInto -case GTK_ICON_VIEW_DROP_LEFT: - self = .dropLeft -case GTK_ICON_VIEW_DROP_RIGHT: - self = .dropRight -case GTK_ICON_VIEW_DROP_ABOVE: - self = .dropAbove -case GTK_ICON_VIEW_DROP_BELOW: - self = .dropBelow + self = .noDrop + case GTK_ICON_VIEW_DROP_INTO: + self = .dropInto + case GTK_ICON_VIEW_DROP_LEFT: + self = .dropLeft + case GTK_ICON_VIEW_DROP_RIGHT: + self = .dropRight + case GTK_ICON_VIEW_DROP_ABOVE: + self = .dropAbove + case GTK_ICON_VIEW_DROP_BELOW: + self = .dropBelow default: fatalError("Unsupported GtkIconViewDropPosition enum value: \(gtkEnum.rawValue)") } @@ -43,17 +43,17 @@ case GTK_ICON_VIEW_DROP_BELOW: public func toGtk() -> GtkIconViewDropPosition { switch self { case .noDrop: - return GTK_ICON_VIEW_NO_DROP -case .dropInto: - return GTK_ICON_VIEW_DROP_INTO -case .dropLeft: - return GTK_ICON_VIEW_DROP_LEFT -case .dropRight: - return GTK_ICON_VIEW_DROP_RIGHT -case .dropAbove: - return GTK_ICON_VIEW_DROP_ABOVE -case .dropBelow: - return GTK_ICON_VIEW_DROP_BELOW + return GTK_ICON_VIEW_NO_DROP + case .dropInto: + return GTK_ICON_VIEW_DROP_INTO + case .dropLeft: + return GTK_ICON_VIEW_DROP_LEFT + case .dropRight: + return GTK_ICON_VIEW_DROP_RIGHT + case .dropAbove: + return GTK_ICON_VIEW_DROP_ABOVE + case .dropBelow: + return GTK_ICON_VIEW_DROP_BELOW } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/Image.swift b/Sources/Gtk3/Generated/Image.swift index f97bce7ea9..f9570e9959 100644 --- a/Sources/Gtk3/Generated/Image.swift +++ b/Sources/Gtk3/Generated/Image.swift @@ -15,21 +15,21 @@ import CGtk3 /// for example by displaying an error message, then load the image with /// gdk_pixbuf_new_from_file(), then create the #GtkImage with /// gtk_image_new_from_pixbuf(). -/// +/// /// The image file may contain an animation, if so the #GtkImage will /// display an animation (#GdkPixbufAnimation) instead of a static image. -/// +/// /// #GtkImage is a subclass of #GtkMisc, which implies that you can /// align it (center, left, right) and add padding to it, using /// #GtkMisc methods. -/// +/// /// #GtkImage is a “no window” widget (has no #GdkWindow of its own), /// so by default does not receive events. If you want to receive events /// on the image, such as button clicks, place the image inside a /// #GtkEventBox, then connect to the event signals on the event box. -/// +/// /// ## Handling button press events on a #GtkImage. -/// +/// /// |[ /// static gboolean /// button_press_callback (GtkWidget *event_box, @@ -38,300 +38,311 @@ import CGtk3 /// { /// g_print ("Event box clicked at coordinates %f,%f\n", /// event->x, event->y); -/// +/// /// // Returning TRUE means we handled the event, so the signal /// // emission should be stopped (don’t call any further callbacks /// // that may be connected). Return FALSE to continue invoking callbacks. /// return TRUE; /// } -/// +/// /// static GtkWidget* /// create_image (void) /// { /// GtkWidget *image; /// GtkWidget *event_box; -/// +/// /// image = gtk_image_new_from_file ("myfile.png"); -/// +/// /// event_box = gtk_event_box_new (); -/// +/// /// gtk_container_add (GTK_CONTAINER (event_box), image); -/// +/// /// g_signal_connect (G_OBJECT (event_box), /// "button_press_event", /// G_CALLBACK (button_press_callback), /// image); -/// +/// /// return image; /// } /// ]| -/// +/// /// When handling events on the event box, keep in mind that coordinates /// in the image may be different from event box coordinates due to /// the alignment and padding settings on the image (see #GtkMisc). /// The simplest way to solve this is to set the alignment to 0.0 /// (left/top), and set the padding to zero. Then the origin of /// the image will be the same as the origin of the event box. -/// +/// /// Sometimes an application will want to avoid depending on external data /// files, such as image files. GTK+ comes with a program to avoid this, /// called “gdk-pixbuf-csource”. This library /// allows you to convert an image into a C variable declaration, which /// can then be loaded into a #GdkPixbuf using /// gdk_pixbuf_new_from_inline(). -/// +/// /// # CSS nodes -/// +/// /// GtkImage has a single CSS node with the name image. The style classes /// may appear on image CSS nodes: .icon-dropshadow, .lowres-icon. open class Image: Misc { /// Creates a new empty #GtkImage widget. -public convenience init() { - self.init( - gtk_image_new() - ) -} - -/// Creates a new #GtkImage displaying the file @filename. If the file -/// isn’t found or can’t be loaded, the resulting #GtkImage will -/// display a “broken image” icon. This function never returns %NULL, -/// it always returns a valid #GtkImage widget. -/// -/// If the file contains an animation, the image will contain an -/// animation. -/// -/// If you need to detect failures to load the file, use -/// gdk_pixbuf_new_from_file() to load the file yourself, then create -/// the #GtkImage from the pixbuf. (Or for animations, use -/// gdk_pixbuf_animation_new_from_file()). -/// -/// The storage type (gtk_image_get_storage_type()) of the returned -/// image is not defined, it will be whatever is appropriate for -/// displaying the file. -public convenience init(filename: String) { - self.init( - gtk_image_new_from_file(filename) - ) -} - -/// Creates a #GtkImage displaying an icon from the current icon theme. -/// If the icon name isn’t known, a “broken image” icon will be -/// displayed instead. If the current icon theme is changed, the icon -/// will be updated appropriately. -public convenience init(icon: OpaquePointer, size: GtkIconSize) { - self.init( - gtk_image_new_from_gicon(icon, size) - ) -} - -/// Creates a #GtkImage displaying an icon from the current icon theme. -/// If the icon name isn’t known, a “broken image” icon will be -/// displayed instead. If the current icon theme is changed, the icon -/// will be updated appropriately. -public convenience init(iconName: String, size: GtkIconSize) { - self.init( - gtk_image_new_from_icon_name(iconName, size) - ) -} - -/// Creates a new #GtkImage displaying the resource file @resource_path. If the file -/// isn’t found or can’t be loaded, the resulting #GtkImage will -/// display a “broken image” icon. This function never returns %NULL, -/// it always returns a valid #GtkImage widget. -/// -/// If the file contains an animation, the image will contain an -/// animation. -/// -/// If you need to detect failures to load the file, use -/// gdk_pixbuf_new_from_file() to load the file yourself, then create -/// the #GtkImage from the pixbuf. (Or for animations, use -/// gdk_pixbuf_animation_new_from_file()). -/// -/// The storage type (gtk_image_get_storage_type()) of the returned -/// image is not defined, it will be whatever is appropriate for -/// displaying the file. -public convenience init(resourcePath: String) { - self.init( - gtk_image_new_from_resource(resourcePath) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_image_new() + ) } -addSignal(name: "notify::file", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFile?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new #GtkImage displaying the file @filename. If the file + /// isn’t found or can’t be loaded, the resulting #GtkImage will + /// display a “broken image” icon. This function never returns %NULL, + /// it always returns a valid #GtkImage widget. + /// + /// If the file contains an animation, the image will contain an + /// animation. + /// + /// If you need to detect failures to load the file, use + /// gdk_pixbuf_new_from_file() to load the file yourself, then create + /// the #GtkImage from the pixbuf. (Or for animations, use + /// gdk_pixbuf_animation_new_from_file()). + /// + /// The storage type (gtk_image_get_storage_type()) of the returned + /// image is not defined, it will be whatever is appropriate for + /// displaying the file. + public convenience init(filename: String) { + self.init( + gtk_image_new_from_file(filename) + ) } -addSignal(name: "notify::gicon", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyGicon?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a #GtkImage displaying an icon from the current icon theme. + /// If the icon name isn’t known, a “broken image” icon will be + /// displayed instead. If the current icon theme is changed, the icon + /// will be updated appropriately. + public convenience init(icon: OpaquePointer, size: GtkIconSize) { + self.init( + gtk_image_new_from_gicon(icon, size) + ) } -addSignal(name: "notify::icon-name", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIconName?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a #GtkImage displaying an icon from the current icon theme. + /// If the icon name isn’t known, a “broken image” icon will be + /// displayed instead. If the current icon theme is changed, the icon + /// will be updated appropriately. + public convenience init(iconName: String, size: GtkIconSize) { + self.init( + gtk_image_new_from_icon_name(iconName, size) + ) } -addSignal(name: "notify::icon-set", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIconSet?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new #GtkImage displaying the resource file @resource_path. If the file + /// isn’t found or can’t be loaded, the resulting #GtkImage will + /// display a “broken image” icon. This function never returns %NULL, + /// it always returns a valid #GtkImage widget. + /// + /// If the file contains an animation, the image will contain an + /// animation. + /// + /// If you need to detect failures to load the file, use + /// gdk_pixbuf_new_from_file() to load the file yourself, then create + /// the #GtkImage from the pixbuf. (Or for animations, use + /// gdk_pixbuf_animation_new_from_file()). + /// + /// The storage type (gtk_image_get_storage_type()) of the returned + /// image is not defined, it will be whatever is appropriate for + /// displaying the file. + public convenience init(resourcePath: String) { + self.init( + gtk_image_new_from_resource(resourcePath) + ) } -addSignal(name: "notify::icon-size", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyIconSize?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::file", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFile?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::gicon", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyGicon?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::icon-name", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIconName?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::icon-set", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIconSet?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::icon-size", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyIconSize?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::pixbuf", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPixbuf?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::pixbuf-animation", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPixbufAnimation?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::pixel-size", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPixelSize?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::resource", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyResource?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::stock", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyStock?(self, param0) + } + + let handler10: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::storage-type", handler: gCallback(handler10)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyStorageType?(self, param0) + } + + let handler11: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::surface", handler: gCallback(handler11)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySurface?(self, param0) + } + + let handler12: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-fallback", handler: gCallback(handler12)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseFallback?(self, param0) + } } -addSignal(name: "notify::pixbuf", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPixbuf?(self, param0) -} + @GObjectProperty(named: "stock") public var stock: String -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + @GObjectProperty(named: "storage-type") public var storageType: ImageType -addSignal(name: "notify::pixbuf-animation", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPixbufAnimation?(self, param0) -} + public var notifyFile: ((Image, OpaquePointer) -> Void)? -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyGicon: ((Image, OpaquePointer) -> Void)? -addSignal(name: "notify::pixel-size", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPixelSize?(self, param0) -} + public var notifyIconName: ((Image, OpaquePointer) -> Void)? -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyIconSet: ((Image, OpaquePointer) -> Void)? -addSignal(name: "notify::resource", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyResource?(self, param0) -} + public var notifyIconSize: ((Image, OpaquePointer) -> Void)? -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyPixbuf: ((Image, OpaquePointer) -> Void)? -addSignal(name: "notify::stock", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyStock?(self, param0) -} + public var notifyPixbufAnimation: ((Image, OpaquePointer) -> Void)? -let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyPixelSize: ((Image, OpaquePointer) -> Void)? -addSignal(name: "notify::storage-type", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyStorageType?(self, param0) -} + public var notifyResource: ((Image, OpaquePointer) -> Void)? -let handler11: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyStock: ((Image, OpaquePointer) -> Void)? -addSignal(name: "notify::surface", handler: gCallback(handler11)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySurface?(self, param0) -} + public var notifyStorageType: ((Image, OpaquePointer) -> Void)? -let handler12: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifySurface: ((Image, OpaquePointer) -> Void)? -addSignal(name: "notify::use-fallback", handler: gCallback(handler12)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseFallback?(self, param0) + public var notifyUseFallback: ((Image, OpaquePointer) -> Void)? } -} - - -@GObjectProperty(named: "stock") public var stock: String - - -@GObjectProperty(named: "storage-type") public var storageType: ImageType - - -public var notifyFile: ((Image, OpaquePointer) -> Void)? - - -public var notifyGicon: ((Image, OpaquePointer) -> Void)? - - -public var notifyIconName: ((Image, OpaquePointer) -> Void)? - - -public var notifyIconSet: ((Image, OpaquePointer) -> Void)? - - -public var notifyIconSize: ((Image, OpaquePointer) -> Void)? - - -public var notifyPixbuf: ((Image, OpaquePointer) -> Void)? - - -public var notifyPixbufAnimation: ((Image, OpaquePointer) -> Void)? - - -public var notifyPixelSize: ((Image, OpaquePointer) -> Void)? - - -public var notifyResource: ((Image, OpaquePointer) -> Void)? - - -public var notifyStock: ((Image, OpaquePointer) -> Void)? - - -public var notifyStorageType: ((Image, OpaquePointer) -> Void)? - - -public var notifySurface: ((Image, OpaquePointer) -> Void)? - - -public var notifyUseFallback: ((Image, OpaquePointer) -> Void)? -} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/ImageType.swift b/Sources/Gtk3/Generated/ImageType.swift index 235d635baa..6689fda8e3 100644 --- a/Sources/Gtk3/Generated/ImageType.swift +++ b/Sources/Gtk3/Generated/ImageType.swift @@ -11,47 +11,47 @@ public enum ImageType: GValueRepresentableEnum { public typealias GtkEnum = GtkImageType /// There is no image displayed by the widget -case empty -/// The widget contains a #GdkPixbuf -case pixbuf -/// The widget contains a [stock item name][gtkstock] -case stock -/// The widget contains a #GtkIconSet -case iconSet -/// The widget contains a #GdkPixbufAnimation -case animation -/// The widget contains a named icon. -/// This image type was added in GTK+ 2.6 -case iconName -/// The widget contains a #GIcon. -/// This image type was added in GTK+ 2.14 -case gicon -/// The widget contains a #cairo_surface_t. -/// This image type was added in GTK+ 3.10 -case surface + case empty + /// The widget contains a #GdkPixbuf + case pixbuf + /// The widget contains a [stock item name][gtkstock] + case stock + /// The widget contains a #GtkIconSet + case iconSet + /// The widget contains a #GdkPixbufAnimation + case animation + /// The widget contains a named icon. + /// This image type was added in GTK+ 2.6 + case iconName + /// The widget contains a #GIcon. + /// This image type was added in GTK+ 2.14 + case gicon + /// The widget contains a #cairo_surface_t. + /// This image type was added in GTK+ 3.10 + case surface public static var type: GType { - gtk_image_type_get_type() -} + gtk_image_type_get_type() + } public init(from gtkEnum: GtkImageType) { switch gtkEnum { case GTK_IMAGE_EMPTY: - self = .empty -case GTK_IMAGE_PIXBUF: - self = .pixbuf -case GTK_IMAGE_STOCK: - self = .stock -case GTK_IMAGE_ICON_SET: - self = .iconSet -case GTK_IMAGE_ANIMATION: - self = .animation -case GTK_IMAGE_ICON_NAME: - self = .iconName -case GTK_IMAGE_GICON: - self = .gicon -case GTK_IMAGE_SURFACE: - self = .surface + self = .empty + case GTK_IMAGE_PIXBUF: + self = .pixbuf + case GTK_IMAGE_STOCK: + self = .stock + case GTK_IMAGE_ICON_SET: + self = .iconSet + case GTK_IMAGE_ANIMATION: + self = .animation + case GTK_IMAGE_ICON_NAME: + self = .iconName + case GTK_IMAGE_GICON: + self = .gicon + case GTK_IMAGE_SURFACE: + self = .surface default: fatalError("Unsupported GtkImageType enum value: \(gtkEnum.rawValue)") } @@ -60,21 +60,21 @@ case GTK_IMAGE_SURFACE: public func toGtk() -> GtkImageType { switch self { case .empty: - return GTK_IMAGE_EMPTY -case .pixbuf: - return GTK_IMAGE_PIXBUF -case .stock: - return GTK_IMAGE_STOCK -case .iconSet: - return GTK_IMAGE_ICON_SET -case .animation: - return GTK_IMAGE_ANIMATION -case .iconName: - return GTK_IMAGE_ICON_NAME -case .gicon: - return GTK_IMAGE_GICON -case .surface: - return GTK_IMAGE_SURFACE + return GTK_IMAGE_EMPTY + case .pixbuf: + return GTK_IMAGE_PIXBUF + case .stock: + return GTK_IMAGE_STOCK + case .iconSet: + return GTK_IMAGE_ICON_SET + case .animation: + return GTK_IMAGE_ANIMATION + case .iconName: + return GTK_IMAGE_ICON_NAME + case .gicon: + return GTK_IMAGE_GICON + case .surface: + return GTK_IMAGE_SURFACE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/Justification.swift b/Sources/Gtk3/Generated/Justification.swift index 8da8a9b5b8..e9ea30c615 100644 --- a/Sources/Gtk3/Generated/Justification.swift +++ b/Sources/Gtk3/Generated/Justification.swift @@ -6,28 +6,28 @@ public enum Justification: GValueRepresentableEnum { public typealias GtkEnum = GtkJustification /// The text is placed at the left edge of the label. -case left -/// The text is placed at the right edge of the label. -case right -/// The text is placed in the center of the label. -case center -/// The text is placed is distributed across the label. -case fill + case left + /// The text is placed at the right edge of the label. + case right + /// The text is placed in the center of the label. + case center + /// The text is placed is distributed across the label. + case fill public static var type: GType { - gtk_justification_get_type() -} + gtk_justification_get_type() + } public init(from gtkEnum: GtkJustification) { switch gtkEnum { case GTK_JUSTIFY_LEFT: - self = .left -case GTK_JUSTIFY_RIGHT: - self = .right -case GTK_JUSTIFY_CENTER: - self = .center -case GTK_JUSTIFY_FILL: - self = .fill + self = .left + case GTK_JUSTIFY_RIGHT: + self = .right + case GTK_JUSTIFY_CENTER: + self = .center + case GTK_JUSTIFY_FILL: + self = .fill default: fatalError("Unsupported GtkJustification enum value: \(gtkEnum.rawValue)") } @@ -36,13 +36,13 @@ case GTK_JUSTIFY_FILL: public func toGtk() -> GtkJustification { switch self { case .left: - return GTK_JUSTIFY_LEFT -case .right: - return GTK_JUSTIFY_RIGHT -case .center: - return GTK_JUSTIFY_CENTER -case .fill: - return GTK_JUSTIFY_FILL + return GTK_JUSTIFY_LEFT + case .right: + return GTK_JUSTIFY_RIGHT + case .center: + return GTK_JUSTIFY_CENTER + case .fill: + return GTK_JUSTIFY_FILL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/Label.swift b/Sources/Gtk3/Generated/Label.swift index 0d9e2f542c..fbb6155cd5 100644 --- a/Sources/Gtk3/Generated/Label.swift +++ b/Sources/Gtk3/Generated/Label.swift @@ -3,9 +3,9 @@ import CGtk3 /// The #GtkLabel widget displays a small amount of text. As the name /// implies, most labels are used to label another widget such as a /// #GtkButton, a #GtkMenuItem, or a #GtkComboBox. -/// +/// /// # CSS nodes -/// +/// /// |[ /// label /// ├── [selection] @@ -13,99 +13,99 @@ import CGtk3 /// ┊ /// ╰── [link] /// ]| -/// +/// /// GtkLabel has a single CSS node with the name label. A wide variety /// of style classes may be applied to labels, such as .title, .subtitle, /// .dim-label, etc. In the #GtkShortcutsWindow, labels are used wth the /// .keycap style class. -/// +/// /// If the label has a selection, it gets a subnode with name selection. -/// +/// /// If the label has links, there is one subnode per link. These subnodes /// carry the link or visited state depending on whether they have been /// visited. -/// +/// /// # GtkLabel as GtkBuildable -/// +/// /// The GtkLabel implementation of the GtkBuildable interface supports a /// custom `` element, which supports any number of `` /// elements. The `` element has attributes named “name“, “value“, /// “start“ and “end“ and allows you to specify #PangoAttribute values for /// this label. -/// +/// /// An example of a UI definition fragment specifying Pango attributes: -/// +/// /// |[ /// ]| -/// +/// /// The start and end attributes specify the range of characters to which the /// Pango attribute applies. If start and end are not specified, the attribute is /// applied to the whole text. Note that specifying ranges does not make much /// sense with translatable attributes. Use markup embedded in the translatable /// content instead. -/// +/// /// # Mnemonics -/// +/// /// Labels may contain “mnemonics”. Mnemonics are /// underlined characters in the label, used for keyboard navigation. /// Mnemonics are created by providing a string with an underscore before /// the mnemonic character, such as `"_File"`, to the /// functions gtk_label_new_with_mnemonic() or /// gtk_label_set_text_with_mnemonic(). -/// +/// /// Mnemonics automatically activate any activatable widget the label is /// inside, such as a #GtkButton; if the label is not inside the /// mnemonic’s target widget, you have to tell the label about the target /// using gtk_label_set_mnemonic_widget(). Here’s a simple example where /// the label is inside a button: -/// +/// /// |[ /// // Pressing Alt+H will activate this button /// GtkWidget *button = gtk_button_new (); /// GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello"); /// gtk_container_add (GTK_CONTAINER (button), label); /// ]| -/// +/// /// There’s a convenience function to create buttons with a mnemonic label /// already inside: -/// +/// /// |[ /// // Pressing Alt+H will activate this button /// GtkWidget *button = gtk_button_new_with_mnemonic ("_Hello"); /// ]| -/// +/// /// To create a mnemonic for a widget alongside the label, such as a /// #GtkEntry, you have to point the label at the entry with /// gtk_label_set_mnemonic_widget(): -/// +/// /// |[ /// // Pressing Alt+H will focus the entry /// GtkWidget *entry = gtk_entry_new (); /// GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello"); /// gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry); /// ]| -/// +/// /// # Markup (styled text) -/// +/// /// To make it easy to format text in a label (changing colors, /// fonts, etc.), label text can be provided in a simple /// [markup format][PangoMarkupFormat]. -/// +/// /// Here’s how to create a label with a small font: /// |[ /// GtkWidget *label = gtk_label_new (NULL); /// gtk_label_set_markup (GTK_LABEL (label), "Small text"); /// ]| -/// +/// /// (See [complete documentation][PangoMarkupFormat] of available /// tags in the Pango manual.) -/// +/// /// The markup passed to gtk_label_set_markup() must be valid; for example, /// literal <, > and & characters must be escaped as <, >, and &. /// If you pass text obtained from the user, file, or a network to /// gtk_label_set_markup(), you’ll want to escape it with /// g_markup_escape_text() or g_markup_printf_escaped(). -/// +/// /// Markup strings are just a convenient way to set the #PangoAttrList on /// a label; gtk_label_set_attributes() may be a simpler way to set /// attributes in some cases. Be careful though; #PangoAttrList tends to @@ -114,29 +114,29 @@ import CGtk3 /// to [0, %G_MAXINT)). The reason is that specifying the start_index and /// end_index for a #PangoAttribute requires knowledge of the exact string /// being displayed, so translations will cause problems. -/// +/// /// # Selectable labels -/// +/// /// Labels can be made selectable with gtk_label_set_selectable(). /// Selectable labels allow the user to copy the label contents to /// the clipboard. Only labels that contain useful-to-copy information /// — such as error messages — should be made selectable. -/// +/// /// # Text layout # {#label-text-layout} -/// +/// /// A label can contain any number of paragraphs, but will have /// performance problems if it contains more than a small number. /// Paragraphs are separated by newlines or other paragraph separators /// understood by Pango. -/// +/// /// Labels can automatically wrap text if you call /// gtk_label_set_line_wrap(). -/// +/// /// gtk_label_set_justify() sets how the lines in a label align /// with one another. If you want to set how the label as a whole /// aligns in its available space, see the #GtkWidget:halign and /// #GtkWidget:valign properties. -/// +/// /// The #GtkLabel:width-chars and #GtkLabel:max-width-chars properties /// can be used to control the size allocation of ellipsized or wrapped /// labels. For ellipsizing labels, if either is specified (and less @@ -145,21 +145,21 @@ import CGtk3 /// width-chars is used as the minimum width, if specified, and max-width-chars /// is used as the natural width. Even if max-width-chars specified, wrapping /// labels will be rewrapped to use all of the available width. -/// +/// /// Note that the interpretation of #GtkLabel:width-chars and /// #GtkLabel:max-width-chars has changed a bit with the introduction of /// [width-for-height geometry management.][geometry-management] -/// +/// /// # Links -/// +/// /// Since 2.18, GTK+ supports markup for clickable hyperlinks in addition /// to regular Pango markup. The markup for links is borrowed from HTML, /// using the `` with “href“ and “title“ attributes. GTK+ renders links /// similar to the way they appear in web browsers, with colored, underlined /// text. The “title“ attribute is displayed as a tooltip on the link. -/// +/// /// An example looks like this: -/// +/// /// |[ /// const gchar *text = /// "Go to the" @@ -168,410 +168,433 @@ import CGtk3 /// GtkWidget *label = gtk_label_new (NULL); /// gtk_label_set_markup (GTK_LABEL (label), text); /// ]| -/// +/// /// It is possible to implement custom handling for links and their tooltips with /// the #GtkLabel::activate-link signal and the gtk_label_get_current_uri() function. open class Label: Misc { /// Creates a new label with the given text inside it. You can -/// pass %NULL to get an empty label widget. -public convenience init(string: String) { - self.init( - gtk_label_new(string) - ) -} - -/// Creates a new #GtkLabel, containing the text in @str. -/// -/// If characters in @str are preceded by an underscore, they are -/// underlined. If you need a literal underscore character in a label, use -/// '__' (two underscores). The first underlined character represents a -/// keyboard accelerator called a mnemonic. The mnemonic key can be used -/// to activate another widget, chosen automatically, or explicitly using -/// gtk_label_set_mnemonic_widget(). -/// -/// If gtk_label_set_mnemonic_widget() is not called, then the first -/// activatable ancestor of the #GtkLabel will be chosen as the mnemonic -/// widget. For instance, if the label is inside a button or menu item, -/// the button or menu item will automatically become the mnemonic widget -/// and be activated by the mnemonic. -public convenience init(mnemonic string: String) { - self.init( - gtk_label_new_with_mnemonic(string) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate-current-link") { [weak self] () in - guard let self = self else { return } - self.activateCurrentLink?(self) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1>.run(data, value1) - } - -addSignal(name: "activate-link", handler: gCallback(handler1)) { [weak self] (param0: UnsafePointer) in - guard let self = self else { return } - self.activateLink?(self, param0) -} - -addSignal(name: "copy-clipboard") { [weak self] () in - guard let self = self else { return } - self.copyClipboard?(self) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, value3, data in - SignalBox3.run(data, value1, value2, value3) - } - -addSignal(name: "move-cursor", handler: gCallback(handler3)) { [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool) in - guard let self = self else { return } - self.moveCursor?(self, param0, param1, param2) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::angle", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAngle?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// pass %NULL to get an empty label widget. + public convenience init(string: String) { + self.init( + gtk_label_new(string) + ) } -addSignal(name: "notify::attributes", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAttributes?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::cursor-position", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyCursorPosition?(self, param0) -} - -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::ellipsize", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEllipsize?(self, param0) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new #GtkLabel, containing the text in @str. + /// + /// If characters in @str are preceded by an underscore, they are + /// underlined. If you need a literal underscore character in a label, use + /// '__' (two underscores). The first underlined character represents a + /// keyboard accelerator called a mnemonic. The mnemonic key can be used + /// to activate another widget, chosen automatically, or explicitly using + /// gtk_label_set_mnemonic_widget(). + /// + /// If gtk_label_set_mnemonic_widget() is not called, then the first + /// activatable ancestor of the #GtkLabel will be chosen as the mnemonic + /// widget. For instance, if the label is inside a button or menu item, + /// the button or menu item will automatically become the mnemonic widget + /// and be activated by the mnemonic. + public convenience init(mnemonic string: String) { + self.init( + gtk_label_new_with_mnemonic(string) + ) } -addSignal(name: "notify::justify", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyJustify?(self, param0) -} - -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate-current-link") { [weak self] () in + guard let self = self else { return } + self.activateCurrentLink?(self) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, UnsafePointer, UnsafeMutableRawPointer) + -> Void = + { _, value1, data in + SignalBox1>.run(data, value1) + } + + addSignal(name: "activate-link", handler: gCallback(handler1)) { + [weak self] (param0: UnsafePointer) in + guard let self = self else { return } + self.activateLink?(self, param0) + } + + addSignal(name: "copy-clipboard") { [weak self] () in + guard let self = self else { return } + self.copyClipboard?(self) + } + + let handler3: + @convention(c) ( + UnsafeMutableRawPointer, GtkMovementStep, Int, Bool, UnsafeMutableRawPointer + ) -> Void = + { _, value1, value2, value3, data in + SignalBox3.run(data, value1, value2, value3) + } + + addSignal(name: "move-cursor", handler: gCallback(handler3)) { + [weak self] (param0: GtkMovementStep, param1: Int, param2: Bool) in + guard let self = self else { return } + self.moveCursor?(self, param0, param1, param2) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::angle", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAngle?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::attributes", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAttributes?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::cursor-position", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyCursorPosition?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::ellipsize", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEllipsize?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::justify", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyJustify?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::label", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLabel?(self, param0) + } + + let handler10: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::lines", handler: gCallback(handler10)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLines?(self, param0) + } + + let handler11: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::max-width-chars", handler: gCallback(handler11)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMaxWidthChars?(self, param0) + } + + let handler12: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::mnemonic-keyval", handler: gCallback(handler12)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyMnemonicKeyval?(self, param0) + } + + let handler13: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::pattern", handler: gCallback(handler13)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPattern?(self, param0) + } + + let handler14: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::selectable", handler: gCallback(handler14)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectable?(self, param0) + } + + let handler15: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::selection-bound", handler: gCallback(handler15)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySelectionBound?(self, param0) + } + + let handler16: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::single-line-mode", handler: gCallback(handler16)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifySingleLineMode?(self, param0) + } + + let handler17: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::track-visited-links", handler: gCallback(handler17)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTrackVisitedLinks?(self, param0) + } + + let handler18: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-markup", handler: gCallback(handler18)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseMarkup?(self, param0) + } + + let handler19: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-underline", handler: gCallback(handler19)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseUnderline?(self, param0) + } + + let handler20: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::width-chars", handler: gCallback(handler20)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWidthChars?(self, param0) + } + + let handler21: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::wrap", handler: gCallback(handler21)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWrap?(self, param0) + } + + let handler22: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::wrap-mode", handler: gCallback(handler22)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyWrapMode?(self, param0) + } + + let handler23: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::xalign", handler: gCallback(handler23)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyXalign?(self, param0) + } + + let handler24: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::yalign", handler: gCallback(handler24)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyYalign?(self, param0) + } } -addSignal(name: "notify::label", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLabel?(self, param0) -} + @GObjectProperty(named: "justify") public var justify: Justification -let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + /// The contents of the label. + /// + /// If the string contains [Pango XML markup][PangoMarkupFormat], you will + /// have to set the #GtkLabel:use-markup property to %TRUE in order for the + /// label to display the markup attributes. See also gtk_label_set_markup() + /// for a convenience function that sets both this property and the + /// #GtkLabel:use-markup property at the same time. + /// + /// If the string contains underlines acting as mnemonics, you will have to + /// set the #GtkLabel:use-underline property to %TRUE in order for the label + /// to display them. + @GObjectProperty(named: "label") public var label: String -addSignal(name: "notify::lines", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLines?(self, param0) -} + @GObjectProperty(named: "mnemonic-keyval") public var mnemonicKeyval: UInt -let handler11: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + @GObjectProperty(named: "selectable") public var selectable: Bool -addSignal(name: "notify::max-width-chars", handler: gCallback(handler11)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMaxWidthChars?(self, param0) -} + @GObjectProperty(named: "use-markup") public var useMarkup: Bool -let handler12: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + @GObjectProperty(named: "use-underline") public var useUnderline: Bool -addSignal(name: "notify::mnemonic-keyval", handler: gCallback(handler12)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyMnemonicKeyval?(self, param0) -} + /// A [keybinding signal][GtkBindingSignal] + /// which gets emitted when the user activates a link in the label. + /// + /// Applications may also emit the signal with g_signal_emit_by_name() + /// if they need to control activation of URIs programmatically. + /// + /// The default bindings for this signal are all forms of the Enter key. + public var activateCurrentLink: ((Label) -> Void)? -let handler13: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + /// The signal which gets emitted to activate a URI. + /// Applications may connect to it to override the default behaviour, + /// which is to call gtk_show_uri_on_window(). + public var activateLink: ((Label, UnsafePointer) -> Void)? -addSignal(name: "notify::pattern", handler: gCallback(handler13)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPattern?(self, param0) -} + /// The ::copy-clipboard signal is a + /// [keybinding signal][GtkBindingSignal] + /// which gets emitted to copy the selection to the clipboard. + /// + /// The default binding for this signal is Ctrl-c. + public var copyClipboard: ((Label) -> Void)? -let handler14: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + /// The ::move-cursor signal is a + /// [keybinding signal][GtkBindingSignal] + /// which gets emitted when the user initiates a cursor movement. + /// If the cursor is not visible in @entry, this signal causes + /// the viewport to be moved instead. + /// + /// Applications should not connect to it, but may emit it with + /// g_signal_emit_by_name() if they need to control the cursor + /// programmatically. + /// + /// The default bindings for this signal come in two variants, + /// the variant with the Shift modifier extends the selection, + /// the variant without the Shift modifer does not. + /// There are too many key combinations to list them all here. + /// - Arrow keys move by individual characters/lines + /// - Ctrl-arrow key combinations move by words/paragraphs + /// - Home/End keys move to the ends of the buffer + public var moveCursor: ((Label, GtkMovementStep, Int, Bool) -> Void)? -addSignal(name: "notify::selectable", handler: gCallback(handler14)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectable?(self, param0) -} + public var notifyAngle: ((Label, OpaquePointer) -> Void)? -let handler15: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyAttributes: ((Label, OpaquePointer) -> Void)? -addSignal(name: "notify::selection-bound", handler: gCallback(handler15)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySelectionBound?(self, param0) -} + public var notifyCursorPosition: ((Label, OpaquePointer) -> Void)? -let handler16: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyEllipsize: ((Label, OpaquePointer) -> Void)? -addSignal(name: "notify::single-line-mode", handler: gCallback(handler16)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifySingleLineMode?(self, param0) -} + public var notifyJustify: ((Label, OpaquePointer) -> Void)? -let handler17: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyLabel: ((Label, OpaquePointer) -> Void)? -addSignal(name: "notify::track-visited-links", handler: gCallback(handler17)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTrackVisitedLinks?(self, param0) -} + public var notifyLines: ((Label, OpaquePointer) -> Void)? -let handler18: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyMaxWidthChars: ((Label, OpaquePointer) -> Void)? -addSignal(name: "notify::use-markup", handler: gCallback(handler18)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseMarkup?(self, param0) -} + public var notifyMnemonicKeyval: ((Label, OpaquePointer) -> Void)? -let handler19: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyPattern: ((Label, OpaquePointer) -> Void)? -addSignal(name: "notify::use-underline", handler: gCallback(handler19)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseUnderline?(self, param0) -} + public var notifySelectable: ((Label, OpaquePointer) -> Void)? -let handler20: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifySelectionBound: ((Label, OpaquePointer) -> Void)? -addSignal(name: "notify::width-chars", handler: gCallback(handler20)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWidthChars?(self, param0) -} + public var notifySingleLineMode: ((Label, OpaquePointer) -> Void)? -let handler21: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyTrackVisitedLinks: ((Label, OpaquePointer) -> Void)? -addSignal(name: "notify::wrap", handler: gCallback(handler21)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWrap?(self, param0) -} + public var notifyUseMarkup: ((Label, OpaquePointer) -> Void)? -let handler22: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyUseUnderline: ((Label, OpaquePointer) -> Void)? -addSignal(name: "notify::wrap-mode", handler: gCallback(handler22)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyWrapMode?(self, param0) -} + public var notifyWidthChars: ((Label, OpaquePointer) -> Void)? -let handler23: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyWrap: ((Label, OpaquePointer) -> Void)? -addSignal(name: "notify::xalign", handler: gCallback(handler23)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyXalign?(self, param0) -} + public var notifyWrapMode: ((Label, OpaquePointer) -> Void)? -let handler24: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyXalign: ((Label, OpaquePointer) -> Void)? -addSignal(name: "notify::yalign", handler: gCallback(handler24)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyYalign?(self, param0) -} + public var notifyYalign: ((Label, OpaquePointer) -> Void)? } - - -@GObjectProperty(named: "justify") public var justify: Justification - -/// The contents of the label. -/// -/// If the string contains [Pango XML markup][PangoMarkupFormat], you will -/// have to set the #GtkLabel:use-markup property to %TRUE in order for the -/// label to display the markup attributes. See also gtk_label_set_markup() -/// for a convenience function that sets both this property and the -/// #GtkLabel:use-markup property at the same time. -/// -/// If the string contains underlines acting as mnemonics, you will have to -/// set the #GtkLabel:use-underline property to %TRUE in order for the label -/// to display them. -@GObjectProperty(named: "label") public var label: String - - -@GObjectProperty(named: "mnemonic-keyval") public var mnemonicKeyval: UInt - - -@GObjectProperty(named: "selectable") public var selectable: Bool - - -@GObjectProperty(named: "use-markup") public var useMarkup: Bool - - -@GObjectProperty(named: "use-underline") public var useUnderline: Bool - -/// A [keybinding signal][GtkBindingSignal] -/// which gets emitted when the user activates a link in the label. -/// -/// Applications may also emit the signal with g_signal_emit_by_name() -/// if they need to control activation of URIs programmatically. -/// -/// The default bindings for this signal are all forms of the Enter key. -public var activateCurrentLink: ((Label) -> Void)? - -/// The signal which gets emitted to activate a URI. -/// Applications may connect to it to override the default behaviour, -/// which is to call gtk_show_uri_on_window(). -public var activateLink: ((Label, UnsafePointer) -> Void)? - -/// The ::copy-clipboard signal is a -/// [keybinding signal][GtkBindingSignal] -/// which gets emitted to copy the selection to the clipboard. -/// -/// The default binding for this signal is Ctrl-c. -public var copyClipboard: ((Label) -> Void)? - -/// The ::move-cursor signal is a -/// [keybinding signal][GtkBindingSignal] -/// which gets emitted when the user initiates a cursor movement. -/// If the cursor is not visible in @entry, this signal causes -/// the viewport to be moved instead. -/// -/// Applications should not connect to it, but may emit it with -/// g_signal_emit_by_name() if they need to control the cursor -/// programmatically. -/// -/// The default bindings for this signal come in two variants, -/// the variant with the Shift modifier extends the selection, -/// the variant without the Shift modifer does not. -/// There are too many key combinations to list them all here. -/// - Arrow keys move by individual characters/lines -/// - Ctrl-arrow key combinations move by words/paragraphs -/// - Home/End keys move to the ends of the buffer -public var moveCursor: ((Label, GtkMovementStep, Int, Bool) -> Void)? - - -public var notifyAngle: ((Label, OpaquePointer) -> Void)? - - -public var notifyAttributes: ((Label, OpaquePointer) -> Void)? - - -public var notifyCursorPosition: ((Label, OpaquePointer) -> Void)? - - -public var notifyEllipsize: ((Label, OpaquePointer) -> Void)? - - -public var notifyJustify: ((Label, OpaquePointer) -> Void)? - - -public var notifyLabel: ((Label, OpaquePointer) -> Void)? - - -public var notifyLines: ((Label, OpaquePointer) -> Void)? - - -public var notifyMaxWidthChars: ((Label, OpaquePointer) -> Void)? - - -public var notifyMnemonicKeyval: ((Label, OpaquePointer) -> Void)? - - -public var notifyPattern: ((Label, OpaquePointer) -> Void)? - - -public var notifySelectable: ((Label, OpaquePointer) -> Void)? - - -public var notifySelectionBound: ((Label, OpaquePointer) -> Void)? - - -public var notifySingleLineMode: ((Label, OpaquePointer) -> Void)? - - -public var notifyTrackVisitedLinks: ((Label, OpaquePointer) -> Void)? - - -public var notifyUseMarkup: ((Label, OpaquePointer) -> Void)? - - -public var notifyUseUnderline: ((Label, OpaquePointer) -> Void)? - - -public var notifyWidthChars: ((Label, OpaquePointer) -> Void)? - - -public var notifyWrap: ((Label, OpaquePointer) -> Void)? - - -public var notifyWrapMode: ((Label, OpaquePointer) -> Void)? - - -public var notifyXalign: ((Label, OpaquePointer) -> Void)? - - -public var notifyYalign: ((Label, OpaquePointer) -> Void)? -} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/MenuDirectionType.swift b/Sources/Gtk3/Generated/MenuDirectionType.swift index 687532a897..d1b1f2987f 100644 --- a/Sources/Gtk3/Generated/MenuDirectionType.swift +++ b/Sources/Gtk3/Generated/MenuDirectionType.swift @@ -5,28 +5,28 @@ public enum MenuDirectionType: GValueRepresentableEnum { public typealias GtkEnum = GtkMenuDirectionType /// To the parent menu shell -case parent -/// To the submenu, if any, associated with the item -case child -/// To the next menu item -case next -/// To the previous menu item -case prev + case parent + /// To the submenu, if any, associated with the item + case child + /// To the next menu item + case next + /// To the previous menu item + case prev public static var type: GType { - gtk_menu_direction_type_get_type() -} + gtk_menu_direction_type_get_type() + } public init(from gtkEnum: GtkMenuDirectionType) { switch gtkEnum { case GTK_MENU_DIR_PARENT: - self = .parent -case GTK_MENU_DIR_CHILD: - self = .child -case GTK_MENU_DIR_NEXT: - self = .next -case GTK_MENU_DIR_PREV: - self = .prev + self = .parent + case GTK_MENU_DIR_CHILD: + self = .child + case GTK_MENU_DIR_NEXT: + self = .next + case GTK_MENU_DIR_PREV: + self = .prev default: fatalError("Unsupported GtkMenuDirectionType enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_MENU_DIR_PREV: public func toGtk() -> GtkMenuDirectionType { switch self { case .parent: - return GTK_MENU_DIR_PARENT -case .child: - return GTK_MENU_DIR_CHILD -case .next: - return GTK_MENU_DIR_NEXT -case .prev: - return GTK_MENU_DIR_PREV + return GTK_MENU_DIR_PARENT + case .child: + return GTK_MENU_DIR_CHILD + case .next: + return GTK_MENU_DIR_NEXT + case .prev: + return GTK_MENU_DIR_PREV } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/MenuShell.swift b/Sources/Gtk3/Generated/MenuShell.swift index ccde9294b5..1fb3f71e87 100644 --- a/Sources/Gtk3/Generated/MenuShell.swift +++ b/Sources/Gtk3/Generated/MenuShell.swift @@ -2,23 +2,23 @@ import CGtk3 /// A #GtkMenuShell is the abstract base class used to derive the /// #GtkMenu and #GtkMenuBar subclasses. -/// +/// /// A #GtkMenuShell is a container of #GtkMenuItem objects arranged /// in a list which can be navigated, selected, and activated by the /// user to perform application functions. A #GtkMenuItem can have a /// submenu associated with it, allowing for nested hierarchical menus. -/// +/// /// # Terminology -/// +/// /// A menu item can be “selected”, this means that it is displayed /// in the prelight state, and if it has a submenu, that submenu /// will be popped up. -/// +/// /// A menu is “active” when it is visible onscreen and the user /// is selecting from it. A menubar is not active until the user /// clicks on one of its menuitems. When a menu is active, /// passing the mouse over a submenu will pop it up. -/// +/// /// There is also is a concept of the current menu and a current /// menu item. The current menu item is the selected menu item /// that is furthest down in the hierarchy. (Every active menu shell @@ -28,122 +28,135 @@ import CGtk3 /// contains the current menu item. It will always have a GTK /// grab and receive all key presses. open class MenuShell: Container { - - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: @convention(c) (UnsafeMutableRawPointer, Bool, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "activate-current", handler: gCallback(handler0)) { [weak self] (param0: Bool) in - guard let self = self else { return } - self.activateCurrent?(self, param0) -} - -addSignal(name: "cancel") { [weak self] () in - guard let self = self else { return } - self.cancel?(self) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, GtkDirectionType, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "cycle-focus", handler: gCallback(handler2)) { [weak self] (param0: GtkDirectionType) in - guard let self = self else { return } - self.cycleFocus?(self, param0) -} - -addSignal(name: "deactivate") { [weak self] () in - guard let self = self else { return } - self.deactivate?(self) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, GtkWidget, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - -addSignal(name: "insert", handler: gCallback(handler4)) { [weak self] (param0: GtkWidget, param1: Int) in - guard let self = self else { return } - self.insert?(self, param0, param1) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, GtkMenuDirectionType, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "move-current", handler: gCallback(handler5)) { [weak self] (param0: GtkMenuDirectionType) in - guard let self = self else { return } - self.moveCurrent?(self, param0) -} - -let handler6: @convention(c) (UnsafeMutableRawPointer, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "move-selected", handler: gCallback(handler6)) { [weak self] (param0: Int) in - guard let self = self else { return } - self.moveSelected?(self, param0) -} - -addSignal(name: "selection-done") { [weak self] () in - guard let self = self else { return } - self.selectionDone?(self) -} - -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, Bool, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "activate-current", handler: gCallback(handler0)) { + [weak self] (param0: Bool) in + guard let self = self else { return } + self.activateCurrent?(self, param0) + } + + addSignal(name: "cancel") { [weak self] () in + guard let self = self else { return } + self.cancel?(self) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, GtkDirectionType, UnsafeMutableRawPointer) -> + Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "cycle-focus", handler: gCallback(handler2)) { + [weak self] (param0: GtkDirectionType) in + guard let self = self else { return } + self.cycleFocus?(self, param0) + } + + addSignal(name: "deactivate") { [weak self] () in + guard let self = self else { return } + self.deactivate?(self) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, GtkWidget, Int, UnsafeMutableRawPointer) -> + Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "insert", handler: gCallback(handler4)) { + [weak self] (param0: GtkWidget, param1: Int) in + guard let self = self else { return } + self.insert?(self, param0, param1) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, GtkMenuDirectionType, UnsafeMutableRawPointer) + -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "move-current", handler: gCallback(handler5)) { + [weak self] (param0: GtkMenuDirectionType) in + guard let self = self else { return } + self.moveCurrent?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "move-selected", handler: gCallback(handler6)) { + [weak self] (param0: Int) in + guard let self = self else { return } + self.moveSelected?(self, param0) + } + + addSignal(name: "selection-done") { [weak self] () in + guard let self = self else { return } + self.selectionDone?(self) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::take-focus", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTakeFocus?(self, param0) + } } -addSignal(name: "notify::take-focus", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTakeFocus?(self, param0) -} -} - /// An action signal that activates the current menu item within -/// the menu shell. -public var activateCurrent: ((MenuShell, Bool) -> Void)? + /// the menu shell. + public var activateCurrent: ((MenuShell, Bool) -> Void)? -/// An action signal which cancels the selection within the menu shell. -/// Causes the #GtkMenuShell::selection-done signal to be emitted. -public var cancel: ((MenuShell) -> Void)? + /// An action signal which cancels the selection within the menu shell. + /// Causes the #GtkMenuShell::selection-done signal to be emitted. + public var cancel: ((MenuShell) -> Void)? -/// A keybinding signal which moves the focus in the -/// given @direction. -public var cycleFocus: ((MenuShell, GtkDirectionType) -> Void)? + /// A keybinding signal which moves the focus in the + /// given @direction. + public var cycleFocus: ((MenuShell, GtkDirectionType) -> Void)? -/// This signal is emitted when a menu shell is deactivated. -public var deactivate: ((MenuShell) -> Void)? + /// This signal is emitted when a menu shell is deactivated. + public var deactivate: ((MenuShell) -> Void)? -/// The ::insert signal is emitted when a new #GtkMenuItem is added to -/// a #GtkMenuShell. A separate signal is used instead of -/// GtkContainer::add because of the need for an additional position -/// parameter. -/// -/// The inverse of this signal is the GtkContainer::removed signal. -public var insert: ((MenuShell, GtkWidget, Int) -> Void)? + /// The ::insert signal is emitted when a new #GtkMenuItem is added to + /// a #GtkMenuShell. A separate signal is used instead of + /// GtkContainer::add because of the need for an additional position + /// parameter. + /// + /// The inverse of this signal is the GtkContainer::removed signal. + public var insert: ((MenuShell, GtkWidget, Int) -> Void)? -/// An keybinding signal which moves the current menu item -/// in the direction specified by @direction. -public var moveCurrent: ((MenuShell, GtkMenuDirectionType) -> Void)? + /// An keybinding signal which moves the current menu item + /// in the direction specified by @direction. + public var moveCurrent: ((MenuShell, GtkMenuDirectionType) -> Void)? -/// The ::move-selected signal is emitted to move the selection to -/// another item. -public var moveSelected: ((MenuShell, Int) -> Void)? + /// The ::move-selected signal is emitted to move the selection to + /// another item. + public var moveSelected: ((MenuShell, Int) -> Void)? -/// This signal is emitted when a selection has been -/// completed within a menu shell. -public var selectionDone: ((MenuShell) -> Void)? + /// This signal is emitted when a selection has been + /// completed within a menu shell. + public var selectionDone: ((MenuShell) -> Void)? - -public var notifyTakeFocus: ((MenuShell, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyTakeFocus: ((MenuShell, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk3/Generated/MessageType.swift b/Sources/Gtk3/Generated/MessageType.swift index 9a0ba5da7e..0cb741a551 100644 --- a/Sources/Gtk3/Generated/MessageType.swift +++ b/Sources/Gtk3/Generated/MessageType.swift @@ -5,32 +5,32 @@ public enum MessageType: GValueRepresentableEnum { public typealias GtkEnum = GtkMessageType /// Informational message -case info -/// Non-fatal warning message -case warning -/// Question requiring a choice -case question -/// Fatal error message -case error -/// None of the above -case other + case info + /// Non-fatal warning message + case warning + /// Question requiring a choice + case question + /// Fatal error message + case error + /// None of the above + case other public static var type: GType { - gtk_message_type_get_type() -} + gtk_message_type_get_type() + } public init(from gtkEnum: GtkMessageType) { switch gtkEnum { case GTK_MESSAGE_INFO: - self = .info -case GTK_MESSAGE_WARNING: - self = .warning -case GTK_MESSAGE_QUESTION: - self = .question -case GTK_MESSAGE_ERROR: - self = .error -case GTK_MESSAGE_OTHER: - self = .other + self = .info + case GTK_MESSAGE_WARNING: + self = .warning + case GTK_MESSAGE_QUESTION: + self = .question + case GTK_MESSAGE_ERROR: + self = .error + case GTK_MESSAGE_OTHER: + self = .other default: fatalError("Unsupported GtkMessageType enum value: \(gtkEnum.rawValue)") } @@ -39,15 +39,15 @@ case GTK_MESSAGE_OTHER: public func toGtk() -> GtkMessageType { switch self { case .info: - return GTK_MESSAGE_INFO -case .warning: - return GTK_MESSAGE_WARNING -case .question: - return GTK_MESSAGE_QUESTION -case .error: - return GTK_MESSAGE_ERROR -case .other: - return GTK_MESSAGE_OTHER + return GTK_MESSAGE_INFO + case .warning: + return GTK_MESSAGE_WARNING + case .question: + return GTK_MESSAGE_QUESTION + case .error: + return GTK_MESSAGE_ERROR + case .other: + return GTK_MESSAGE_OTHER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/MovementStep.swift b/Sources/Gtk3/Generated/MovementStep.swift index ee4799adc3..9aff73c2bd 100644 --- a/Sources/Gtk3/Generated/MovementStep.swift +++ b/Sources/Gtk3/Generated/MovementStep.swift @@ -1,56 +1,55 @@ import CGtk3 - public enum MovementStep: GValueRepresentableEnum { public typealias GtkEnum = GtkMovementStep /// Move forward or back by graphemes -case logicalPositions -/// Move left or right by graphemes -case visualPositions -/// Move forward or back by words -case words -/// Move up or down lines (wrapped lines) -case displayLines -/// Move to either end of a line -case displayLineEnds -/// Move up or down paragraphs (newline-ended lines) -case paragraphs -/// Move to either end of a paragraph -case paragraphEnds -/// Move by pages -case pages -/// Move to ends of the buffer -case bufferEnds -/// Move horizontally by pages -case horizontalPages + case logicalPositions + /// Move left or right by graphemes + case visualPositions + /// Move forward or back by words + case words + /// Move up or down lines (wrapped lines) + case displayLines + /// Move to either end of a line + case displayLineEnds + /// Move up or down paragraphs (newline-ended lines) + case paragraphs + /// Move to either end of a paragraph + case paragraphEnds + /// Move by pages + case pages + /// Move to ends of the buffer + case bufferEnds + /// Move horizontally by pages + case horizontalPages public static var type: GType { - gtk_movement_step_get_type() -} + gtk_movement_step_get_type() + } public init(from gtkEnum: GtkMovementStep) { switch gtkEnum { case GTK_MOVEMENT_LOGICAL_POSITIONS: - self = .logicalPositions -case GTK_MOVEMENT_VISUAL_POSITIONS: - self = .visualPositions -case GTK_MOVEMENT_WORDS: - self = .words -case GTK_MOVEMENT_DISPLAY_LINES: - self = .displayLines -case GTK_MOVEMENT_DISPLAY_LINE_ENDS: - self = .displayLineEnds -case GTK_MOVEMENT_PARAGRAPHS: - self = .paragraphs -case GTK_MOVEMENT_PARAGRAPH_ENDS: - self = .paragraphEnds -case GTK_MOVEMENT_PAGES: - self = .pages -case GTK_MOVEMENT_BUFFER_ENDS: - self = .bufferEnds -case GTK_MOVEMENT_HORIZONTAL_PAGES: - self = .horizontalPages + self = .logicalPositions + case GTK_MOVEMENT_VISUAL_POSITIONS: + self = .visualPositions + case GTK_MOVEMENT_WORDS: + self = .words + case GTK_MOVEMENT_DISPLAY_LINES: + self = .displayLines + case GTK_MOVEMENT_DISPLAY_LINE_ENDS: + self = .displayLineEnds + case GTK_MOVEMENT_PARAGRAPHS: + self = .paragraphs + case GTK_MOVEMENT_PARAGRAPH_ENDS: + self = .paragraphEnds + case GTK_MOVEMENT_PAGES: + self = .pages + case GTK_MOVEMENT_BUFFER_ENDS: + self = .bufferEnds + case GTK_MOVEMENT_HORIZONTAL_PAGES: + self = .horizontalPages default: fatalError("Unsupported GtkMovementStep enum value: \(gtkEnum.rawValue)") } @@ -59,25 +58,25 @@ case GTK_MOVEMENT_HORIZONTAL_PAGES: public func toGtk() -> GtkMovementStep { switch self { case .logicalPositions: - return GTK_MOVEMENT_LOGICAL_POSITIONS -case .visualPositions: - return GTK_MOVEMENT_VISUAL_POSITIONS -case .words: - return GTK_MOVEMENT_WORDS -case .displayLines: - return GTK_MOVEMENT_DISPLAY_LINES -case .displayLineEnds: - return GTK_MOVEMENT_DISPLAY_LINE_ENDS -case .paragraphs: - return GTK_MOVEMENT_PARAGRAPHS -case .paragraphEnds: - return GTK_MOVEMENT_PARAGRAPH_ENDS -case .pages: - return GTK_MOVEMENT_PAGES -case .bufferEnds: - return GTK_MOVEMENT_BUFFER_ENDS -case .horizontalPages: - return GTK_MOVEMENT_HORIZONTAL_PAGES + return GTK_MOVEMENT_LOGICAL_POSITIONS + case .visualPositions: + return GTK_MOVEMENT_VISUAL_POSITIONS + case .words: + return GTK_MOVEMENT_WORDS + case .displayLines: + return GTK_MOVEMENT_DISPLAY_LINES + case .displayLineEnds: + return GTK_MOVEMENT_DISPLAY_LINE_ENDS + case .paragraphs: + return GTK_MOVEMENT_PARAGRAPHS + case .paragraphEnds: + return GTK_MOVEMENT_PARAGRAPH_ENDS + case .pages: + return GTK_MOVEMENT_PAGES + case .bufferEnds: + return GTK_MOVEMENT_BUFFER_ENDS + case .horizontalPages: + return GTK_MOVEMENT_HORIZONTAL_PAGES } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/NativeDialog.swift b/Sources/Gtk3/Generated/NativeDialog.swift index 42d26db61f..df63a37b59 100644 --- a/Sources/Gtk3/Generated/NativeDialog.swift +++ b/Sources/Gtk3/Generated/NativeDialog.swift @@ -4,91 +4,95 @@ import CGtk3 /// #GtkWindow. They are used in order to integrate better with a /// platform, by looking the same as other native applications and /// supporting platform specific features. -/// +/// /// The #GtkDialog functions cannot be used on such objects, but we /// need a similar API in order to drive them. The #GtkNativeDialog /// object is an API that allows you to do this. It allows you to set /// various common properties on the dialog, as well as show and hide /// it and get a #GtkNativeDialog::response signal when the user finished /// with the dialog. -/// +/// /// There is also a gtk_native_dialog_run() helper that makes it easy /// to run any native dialog in a modal way with a recursive mainloop, /// similar to gtk_dialog_run(). open class NativeDialog: GObject { - public override func registerSignals() { - super.registerSignals() - - let handler0: @convention(c) (UnsafeMutableRawPointer, Int, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "response", handler: gCallback(handler0)) { [weak self] (param0: Int) in - guard let self = self else { return } - self.response?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::modal", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyModal?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::title", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTitle?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + super.registerSignals() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, Int, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "response", handler: gCallback(handler0)) { [weak self] (param0: Int) in + guard let self = self else { return } + self.response?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::modal", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyModal?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::title", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTitle?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::transient-for", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyTransientFor?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::visible", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyVisible?(self, param0) + } } -addSignal(name: "notify::transient-for", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyTransientFor?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::visible", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyVisible?(self, param0) -} -} - /// Emitted when the user responds to the dialog. -/// -/// When this is called the dialog has been hidden. -/// -/// If you call gtk_native_dialog_hide() before the user responds to -/// the dialog this signal will not be emitted. -public var response: ((NativeDialog, Int) -> Void)? - - -public var notifyModal: ((NativeDialog, OpaquePointer) -> Void)? + /// + /// When this is called the dialog has been hidden. + /// + /// If you call gtk_native_dialog_hide() before the user responds to + /// the dialog this signal will not be emitted. + public var response: ((NativeDialog, Int) -> Void)? + public var notifyModal: ((NativeDialog, OpaquePointer) -> Void)? -public var notifyTitle: ((NativeDialog, OpaquePointer) -> Void)? + public var notifyTitle: ((NativeDialog, OpaquePointer) -> Void)? + public var notifyTransientFor: ((NativeDialog, OpaquePointer) -> Void)? -public var notifyTransientFor: ((NativeDialog, OpaquePointer) -> Void)? - - -public var notifyVisible: ((NativeDialog, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyVisible: ((NativeDialog, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk3/Generated/NotebookTab.swift b/Sources/Gtk3/Generated/NotebookTab.swift index 4ce8febbb9..576b2fae1c 100644 --- a/Sources/Gtk3/Generated/NotebookTab.swift +++ b/Sources/Gtk3/Generated/NotebookTab.swift @@ -1,24 +1,22 @@ import CGtk3 - public enum NotebookTab: GValueRepresentableEnum { public typealias GtkEnum = GtkNotebookTab - -case first + case first -case last + case last public static var type: GType { - gtk_notebook_tab_get_type() -} + gtk_notebook_tab_get_type() + } public init(from gtkEnum: GtkNotebookTab) { switch gtkEnum { case GTK_NOTEBOOK_TAB_FIRST: - self = .first -case GTK_NOTEBOOK_TAB_LAST: - self = .last + self = .first + case GTK_NOTEBOOK_TAB_LAST: + self = .last default: fatalError("Unsupported GtkNotebookTab enum value: \(gtkEnum.rawValue)") } @@ -27,9 +25,9 @@ case GTK_NOTEBOOK_TAB_LAST: public func toGtk() -> GtkNotebookTab { switch self { case .first: - return GTK_NOTEBOOK_TAB_FIRST -case .last: - return GTK_NOTEBOOK_TAB_LAST + return GTK_NOTEBOOK_TAB_FIRST + case .last: + return GTK_NOTEBOOK_TAB_LAST } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/NumberUpLayout.swift b/Sources/Gtk3/Generated/NumberUpLayout.swift index ac377e017e..e4d5258a24 100644 --- a/Sources/Gtk3/Generated/NumberUpLayout.swift +++ b/Sources/Gtk3/Generated/NumberUpLayout.swift @@ -6,44 +6,44 @@ public enum NumberUpLayout: GValueRepresentableEnum { public typealias GtkEnum = GtkNumberUpLayout /// ![](layout-lrtb.png) -case lrtb -/// ![](layout-lrbt.png) -case lrbt -/// ![](layout-rltb.png) -case rltb -/// ![](layout-rlbt.png) -case rlbt -/// ![](layout-tblr.png) -case tblr -/// ![](layout-tbrl.png) -case tbrl -/// ![](layout-btlr.png) -case btlr -/// ![](layout-btrl.png) -case btrl + case lrtb + /// ![](layout-lrbt.png) + case lrbt + /// ![](layout-rltb.png) + case rltb + /// ![](layout-rlbt.png) + case rlbt + /// ![](layout-tblr.png) + case tblr + /// ![](layout-tbrl.png) + case tbrl + /// ![](layout-btlr.png) + case btlr + /// ![](layout-btrl.png) + case btrl public static var type: GType { - gtk_number_up_layout_get_type() -} + gtk_number_up_layout_get_type() + } public init(from gtkEnum: GtkNumberUpLayout) { switch gtkEnum { case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM: - self = .lrtb -case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP: - self = .lrbt -case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM: - self = .rltb -case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP: - self = .rlbt -case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT: - self = .tblr -case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT: - self = .tbrl -case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT: - self = .btlr -case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT: - self = .btrl + self = .lrtb + case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP: + self = .lrbt + case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM: + self = .rltb + case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP: + self = .rlbt + case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT: + self = .tblr + case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT: + self = .tbrl + case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT: + self = .btlr + case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT: + self = .btrl default: fatalError("Unsupported GtkNumberUpLayout enum value: \(gtkEnum.rawValue)") } @@ -52,21 +52,21 @@ case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT: public func toGtk() -> GtkNumberUpLayout { switch self { case .lrtb: - return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM -case .lrbt: - return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP -case .rltb: - return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM -case .rlbt: - return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP -case .tblr: - return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT -case .tbrl: - return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT -case .btlr: - return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT -case .btrl: - return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT + return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM + case .lrbt: + return GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP + case .rltb: + return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM + case .rlbt: + return GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP + case .tblr: + return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT + case .tbrl: + return GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT + case .btlr: + return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT + case .btrl: + return GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/Orientation.swift b/Sources/Gtk3/Generated/Orientation.swift index 79dbb9ae38..8f472be5dc 100644 --- a/Sources/Gtk3/Generated/Orientation.swift +++ b/Sources/Gtk3/Generated/Orientation.swift @@ -7,20 +7,20 @@ public enum Orientation: GValueRepresentableEnum { public typealias GtkEnum = GtkOrientation /// The element is in horizontal orientation. -case horizontal -/// The element is in vertical orientation. -case vertical + case horizontal + /// The element is in vertical orientation. + case vertical public static var type: GType { - gtk_orientation_get_type() -} + gtk_orientation_get_type() + } public init(from gtkEnum: GtkOrientation) { switch gtkEnum { case GTK_ORIENTATION_HORIZONTAL: - self = .horizontal -case GTK_ORIENTATION_VERTICAL: - self = .vertical + self = .horizontal + case GTK_ORIENTATION_VERTICAL: + self = .vertical default: fatalError("Unsupported GtkOrientation enum value: \(gtkEnum.rawValue)") } @@ -29,9 +29,9 @@ case GTK_ORIENTATION_VERTICAL: public func toGtk() -> GtkOrientation { switch self { case .horizontal: - return GTK_ORIENTATION_HORIZONTAL -case .vertical: - return GTK_ORIENTATION_VERTICAL + return GTK_ORIENTATION_HORIZONTAL + case .vertical: + return GTK_ORIENTATION_VERTICAL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/PackDirection.swift b/Sources/Gtk3/Generated/PackDirection.swift index a3a80f7ffa..94613fcbef 100644 --- a/Sources/Gtk3/Generated/PackDirection.swift +++ b/Sources/Gtk3/Generated/PackDirection.swift @@ -6,28 +6,28 @@ public enum PackDirection: GValueRepresentableEnum { public typealias GtkEnum = GtkPackDirection /// Widgets are packed left-to-right -case ltr -/// Widgets are packed right-to-left -case rtl -/// Widgets are packed top-to-bottom -case ttb -/// Widgets are packed bottom-to-top -case btt + case ltr + /// Widgets are packed right-to-left + case rtl + /// Widgets are packed top-to-bottom + case ttb + /// Widgets are packed bottom-to-top + case btt public static var type: GType { - gtk_pack_direction_get_type() -} + gtk_pack_direction_get_type() + } public init(from gtkEnum: GtkPackDirection) { switch gtkEnum { case GTK_PACK_DIRECTION_LTR: - self = .ltr -case GTK_PACK_DIRECTION_RTL: - self = .rtl -case GTK_PACK_DIRECTION_TTB: - self = .ttb -case GTK_PACK_DIRECTION_BTT: - self = .btt + self = .ltr + case GTK_PACK_DIRECTION_RTL: + self = .rtl + case GTK_PACK_DIRECTION_TTB: + self = .ttb + case GTK_PACK_DIRECTION_BTT: + self = .btt default: fatalError("Unsupported GtkPackDirection enum value: \(gtkEnum.rawValue)") } @@ -36,13 +36,13 @@ case GTK_PACK_DIRECTION_BTT: public func toGtk() -> GtkPackDirection { switch self { case .ltr: - return GTK_PACK_DIRECTION_LTR -case .rtl: - return GTK_PACK_DIRECTION_RTL -case .ttb: - return GTK_PACK_DIRECTION_TTB -case .btt: - return GTK_PACK_DIRECTION_BTT + return GTK_PACK_DIRECTION_LTR + case .rtl: + return GTK_PACK_DIRECTION_RTL + case .ttb: + return GTK_PACK_DIRECTION_TTB + case .btt: + return GTK_PACK_DIRECTION_BTT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/PackType.swift b/Sources/Gtk3/Generated/PackType.swift index a4c48d3163..910f8cd940 100644 --- a/Sources/Gtk3/Generated/PackType.swift +++ b/Sources/Gtk3/Generated/PackType.swift @@ -6,20 +6,20 @@ public enum PackType: GValueRepresentableEnum { public typealias GtkEnum = GtkPackType /// The child is packed into the start of the box -case start -/// The child is packed into the end of the box -case end + case start + /// The child is packed into the end of the box + case end public static var type: GType { - gtk_pack_type_get_type() -} + gtk_pack_type_get_type() + } public init(from gtkEnum: GtkPackType) { switch gtkEnum { case GTK_PACK_START: - self = .start -case GTK_PACK_END: - self = .end + self = .start + case GTK_PACK_END: + self = .end default: fatalError("Unsupported GtkPackType enum value: \(gtkEnum.rawValue)") } @@ -28,9 +28,9 @@ case GTK_PACK_END: public func toGtk() -> GtkPackType { switch self { case .start: - return GTK_PACK_START -case .end: - return GTK_PACK_END + return GTK_PACK_START + case .end: + return GTK_PACK_END } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/PadActionType.swift b/Sources/Gtk3/Generated/PadActionType.swift index c626946160..50518d70c8 100644 --- a/Sources/Gtk3/Generated/PadActionType.swift +++ b/Sources/Gtk3/Generated/PadActionType.swift @@ -5,24 +5,24 @@ public enum PadActionType: GValueRepresentableEnum { public typealias GtkEnum = GtkPadActionType /// Action is triggered by a pad button -case button -/// Action is triggered by a pad ring -case ring -/// Action is triggered by a pad strip -case strip + case button + /// Action is triggered by a pad ring + case ring + /// Action is triggered by a pad strip + case strip public static var type: GType { - gtk_pad_action_type_get_type() -} + gtk_pad_action_type_get_type() + } public init(from gtkEnum: GtkPadActionType) { switch gtkEnum { case GTK_PAD_ACTION_BUTTON: - self = .button -case GTK_PAD_ACTION_RING: - self = .ring -case GTK_PAD_ACTION_STRIP: - self = .strip + self = .button + case GTK_PAD_ACTION_RING: + self = .ring + case GTK_PAD_ACTION_STRIP: + self = .strip default: fatalError("Unsupported GtkPadActionType enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ case GTK_PAD_ACTION_STRIP: public func toGtk() -> GtkPadActionType { switch self { case .button: - return GTK_PAD_ACTION_BUTTON -case .ring: - return GTK_PAD_ACTION_RING -case .strip: - return GTK_PAD_ACTION_STRIP + return GTK_PAD_ACTION_BUTTON + case .ring: + return GTK_PAD_ACTION_RING + case .strip: + return GTK_PAD_ACTION_STRIP } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/PageOrientation.swift b/Sources/Gtk3/Generated/PageOrientation.swift index 6e18d24d1e..352aa8c1a8 100644 --- a/Sources/Gtk3/Generated/PageOrientation.swift +++ b/Sources/Gtk3/Generated/PageOrientation.swift @@ -5,28 +5,28 @@ public enum PageOrientation: GValueRepresentableEnum { public typealias GtkEnum = GtkPageOrientation /// Portrait mode. -case portrait -/// Landscape mode. -case landscape -/// Reverse portrait mode. -case reversePortrait -/// Reverse landscape mode. -case reverseLandscape + case portrait + /// Landscape mode. + case landscape + /// Reverse portrait mode. + case reversePortrait + /// Reverse landscape mode. + case reverseLandscape public static var type: GType { - gtk_page_orientation_get_type() -} + gtk_page_orientation_get_type() + } public init(from gtkEnum: GtkPageOrientation) { switch gtkEnum { case GTK_PAGE_ORIENTATION_PORTRAIT: - self = .portrait -case GTK_PAGE_ORIENTATION_LANDSCAPE: - self = .landscape -case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT: - self = .reversePortrait -case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE: - self = .reverseLandscape + self = .portrait + case GTK_PAGE_ORIENTATION_LANDSCAPE: + self = .landscape + case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT: + self = .reversePortrait + case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE: + self = .reverseLandscape default: fatalError("Unsupported GtkPageOrientation enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE: public func toGtk() -> GtkPageOrientation { switch self { case .portrait: - return GTK_PAGE_ORIENTATION_PORTRAIT -case .landscape: - return GTK_PAGE_ORIENTATION_LANDSCAPE -case .reversePortrait: - return GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT -case .reverseLandscape: - return GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE + return GTK_PAGE_ORIENTATION_PORTRAIT + case .landscape: + return GTK_PAGE_ORIENTATION_LANDSCAPE + case .reversePortrait: + return GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT + case .reverseLandscape: + return GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/PageSet.swift b/Sources/Gtk3/Generated/PageSet.swift index b12b708cd7..771ba9aebf 100644 --- a/Sources/Gtk3/Generated/PageSet.swift +++ b/Sources/Gtk3/Generated/PageSet.swift @@ -5,24 +5,24 @@ public enum PageSet: GValueRepresentableEnum { public typealias GtkEnum = GtkPageSet /// All pages. -case all -/// Even pages. -case even -/// Odd pages. -case odd + case all + /// Even pages. + case even + /// Odd pages. + case odd public static var type: GType { - gtk_page_set_get_type() -} + gtk_page_set_get_type() + } public init(from gtkEnum: GtkPageSet) { switch gtkEnum { case GTK_PAGE_SET_ALL: - self = .all -case GTK_PAGE_SET_EVEN: - self = .even -case GTK_PAGE_SET_ODD: - self = .odd + self = .all + case GTK_PAGE_SET_EVEN: + self = .even + case GTK_PAGE_SET_ODD: + self = .odd default: fatalError("Unsupported GtkPageSet enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ case GTK_PAGE_SET_ODD: public func toGtk() -> GtkPageSet { switch self { case .all: - return GTK_PAGE_SET_ALL -case .even: - return GTK_PAGE_SET_EVEN -case .odd: - return GTK_PAGE_SET_ODD + return GTK_PAGE_SET_ALL + case .even: + return GTK_PAGE_SET_EVEN + case .odd: + return GTK_PAGE_SET_ODD } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/PathPriorityType.swift b/Sources/Gtk3/Generated/PathPriorityType.swift index ea3b474ab4..d4fba1a4e3 100644 --- a/Sources/Gtk3/Generated/PathPriorityType.swift +++ b/Sources/Gtk3/Generated/PathPriorityType.swift @@ -6,36 +6,36 @@ public enum PathPriorityType: GValueRepresentableEnum { public typealias GtkEnum = GtkPathPriorityType /// Deprecated -case lowest -/// Deprecated -case gtk -/// Deprecated -case application -/// Deprecated -case theme -/// Deprecated -case rc -/// Deprecated -case highest + case lowest + /// Deprecated + case gtk + /// Deprecated + case application + /// Deprecated + case theme + /// Deprecated + case rc + /// Deprecated + case highest public static var type: GType { - gtk_path_priority_type_get_type() -} + gtk_path_priority_type_get_type() + } public init(from gtkEnum: GtkPathPriorityType) { switch gtkEnum { case GTK_PATH_PRIO_LOWEST: - self = .lowest -case GTK_PATH_PRIO_GTK: - self = .gtk -case GTK_PATH_PRIO_APPLICATION: - self = .application -case GTK_PATH_PRIO_THEME: - self = .theme -case GTK_PATH_PRIO_RC: - self = .rc -case GTK_PATH_PRIO_HIGHEST: - self = .highest + self = .lowest + case GTK_PATH_PRIO_GTK: + self = .gtk + case GTK_PATH_PRIO_APPLICATION: + self = .application + case GTK_PATH_PRIO_THEME: + self = .theme + case GTK_PATH_PRIO_RC: + self = .rc + case GTK_PATH_PRIO_HIGHEST: + self = .highest default: fatalError("Unsupported GtkPathPriorityType enum value: \(gtkEnum.rawValue)") } @@ -44,17 +44,17 @@ case GTK_PATH_PRIO_HIGHEST: public func toGtk() -> GtkPathPriorityType { switch self { case .lowest: - return GTK_PATH_PRIO_LOWEST -case .gtk: - return GTK_PATH_PRIO_GTK -case .application: - return GTK_PATH_PRIO_APPLICATION -case .theme: - return GTK_PATH_PRIO_THEME -case .rc: - return GTK_PATH_PRIO_RC -case .highest: - return GTK_PATH_PRIO_HIGHEST + return GTK_PATH_PRIO_LOWEST + case .gtk: + return GTK_PATH_PRIO_GTK + case .application: + return GTK_PATH_PRIO_APPLICATION + case .theme: + return GTK_PATH_PRIO_THEME + case .rc: + return GTK_PATH_PRIO_RC + case .highest: + return GTK_PATH_PRIO_HIGHEST } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/PathType.swift b/Sources/Gtk3/Generated/PathType.swift index f7b42fa55a..e25c90ecee 100644 --- a/Sources/Gtk3/Generated/PathType.swift +++ b/Sources/Gtk3/Generated/PathType.swift @@ -6,24 +6,24 @@ public enum PathType: GValueRepresentableEnum { public typealias GtkEnum = GtkPathType /// Deprecated -case widget -/// Deprecated -case widgetClass -/// Deprecated -case class_ + case widget + /// Deprecated + case widgetClass + /// Deprecated + case class_ public static var type: GType { - gtk_path_type_get_type() -} + gtk_path_type_get_type() + } public init(from gtkEnum: GtkPathType) { switch gtkEnum { case GTK_PATH_WIDGET: - self = .widget -case GTK_PATH_WIDGET_CLASS: - self = .widgetClass -case GTK_PATH_CLASS: - self = .class_ + self = .widget + case GTK_PATH_WIDGET_CLASS: + self = .widgetClass + case GTK_PATH_CLASS: + self = .class_ default: fatalError("Unsupported GtkPathType enum value: \(gtkEnum.rawValue)") } @@ -32,11 +32,11 @@ case GTK_PATH_CLASS: public func toGtk() -> GtkPathType { switch self { case .widget: - return GTK_PATH_WIDGET -case .widgetClass: - return GTK_PATH_WIDGET_CLASS -case .class_: - return GTK_PATH_CLASS + return GTK_PATH_WIDGET + case .widgetClass: + return GTK_PATH_WIDGET_CLASS + case .class_: + return GTK_PATH_CLASS } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/PolicyType.swift b/Sources/Gtk3/Generated/PolicyType.swift index 3d9c4e6f86..ba363adbcd 100644 --- a/Sources/Gtk3/Generated/PolicyType.swift +++ b/Sources/Gtk3/Generated/PolicyType.swift @@ -6,27 +6,27 @@ public enum PolicyType: GValueRepresentableEnum { public typealias GtkEnum = GtkPolicyType /// The scrollbar is always visible. The view size is -/// independent of the content. -case always -/// The scrollbar will appear and disappear as necessary. -/// For example, when all of a #GtkTreeView can not be seen. -case automatic -/// The scrollbar should never appear. In this mode the -/// content determines the size. -case never + /// independent of the content. + case always + /// The scrollbar will appear and disappear as necessary. + /// For example, when all of a #GtkTreeView can not be seen. + case automatic + /// The scrollbar should never appear. In this mode the + /// content determines the size. + case never public static var type: GType { - gtk_policy_type_get_type() -} + gtk_policy_type_get_type() + } public init(from gtkEnum: GtkPolicyType) { switch gtkEnum { case GTK_POLICY_ALWAYS: - self = .always -case GTK_POLICY_AUTOMATIC: - self = .automatic -case GTK_POLICY_NEVER: - self = .never + self = .always + case GTK_POLICY_AUTOMATIC: + self = .automatic + case GTK_POLICY_NEVER: + self = .never default: fatalError("Unsupported GtkPolicyType enum value: \(gtkEnum.rawValue)") } @@ -35,11 +35,11 @@ case GTK_POLICY_NEVER: public func toGtk() -> GtkPolicyType { switch self { case .always: - return GTK_POLICY_ALWAYS -case .automatic: - return GTK_POLICY_AUTOMATIC -case .never: - return GTK_POLICY_NEVER + return GTK_POLICY_ALWAYS + case .automatic: + return GTK_POLICY_AUTOMATIC + case .never: + return GTK_POLICY_NEVER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/PositionType.swift b/Sources/Gtk3/Generated/PositionType.swift index e3b336b90f..1e37a29311 100644 --- a/Sources/Gtk3/Generated/PositionType.swift +++ b/Sources/Gtk3/Generated/PositionType.swift @@ -7,28 +7,28 @@ public enum PositionType: GValueRepresentableEnum { public typealias GtkEnum = GtkPositionType /// The feature is at the left edge. -case left -/// The feature is at the right edge. -case right -/// The feature is at the top edge. -case top -/// The feature is at the bottom edge. -case bottom + case left + /// The feature is at the right edge. + case right + /// The feature is at the top edge. + case top + /// The feature is at the bottom edge. + case bottom public static var type: GType { - gtk_position_type_get_type() -} + gtk_position_type_get_type() + } public init(from gtkEnum: GtkPositionType) { switch gtkEnum { case GTK_POS_LEFT: - self = .left -case GTK_POS_RIGHT: - self = .right -case GTK_POS_TOP: - self = .top -case GTK_POS_BOTTOM: - self = .bottom + self = .left + case GTK_POS_RIGHT: + self = .right + case GTK_POS_TOP: + self = .top + case GTK_POS_BOTTOM: + self = .bottom default: fatalError("Unsupported GtkPositionType enum value: \(gtkEnum.rawValue)") } @@ -37,13 +37,13 @@ case GTK_POS_BOTTOM: public func toGtk() -> GtkPositionType { switch self { case .left: - return GTK_POS_LEFT -case .right: - return GTK_POS_RIGHT -case .top: - return GTK_POS_TOP -case .bottom: - return GTK_POS_BOTTOM + return GTK_POS_LEFT + case .right: + return GTK_POS_RIGHT + case .top: + return GTK_POS_TOP + case .bottom: + return GTK_POS_BOTTOM } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/PrintDuplex.swift b/Sources/Gtk3/Generated/PrintDuplex.swift index 1a3922903d..60506773d8 100644 --- a/Sources/Gtk3/Generated/PrintDuplex.swift +++ b/Sources/Gtk3/Generated/PrintDuplex.swift @@ -5,24 +5,24 @@ public enum PrintDuplex: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintDuplex /// No duplex. -case simplex -/// Horizontal duplex. -case horizontal -/// Vertical duplex. -case vertical + case simplex + /// Horizontal duplex. + case horizontal + /// Vertical duplex. + case vertical public static var type: GType { - gtk_print_duplex_get_type() -} + gtk_print_duplex_get_type() + } public init(from gtkEnum: GtkPrintDuplex) { switch gtkEnum { case GTK_PRINT_DUPLEX_SIMPLEX: - self = .simplex -case GTK_PRINT_DUPLEX_HORIZONTAL: - self = .horizontal -case GTK_PRINT_DUPLEX_VERTICAL: - self = .vertical + self = .simplex + case GTK_PRINT_DUPLEX_HORIZONTAL: + self = .horizontal + case GTK_PRINT_DUPLEX_VERTICAL: + self = .vertical default: fatalError("Unsupported GtkPrintDuplex enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ case GTK_PRINT_DUPLEX_VERTICAL: public func toGtk() -> GtkPrintDuplex { switch self { case .simplex: - return GTK_PRINT_DUPLEX_SIMPLEX -case .horizontal: - return GTK_PRINT_DUPLEX_HORIZONTAL -case .vertical: - return GTK_PRINT_DUPLEX_VERTICAL + return GTK_PRINT_DUPLEX_SIMPLEX + case .horizontal: + return GTK_PRINT_DUPLEX_HORIZONTAL + case .vertical: + return GTK_PRINT_DUPLEX_VERTICAL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/PrintError.swift b/Sources/Gtk3/Generated/PrintError.swift index 98f82b5e43..d7b2497763 100644 --- a/Sources/Gtk3/Generated/PrintError.swift +++ b/Sources/Gtk3/Generated/PrintError.swift @@ -6,29 +6,29 @@ public enum PrintError: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintError /// An unspecified error occurred. -case general -/// An internal error occurred. -case internalError -/// A memory allocation failed. -case nomem -/// An error occurred while loading a page setup -/// or paper size from a key file. -case invalidFile + case general + /// An internal error occurred. + case internalError + /// A memory allocation failed. + case nomem + /// An error occurred while loading a page setup + /// or paper size from a key file. + case invalidFile public static var type: GType { - gtk_print_error_get_type() -} + gtk_print_error_get_type() + } public init(from gtkEnum: GtkPrintError) { switch gtkEnum { case GTK_PRINT_ERROR_GENERAL: - self = .general -case GTK_PRINT_ERROR_INTERNAL_ERROR: - self = .internalError -case GTK_PRINT_ERROR_NOMEM: - self = .nomem -case GTK_PRINT_ERROR_INVALID_FILE: - self = .invalidFile + self = .general + case GTK_PRINT_ERROR_INTERNAL_ERROR: + self = .internalError + case GTK_PRINT_ERROR_NOMEM: + self = .nomem + case GTK_PRINT_ERROR_INVALID_FILE: + self = .invalidFile default: fatalError("Unsupported GtkPrintError enum value: \(gtkEnum.rawValue)") } @@ -37,13 +37,13 @@ case GTK_PRINT_ERROR_INVALID_FILE: public func toGtk() -> GtkPrintError { switch self { case .general: - return GTK_PRINT_ERROR_GENERAL -case .internalError: - return GTK_PRINT_ERROR_INTERNAL_ERROR -case .nomem: - return GTK_PRINT_ERROR_NOMEM -case .invalidFile: - return GTK_PRINT_ERROR_INVALID_FILE + return GTK_PRINT_ERROR_GENERAL + case .internalError: + return GTK_PRINT_ERROR_INTERNAL_ERROR + case .nomem: + return GTK_PRINT_ERROR_NOMEM + case .invalidFile: + return GTK_PRINT_ERROR_INVALID_FILE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/PrintOperationAction.swift b/Sources/Gtk3/Generated/PrintOperationAction.swift index 2f1a52c706..0a349d42b8 100644 --- a/Sources/Gtk3/Generated/PrintOperationAction.swift +++ b/Sources/Gtk3/Generated/PrintOperationAction.swift @@ -6,30 +6,30 @@ public enum PrintOperationAction: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintOperationAction /// Show the print dialog. -case printDialog -/// Start to print without showing -/// the print dialog, based on the current print settings. -case print -/// Show the print preview. -case preview -/// Export to a file. This requires -/// the export-filename property to be set. -case export + case printDialog + /// Start to print without showing + /// the print dialog, based on the current print settings. + case print + /// Show the print preview. + case preview + /// Export to a file. This requires + /// the export-filename property to be set. + case export public static var type: GType { - gtk_print_operation_action_get_type() -} + gtk_print_operation_action_get_type() + } public init(from gtkEnum: GtkPrintOperationAction) { switch gtkEnum { case GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG: - self = .printDialog -case GTK_PRINT_OPERATION_ACTION_PRINT: - self = .print -case GTK_PRINT_OPERATION_ACTION_PREVIEW: - self = .preview -case GTK_PRINT_OPERATION_ACTION_EXPORT: - self = .export + self = .printDialog + case GTK_PRINT_OPERATION_ACTION_PRINT: + self = .print + case GTK_PRINT_OPERATION_ACTION_PREVIEW: + self = .preview + case GTK_PRINT_OPERATION_ACTION_EXPORT: + self = .export default: fatalError("Unsupported GtkPrintOperationAction enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ case GTK_PRINT_OPERATION_ACTION_EXPORT: public func toGtk() -> GtkPrintOperationAction { switch self { case .printDialog: - return GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG -case .print: - return GTK_PRINT_OPERATION_ACTION_PRINT -case .preview: - return GTK_PRINT_OPERATION_ACTION_PREVIEW -case .export: - return GTK_PRINT_OPERATION_ACTION_EXPORT + return GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG + case .print: + return GTK_PRINT_OPERATION_ACTION_PRINT + case .preview: + return GTK_PRINT_OPERATION_ACTION_PREVIEW + case .export: + return GTK_PRINT_OPERATION_ACTION_EXPORT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/PrintOperationResult.swift b/Sources/Gtk3/Generated/PrintOperationResult.swift index dc42857d5b..4604a592dc 100644 --- a/Sources/Gtk3/Generated/PrintOperationResult.swift +++ b/Sources/Gtk3/Generated/PrintOperationResult.swift @@ -5,30 +5,30 @@ public enum PrintOperationResult: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintOperationResult /// An error has occurred. -case error -/// The print settings should be stored. -case apply -/// The print operation has been canceled, -/// the print settings should not be stored. -case cancel -/// The print operation is not complete -/// yet. This value will only be returned when running asynchronously. -case inProgress + case error + /// The print settings should be stored. + case apply + /// The print operation has been canceled, + /// the print settings should not be stored. + case cancel + /// The print operation is not complete + /// yet. This value will only be returned when running asynchronously. + case inProgress public static var type: GType { - gtk_print_operation_result_get_type() -} + gtk_print_operation_result_get_type() + } public init(from gtkEnum: GtkPrintOperationResult) { switch gtkEnum { case GTK_PRINT_OPERATION_RESULT_ERROR: - self = .error -case GTK_PRINT_OPERATION_RESULT_APPLY: - self = .apply -case GTK_PRINT_OPERATION_RESULT_CANCEL: - self = .cancel -case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS: - self = .inProgress + self = .error + case GTK_PRINT_OPERATION_RESULT_APPLY: + self = .apply + case GTK_PRINT_OPERATION_RESULT_CANCEL: + self = .cancel + case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS: + self = .inProgress default: fatalError("Unsupported GtkPrintOperationResult enum value: \(gtkEnum.rawValue)") } @@ -37,13 +37,13 @@ case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS: public func toGtk() -> GtkPrintOperationResult { switch self { case .error: - return GTK_PRINT_OPERATION_RESULT_ERROR -case .apply: - return GTK_PRINT_OPERATION_RESULT_APPLY -case .cancel: - return GTK_PRINT_OPERATION_RESULT_CANCEL -case .inProgress: - return GTK_PRINT_OPERATION_RESULT_IN_PROGRESS + return GTK_PRINT_OPERATION_RESULT_ERROR + case .apply: + return GTK_PRINT_OPERATION_RESULT_APPLY + case .cancel: + return GTK_PRINT_OPERATION_RESULT_CANCEL + case .inProgress: + return GTK_PRINT_OPERATION_RESULT_IN_PROGRESS } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/PrintPages.swift b/Sources/Gtk3/Generated/PrintPages.swift index 3b3b5d5286..dd20901120 100644 --- a/Sources/Gtk3/Generated/PrintPages.swift +++ b/Sources/Gtk3/Generated/PrintPages.swift @@ -5,28 +5,28 @@ public enum PrintPages: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintPages /// All pages. -case all -/// Current page. -case current -/// Range of pages. -case ranges -/// Selected pages. -case selection + case all + /// Current page. + case current + /// Range of pages. + case ranges + /// Selected pages. + case selection public static var type: GType { - gtk_print_pages_get_type() -} + gtk_print_pages_get_type() + } public init(from gtkEnum: GtkPrintPages) { switch gtkEnum { case GTK_PRINT_PAGES_ALL: - self = .all -case GTK_PRINT_PAGES_CURRENT: - self = .current -case GTK_PRINT_PAGES_RANGES: - self = .ranges -case GTK_PRINT_PAGES_SELECTION: - self = .selection + self = .all + case GTK_PRINT_PAGES_CURRENT: + self = .current + case GTK_PRINT_PAGES_RANGES: + self = .ranges + case GTK_PRINT_PAGES_SELECTION: + self = .selection default: fatalError("Unsupported GtkPrintPages enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_PRINT_PAGES_SELECTION: public func toGtk() -> GtkPrintPages { switch self { case .all: - return GTK_PRINT_PAGES_ALL -case .current: - return GTK_PRINT_PAGES_CURRENT -case .ranges: - return GTK_PRINT_PAGES_RANGES -case .selection: - return GTK_PRINT_PAGES_SELECTION + return GTK_PRINT_PAGES_ALL + case .current: + return GTK_PRINT_PAGES_CURRENT + case .ranges: + return GTK_PRINT_PAGES_RANGES + case .selection: + return GTK_PRINT_PAGES_SELECTION } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/PrintQuality.swift b/Sources/Gtk3/Generated/PrintQuality.swift index f45c60948b..49d7e527b4 100644 --- a/Sources/Gtk3/Generated/PrintQuality.swift +++ b/Sources/Gtk3/Generated/PrintQuality.swift @@ -5,28 +5,28 @@ public enum PrintQuality: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintQuality /// Low quality. -case low -/// Normal quality. -case normal -/// High quality. -case high -/// Draft quality. -case draft + case low + /// Normal quality. + case normal + /// High quality. + case high + /// Draft quality. + case draft public static var type: GType { - gtk_print_quality_get_type() -} + gtk_print_quality_get_type() + } public init(from gtkEnum: GtkPrintQuality) { switch gtkEnum { case GTK_PRINT_QUALITY_LOW: - self = .low -case GTK_PRINT_QUALITY_NORMAL: - self = .normal -case GTK_PRINT_QUALITY_HIGH: - self = .high -case GTK_PRINT_QUALITY_DRAFT: - self = .draft + self = .low + case GTK_PRINT_QUALITY_NORMAL: + self = .normal + case GTK_PRINT_QUALITY_HIGH: + self = .high + case GTK_PRINT_QUALITY_DRAFT: + self = .draft default: fatalError("Unsupported GtkPrintQuality enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_PRINT_QUALITY_DRAFT: public func toGtk() -> GtkPrintQuality { switch self { case .low: - return GTK_PRINT_QUALITY_LOW -case .normal: - return GTK_PRINT_QUALITY_NORMAL -case .high: - return GTK_PRINT_QUALITY_HIGH -case .draft: - return GTK_PRINT_QUALITY_DRAFT + return GTK_PRINT_QUALITY_LOW + case .normal: + return GTK_PRINT_QUALITY_NORMAL + case .high: + return GTK_PRINT_QUALITY_HIGH + case .draft: + return GTK_PRINT_QUALITY_DRAFT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/PrintStatus.swift b/Sources/Gtk3/Generated/PrintStatus.swift index 175ba17753..363177adf1 100644 --- a/Sources/Gtk3/Generated/PrintStatus.swift +++ b/Sources/Gtk3/Generated/PrintStatus.swift @@ -6,54 +6,54 @@ public enum PrintStatus: GValueRepresentableEnum { public typealias GtkEnum = GtkPrintStatus /// The printing has not started yet; this -/// status is set initially, and while the print dialog is shown. -case initial -/// This status is set while the begin-print -/// signal is emitted and during pagination. -case preparing -/// This status is set while the -/// pages are being rendered. -case generatingData -/// The print job is being sent off to the -/// printer. -case sendingData -/// The print job has been sent to the printer, -/// but is not printed for some reason, e.g. the printer may be stopped. -case pending -/// Some problem has occurred during -/// printing, e.g. a paper jam. -case pendingIssue -/// The printer is processing the print job. -case printing -/// The printing has been completed successfully. -case finished -/// The printing has been aborted. -case finishedAborted + /// status is set initially, and while the print dialog is shown. + case initial + /// This status is set while the begin-print + /// signal is emitted and during pagination. + case preparing + /// This status is set while the + /// pages are being rendered. + case generatingData + /// The print job is being sent off to the + /// printer. + case sendingData + /// The print job has been sent to the printer, + /// but is not printed for some reason, e.g. the printer may be stopped. + case pending + /// Some problem has occurred during + /// printing, e.g. a paper jam. + case pendingIssue + /// The printer is processing the print job. + case printing + /// The printing has been completed successfully. + case finished + /// The printing has been aborted. + case finishedAborted public static var type: GType { - gtk_print_status_get_type() -} + gtk_print_status_get_type() + } public init(from gtkEnum: GtkPrintStatus) { switch gtkEnum { case GTK_PRINT_STATUS_INITIAL: - self = .initial -case GTK_PRINT_STATUS_PREPARING: - self = .preparing -case GTK_PRINT_STATUS_GENERATING_DATA: - self = .generatingData -case GTK_PRINT_STATUS_SENDING_DATA: - self = .sendingData -case GTK_PRINT_STATUS_PENDING: - self = .pending -case GTK_PRINT_STATUS_PENDING_ISSUE: - self = .pendingIssue -case GTK_PRINT_STATUS_PRINTING: - self = .printing -case GTK_PRINT_STATUS_FINISHED: - self = .finished -case GTK_PRINT_STATUS_FINISHED_ABORTED: - self = .finishedAborted + self = .initial + case GTK_PRINT_STATUS_PREPARING: + self = .preparing + case GTK_PRINT_STATUS_GENERATING_DATA: + self = .generatingData + case GTK_PRINT_STATUS_SENDING_DATA: + self = .sendingData + case GTK_PRINT_STATUS_PENDING: + self = .pending + case GTK_PRINT_STATUS_PENDING_ISSUE: + self = .pendingIssue + case GTK_PRINT_STATUS_PRINTING: + self = .printing + case GTK_PRINT_STATUS_FINISHED: + self = .finished + case GTK_PRINT_STATUS_FINISHED_ABORTED: + self = .finishedAborted default: fatalError("Unsupported GtkPrintStatus enum value: \(gtkEnum.rawValue)") } @@ -62,23 +62,23 @@ case GTK_PRINT_STATUS_FINISHED_ABORTED: public func toGtk() -> GtkPrintStatus { switch self { case .initial: - return GTK_PRINT_STATUS_INITIAL -case .preparing: - return GTK_PRINT_STATUS_PREPARING -case .generatingData: - return GTK_PRINT_STATUS_GENERATING_DATA -case .sendingData: - return GTK_PRINT_STATUS_SENDING_DATA -case .pending: - return GTK_PRINT_STATUS_PENDING -case .pendingIssue: - return GTK_PRINT_STATUS_PENDING_ISSUE -case .printing: - return GTK_PRINT_STATUS_PRINTING -case .finished: - return GTK_PRINT_STATUS_FINISHED -case .finishedAborted: - return GTK_PRINT_STATUS_FINISHED_ABORTED + return GTK_PRINT_STATUS_INITIAL + case .preparing: + return GTK_PRINT_STATUS_PREPARING + case .generatingData: + return GTK_PRINT_STATUS_GENERATING_DATA + case .sendingData: + return GTK_PRINT_STATUS_SENDING_DATA + case .pending: + return GTK_PRINT_STATUS_PENDING + case .pendingIssue: + return GTK_PRINT_STATUS_PENDING_ISSUE + case .printing: + return GTK_PRINT_STATUS_PRINTING + case .finished: + return GTK_PRINT_STATUS_FINISHED + case .finishedAborted: + return GTK_PRINT_STATUS_FINISHED_ABORTED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/ProgressBar.swift b/Sources/Gtk3/Generated/ProgressBar.swift index 764ede31a9..9b3eb446a4 100644 --- a/Sources/Gtk3/Generated/ProgressBar.swift +++ b/Sources/Gtk3/Generated/ProgressBar.swift @@ -4,34 +4,34 @@ import CGtk3 /// running operation. It provides a visual clue that processing is underway. /// The GtkProgressBar can be used in two different modes: percentage mode /// and activity mode. -/// +/// /// When an application can determine how much work needs to take place /// (e.g. read a fixed number of bytes from a file) and can monitor its /// progress, it can use the GtkProgressBar in percentage mode and the /// user sees a growing bar indicating the percentage of the work that /// has been completed. In this mode, the application is required to call /// gtk_progress_bar_set_fraction() periodically to update the progress bar. -/// +/// /// When an application has no accurate way of knowing the amount of work /// to do, it can use the #GtkProgressBar in activity mode, which shows /// activity by a block moving back and forth within the progress area. In /// this mode, the application is required to call gtk_progress_bar_pulse() /// periodically to update the progress bar. -/// +/// /// There is quite a bit of flexibility provided to control the appearance /// of the #GtkProgressBar. Functions are provided to control the orientation /// of the bar, optional text can be displayed along with the bar, and the /// step size used in activity mode can be set. -/// +/// /// # CSS nodes -/// +/// /// |[ /// progressbar[.osd] /// ├── [text] /// ╰── trough[.empty][.full] /// ╰── progress[.pulse] /// ]| -/// +/// /// GtkProgressBar has a main CSS node with name progressbar and subnodes with /// names text and trough, of which the latter has a subnode named progress. The /// text subnode is only present if text is shown. The progress subnode has the @@ -41,116 +41,119 @@ import CGtk3 /// in overlays like the one Epiphany has for page loading progress. open class ProgressBar: Widget, Orientable { /// Creates a new #GtkProgressBar. -public convenience init() { - self.init( - gtk_progress_bar_new() - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_progress_bar_new() + ) } -addSignal(name: "notify::ellipsize", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyEllipsize?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::ellipsize", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyEllipsize?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::fraction", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFraction?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::inverted", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInverted?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::pulse-step", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyPulseStep?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::show-text", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowText?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::text", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyText?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::orientation", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyOrientation?(self, param0) + } } -addSignal(name: "notify::fraction", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFraction?(self, param0) -} + @GObjectProperty(named: "fraction") public var fraction: Double -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + @GObjectProperty(named: "inverted") public var inverted: Bool -addSignal(name: "notify::inverted", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInverted?(self, param0) -} + @GObjectProperty(named: "pulse-step") public var pulseStep: Double -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + @GObjectProperty(named: "text") public var text: String? -addSignal(name: "notify::pulse-step", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyPulseStep?(self, param0) -} + public var notifyEllipsize: ((ProgressBar, OpaquePointer) -> Void)? -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyFraction: ((ProgressBar, OpaquePointer) -> Void)? -addSignal(name: "notify::show-text", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowText?(self, param0) -} + public var notifyInverted: ((ProgressBar, OpaquePointer) -> Void)? -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyPulseStep: ((ProgressBar, OpaquePointer) -> Void)? -addSignal(name: "notify::text", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyText?(self, param0) -} + public var notifyShowText: ((ProgressBar, OpaquePointer) -> Void)? -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyText: ((ProgressBar, OpaquePointer) -> Void)? -addSignal(name: "notify::orientation", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyOrientation?(self, param0) + public var notifyOrientation: ((ProgressBar, OpaquePointer) -> Void)? } -} - - -@GObjectProperty(named: "fraction") public var fraction: Double - - -@GObjectProperty(named: "inverted") public var inverted: Bool - - -@GObjectProperty(named: "pulse-step") public var pulseStep: Double - - -@GObjectProperty(named: "text") public var text: String? - - -public var notifyEllipsize: ((ProgressBar, OpaquePointer) -> Void)? - - -public var notifyFraction: ((ProgressBar, OpaquePointer) -> Void)? - - -public var notifyInverted: ((ProgressBar, OpaquePointer) -> Void)? - - -public var notifyPulseStep: ((ProgressBar, OpaquePointer) -> Void)? - - -public var notifyShowText: ((ProgressBar, OpaquePointer) -> Void)? - - -public var notifyText: ((ProgressBar, OpaquePointer) -> Void)? - - -public var notifyOrientation: ((ProgressBar, OpaquePointer) -> Void)? -} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/Range.swift b/Sources/Gtk3/Generated/Range.swift index e2405f6340..b93bddbbe7 100644 --- a/Sources/Gtk3/Generated/Range.swift +++ b/Sources/Gtk3/Generated/Range.swift @@ -2,200 +2,214 @@ import CGtk3 /// #GtkRange is the common base class for widgets which visualize an /// adjustment, e.g #GtkScale or #GtkScrollbar. -/// +/// /// Apart from signals for monitoring the parameters of the adjustment, /// #GtkRange provides properties and methods for influencing the sensitivity /// of the “steppers”. It also provides properties and methods for setting a /// “fill level” on range widgets. See gtk_range_set_fill_level(). open class Range: Widget, Orientable { - - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: @convention(c) (UnsafeMutableRawPointer, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "adjust-bounds", handler: gCallback(handler0)) { [weak self] (param0: Double) in - guard let self = self else { return } - self.adjustBounds?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, GtkScrollType, Double, UnsafeMutableRawPointer) -> Void = - { _, value1, value2, data in - SignalBox2.run(data, value1, value2) - } - -addSignal(name: "change-value", handler: gCallback(handler1)) { [weak self] (param0: GtkScrollType, param1: Double) in - guard let self = self else { return } - self.changeValue?(self, param0, param1) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, GtkScrollType, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "move-slider", handler: gCallback(handler2)) { [weak self] (param0: GtkScrollType) in - guard let self = self else { return } - self.moveSlider?(self, param0) -} - -addSignal(name: "value-changed") { [weak self] () in - guard let self = self else { return } - self.valueChanged?(self) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, Double, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "adjust-bounds", handler: gCallback(handler0)) { + [weak self] (param0: Double) in + guard let self = self else { return } + self.adjustBounds?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, GtkScrollType, Double, UnsafeMutableRawPointer) + -> Void = + { _, value1, value2, data in + SignalBox2.run(data, value1, value2) + } + + addSignal(name: "change-value", handler: gCallback(handler1)) { + [weak self] (param0: GtkScrollType, param1: Double) in + guard let self = self else { return } + self.changeValue?(self, param0, param1) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, GtkScrollType, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "move-slider", handler: gCallback(handler2)) { + [weak self] (param0: GtkScrollType) in + guard let self = self else { return } + self.moveSlider?(self, param0) + } + + addSignal(name: "value-changed") { [weak self] () in + guard let self = self else { return } + self.valueChanged?(self) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::adjustment", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyAdjustment?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::fill-level", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyFillLevel?(self, param0) + } + + let handler6: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::inverted", handler: gCallback(handler6)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyInverted?(self, param0) + } + + let handler7: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::lower-stepper-sensitivity", handler: gCallback(handler7)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyLowerStepperSensitivity?(self, param0) + } + + let handler8: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::restrict-to-fill-level", handler: gCallback(handler8)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyRestrictToFillLevel?(self, param0) + } + + let handler9: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::round-digits", handler: gCallback(handler9)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyRoundDigits?(self, param0) + } + + let handler10: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::show-fill-level", handler: gCallback(handler10)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyShowFillLevel?(self, param0) + } + + let handler11: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::upper-stepper-sensitivity", handler: gCallback(handler11)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUpperStepperSensitivity?(self, param0) + } + + let handler12: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::orientation", handler: gCallback(handler12)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyOrientation?(self, param0) + } } -addSignal(name: "notify::adjustment", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyAdjustment?(self, param0) -} + @GObjectProperty(named: "inverted") public var inverted: Bool -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + @GObjectProperty(named: "lower-stepper-sensitivity") public var lowerStepperSensitivity: + SensitivityType -addSignal(name: "notify::fill-level", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyFillLevel?(self, param0) -} + @GObjectProperty(named: "upper-stepper-sensitivity") public var upperStepperSensitivity: + SensitivityType -let handler6: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + /// Emitted before clamping a value, to give the application a + /// chance to adjust the bounds. + public var adjustBounds: ((Range, Double) -> Void)? -addSignal(name: "notify::inverted", handler: gCallback(handler6)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyInverted?(self, param0) -} + /// The #GtkRange::change-value signal is emitted when a scroll action is + /// performed on a range. It allows an application to determine the + /// type of scroll event that occurred and the resultant new value. + /// The application can handle the event itself and return %TRUE to + /// prevent further processing. Or, by returning %FALSE, it can pass + /// the event to other handlers until the default GTK+ handler is + /// reached. + /// + /// The value parameter is unrounded. An application that overrides + /// the GtkRange::change-value signal is responsible for clamping the + /// value to the desired number of decimal digits; the default GTK+ + /// handler clamps the value based on #GtkRange:round-digits. + public var changeValue: ((Range, GtkScrollType, Double) -> Void)? -let handler7: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + /// Virtual function that moves the slider. Used for keybindings. + public var moveSlider: ((Range, GtkScrollType) -> Void)? -addSignal(name: "notify::lower-stepper-sensitivity", handler: gCallback(handler7)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyLowerStepperSensitivity?(self, param0) -} + /// Emitted when the range value changes. + public var valueChanged: ((Range) -> Void)? -let handler8: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyAdjustment: ((Range, OpaquePointer) -> Void)? -addSignal(name: "notify::restrict-to-fill-level", handler: gCallback(handler8)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyRestrictToFillLevel?(self, param0) -} + public var notifyFillLevel: ((Range, OpaquePointer) -> Void)? -let handler9: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyInverted: ((Range, OpaquePointer) -> Void)? -addSignal(name: "notify::round-digits", handler: gCallback(handler9)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyRoundDigits?(self, param0) -} + public var notifyLowerStepperSensitivity: ((Range, OpaquePointer) -> Void)? -let handler10: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyRestrictToFillLevel: ((Range, OpaquePointer) -> Void)? -addSignal(name: "notify::show-fill-level", handler: gCallback(handler10)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyShowFillLevel?(self, param0) -} - -let handler11: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyRoundDigits: ((Range, OpaquePointer) -> Void)? -addSignal(name: "notify::upper-stepper-sensitivity", handler: gCallback(handler11)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUpperStepperSensitivity?(self, param0) -} + public var notifyShowFillLevel: ((Range, OpaquePointer) -> Void)? -let handler12: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } + public var notifyUpperStepperSensitivity: ((Range, OpaquePointer) -> Void)? -addSignal(name: "notify::orientation", handler: gCallback(handler12)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyOrientation?(self, param0) + public var notifyOrientation: ((Range, OpaquePointer) -> Void)? } -} - - -@GObjectProperty(named: "inverted") public var inverted: Bool - - -@GObjectProperty(named: "lower-stepper-sensitivity") public var lowerStepperSensitivity: SensitivityType - - -@GObjectProperty(named: "upper-stepper-sensitivity") public var upperStepperSensitivity: SensitivityType - -/// Emitted before clamping a value, to give the application a -/// chance to adjust the bounds. -public var adjustBounds: ((Range, Double) -> Void)? - -/// The #GtkRange::change-value signal is emitted when a scroll action is -/// performed on a range. It allows an application to determine the -/// type of scroll event that occurred and the resultant new value. -/// The application can handle the event itself and return %TRUE to -/// prevent further processing. Or, by returning %FALSE, it can pass -/// the event to other handlers until the default GTK+ handler is -/// reached. -/// -/// The value parameter is unrounded. An application that overrides -/// the GtkRange::change-value signal is responsible for clamping the -/// value to the desired number of decimal digits; the default GTK+ -/// handler clamps the value based on #GtkRange:round-digits. -public var changeValue: ((Range, GtkScrollType, Double) -> Void)? - -/// Virtual function that moves the slider. Used for keybindings. -public var moveSlider: ((Range, GtkScrollType) -> Void)? - -/// Emitted when the range value changes. -public var valueChanged: ((Range) -> Void)? - - -public var notifyAdjustment: ((Range, OpaquePointer) -> Void)? - - -public var notifyFillLevel: ((Range, OpaquePointer) -> Void)? - - -public var notifyInverted: ((Range, OpaquePointer) -> Void)? - - -public var notifyLowerStepperSensitivity: ((Range, OpaquePointer) -> Void)? - - -public var notifyRestrictToFillLevel: ((Range, OpaquePointer) -> Void)? - - -public var notifyRoundDigits: ((Range, OpaquePointer) -> Void)? - - -public var notifyShowFillLevel: ((Range, OpaquePointer) -> Void)? - - -public var notifyUpperStepperSensitivity: ((Range, OpaquePointer) -> Void)? - - -public var notifyOrientation: ((Range, OpaquePointer) -> Void)? -} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/RcTokenType.swift b/Sources/Gtk3/Generated/RcTokenType.swift index 0c86451698..bf9b68857a 100644 --- a/Sources/Gtk3/Generated/RcTokenType.swift +++ b/Sources/Gtk3/Generated/RcTokenType.swift @@ -8,172 +8,172 @@ public enum RcTokenType: GValueRepresentableEnum { public typealias GtkEnum = GtkRcTokenType /// Deprecated -case invalid -/// Deprecated -case include -/// Deprecated -case normal -/// Deprecated -case active -/// Deprecated -case prelight -/// Deprecated -case selected -/// Deprecated -case insensitive -/// Deprecated -case fg -/// Deprecated -case bg -/// Deprecated -case text -/// Deprecated -case base -/// Deprecated -case xthickness -/// Deprecated -case ythickness -/// Deprecated -case font -/// Deprecated -case fontset -/// Deprecated -case fontName -/// Deprecated -case bgPixmap -/// Deprecated -case pixmapPath -/// Deprecated -case style -/// Deprecated -case binding -/// Deprecated -case bind -/// Deprecated -case widget -/// Deprecated -case widgetClass -/// Deprecated -case class_ -/// Deprecated -case lowest -/// Deprecated -case gtk -/// Deprecated -case application -/// Deprecated -case theme -/// Deprecated -case rc -/// Deprecated -case highest -/// Deprecated -case engine -/// Deprecated -case modulePath -/// Deprecated -case imModulePath -/// Deprecated -case imModuleFile -/// Deprecated -case stock -/// Deprecated -case ltr -/// Deprecated -case rtl -/// Deprecated -case color -/// Deprecated -case unbind -/// Deprecated -case last + case invalid + /// Deprecated + case include + /// Deprecated + case normal + /// Deprecated + case active + /// Deprecated + case prelight + /// Deprecated + case selected + /// Deprecated + case insensitive + /// Deprecated + case fg + /// Deprecated + case bg + /// Deprecated + case text + /// Deprecated + case base + /// Deprecated + case xthickness + /// Deprecated + case ythickness + /// Deprecated + case font + /// Deprecated + case fontset + /// Deprecated + case fontName + /// Deprecated + case bgPixmap + /// Deprecated + case pixmapPath + /// Deprecated + case style + /// Deprecated + case binding + /// Deprecated + case bind + /// Deprecated + case widget + /// Deprecated + case widgetClass + /// Deprecated + case class_ + /// Deprecated + case lowest + /// Deprecated + case gtk + /// Deprecated + case application + /// Deprecated + case theme + /// Deprecated + case rc + /// Deprecated + case highest + /// Deprecated + case engine + /// Deprecated + case modulePath + /// Deprecated + case imModulePath + /// Deprecated + case imModuleFile + /// Deprecated + case stock + /// Deprecated + case ltr + /// Deprecated + case rtl + /// Deprecated + case color + /// Deprecated + case unbind + /// Deprecated + case last public static var type: GType { - gtk_rc_token_type_get_type() -} + gtk_rc_token_type_get_type() + } public init(from gtkEnum: GtkRcTokenType) { switch gtkEnum { case GTK_RC_TOKEN_INVALID: - self = .invalid -case GTK_RC_TOKEN_INCLUDE: - self = .include -case GTK_RC_TOKEN_NORMAL: - self = .normal -case GTK_RC_TOKEN_ACTIVE: - self = .active -case GTK_RC_TOKEN_PRELIGHT: - self = .prelight -case GTK_RC_TOKEN_SELECTED: - self = .selected -case GTK_RC_TOKEN_INSENSITIVE: - self = .insensitive -case GTK_RC_TOKEN_FG: - self = .fg -case GTK_RC_TOKEN_BG: - self = .bg -case GTK_RC_TOKEN_TEXT: - self = .text -case GTK_RC_TOKEN_BASE: - self = .base -case GTK_RC_TOKEN_XTHICKNESS: - self = .xthickness -case GTK_RC_TOKEN_YTHICKNESS: - self = .ythickness -case GTK_RC_TOKEN_FONT: - self = .font -case GTK_RC_TOKEN_FONTSET: - self = .fontset -case GTK_RC_TOKEN_FONT_NAME: - self = .fontName -case GTK_RC_TOKEN_BG_PIXMAP: - self = .bgPixmap -case GTK_RC_TOKEN_PIXMAP_PATH: - self = .pixmapPath -case GTK_RC_TOKEN_STYLE: - self = .style -case GTK_RC_TOKEN_BINDING: - self = .binding -case GTK_RC_TOKEN_BIND: - self = .bind -case GTK_RC_TOKEN_WIDGET: - self = .widget -case GTK_RC_TOKEN_WIDGET_CLASS: - self = .widgetClass -case GTK_RC_TOKEN_CLASS: - self = .class_ -case GTK_RC_TOKEN_LOWEST: - self = .lowest -case GTK_RC_TOKEN_GTK: - self = .gtk -case GTK_RC_TOKEN_APPLICATION: - self = .application -case GTK_RC_TOKEN_THEME: - self = .theme -case GTK_RC_TOKEN_RC: - self = .rc -case GTK_RC_TOKEN_HIGHEST: - self = .highest -case GTK_RC_TOKEN_ENGINE: - self = .engine -case GTK_RC_TOKEN_MODULE_PATH: - self = .modulePath -case GTK_RC_TOKEN_IM_MODULE_PATH: - self = .imModulePath -case GTK_RC_TOKEN_IM_MODULE_FILE: - self = .imModuleFile -case GTK_RC_TOKEN_STOCK: - self = .stock -case GTK_RC_TOKEN_LTR: - self = .ltr -case GTK_RC_TOKEN_RTL: - self = .rtl -case GTK_RC_TOKEN_COLOR: - self = .color -case GTK_RC_TOKEN_UNBIND: - self = .unbind -case GTK_RC_TOKEN_LAST: - self = .last + self = .invalid + case GTK_RC_TOKEN_INCLUDE: + self = .include + case GTK_RC_TOKEN_NORMAL: + self = .normal + case GTK_RC_TOKEN_ACTIVE: + self = .active + case GTK_RC_TOKEN_PRELIGHT: + self = .prelight + case GTK_RC_TOKEN_SELECTED: + self = .selected + case GTK_RC_TOKEN_INSENSITIVE: + self = .insensitive + case GTK_RC_TOKEN_FG: + self = .fg + case GTK_RC_TOKEN_BG: + self = .bg + case GTK_RC_TOKEN_TEXT: + self = .text + case GTK_RC_TOKEN_BASE: + self = .base + case GTK_RC_TOKEN_XTHICKNESS: + self = .xthickness + case GTK_RC_TOKEN_YTHICKNESS: + self = .ythickness + case GTK_RC_TOKEN_FONT: + self = .font + case GTK_RC_TOKEN_FONTSET: + self = .fontset + case GTK_RC_TOKEN_FONT_NAME: + self = .fontName + case GTK_RC_TOKEN_BG_PIXMAP: + self = .bgPixmap + case GTK_RC_TOKEN_PIXMAP_PATH: + self = .pixmapPath + case GTK_RC_TOKEN_STYLE: + self = .style + case GTK_RC_TOKEN_BINDING: + self = .binding + case GTK_RC_TOKEN_BIND: + self = .bind + case GTK_RC_TOKEN_WIDGET: + self = .widget + case GTK_RC_TOKEN_WIDGET_CLASS: + self = .widgetClass + case GTK_RC_TOKEN_CLASS: + self = .class_ + case GTK_RC_TOKEN_LOWEST: + self = .lowest + case GTK_RC_TOKEN_GTK: + self = .gtk + case GTK_RC_TOKEN_APPLICATION: + self = .application + case GTK_RC_TOKEN_THEME: + self = .theme + case GTK_RC_TOKEN_RC: + self = .rc + case GTK_RC_TOKEN_HIGHEST: + self = .highest + case GTK_RC_TOKEN_ENGINE: + self = .engine + case GTK_RC_TOKEN_MODULE_PATH: + self = .modulePath + case GTK_RC_TOKEN_IM_MODULE_PATH: + self = .imModulePath + case GTK_RC_TOKEN_IM_MODULE_FILE: + self = .imModuleFile + case GTK_RC_TOKEN_STOCK: + self = .stock + case GTK_RC_TOKEN_LTR: + self = .ltr + case GTK_RC_TOKEN_RTL: + self = .rtl + case GTK_RC_TOKEN_COLOR: + self = .color + case GTK_RC_TOKEN_UNBIND: + self = .unbind + case GTK_RC_TOKEN_LAST: + self = .last default: fatalError("Unsupported GtkRcTokenType enum value: \(gtkEnum.rawValue)") } @@ -182,85 +182,85 @@ case GTK_RC_TOKEN_LAST: public func toGtk() -> GtkRcTokenType { switch self { case .invalid: - return GTK_RC_TOKEN_INVALID -case .include: - return GTK_RC_TOKEN_INCLUDE -case .normal: - return GTK_RC_TOKEN_NORMAL -case .active: - return GTK_RC_TOKEN_ACTIVE -case .prelight: - return GTK_RC_TOKEN_PRELIGHT -case .selected: - return GTK_RC_TOKEN_SELECTED -case .insensitive: - return GTK_RC_TOKEN_INSENSITIVE -case .fg: - return GTK_RC_TOKEN_FG -case .bg: - return GTK_RC_TOKEN_BG -case .text: - return GTK_RC_TOKEN_TEXT -case .base: - return GTK_RC_TOKEN_BASE -case .xthickness: - return GTK_RC_TOKEN_XTHICKNESS -case .ythickness: - return GTK_RC_TOKEN_YTHICKNESS -case .font: - return GTK_RC_TOKEN_FONT -case .fontset: - return GTK_RC_TOKEN_FONTSET -case .fontName: - return GTK_RC_TOKEN_FONT_NAME -case .bgPixmap: - return GTK_RC_TOKEN_BG_PIXMAP -case .pixmapPath: - return GTK_RC_TOKEN_PIXMAP_PATH -case .style: - return GTK_RC_TOKEN_STYLE -case .binding: - return GTK_RC_TOKEN_BINDING -case .bind: - return GTK_RC_TOKEN_BIND -case .widget: - return GTK_RC_TOKEN_WIDGET -case .widgetClass: - return GTK_RC_TOKEN_WIDGET_CLASS -case .class_: - return GTK_RC_TOKEN_CLASS -case .lowest: - return GTK_RC_TOKEN_LOWEST -case .gtk: - return GTK_RC_TOKEN_GTK -case .application: - return GTK_RC_TOKEN_APPLICATION -case .theme: - return GTK_RC_TOKEN_THEME -case .rc: - return GTK_RC_TOKEN_RC -case .highest: - return GTK_RC_TOKEN_HIGHEST -case .engine: - return GTK_RC_TOKEN_ENGINE -case .modulePath: - return GTK_RC_TOKEN_MODULE_PATH -case .imModulePath: - return GTK_RC_TOKEN_IM_MODULE_PATH -case .imModuleFile: - return GTK_RC_TOKEN_IM_MODULE_FILE -case .stock: - return GTK_RC_TOKEN_STOCK -case .ltr: - return GTK_RC_TOKEN_LTR -case .rtl: - return GTK_RC_TOKEN_RTL -case .color: - return GTK_RC_TOKEN_COLOR -case .unbind: - return GTK_RC_TOKEN_UNBIND -case .last: - return GTK_RC_TOKEN_LAST + return GTK_RC_TOKEN_INVALID + case .include: + return GTK_RC_TOKEN_INCLUDE + case .normal: + return GTK_RC_TOKEN_NORMAL + case .active: + return GTK_RC_TOKEN_ACTIVE + case .prelight: + return GTK_RC_TOKEN_PRELIGHT + case .selected: + return GTK_RC_TOKEN_SELECTED + case .insensitive: + return GTK_RC_TOKEN_INSENSITIVE + case .fg: + return GTK_RC_TOKEN_FG + case .bg: + return GTK_RC_TOKEN_BG + case .text: + return GTK_RC_TOKEN_TEXT + case .base: + return GTK_RC_TOKEN_BASE + case .xthickness: + return GTK_RC_TOKEN_XTHICKNESS + case .ythickness: + return GTK_RC_TOKEN_YTHICKNESS + case .font: + return GTK_RC_TOKEN_FONT + case .fontset: + return GTK_RC_TOKEN_FONTSET + case .fontName: + return GTK_RC_TOKEN_FONT_NAME + case .bgPixmap: + return GTK_RC_TOKEN_BG_PIXMAP + case .pixmapPath: + return GTK_RC_TOKEN_PIXMAP_PATH + case .style: + return GTK_RC_TOKEN_STYLE + case .binding: + return GTK_RC_TOKEN_BINDING + case .bind: + return GTK_RC_TOKEN_BIND + case .widget: + return GTK_RC_TOKEN_WIDGET + case .widgetClass: + return GTK_RC_TOKEN_WIDGET_CLASS + case .class_: + return GTK_RC_TOKEN_CLASS + case .lowest: + return GTK_RC_TOKEN_LOWEST + case .gtk: + return GTK_RC_TOKEN_GTK + case .application: + return GTK_RC_TOKEN_APPLICATION + case .theme: + return GTK_RC_TOKEN_THEME + case .rc: + return GTK_RC_TOKEN_RC + case .highest: + return GTK_RC_TOKEN_HIGHEST + case .engine: + return GTK_RC_TOKEN_ENGINE + case .modulePath: + return GTK_RC_TOKEN_MODULE_PATH + case .imModulePath: + return GTK_RC_TOKEN_IM_MODULE_PATH + case .imModuleFile: + return GTK_RC_TOKEN_IM_MODULE_FILE + case .stock: + return GTK_RC_TOKEN_STOCK + case .ltr: + return GTK_RC_TOKEN_LTR + case .rtl: + return GTK_RC_TOKEN_RTL + case .color: + return GTK_RC_TOKEN_COLOR + case .unbind: + return GTK_RC_TOKEN_UNBIND + case .last: + return GTK_RC_TOKEN_LAST } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/RecentChooser.swift b/Sources/Gtk3/Generated/RecentChooser.swift index f869ec0de9..c75b23fae0 100644 --- a/Sources/Gtk3/Generated/RecentChooser.swift +++ b/Sources/Gtk3/Generated/RecentChooser.swift @@ -4,21 +4,21 @@ import CGtk3 /// displaying the list of recently used files. In GTK+, the main objects /// that implement this interface are #GtkRecentChooserWidget, /// #GtkRecentChooserDialog and #GtkRecentChooserMenu. -/// +/// /// Recently used files are supported since GTK+ 2.10. public protocol RecentChooser: GObjectRepresentable { - -var showPrivate: Bool { get set } + + var showPrivate: Bool { get set } /// This signal is emitted when the user "activates" a recent item -/// in the recent chooser. This can happen by double-clicking on an item -/// in the recently used resources list, or by pressing -/// `Enter`. -var itemActivated: ((Self) -> Void)? { get set } + /// in the recent chooser. This can happen by double-clicking on an item + /// in the recently used resources list, or by pressing + /// `Enter`. + var itemActivated: ((Self) -> Void)? { get set } -/// This signal is emitted when there is a change in the set of -/// selected recently used resources. This can happen when a user -/// modifies the selection with the mouse or the keyboard, or when -/// explicitly calling functions to change the selection. -var selectionChanged: ((Self) -> Void)? { get set } -} \ No newline at end of file + /// This signal is emitted when there is a change in the set of + /// selected recently used resources. This can happen when a user + /// modifies the selection with the mouse or the keyboard, or when + /// explicitly calling functions to change the selection. + var selectionChanged: ((Self) -> Void)? { get set } +} diff --git a/Sources/Gtk3/Generated/ReliefStyle.swift b/Sources/Gtk3/Generated/ReliefStyle.swift index b55dcc2aca..4949c0d1a0 100644 --- a/Sources/Gtk3/Generated/ReliefStyle.swift +++ b/Sources/Gtk3/Generated/ReliefStyle.swift @@ -5,24 +5,24 @@ public enum ReliefStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkReliefStyle /// Draw a normal relief. -case normal -/// A half relief. Deprecated in 3.14, does the same as @GTK_RELIEF_NORMAL -case half -/// No relief. -case none + case normal + /// A half relief. Deprecated in 3.14, does the same as @GTK_RELIEF_NORMAL + case half + /// No relief. + case none public static var type: GType { - gtk_relief_style_get_type() -} + gtk_relief_style_get_type() + } public init(from gtkEnum: GtkReliefStyle) { switch gtkEnum { case GTK_RELIEF_NORMAL: - self = .normal -case GTK_RELIEF_HALF: - self = .half -case GTK_RELIEF_NONE: - self = .none + self = .normal + case GTK_RELIEF_HALF: + self = .half + case GTK_RELIEF_NONE: + self = .none default: fatalError("Unsupported GtkReliefStyle enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ case GTK_RELIEF_NONE: public func toGtk() -> GtkReliefStyle { switch self { case .normal: - return GTK_RELIEF_NORMAL -case .half: - return GTK_RELIEF_HALF -case .none: - return GTK_RELIEF_NONE + return GTK_RELIEF_NORMAL + case .half: + return GTK_RELIEF_HALF + case .none: + return GTK_RELIEF_NONE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/ResizeMode.swift b/Sources/Gtk3/Generated/ResizeMode.swift index 689e77f609..ef35892b87 100644 --- a/Sources/Gtk3/Generated/ResizeMode.swift +++ b/Sources/Gtk3/Generated/ResizeMode.swift @@ -1,28 +1,27 @@ import CGtk3 - public enum ResizeMode: GValueRepresentableEnum { public typealias GtkEnum = GtkResizeMode /// Pass resize request to the parent -case parent -/// Queue resizes on this widget -case queue -/// Resize immediately. Deprecated. -case immediate + case parent + /// Queue resizes on this widget + case queue + /// Resize immediately. Deprecated. + case immediate public static var type: GType { - gtk_resize_mode_get_type() -} + gtk_resize_mode_get_type() + } public init(from gtkEnum: GtkResizeMode) { switch gtkEnum { case GTK_RESIZE_PARENT: - self = .parent -case GTK_RESIZE_QUEUE: - self = .queue -case GTK_RESIZE_IMMEDIATE: - self = .immediate + self = .parent + case GTK_RESIZE_QUEUE: + self = .queue + case GTK_RESIZE_IMMEDIATE: + self = .immediate default: fatalError("Unsupported GtkResizeMode enum value: \(gtkEnum.rawValue)") } @@ -31,11 +30,11 @@ case GTK_RESIZE_IMMEDIATE: public func toGtk() -> GtkResizeMode { switch self { case .parent: - return GTK_RESIZE_PARENT -case .queue: - return GTK_RESIZE_QUEUE -case .immediate: - return GTK_RESIZE_IMMEDIATE + return GTK_RESIZE_PARENT + case .queue: + return GTK_RESIZE_QUEUE + case .immediate: + return GTK_RESIZE_IMMEDIATE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/ResponseType.swift b/Sources/Gtk3/Generated/ResponseType.swift index 73389bb527..5db0b51336 100644 --- a/Sources/Gtk3/Generated/ResponseType.swift +++ b/Sources/Gtk3/Generated/ResponseType.swift @@ -7,57 +7,57 @@ public enum ResponseType: GValueRepresentableEnum { public typealias GtkEnum = GtkResponseType /// Returned if an action widget has no response id, -/// or if the dialog gets programmatically hidden or destroyed -case none -/// Generic response id, not used by GTK+ dialogs -case reject -/// Generic response id, not used by GTK+ dialogs -case accept -/// Returned if the dialog is deleted -case deleteEvent -/// Returned by OK buttons in GTK+ dialogs -case ok -/// Returned by Cancel buttons in GTK+ dialogs -case cancel -/// Returned by Close buttons in GTK+ dialogs -case close -/// Returned by Yes buttons in GTK+ dialogs -case yes -/// Returned by No buttons in GTK+ dialogs -case no -/// Returned by Apply buttons in GTK+ dialogs -case apply -/// Returned by Help buttons in GTK+ dialogs -case help + /// or if the dialog gets programmatically hidden or destroyed + case none + /// Generic response id, not used by GTK+ dialogs + case reject + /// Generic response id, not used by GTK+ dialogs + case accept + /// Returned if the dialog is deleted + case deleteEvent + /// Returned by OK buttons in GTK+ dialogs + case ok + /// Returned by Cancel buttons in GTK+ dialogs + case cancel + /// Returned by Close buttons in GTK+ dialogs + case close + /// Returned by Yes buttons in GTK+ dialogs + case yes + /// Returned by No buttons in GTK+ dialogs + case no + /// Returned by Apply buttons in GTK+ dialogs + case apply + /// Returned by Help buttons in GTK+ dialogs + case help public static var type: GType { - gtk_response_type_get_type() -} + gtk_response_type_get_type() + } public init(from gtkEnum: GtkResponseType) { switch gtkEnum { case GTK_RESPONSE_NONE: - self = .none -case GTK_RESPONSE_REJECT: - self = .reject -case GTK_RESPONSE_ACCEPT: - self = .accept -case GTK_RESPONSE_DELETE_EVENT: - self = .deleteEvent -case GTK_RESPONSE_OK: - self = .ok -case GTK_RESPONSE_CANCEL: - self = .cancel -case GTK_RESPONSE_CLOSE: - self = .close -case GTK_RESPONSE_YES: - self = .yes -case GTK_RESPONSE_NO: - self = .no -case GTK_RESPONSE_APPLY: - self = .apply -case GTK_RESPONSE_HELP: - self = .help + self = .none + case GTK_RESPONSE_REJECT: + self = .reject + case GTK_RESPONSE_ACCEPT: + self = .accept + case GTK_RESPONSE_DELETE_EVENT: + self = .deleteEvent + case GTK_RESPONSE_OK: + self = .ok + case GTK_RESPONSE_CANCEL: + self = .cancel + case GTK_RESPONSE_CLOSE: + self = .close + case GTK_RESPONSE_YES: + self = .yes + case GTK_RESPONSE_NO: + self = .no + case GTK_RESPONSE_APPLY: + self = .apply + case GTK_RESPONSE_HELP: + self = .help default: fatalError("Unsupported GtkResponseType enum value: \(gtkEnum.rawValue)") } @@ -66,27 +66,27 @@ case GTK_RESPONSE_HELP: public func toGtk() -> GtkResponseType { switch self { case .none: - return GTK_RESPONSE_NONE -case .reject: - return GTK_RESPONSE_REJECT -case .accept: - return GTK_RESPONSE_ACCEPT -case .deleteEvent: - return GTK_RESPONSE_DELETE_EVENT -case .ok: - return GTK_RESPONSE_OK -case .cancel: - return GTK_RESPONSE_CANCEL -case .close: - return GTK_RESPONSE_CLOSE -case .yes: - return GTK_RESPONSE_YES -case .no: - return GTK_RESPONSE_NO -case .apply: - return GTK_RESPONSE_APPLY -case .help: - return GTK_RESPONSE_HELP + return GTK_RESPONSE_NONE + case .reject: + return GTK_RESPONSE_REJECT + case .accept: + return GTK_RESPONSE_ACCEPT + case .deleteEvent: + return GTK_RESPONSE_DELETE_EVENT + case .ok: + return GTK_RESPONSE_OK + case .cancel: + return GTK_RESPONSE_CANCEL + case .close: + return GTK_RESPONSE_CLOSE + case .yes: + return GTK_RESPONSE_YES + case .no: + return GTK_RESPONSE_NO + case .apply: + return GTK_RESPONSE_APPLY + case .help: + return GTK_RESPONSE_HELP } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/RevealerTransitionType.swift b/Sources/Gtk3/Generated/RevealerTransitionType.swift index c6177e2bb4..beabd123fb 100644 --- a/Sources/Gtk3/Generated/RevealerTransitionType.swift +++ b/Sources/Gtk3/Generated/RevealerTransitionType.swift @@ -6,36 +6,36 @@ public enum RevealerTransitionType: GValueRepresentableEnum { public typealias GtkEnum = GtkRevealerTransitionType /// No transition -case none -/// Fade in -case crossfade -/// Slide in from the left -case slideRight -/// Slide in from the right -case slideLeft -/// Slide in from the bottom -case slideUp -/// Slide in from the top -case slideDown + case none + /// Fade in + case crossfade + /// Slide in from the left + case slideRight + /// Slide in from the right + case slideLeft + /// Slide in from the bottom + case slideUp + /// Slide in from the top + case slideDown public static var type: GType { - gtk_revealer_transition_type_get_type() -} + gtk_revealer_transition_type_get_type() + } public init(from gtkEnum: GtkRevealerTransitionType) { switch gtkEnum { case GTK_REVEALER_TRANSITION_TYPE_NONE: - self = .none -case GTK_REVEALER_TRANSITION_TYPE_CROSSFADE: - self = .crossfade -case GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT: - self = .slideRight -case GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT: - self = .slideLeft -case GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP: - self = .slideUp -case GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN: - self = .slideDown + self = .none + case GTK_REVEALER_TRANSITION_TYPE_CROSSFADE: + self = .crossfade + case GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT: + self = .slideRight + case GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT: + self = .slideLeft + case GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP: + self = .slideUp + case GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN: + self = .slideDown default: fatalError("Unsupported GtkRevealerTransitionType enum value: \(gtkEnum.rawValue)") } @@ -44,17 +44,17 @@ case GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN: public func toGtk() -> GtkRevealerTransitionType { switch self { case .none: - return GTK_REVEALER_TRANSITION_TYPE_NONE -case .crossfade: - return GTK_REVEALER_TRANSITION_TYPE_CROSSFADE -case .slideRight: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT -case .slideLeft: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT -case .slideUp: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP -case .slideDown: - return GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN + return GTK_REVEALER_TRANSITION_TYPE_NONE + case .crossfade: + return GTK_REVEALER_TRANSITION_TYPE_CROSSFADE + case .slideRight: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT + case .slideLeft: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT + case .slideUp: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP + case .slideDown: + return GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/Scale.swift b/Sources/Gtk3/Generated/Scale.swift index 4ca52e5470..b6970ca14b 100644 --- a/Sources/Gtk3/Generated/Scale.swift +++ b/Sources/Gtk3/Generated/Scale.swift @@ -6,23 +6,23 @@ import CGtk3 /// To set the value of a scale, you would normally use gtk_range_set_value(). /// To detect changes to the value, you would normally use the /// #GtkRange::value-changed signal. -/// +/// /// Note that using the same upper and lower bounds for the #GtkScale (through /// the #GtkRange methods) will hide the slider itself. This is useful for /// applications that want to show an undeterminate value on the scale, without /// changing the layout of the application (such as movie or music players). -/// +/// /// # GtkScale as GtkBuildable -/// +/// /// GtkScale supports a custom `` element, which can contain multiple /// `` elements. The “value” and “position” attributes have the same /// meaning as gtk_scale_add_mark() parameters of the same name. If the /// element is not empty, its content is taken as the markup to show at /// the mark. It can be translated with the usual ”translatable” and /// “context” attributes. -/// +/// /// # CSS nodes -/// +/// /// |[ /// scale[.fine-tune][.marks-before][.marks-after] /// ├── marks.top @@ -43,123 +43,127 @@ import CGtk3 /// ┊ ╰── [label] /// ╰── mark /// ]| -/// +/// /// GtkScale has a main CSS node with name scale and a subnode for its contents, /// with subnodes named trough and slider. -/// +/// /// The main node gets the style class .fine-tune added when the scale is in /// 'fine-tuning' mode. -/// +/// /// If the scale has an origin (see gtk_scale_set_has_origin()), there is a /// subnode with name highlight below the trough node that is used for rendering /// the highlighted part of the trough. -/// +/// /// If the scale is showing a fill level (see gtk_range_set_show_fill_level()), /// there is a subnode with name fill below the trough node that is used for /// rendering the filled in part of the trough. -/// +/// /// If marks are present, there is a marks subnode before or after the contents /// node, below which each mark gets a node with name mark. The marks nodes get /// either the .top or .bottom style class. -/// +/// /// The mark node has a subnode named indicator. If the mark has text, it also /// has a subnode named label. When the mark is either above or left of the /// scale, the label subnode is the first when present. Otherwise, the indicator /// subnode is the first. -/// +/// /// The main CSS node gets the 'marks-before' and/or 'marks-after' style classes /// added depending on what marks are present. -/// +/// /// If the scale is displaying the value (see #GtkScale:draw-value), there is /// subnode with name value. open class Scale: Range { /// Creates a new #GtkScale. -public convenience init(orientation: GtkOrientation, adjustment: UnsafeMutablePointer!) { - self.init( - gtk_scale_new(orientation, adjustment) - ) -} - -/// Creates a new scale widget with the given orientation that lets the -/// user input a number between @min and @max (including @min and @max) -/// with the increment @step. @step must be nonzero; it’s the distance -/// the slider moves when using the arrow keys to adjust the scale -/// value. -/// -/// Note that the way in which the precision is derived works best if @step -/// is a power of ten. If the resulting precision is not suitable for your -/// needs, use gtk_scale_set_digits() to correct it. -public convenience init(range orientation: GtkOrientation, min: Double, max: Double, step: Double) { - self.init( - gtk_scale_new_with_range(orientation, min, max, step) - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::digits", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDigits?(self, param0) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init( + orientation: GtkOrientation, adjustment: UnsafeMutablePointer! + ) { + self.init( + gtk_scale_new(orientation, adjustment) + ) } -addSignal(name: "notify::draw-value", handler: gCallback(handler1)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyDrawValue?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + /// Creates a new scale widget with the given orientation that lets the + /// user input a number between @min and @max (including @min and @max) + /// with the increment @step. @step must be nonzero; it’s the distance + /// the slider moves when using the arrow keys to adjust the scale + /// value. + /// + /// Note that the way in which the precision is derived works best if @step + /// is a power of ten. If the resulting precision is not suitable for your + /// needs, use gtk_scale_set_digits() to correct it. + public convenience init( + range orientation: GtkOrientation, min: Double, max: Double, step: Double + ) { + self.init( + gtk_scale_new_with_range(orientation, min, max, step) + ) } -addSignal(name: "notify::has-origin", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyHasOrigin?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::digits", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDigits?(self, param0) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::draw-value", handler: gCallback(handler1)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyDrawValue?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::has-origin", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyHasOrigin?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::value-pos", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyValuePos?(self, param0) + } } -addSignal(name: "notify::value-pos", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyValuePos?(self, param0) -} -} - - -@GObjectProperty(named: "digits") public var digits: Int - - -@GObjectProperty(named: "draw-value") public var drawValue: Bool + @GObjectProperty(named: "digits") public var digits: Int + @GObjectProperty(named: "draw-value") public var drawValue: Bool -@GObjectProperty(named: "has-origin") public var hasOrigin: Bool + @GObjectProperty(named: "has-origin") public var hasOrigin: Bool + @GObjectProperty(named: "value-pos") public var valuePos: PositionType -@GObjectProperty(named: "value-pos") public var valuePos: PositionType + public var notifyDigits: ((Scale, OpaquePointer) -> Void)? + public var notifyDrawValue: ((Scale, OpaquePointer) -> Void)? -public var notifyDigits: ((Scale, OpaquePointer) -> Void)? + public var notifyHasOrigin: ((Scale, OpaquePointer) -> Void)? - -public var notifyDrawValue: ((Scale, OpaquePointer) -> Void)? - - -public var notifyHasOrigin: ((Scale, OpaquePointer) -> Void)? - - -public var notifyValuePos: ((Scale, OpaquePointer) -> Void)? -} \ No newline at end of file + public var notifyValuePos: ((Scale, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk3/Generated/ScrollStep.swift b/Sources/Gtk3/Generated/ScrollStep.swift index f6216a60cb..be495a07c8 100644 --- a/Sources/Gtk3/Generated/ScrollStep.swift +++ b/Sources/Gtk3/Generated/ScrollStep.swift @@ -1,40 +1,39 @@ import CGtk3 - public enum ScrollStep: GValueRepresentableEnum { public typealias GtkEnum = GtkScrollStep /// Scroll in steps. -case steps -/// Scroll by pages. -case pages -/// Scroll to ends. -case ends -/// Scroll in horizontal steps. -case horizontalSteps -/// Scroll by horizontal pages. -case horizontalPages -/// Scroll to the horizontal ends. -case horizontalEnds + case steps + /// Scroll by pages. + case pages + /// Scroll to ends. + case ends + /// Scroll in horizontal steps. + case horizontalSteps + /// Scroll by horizontal pages. + case horizontalPages + /// Scroll to the horizontal ends. + case horizontalEnds public static var type: GType { - gtk_scroll_step_get_type() -} + gtk_scroll_step_get_type() + } public init(from gtkEnum: GtkScrollStep) { switch gtkEnum { case GTK_SCROLL_STEPS: - self = .steps -case GTK_SCROLL_PAGES: - self = .pages -case GTK_SCROLL_ENDS: - self = .ends -case GTK_SCROLL_HORIZONTAL_STEPS: - self = .horizontalSteps -case GTK_SCROLL_HORIZONTAL_PAGES: - self = .horizontalPages -case GTK_SCROLL_HORIZONTAL_ENDS: - self = .horizontalEnds + self = .steps + case GTK_SCROLL_PAGES: + self = .pages + case GTK_SCROLL_ENDS: + self = .ends + case GTK_SCROLL_HORIZONTAL_STEPS: + self = .horizontalSteps + case GTK_SCROLL_HORIZONTAL_PAGES: + self = .horizontalPages + case GTK_SCROLL_HORIZONTAL_ENDS: + self = .horizontalEnds default: fatalError("Unsupported GtkScrollStep enum value: \(gtkEnum.rawValue)") } @@ -43,17 +42,17 @@ case GTK_SCROLL_HORIZONTAL_ENDS: public func toGtk() -> GtkScrollStep { switch self { case .steps: - return GTK_SCROLL_STEPS -case .pages: - return GTK_SCROLL_PAGES -case .ends: - return GTK_SCROLL_ENDS -case .horizontalSteps: - return GTK_SCROLL_HORIZONTAL_STEPS -case .horizontalPages: - return GTK_SCROLL_HORIZONTAL_PAGES -case .horizontalEnds: - return GTK_SCROLL_HORIZONTAL_ENDS + return GTK_SCROLL_STEPS + case .pages: + return GTK_SCROLL_PAGES + case .ends: + return GTK_SCROLL_ENDS + case .horizontalSteps: + return GTK_SCROLL_HORIZONTAL_STEPS + case .horizontalPages: + return GTK_SCROLL_HORIZONTAL_PAGES + case .horizontalEnds: + return GTK_SCROLL_HORIZONTAL_ENDS } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/ScrollType.swift b/Sources/Gtk3/Generated/ScrollType.swift index 412ab0685e..94e7335be2 100644 --- a/Sources/Gtk3/Generated/ScrollType.swift +++ b/Sources/Gtk3/Generated/ScrollType.swift @@ -5,76 +5,76 @@ public enum ScrollType: GValueRepresentableEnum { public typealias GtkEnum = GtkScrollType /// No scrolling. -case none -/// Jump to new location. -case jump -/// Step backward. -case stepBackward -/// Step forward. -case stepForward -/// Page backward. -case pageBackward -/// Page forward. -case pageForward -/// Step up. -case stepUp -/// Step down. -case stepDown -/// Page up. -case pageUp -/// Page down. -case pageDown -/// Step to the left. -case stepLeft -/// Step to the right. -case stepRight -/// Page to the left. -case pageLeft -/// Page to the right. -case pageRight -/// Scroll to start. -case start -/// Scroll to end. -case end + case none + /// Jump to new location. + case jump + /// Step backward. + case stepBackward + /// Step forward. + case stepForward + /// Page backward. + case pageBackward + /// Page forward. + case pageForward + /// Step up. + case stepUp + /// Step down. + case stepDown + /// Page up. + case pageUp + /// Page down. + case pageDown + /// Step to the left. + case stepLeft + /// Step to the right. + case stepRight + /// Page to the left. + case pageLeft + /// Page to the right. + case pageRight + /// Scroll to start. + case start + /// Scroll to end. + case end public static var type: GType { - gtk_scroll_type_get_type() -} + gtk_scroll_type_get_type() + } public init(from gtkEnum: GtkScrollType) { switch gtkEnum { case GTK_SCROLL_NONE: - self = .none -case GTK_SCROLL_JUMP: - self = .jump -case GTK_SCROLL_STEP_BACKWARD: - self = .stepBackward -case GTK_SCROLL_STEP_FORWARD: - self = .stepForward -case GTK_SCROLL_PAGE_BACKWARD: - self = .pageBackward -case GTK_SCROLL_PAGE_FORWARD: - self = .pageForward -case GTK_SCROLL_STEP_UP: - self = .stepUp -case GTK_SCROLL_STEP_DOWN: - self = .stepDown -case GTK_SCROLL_PAGE_UP: - self = .pageUp -case GTK_SCROLL_PAGE_DOWN: - self = .pageDown -case GTK_SCROLL_STEP_LEFT: - self = .stepLeft -case GTK_SCROLL_STEP_RIGHT: - self = .stepRight -case GTK_SCROLL_PAGE_LEFT: - self = .pageLeft -case GTK_SCROLL_PAGE_RIGHT: - self = .pageRight -case GTK_SCROLL_START: - self = .start -case GTK_SCROLL_END: - self = .end + self = .none + case GTK_SCROLL_JUMP: + self = .jump + case GTK_SCROLL_STEP_BACKWARD: + self = .stepBackward + case GTK_SCROLL_STEP_FORWARD: + self = .stepForward + case GTK_SCROLL_PAGE_BACKWARD: + self = .pageBackward + case GTK_SCROLL_PAGE_FORWARD: + self = .pageForward + case GTK_SCROLL_STEP_UP: + self = .stepUp + case GTK_SCROLL_STEP_DOWN: + self = .stepDown + case GTK_SCROLL_PAGE_UP: + self = .pageUp + case GTK_SCROLL_PAGE_DOWN: + self = .pageDown + case GTK_SCROLL_STEP_LEFT: + self = .stepLeft + case GTK_SCROLL_STEP_RIGHT: + self = .stepRight + case GTK_SCROLL_PAGE_LEFT: + self = .pageLeft + case GTK_SCROLL_PAGE_RIGHT: + self = .pageRight + case GTK_SCROLL_START: + self = .start + case GTK_SCROLL_END: + self = .end default: fatalError("Unsupported GtkScrollType enum value: \(gtkEnum.rawValue)") } @@ -83,37 +83,37 @@ case GTK_SCROLL_END: public func toGtk() -> GtkScrollType { switch self { case .none: - return GTK_SCROLL_NONE -case .jump: - return GTK_SCROLL_JUMP -case .stepBackward: - return GTK_SCROLL_STEP_BACKWARD -case .stepForward: - return GTK_SCROLL_STEP_FORWARD -case .pageBackward: - return GTK_SCROLL_PAGE_BACKWARD -case .pageForward: - return GTK_SCROLL_PAGE_FORWARD -case .stepUp: - return GTK_SCROLL_STEP_UP -case .stepDown: - return GTK_SCROLL_STEP_DOWN -case .pageUp: - return GTK_SCROLL_PAGE_UP -case .pageDown: - return GTK_SCROLL_PAGE_DOWN -case .stepLeft: - return GTK_SCROLL_STEP_LEFT -case .stepRight: - return GTK_SCROLL_STEP_RIGHT -case .pageLeft: - return GTK_SCROLL_PAGE_LEFT -case .pageRight: - return GTK_SCROLL_PAGE_RIGHT -case .start: - return GTK_SCROLL_START -case .end: - return GTK_SCROLL_END + return GTK_SCROLL_NONE + case .jump: + return GTK_SCROLL_JUMP + case .stepBackward: + return GTK_SCROLL_STEP_BACKWARD + case .stepForward: + return GTK_SCROLL_STEP_FORWARD + case .pageBackward: + return GTK_SCROLL_PAGE_BACKWARD + case .pageForward: + return GTK_SCROLL_PAGE_FORWARD + case .stepUp: + return GTK_SCROLL_STEP_UP + case .stepDown: + return GTK_SCROLL_STEP_DOWN + case .pageUp: + return GTK_SCROLL_PAGE_UP + case .pageDown: + return GTK_SCROLL_PAGE_DOWN + case .stepLeft: + return GTK_SCROLL_STEP_LEFT + case .stepRight: + return GTK_SCROLL_STEP_RIGHT + case .pageLeft: + return GTK_SCROLL_PAGE_LEFT + case .pageRight: + return GTK_SCROLL_PAGE_RIGHT + case .start: + return GTK_SCROLL_START + case .end: + return GTK_SCROLL_END } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/Scrollable.swift b/Sources/Gtk3/Generated/Scrollable.swift index 8f932fb53e..eafd72323f 100644 --- a/Sources/Gtk3/Generated/Scrollable.swift +++ b/Sources/Gtk3/Generated/Scrollable.swift @@ -2,33 +2,31 @@ import CGtk3 /// #GtkScrollable is an interface that is implemented by widgets with native /// scrolling ability. -/// +/// /// To implement this interface you should override the /// #GtkScrollable:hadjustment and #GtkScrollable:vadjustment properties. -/// +/// /// ## Creating a scrollable widget -/// +/// /// All scrollable widgets should do the following. -/// +/// /// - When a parent widget sets the scrollable child widget’s adjustments, /// the widget should populate the adjustments’ /// #GtkAdjustment:lower, #GtkAdjustment:upper, /// #GtkAdjustment:step-increment, #GtkAdjustment:page-increment and /// #GtkAdjustment:page-size properties and connect to the /// #GtkAdjustment::value-changed signal. -/// +/// /// - Because its preferred size is the size for a fully expanded widget, /// the scrollable widget must be able to cope with underallocations. /// This means that it must accept any value passed to its /// #GtkWidgetClass.size_allocate() function. -/// +/// /// - When the parent allocates space to the scrollable child widget, /// the widget should update the adjustments’ properties with new values. -/// +/// /// - When any of the adjustments emits the #GtkAdjustment::value-changed signal, /// the scrollable widget should scroll its contents. public protocol Scrollable: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/ScrollablePolicy.swift b/Sources/Gtk3/Generated/ScrollablePolicy.swift index f8cade5c6a..4d1678a0cb 100644 --- a/Sources/Gtk3/Generated/ScrollablePolicy.swift +++ b/Sources/Gtk3/Generated/ScrollablePolicy.swift @@ -6,20 +6,20 @@ public enum ScrollablePolicy: GValueRepresentableEnum { public typealias GtkEnum = GtkScrollablePolicy /// Scrollable adjustments are based on the minimum size -case minimum -/// Scrollable adjustments are based on the natural size -case natural + case minimum + /// Scrollable adjustments are based on the natural size + case natural public static var type: GType { - gtk_scrollable_policy_get_type() -} + gtk_scrollable_policy_get_type() + } public init(from gtkEnum: GtkScrollablePolicy) { switch gtkEnum { case GTK_SCROLL_MINIMUM: - self = .minimum -case GTK_SCROLL_NATURAL: - self = .natural + self = .minimum + case GTK_SCROLL_NATURAL: + self = .natural default: fatalError("Unsupported GtkScrollablePolicy enum value: \(gtkEnum.rawValue)") } @@ -28,9 +28,9 @@ case GTK_SCROLL_NATURAL: public func toGtk() -> GtkScrollablePolicy { switch self { case .minimum: - return GTK_SCROLL_MINIMUM -case .natural: - return GTK_SCROLL_NATURAL + return GTK_SCROLL_MINIMUM + case .natural: + return GTK_SCROLL_NATURAL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/SelectionMode.swift b/Sources/Gtk3/Generated/SelectionMode.swift index fb0a15ff67..6dda666993 100644 --- a/Sources/Gtk3/Generated/SelectionMode.swift +++ b/Sources/Gtk3/Generated/SelectionMode.swift @@ -5,36 +5,36 @@ public enum SelectionMode: GValueRepresentableEnum { public typealias GtkEnum = GtkSelectionMode /// No selection is possible. -case none -/// Zero or one element may be selected. -case single -/// Exactly one element is selected. -/// In some circumstances, such as initially or during a search -/// operation, it’s possible for no element to be selected with -/// %GTK_SELECTION_BROWSE. What is really enforced is that the user -/// can’t deselect a currently selected element except by selecting -/// another element. -case browse -/// Any number of elements may be selected. -/// The Ctrl key may be used to enlarge the selection, and Shift -/// key to select between the focus and the child pointed to. -/// Some widgets may also allow Click-drag to select a range of elements. -case multiple + case none + /// Zero or one element may be selected. + case single + /// Exactly one element is selected. + /// In some circumstances, such as initially or during a search + /// operation, it’s possible for no element to be selected with + /// %GTK_SELECTION_BROWSE. What is really enforced is that the user + /// can’t deselect a currently selected element except by selecting + /// another element. + case browse + /// Any number of elements may be selected. + /// The Ctrl key may be used to enlarge the selection, and Shift + /// key to select between the focus and the child pointed to. + /// Some widgets may also allow Click-drag to select a range of elements. + case multiple public static var type: GType { - gtk_selection_mode_get_type() -} + gtk_selection_mode_get_type() + } public init(from gtkEnum: GtkSelectionMode) { switch gtkEnum { case GTK_SELECTION_NONE: - self = .none -case GTK_SELECTION_SINGLE: - self = .single -case GTK_SELECTION_BROWSE: - self = .browse -case GTK_SELECTION_MULTIPLE: - self = .multiple + self = .none + case GTK_SELECTION_SINGLE: + self = .single + case GTK_SELECTION_BROWSE: + self = .browse + case GTK_SELECTION_MULTIPLE: + self = .multiple default: fatalError("Unsupported GtkSelectionMode enum value: \(gtkEnum.rawValue)") } @@ -43,13 +43,13 @@ case GTK_SELECTION_MULTIPLE: public func toGtk() -> GtkSelectionMode { switch self { case .none: - return GTK_SELECTION_NONE -case .single: - return GTK_SELECTION_SINGLE -case .browse: - return GTK_SELECTION_BROWSE -case .multiple: - return GTK_SELECTION_MULTIPLE + return GTK_SELECTION_NONE + case .single: + return GTK_SELECTION_SINGLE + case .browse: + return GTK_SELECTION_BROWSE + case .multiple: + return GTK_SELECTION_MULTIPLE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/SensitivityType.swift b/Sources/Gtk3/Generated/SensitivityType.swift index c06750c9fb..c4a6714063 100644 --- a/Sources/Gtk3/Generated/SensitivityType.swift +++ b/Sources/Gtk3/Generated/SensitivityType.swift @@ -6,25 +6,25 @@ public enum SensitivityType: GValueRepresentableEnum { public typealias GtkEnum = GtkSensitivityType /// The arrow is made insensitive if the -/// thumb is at the end -case auto -/// The arrow is always sensitive -case on -/// The arrow is always insensitive -case off + /// thumb is at the end + case auto + /// The arrow is always sensitive + case on + /// The arrow is always insensitive + case off public static var type: GType { - gtk_sensitivity_type_get_type() -} + gtk_sensitivity_type_get_type() + } public init(from gtkEnum: GtkSensitivityType) { switch gtkEnum { case GTK_SENSITIVITY_AUTO: - self = .auto -case GTK_SENSITIVITY_ON: - self = .on -case GTK_SENSITIVITY_OFF: - self = .off + self = .auto + case GTK_SENSITIVITY_ON: + self = .on + case GTK_SENSITIVITY_OFF: + self = .off default: fatalError("Unsupported GtkSensitivityType enum value: \(gtkEnum.rawValue)") } @@ -33,11 +33,11 @@ case GTK_SENSITIVITY_OFF: public func toGtk() -> GtkSensitivityType { switch self { case .auto: - return GTK_SENSITIVITY_AUTO -case .on: - return GTK_SENSITIVITY_ON -case .off: - return GTK_SENSITIVITY_OFF + return GTK_SENSITIVITY_AUTO + case .on: + return GTK_SENSITIVITY_ON + case .off: + return GTK_SENSITIVITY_OFF } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/ShadowType.swift b/Sources/Gtk3/Generated/ShadowType.swift index 708a3a99b0..309bdc77b6 100644 --- a/Sources/Gtk3/Generated/ShadowType.swift +++ b/Sources/Gtk3/Generated/ShadowType.swift @@ -1,7 +1,7 @@ import CGtk3 /// Used to change the appearance of an outline typically provided by a #GtkFrame. -/// +/// /// Note that many themes do not differentiate the appearance of the /// various shadow types: Either their is no visible shadow (@GTK_SHADOW_NONE), /// or there is (any other value). @@ -9,32 +9,32 @@ public enum ShadowType: GValueRepresentableEnum { public typealias GtkEnum = GtkShadowType /// No outline. -case none -/// The outline is bevelled inwards. -case in_ -/// The outline is bevelled outwards like a button. -case out -/// The outline has a sunken 3d appearance. -case etchedIn -/// The outline has a raised 3d appearance. -case etchedOut + case none + /// The outline is bevelled inwards. + case in_ + /// The outline is bevelled outwards like a button. + case out + /// The outline has a sunken 3d appearance. + case etchedIn + /// The outline has a raised 3d appearance. + case etchedOut public static var type: GType { - gtk_shadow_type_get_type() -} + gtk_shadow_type_get_type() + } public init(from gtkEnum: GtkShadowType) { switch gtkEnum { case GTK_SHADOW_NONE: - self = .none -case GTK_SHADOW_IN: - self = .in_ -case GTK_SHADOW_OUT: - self = .out -case GTK_SHADOW_ETCHED_IN: - self = .etchedIn -case GTK_SHADOW_ETCHED_OUT: - self = .etchedOut + self = .none + case GTK_SHADOW_IN: + self = .in_ + case GTK_SHADOW_OUT: + self = .out + case GTK_SHADOW_ETCHED_IN: + self = .etchedIn + case GTK_SHADOW_ETCHED_OUT: + self = .etchedOut default: fatalError("Unsupported GtkShadowType enum value: \(gtkEnum.rawValue)") } @@ -43,15 +43,15 @@ case GTK_SHADOW_ETCHED_OUT: public func toGtk() -> GtkShadowType { switch self { case .none: - return GTK_SHADOW_NONE -case .in_: - return GTK_SHADOW_IN -case .out: - return GTK_SHADOW_OUT -case .etchedIn: - return GTK_SHADOW_ETCHED_IN -case .etchedOut: - return GTK_SHADOW_ETCHED_OUT + return GTK_SHADOW_NONE + case .in_: + return GTK_SHADOW_IN + case .out: + return GTK_SHADOW_OUT + case .etchedIn: + return GTK_SHADOW_ETCHED_IN + case .etchedOut: + return GTK_SHADOW_ETCHED_OUT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/SizeGroupMode.swift b/Sources/Gtk3/Generated/SizeGroupMode.swift index 86e8580877..7a61c99981 100644 --- a/Sources/Gtk3/Generated/SizeGroupMode.swift +++ b/Sources/Gtk3/Generated/SizeGroupMode.swift @@ -6,28 +6,28 @@ public enum SizeGroupMode: GValueRepresentableEnum { public typealias GtkEnum = GtkSizeGroupMode /// Group has no effect -case none -/// Group affects horizontal requisition -case horizontal -/// Group affects vertical requisition -case vertical -/// Group affects both horizontal and vertical requisition -case both + case none + /// Group affects horizontal requisition + case horizontal + /// Group affects vertical requisition + case vertical + /// Group affects both horizontal and vertical requisition + case both public static var type: GType { - gtk_size_group_mode_get_type() -} + gtk_size_group_mode_get_type() + } public init(from gtkEnum: GtkSizeGroupMode) { switch gtkEnum { case GTK_SIZE_GROUP_NONE: - self = .none -case GTK_SIZE_GROUP_HORIZONTAL: - self = .horizontal -case GTK_SIZE_GROUP_VERTICAL: - self = .vertical -case GTK_SIZE_GROUP_BOTH: - self = .both + self = .none + case GTK_SIZE_GROUP_HORIZONTAL: + self = .horizontal + case GTK_SIZE_GROUP_VERTICAL: + self = .vertical + case GTK_SIZE_GROUP_BOTH: + self = .both default: fatalError("Unsupported GtkSizeGroupMode enum value: \(gtkEnum.rawValue)") } @@ -36,13 +36,13 @@ case GTK_SIZE_GROUP_BOTH: public func toGtk() -> GtkSizeGroupMode { switch self { case .none: - return GTK_SIZE_GROUP_NONE -case .horizontal: - return GTK_SIZE_GROUP_HORIZONTAL -case .vertical: - return GTK_SIZE_GROUP_VERTICAL -case .both: - return GTK_SIZE_GROUP_BOTH + return GTK_SIZE_GROUP_NONE + case .horizontal: + return GTK_SIZE_GROUP_HORIZONTAL + case .vertical: + return GTK_SIZE_GROUP_VERTICAL + case .both: + return GTK_SIZE_GROUP_BOTH } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/SizeRequestMode.swift b/Sources/Gtk3/Generated/SizeRequestMode.swift index c8975faf7d..23b8567b54 100644 --- a/Sources/Gtk3/Generated/SizeRequestMode.swift +++ b/Sources/Gtk3/Generated/SizeRequestMode.swift @@ -6,24 +6,24 @@ public enum SizeRequestMode: GValueRepresentableEnum { public typealias GtkEnum = GtkSizeRequestMode /// Prefer height-for-width geometry management -case heightForWidth -/// Prefer width-for-height geometry management -case widthForHeight -/// Don’t trade height-for-width or width-for-height -case constantSize + case heightForWidth + /// Prefer width-for-height geometry management + case widthForHeight + /// Don’t trade height-for-width or width-for-height + case constantSize public static var type: GType { - gtk_size_request_mode_get_type() -} + gtk_size_request_mode_get_type() + } public init(from gtkEnum: GtkSizeRequestMode) { switch gtkEnum { case GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH: - self = .heightForWidth -case GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT: - self = .widthForHeight -case GTK_SIZE_REQUEST_CONSTANT_SIZE: - self = .constantSize + self = .heightForWidth + case GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT: + self = .widthForHeight + case GTK_SIZE_REQUEST_CONSTANT_SIZE: + self = .constantSize default: fatalError("Unsupported GtkSizeRequestMode enum value: \(gtkEnum.rawValue)") } @@ -32,11 +32,11 @@ case GTK_SIZE_REQUEST_CONSTANT_SIZE: public func toGtk() -> GtkSizeRequestMode { switch self { case .heightForWidth: - return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH -case .widthForHeight: - return GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT -case .constantSize: - return GTK_SIZE_REQUEST_CONSTANT_SIZE + return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH + case .widthForHeight: + return GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT + case .constantSize: + return GTK_SIZE_REQUEST_CONSTANT_SIZE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/SortType.swift b/Sources/Gtk3/Generated/SortType.swift index 3d5ab3098a..389f2f0f5f 100644 --- a/Sources/Gtk3/Generated/SortType.swift +++ b/Sources/Gtk3/Generated/SortType.swift @@ -5,20 +5,20 @@ public enum SortType: GValueRepresentableEnum { public typealias GtkEnum = GtkSortType /// Sorting is in ascending order. -case ascending -/// Sorting is in descending order. -case descending + case ascending + /// Sorting is in descending order. + case descending public static var type: GType { - gtk_sort_type_get_type() -} + gtk_sort_type_get_type() + } public init(from gtkEnum: GtkSortType) { switch gtkEnum { case GTK_SORT_ASCENDING: - self = .ascending -case GTK_SORT_DESCENDING: - self = .descending + self = .ascending + case GTK_SORT_DESCENDING: + self = .descending default: fatalError("Unsupported GtkSortType enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ case GTK_SORT_DESCENDING: public func toGtk() -> GtkSortType { switch self { case .ascending: - return GTK_SORT_ASCENDING -case .descending: - return GTK_SORT_DESCENDING + return GTK_SORT_ASCENDING + case .descending: + return GTK_SORT_DESCENDING } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/SpinButtonUpdatePolicy.swift b/Sources/Gtk3/Generated/SpinButtonUpdatePolicy.swift index 6e963931cc..5bb3220776 100644 --- a/Sources/Gtk3/Generated/SpinButtonUpdatePolicy.swift +++ b/Sources/Gtk3/Generated/SpinButtonUpdatePolicy.swift @@ -7,23 +7,23 @@ public enum SpinButtonUpdatePolicy: GValueRepresentableEnum { public typealias GtkEnum = GtkSpinButtonUpdatePolicy /// When refreshing your #GtkSpinButton, the value is -/// always displayed -case always -/// When refreshing your #GtkSpinButton, the value is -/// only displayed if it is valid within the bounds of the spin button's -/// adjustment -case ifValid + /// always displayed + case always + /// When refreshing your #GtkSpinButton, the value is + /// only displayed if it is valid within the bounds of the spin button's + /// adjustment + case ifValid public static var type: GType { - gtk_spin_button_update_policy_get_type() -} + gtk_spin_button_update_policy_get_type() + } public init(from gtkEnum: GtkSpinButtonUpdatePolicy) { switch gtkEnum { case GTK_UPDATE_ALWAYS: - self = .always -case GTK_UPDATE_IF_VALID: - self = .ifValid + self = .always + case GTK_UPDATE_IF_VALID: + self = .ifValid default: fatalError("Unsupported GtkSpinButtonUpdatePolicy enum value: \(gtkEnum.rawValue)") } @@ -32,9 +32,9 @@ case GTK_UPDATE_IF_VALID: public func toGtk() -> GtkSpinButtonUpdatePolicy { switch self { case .always: - return GTK_UPDATE_ALWAYS -case .ifValid: - return GTK_UPDATE_IF_VALID + return GTK_UPDATE_ALWAYS + case .ifValid: + return GTK_UPDATE_IF_VALID } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/SpinType.swift b/Sources/Gtk3/Generated/SpinType.swift index 248fa20410..076bd6ef5d 100644 --- a/Sources/Gtk3/Generated/SpinType.swift +++ b/Sources/Gtk3/Generated/SpinType.swift @@ -6,40 +6,40 @@ public enum SpinType: GValueRepresentableEnum { public typealias GtkEnum = GtkSpinType /// Increment by the adjustments step increment. -case stepForward -/// Decrement by the adjustments step increment. -case stepBackward -/// Increment by the adjustments page increment. -case pageForward -/// Decrement by the adjustments page increment. -case pageBackward -/// Go to the adjustments lower bound. -case home -/// Go to the adjustments upper bound. -case end -/// Change by a specified amount. -case userDefined + case stepForward + /// Decrement by the adjustments step increment. + case stepBackward + /// Increment by the adjustments page increment. + case pageForward + /// Decrement by the adjustments page increment. + case pageBackward + /// Go to the adjustments lower bound. + case home + /// Go to the adjustments upper bound. + case end + /// Change by a specified amount. + case userDefined public static var type: GType { - gtk_spin_type_get_type() -} + gtk_spin_type_get_type() + } public init(from gtkEnum: GtkSpinType) { switch gtkEnum { case GTK_SPIN_STEP_FORWARD: - self = .stepForward -case GTK_SPIN_STEP_BACKWARD: - self = .stepBackward -case GTK_SPIN_PAGE_FORWARD: - self = .pageForward -case GTK_SPIN_PAGE_BACKWARD: - self = .pageBackward -case GTK_SPIN_HOME: - self = .home -case GTK_SPIN_END: - self = .end -case GTK_SPIN_USER_DEFINED: - self = .userDefined + self = .stepForward + case GTK_SPIN_STEP_BACKWARD: + self = .stepBackward + case GTK_SPIN_PAGE_FORWARD: + self = .pageForward + case GTK_SPIN_PAGE_BACKWARD: + self = .pageBackward + case GTK_SPIN_HOME: + self = .home + case GTK_SPIN_END: + self = .end + case GTK_SPIN_USER_DEFINED: + self = .userDefined default: fatalError("Unsupported GtkSpinType enum value: \(gtkEnum.rawValue)") } @@ -48,19 +48,19 @@ case GTK_SPIN_USER_DEFINED: public func toGtk() -> GtkSpinType { switch self { case .stepForward: - return GTK_SPIN_STEP_FORWARD -case .stepBackward: - return GTK_SPIN_STEP_BACKWARD -case .pageForward: - return GTK_SPIN_PAGE_FORWARD -case .pageBackward: - return GTK_SPIN_PAGE_BACKWARD -case .home: - return GTK_SPIN_HOME -case .end: - return GTK_SPIN_END -case .userDefined: - return GTK_SPIN_USER_DEFINED + return GTK_SPIN_STEP_FORWARD + case .stepBackward: + return GTK_SPIN_STEP_BACKWARD + case .pageForward: + return GTK_SPIN_PAGE_FORWARD + case .pageBackward: + return GTK_SPIN_PAGE_BACKWARD + case .home: + return GTK_SPIN_HOME + case .end: + return GTK_SPIN_END + case .userDefined: + return GTK_SPIN_USER_DEFINED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/Spinner.swift b/Sources/Gtk3/Generated/Spinner.swift index f230996f87..c65f02682d 100644 --- a/Sources/Gtk3/Generated/Spinner.swift +++ b/Sources/Gtk3/Generated/Spinner.swift @@ -3,36 +3,37 @@ import CGtk3 /// A GtkSpinner widget displays an icon-size spinning animation. /// It is often used as an alternative to a #GtkProgressBar for /// displaying indefinite activity, instead of actual progress. -/// +/// /// To start the animation, use gtk_spinner_start(), to stop it /// use gtk_spinner_stop(). -/// +/// /// # CSS nodes -/// +/// /// GtkSpinner has a single CSS node with the name spinner. When the animation is /// active, the :checked pseudoclass is added to this node. open class Spinner: Widget { /// Returns a new spinner widget. Not yet started. -public convenience init() { - self.init( - gtk_spinner_new() - ) -} + public convenience init() { + self.init( + gtk_spinner_new() + ) + } + + override func didMoveToParent() { + super.didMoveToParent() - override func didMoveToParent() { - super.didMoveToParent() + let handler0: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } - let handler0: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + addSignal(name: "notify::active", handler: gCallback(handler0)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActive?(self, param0) + } } -addSignal(name: "notify::active", handler: gCallback(handler0)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActive?(self, param0) + public var notifyActive: ((Spinner, OpaquePointer) -> Void)? } -} - - -public var notifyActive: ((Spinner, OpaquePointer) -> Void)? -} \ No newline at end of file diff --git a/Sources/Gtk3/Generated/StackTransitionType.swift b/Sources/Gtk3/Generated/StackTransitionType.swift index 870b50668d..260d71fb44 100644 --- a/Sources/Gtk3/Generated/StackTransitionType.swift +++ b/Sources/Gtk3/Generated/StackTransitionType.swift @@ -2,50 +2,50 @@ import CGtk3 /// These enumeration values describe the possible transitions /// between pages in a #GtkStack widget. -/// +/// /// New values may be added to this enumeration over time. public enum StackTransitionType: GValueRepresentableEnum { public typealias GtkEnum = GtkStackTransitionType /// No transition -case none -/// A cross-fade -case crossfade -/// Slide from left to right -case slideRight -/// Slide from right to left -case slideLeft -/// Slide from bottom up -case slideUp -/// Slide from top down -case slideDown -/// Slide from left or right according to the children order -case slideLeftRight -/// Slide from top down or bottom up according to the order -case slideUpDown + case none + /// A cross-fade + case crossfade + /// Slide from left to right + case slideRight + /// Slide from right to left + case slideLeft + /// Slide from bottom up + case slideUp + /// Slide from top down + case slideDown + /// Slide from left or right according to the children order + case slideLeftRight + /// Slide from top down or bottom up according to the order + case slideUpDown public static var type: GType { - gtk_stack_transition_type_get_type() -} + gtk_stack_transition_type_get_type() + } public init(from gtkEnum: GtkStackTransitionType) { switch gtkEnum { case GTK_STACK_TRANSITION_TYPE_NONE: - self = .none -case GTK_STACK_TRANSITION_TYPE_CROSSFADE: - self = .crossfade -case GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT: - self = .slideRight -case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT: - self = .slideLeft -case GTK_STACK_TRANSITION_TYPE_SLIDE_UP: - self = .slideUp -case GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN: - self = .slideDown -case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT: - self = .slideLeftRight -case GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN: - self = .slideUpDown + self = .none + case GTK_STACK_TRANSITION_TYPE_CROSSFADE: + self = .crossfade + case GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT: + self = .slideRight + case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT: + self = .slideLeft + case GTK_STACK_TRANSITION_TYPE_SLIDE_UP: + self = .slideUp + case GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN: + self = .slideDown + case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT: + self = .slideLeftRight + case GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN: + self = .slideUpDown default: fatalError("Unsupported GtkStackTransitionType enum value: \(gtkEnum.rawValue)") } @@ -54,21 +54,21 @@ case GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN: public func toGtk() -> GtkStackTransitionType { switch self { case .none: - return GTK_STACK_TRANSITION_TYPE_NONE -case .crossfade: - return GTK_STACK_TRANSITION_TYPE_CROSSFADE -case .slideRight: - return GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT -case .slideLeft: - return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT -case .slideUp: - return GTK_STACK_TRANSITION_TYPE_SLIDE_UP -case .slideDown: - return GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN -case .slideLeftRight: - return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT -case .slideUpDown: - return GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN + return GTK_STACK_TRANSITION_TYPE_NONE + case .crossfade: + return GTK_STACK_TRANSITION_TYPE_CROSSFADE + case .slideRight: + return GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT + case .slideLeft: + return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT + case .slideUp: + return GTK_STACK_TRANSITION_TYPE_SLIDE_UP + case .slideDown: + return GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN + case .slideLeftRight: + return GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT + case .slideUpDown: + return GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/StateType.swift b/Sources/Gtk3/Generated/StateType.swift index f21b1e4a0e..10a2ea95f5 100644 --- a/Sources/Gtk3/Generated/StateType.swift +++ b/Sources/Gtk3/Generated/StateType.swift @@ -8,44 +8,44 @@ public enum StateType: GValueRepresentableEnum { public typealias GtkEnum = GtkStateType /// State during normal operation. -case normal -/// State of a currently active widget, such as a depressed button. -case active -/// State indicating that the mouse pointer is over -/// the widget and the widget will respond to mouse clicks. -case prelight -/// State of a selected item, such the selected row in a list. -case selected -/// State indicating that the widget is -/// unresponsive to user actions. -case insensitive -/// The widget is inconsistent, such as checkbuttons -/// or radiobuttons that aren’t either set to %TRUE nor %FALSE, -/// or buttons requiring the user attention. -case inconsistent -/// The widget has the keyboard focus. -case focused + case normal + /// State of a currently active widget, such as a depressed button. + case active + /// State indicating that the mouse pointer is over + /// the widget and the widget will respond to mouse clicks. + case prelight + /// State of a selected item, such the selected row in a list. + case selected + /// State indicating that the widget is + /// unresponsive to user actions. + case insensitive + /// The widget is inconsistent, such as checkbuttons + /// or radiobuttons that aren’t either set to %TRUE nor %FALSE, + /// or buttons requiring the user attention. + case inconsistent + /// The widget has the keyboard focus. + case focused public static var type: GType { - gtk_state_type_get_type() -} + gtk_state_type_get_type() + } public init(from gtkEnum: GtkStateType) { switch gtkEnum { case GTK_STATE_NORMAL: - self = .normal -case GTK_STATE_ACTIVE: - self = .active -case GTK_STATE_PRELIGHT: - self = .prelight -case GTK_STATE_SELECTED: - self = .selected -case GTK_STATE_INSENSITIVE: - self = .insensitive -case GTK_STATE_INCONSISTENT: - self = .inconsistent -case GTK_STATE_FOCUSED: - self = .focused + self = .normal + case GTK_STATE_ACTIVE: + self = .active + case GTK_STATE_PRELIGHT: + self = .prelight + case GTK_STATE_SELECTED: + self = .selected + case GTK_STATE_INSENSITIVE: + self = .insensitive + case GTK_STATE_INCONSISTENT: + self = .inconsistent + case GTK_STATE_FOCUSED: + self = .focused default: fatalError("Unsupported GtkStateType enum value: \(gtkEnum.rawValue)") } @@ -54,19 +54,19 @@ case GTK_STATE_FOCUSED: public func toGtk() -> GtkStateType { switch self { case .normal: - return GTK_STATE_NORMAL -case .active: - return GTK_STATE_ACTIVE -case .prelight: - return GTK_STATE_PRELIGHT -case .selected: - return GTK_STATE_SELECTED -case .insensitive: - return GTK_STATE_INSENSITIVE -case .inconsistent: - return GTK_STATE_INCONSISTENT -case .focused: - return GTK_STATE_FOCUSED + return GTK_STATE_NORMAL + case .active: + return GTK_STATE_ACTIVE + case .prelight: + return GTK_STATE_PRELIGHT + case .selected: + return GTK_STATE_SELECTED + case .insensitive: + return GTK_STATE_INSENSITIVE + case .inconsistent: + return GTK_STATE_INCONSISTENT + case .focused: + return GTK_STATE_FOCUSED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/StyleProvider.swift b/Sources/Gtk3/Generated/StyleProvider.swift index 1d7937ca7e..7dabf6a87d 100644 --- a/Sources/Gtk3/Generated/StyleProvider.swift +++ b/Sources/Gtk3/Generated/StyleProvider.swift @@ -3,7 +3,5 @@ import CGtk3 /// GtkStyleProvider is an interface used to provide style information to a #GtkStyleContext. /// See gtk_style_context_add_provider() and gtk_style_context_add_provider_for_screen(). public protocol StyleProvider: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/Switch.swift b/Sources/Gtk3/Generated/Switch.swift index 41fa213cad..3ce717d935 100644 --- a/Sources/Gtk3/Generated/Switch.swift +++ b/Sources/Gtk3/Generated/Switch.swift @@ -3,119 +3,124 @@ import CGtk3 /// #GtkSwitch is a widget that has two states: on or off. The user can control /// which state should be active by clicking the empty area, or by dragging the /// handle. -/// +/// /// GtkSwitch can also handle situations where the underlying state changes with /// a delay. See #GtkSwitch::state-set for details. -/// +/// /// # CSS nodes -/// +/// /// |[ /// switch /// ╰── slider /// ]| -/// +/// /// GtkSwitch has two css nodes, the main node with the name switch and a subnode /// named slider. Neither of them is using any style classes. open class Switch: Widget, Activatable { /// Creates a new #GtkSwitch widget. -public convenience init() { - self.init( - gtk_switch_new() - ) -} - - override func didMoveToParent() { - super.didMoveToParent() - - addSignal(name: "activate") { [weak self] () in - guard let self = self else { return } - self.activate?(self) -} - -let handler1: @convention(c) (UnsafeMutableRawPointer, Bool, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + public convenience init() { + self.init( + gtk_switch_new() + ) } -addSignal(name: "state-set", handler: gCallback(handler1)) { [weak self] (param0: Bool) in - guard let self = self else { return } - self.stateSet?(self, param0) -} - -let handler2: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) + override func didMoveToParent() { + super.didMoveToParent() + + addSignal(name: "activate") { [weak self] () in + guard let self = self else { return } + self.activate?(self) + } + + let handler1: + @convention(c) (UnsafeMutableRawPointer, Bool, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "state-set", handler: gCallback(handler1)) { [weak self] (param0: Bool) in + guard let self = self else { return } + self.stateSet?(self, param0) + } + + let handler2: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::active", handler: gCallback(handler2)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyActive?(self, param0) + } + + let handler3: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::state", handler: gCallback(handler3)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyState?(self, param0) + } + + let handler4: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::related-action", handler: gCallback(handler4)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyRelatedAction?(self, param0) + } + + let handler5: + @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = + { _, value1, data in + SignalBox1.run(data, value1) + } + + addSignal(name: "notify::use-action-appearance", handler: gCallback(handler5)) { + [weak self] (param0: OpaquePointer) in + guard let self = self else { return } + self.notifyUseActionAppearance?(self, param0) + } } -addSignal(name: "notify::active", handler: gCallback(handler2)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyActive?(self, param0) -} - -let handler3: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::state", handler: gCallback(handler3)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyState?(self, param0) -} - -let handler4: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::related-action", handler: gCallback(handler4)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyRelatedAction?(self, param0) -} - -let handler5: @convention(c) (UnsafeMutableRawPointer, OpaquePointer, UnsafeMutableRawPointer) -> Void = - { _, value1, data in - SignalBox1.run(data, value1) - } - -addSignal(name: "notify::use-action-appearance", handler: gCallback(handler5)) { [weak self] (param0: OpaquePointer) in - guard let self = self else { return } - self.notifyUseActionAppearance?(self, param0) -} -} - /// Whether the #GtkSwitch widget is in its on or off state. -@GObjectProperty(named: "active") public var active: Bool - -/// The ::activate signal on GtkSwitch is an action signal and -/// emitting it causes the switch to animate. -/// Applications should never connect to this signal, but use the -/// notify::active signal. -public var activate: ((Switch) -> Void)? - -/// The ::state-set signal on GtkSwitch is emitted to change the underlying -/// state. It is emitted when the user changes the switch position. The -/// default handler keeps the state in sync with the #GtkSwitch:active -/// property. -/// -/// To implement delayed state change, applications can connect to this signal, -/// initiate the change of the underlying state, and call gtk_switch_set_state() -/// when the underlying state change is complete. The signal handler should -/// return %TRUE to prevent the default handler from running. -/// -/// Visually, the underlying state is represented by the trough color of -/// the switch, while the #GtkSwitch:active property is represented by the -/// position of the switch. -public var stateSet: ((Switch, Bool) -> Void)? - - -public var notifyActive: ((Switch, OpaquePointer) -> Void)? - - -public var notifyState: ((Switch, OpaquePointer) -> Void)? - - -public var notifyRelatedAction: ((Switch, OpaquePointer) -> Void)? - - -public var notifyUseActionAppearance: ((Switch, OpaquePointer) -> Void)? -} \ No newline at end of file + @GObjectProperty(named: "active") public var active: Bool + + /// The ::activate signal on GtkSwitch is an action signal and + /// emitting it causes the switch to animate. + /// Applications should never connect to this signal, but use the + /// notify::active signal. + public var activate: ((Switch) -> Void)? + + /// The ::state-set signal on GtkSwitch is emitted to change the underlying + /// state. It is emitted when the user changes the switch position. The + /// default handler keeps the state in sync with the #GtkSwitch:active + /// property. + /// + /// To implement delayed state change, applications can connect to this signal, + /// initiate the change of the underlying state, and call gtk_switch_set_state() + /// when the underlying state change is complete. The signal handler should + /// return %TRUE to prevent the default handler from running. + /// + /// Visually, the underlying state is represented by the trough color of + /// the switch, while the #GtkSwitch:active property is represented by the + /// position of the switch. + public var stateSet: ((Switch, Bool) -> Void)? + + public var notifyActive: ((Switch, OpaquePointer) -> Void)? + + public var notifyState: ((Switch, OpaquePointer) -> Void)? + + public var notifyRelatedAction: ((Switch, OpaquePointer) -> Void)? + + public var notifyUseActionAppearance: ((Switch, OpaquePointer) -> Void)? +} diff --git a/Sources/Gtk3/Generated/TextBufferTargetInfo.swift b/Sources/Gtk3/Generated/TextBufferTargetInfo.swift index 28525b2075..846425b492 100644 --- a/Sources/Gtk3/Generated/TextBufferTargetInfo.swift +++ b/Sources/Gtk3/Generated/TextBufferTargetInfo.swift @@ -3,31 +3,31 @@ import CGtk3 /// These values are used as “info” for the targets contained in the /// lists returned by gtk_text_buffer_get_copy_target_list() and /// gtk_text_buffer_get_paste_target_list(). -/// +/// /// The values counts down from `-1` to avoid clashes /// with application added drag destinations which usually start at 0. public enum TextBufferTargetInfo: GValueRepresentableEnum { public typealias GtkEnum = GtkTextBufferTargetInfo /// Buffer contents -case bufferContents -/// Rich text -case richText -/// Text -case text + case bufferContents + /// Rich text + case richText + /// Text + case text public static var type: GType { - gtk_text_buffer_target_info_get_type() -} + gtk_text_buffer_target_info_get_type() + } public init(from gtkEnum: GtkTextBufferTargetInfo) { switch gtkEnum { case GTK_TEXT_BUFFER_TARGET_INFO_BUFFER_CONTENTS: - self = .bufferContents -case GTK_TEXT_BUFFER_TARGET_INFO_RICH_TEXT: - self = .richText -case GTK_TEXT_BUFFER_TARGET_INFO_TEXT: - self = .text + self = .bufferContents + case GTK_TEXT_BUFFER_TARGET_INFO_RICH_TEXT: + self = .richText + case GTK_TEXT_BUFFER_TARGET_INFO_TEXT: + self = .text default: fatalError("Unsupported GtkTextBufferTargetInfo enum value: \(gtkEnum.rawValue)") } @@ -36,11 +36,11 @@ case GTK_TEXT_BUFFER_TARGET_INFO_TEXT: public func toGtk() -> GtkTextBufferTargetInfo { switch self { case .bufferContents: - return GTK_TEXT_BUFFER_TARGET_INFO_BUFFER_CONTENTS -case .richText: - return GTK_TEXT_BUFFER_TARGET_INFO_RICH_TEXT -case .text: - return GTK_TEXT_BUFFER_TARGET_INFO_TEXT + return GTK_TEXT_BUFFER_TARGET_INFO_BUFFER_CONTENTS + case .richText: + return GTK_TEXT_BUFFER_TARGET_INFO_RICH_TEXT + case .text: + return GTK_TEXT_BUFFER_TARGET_INFO_TEXT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/TextDirection.swift b/Sources/Gtk3/Generated/TextDirection.swift index 29290c2522..c74a0590d6 100644 --- a/Sources/Gtk3/Generated/TextDirection.swift +++ b/Sources/Gtk3/Generated/TextDirection.swift @@ -5,24 +5,24 @@ public enum TextDirection: GValueRepresentableEnum { public typealias GtkEnum = GtkTextDirection /// No direction. -case none -/// Left to right text direction. -case ltr -/// Right to left text direction. -case rtl + case none + /// Left to right text direction. + case ltr + /// Right to left text direction. + case rtl public static var type: GType { - gtk_text_direction_get_type() -} + gtk_text_direction_get_type() + } public init(from gtkEnum: GtkTextDirection) { switch gtkEnum { case GTK_TEXT_DIR_NONE: - self = .none -case GTK_TEXT_DIR_LTR: - self = .ltr -case GTK_TEXT_DIR_RTL: - self = .rtl + self = .none + case GTK_TEXT_DIR_LTR: + self = .ltr + case GTK_TEXT_DIR_RTL: + self = .rtl default: fatalError("Unsupported GtkTextDirection enum value: \(gtkEnum.rawValue)") } @@ -31,11 +31,11 @@ case GTK_TEXT_DIR_RTL: public func toGtk() -> GtkTextDirection { switch self { case .none: - return GTK_TEXT_DIR_NONE -case .ltr: - return GTK_TEXT_DIR_LTR -case .rtl: - return GTK_TEXT_DIR_RTL + return GTK_TEXT_DIR_NONE + case .ltr: + return GTK_TEXT_DIR_LTR + case .rtl: + return GTK_TEXT_DIR_RTL } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/TextViewLayer.swift b/Sources/Gtk3/Generated/TextViewLayer.swift index cc23ab1d92..9ffbe32f05 100644 --- a/Sources/Gtk3/Generated/TextViewLayer.swift +++ b/Sources/Gtk3/Generated/TextViewLayer.swift @@ -6,20 +6,20 @@ public enum TextViewLayer: GValueRepresentableEnum { public typealias GtkEnum = GtkTextViewLayer /// Old deprecated layer, use %GTK_TEXT_VIEW_LAYER_BELOW_TEXT instead -case below -/// Old deprecated layer, use %GTK_TEXT_VIEW_LAYER_ABOVE_TEXT instead -case above + case below + /// Old deprecated layer, use %GTK_TEXT_VIEW_LAYER_ABOVE_TEXT instead + case above public static var type: GType { - gtk_text_view_layer_get_type() -} + gtk_text_view_layer_get_type() + } public init(from gtkEnum: GtkTextViewLayer) { switch gtkEnum { case GTK_TEXT_VIEW_LAYER_BELOW: - self = .below -case GTK_TEXT_VIEW_LAYER_ABOVE: - self = .above + self = .below + case GTK_TEXT_VIEW_LAYER_ABOVE: + self = .above default: fatalError("Unsupported GtkTextViewLayer enum value: \(gtkEnum.rawValue)") } @@ -28,9 +28,9 @@ case GTK_TEXT_VIEW_LAYER_ABOVE: public func toGtk() -> GtkTextViewLayer { switch self { case .below: - return GTK_TEXT_VIEW_LAYER_BELOW -case .above: - return GTK_TEXT_VIEW_LAYER_ABOVE + return GTK_TEXT_VIEW_LAYER_BELOW + case .above: + return GTK_TEXT_VIEW_LAYER_ABOVE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/TextWindowType.swift b/Sources/Gtk3/Generated/TextWindowType.swift index bcecb85277..0e03d8328c 100644 --- a/Sources/Gtk3/Generated/TextWindowType.swift +++ b/Sources/Gtk3/Generated/TextWindowType.swift @@ -5,40 +5,40 @@ public enum TextWindowType: GValueRepresentableEnum { public typealias GtkEnum = GtkTextWindowType /// Invalid value, used as a marker -case private_ -/// Window that floats over scrolling areas. -case widget -/// Scrollable text window. -case text -/// Left side border window. -case left -/// Right side border window. -case right -/// Top border window. -case top -/// Bottom border window. -case bottom + case private_ + /// Window that floats over scrolling areas. + case widget + /// Scrollable text window. + case text + /// Left side border window. + case left + /// Right side border window. + case right + /// Top border window. + case top + /// Bottom border window. + case bottom public static var type: GType { - gtk_text_window_type_get_type() -} + gtk_text_window_type_get_type() + } public init(from gtkEnum: GtkTextWindowType) { switch gtkEnum { case GTK_TEXT_WINDOW_PRIVATE: - self = .private_ -case GTK_TEXT_WINDOW_WIDGET: - self = .widget -case GTK_TEXT_WINDOW_TEXT: - self = .text -case GTK_TEXT_WINDOW_LEFT: - self = .left -case GTK_TEXT_WINDOW_RIGHT: - self = .right -case GTK_TEXT_WINDOW_TOP: - self = .top -case GTK_TEXT_WINDOW_BOTTOM: - self = .bottom + self = .private_ + case GTK_TEXT_WINDOW_WIDGET: + self = .widget + case GTK_TEXT_WINDOW_TEXT: + self = .text + case GTK_TEXT_WINDOW_LEFT: + self = .left + case GTK_TEXT_WINDOW_RIGHT: + self = .right + case GTK_TEXT_WINDOW_TOP: + self = .top + case GTK_TEXT_WINDOW_BOTTOM: + self = .bottom default: fatalError("Unsupported GtkTextWindowType enum value: \(gtkEnum.rawValue)") } @@ -47,19 +47,19 @@ case GTK_TEXT_WINDOW_BOTTOM: public func toGtk() -> GtkTextWindowType { switch self { case .private_: - return GTK_TEXT_WINDOW_PRIVATE -case .widget: - return GTK_TEXT_WINDOW_WIDGET -case .text: - return GTK_TEXT_WINDOW_TEXT -case .left: - return GTK_TEXT_WINDOW_LEFT -case .right: - return GTK_TEXT_WINDOW_RIGHT -case .top: - return GTK_TEXT_WINDOW_TOP -case .bottom: - return GTK_TEXT_WINDOW_BOTTOM + return GTK_TEXT_WINDOW_PRIVATE + case .widget: + return GTK_TEXT_WINDOW_WIDGET + case .text: + return GTK_TEXT_WINDOW_TEXT + case .left: + return GTK_TEXT_WINDOW_LEFT + case .right: + return GTK_TEXT_WINDOW_RIGHT + case .top: + return GTK_TEXT_WINDOW_TOP + case .bottom: + return GTK_TEXT_WINDOW_BOTTOM } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/ToolShell.swift b/Sources/Gtk3/Generated/ToolShell.swift index 1a93a30464..fd4e4fc0ac 100644 --- a/Sources/Gtk3/Generated/ToolShell.swift +++ b/Sources/Gtk3/Generated/ToolShell.swift @@ -3,7 +3,5 @@ import CGtk3 /// The #GtkToolShell interface allows container widgets to provide additional /// information when embedding #GtkToolItem widgets. public protocol ToolShell: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/ToolbarSpaceStyle.swift b/Sources/Gtk3/Generated/ToolbarSpaceStyle.swift index 09aa80805d..8a6d192a47 100644 --- a/Sources/Gtk3/Generated/ToolbarSpaceStyle.swift +++ b/Sources/Gtk3/Generated/ToolbarSpaceStyle.swift @@ -5,20 +5,20 @@ public enum ToolbarSpaceStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkToolbarSpaceStyle /// Use blank spacers. -case empty -/// Use vertical lines for spacers. -case line + case empty + /// Use vertical lines for spacers. + case line public static var type: GType { - gtk_toolbar_space_style_get_type() -} + gtk_toolbar_space_style_get_type() + } public init(from gtkEnum: GtkToolbarSpaceStyle) { switch gtkEnum { case GTK_TOOLBAR_SPACE_EMPTY: - self = .empty -case GTK_TOOLBAR_SPACE_LINE: - self = .line + self = .empty + case GTK_TOOLBAR_SPACE_LINE: + self = .line default: fatalError("Unsupported GtkToolbarSpaceStyle enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ case GTK_TOOLBAR_SPACE_LINE: public func toGtk() -> GtkToolbarSpaceStyle { switch self { case .empty: - return GTK_TOOLBAR_SPACE_EMPTY -case .line: - return GTK_TOOLBAR_SPACE_LINE + return GTK_TOOLBAR_SPACE_EMPTY + case .line: + return GTK_TOOLBAR_SPACE_LINE } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/ToolbarStyle.swift b/Sources/Gtk3/Generated/ToolbarStyle.swift index 2ead34530b..66ac7191ee 100644 --- a/Sources/Gtk3/Generated/ToolbarStyle.swift +++ b/Sources/Gtk3/Generated/ToolbarStyle.swift @@ -9,29 +9,29 @@ public enum ToolbarStyle: GValueRepresentableEnum { public typealias GtkEnum = GtkToolbarStyle /// Buttons display only icons in the toolbar. -case icons -/// Buttons display only text labels in the toolbar. -case text -/// Buttons display text and icons in the toolbar. -case both -/// Buttons display icons and text alongside each -/// other, rather than vertically stacked -case bothHoriz + case icons + /// Buttons display only text labels in the toolbar. + case text + /// Buttons display text and icons in the toolbar. + case both + /// Buttons display icons and text alongside each + /// other, rather than vertically stacked + case bothHoriz public static var type: GType { - gtk_toolbar_style_get_type() -} + gtk_toolbar_style_get_type() + } public init(from gtkEnum: GtkToolbarStyle) { switch gtkEnum { case GTK_TOOLBAR_ICONS: - self = .icons -case GTK_TOOLBAR_TEXT: - self = .text -case GTK_TOOLBAR_BOTH: - self = .both -case GTK_TOOLBAR_BOTH_HORIZ: - self = .bothHoriz + self = .icons + case GTK_TOOLBAR_TEXT: + self = .text + case GTK_TOOLBAR_BOTH: + self = .both + case GTK_TOOLBAR_BOTH_HORIZ: + self = .bothHoriz default: fatalError("Unsupported GtkToolbarStyle enum value: \(gtkEnum.rawValue)") } @@ -40,13 +40,13 @@ case GTK_TOOLBAR_BOTH_HORIZ: public func toGtk() -> GtkToolbarStyle { switch self { case .icons: - return GTK_TOOLBAR_ICONS -case .text: - return GTK_TOOLBAR_TEXT -case .both: - return GTK_TOOLBAR_BOTH -case .bothHoriz: - return GTK_TOOLBAR_BOTH_HORIZ + return GTK_TOOLBAR_ICONS + case .text: + return GTK_TOOLBAR_TEXT + case .both: + return GTK_TOOLBAR_BOTH + case .bothHoriz: + return GTK_TOOLBAR_BOTH_HORIZ } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/TreeDragDest.swift b/Sources/Gtk3/Generated/TreeDragDest.swift index 6d1310aa9a..f21493d8f0 100644 --- a/Sources/Gtk3/Generated/TreeDragDest.swift +++ b/Sources/Gtk3/Generated/TreeDragDest.swift @@ -1,8 +1,5 @@ import CGtk3 - public protocol TreeDragDest: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/TreeDragSource.swift b/Sources/Gtk3/Generated/TreeDragSource.swift index eac0aada25..b832c76c8d 100644 --- a/Sources/Gtk3/Generated/TreeDragSource.swift +++ b/Sources/Gtk3/Generated/TreeDragSource.swift @@ -1,8 +1,5 @@ import CGtk3 - public protocol TreeDragSource: GObjectRepresentable { - - -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/TreeSortable.swift b/Sources/Gtk3/Generated/TreeSortable.swift index 3cce465397..b14e224e08 100644 --- a/Sources/Gtk3/Generated/TreeSortable.swift +++ b/Sources/Gtk3/Generated/TreeSortable.swift @@ -4,10 +4,9 @@ import CGtk3 /// support sorting. The #GtkTreeView uses the methods provided by this interface /// to sort the model. public protocol TreeSortable: GObjectRepresentable { - /// The ::sort-column-changed signal is emitted when the sort column -/// or sort order of @sortable is changed. The signal is emitted before -/// the contents of @sortable are resorted. -var sortColumnChanged: ((Self) -> Void)? { get set } -} \ No newline at end of file + /// or sort order of @sortable is changed. The signal is emitted before + /// the contents of @sortable are resorted. + var sortColumnChanged: ((Self) -> Void)? { get set } +} diff --git a/Sources/Gtk3/Generated/TreeViewColumnSizing.swift b/Sources/Gtk3/Generated/TreeViewColumnSizing.swift index 0457c93921..08a284c2d5 100644 --- a/Sources/Gtk3/Generated/TreeViewColumnSizing.swift +++ b/Sources/Gtk3/Generated/TreeViewColumnSizing.swift @@ -7,24 +7,24 @@ public enum TreeViewColumnSizing: GValueRepresentableEnum { public typealias GtkEnum = GtkTreeViewColumnSizing /// Columns only get bigger in reaction to changes in the model -case growOnly -/// Columns resize to be the optimal size everytime the model changes. -case autosize -/// Columns are a fixed numbers of pixels wide. -case fixed + case growOnly + /// Columns resize to be the optimal size everytime the model changes. + case autosize + /// Columns are a fixed numbers of pixels wide. + case fixed public static var type: GType { - gtk_tree_view_column_sizing_get_type() -} + gtk_tree_view_column_sizing_get_type() + } public init(from gtkEnum: GtkTreeViewColumnSizing) { switch gtkEnum { case GTK_TREE_VIEW_COLUMN_GROW_ONLY: - self = .growOnly -case GTK_TREE_VIEW_COLUMN_AUTOSIZE: - self = .autosize -case GTK_TREE_VIEW_COLUMN_FIXED: - self = .fixed + self = .growOnly + case GTK_TREE_VIEW_COLUMN_AUTOSIZE: + self = .autosize + case GTK_TREE_VIEW_COLUMN_FIXED: + self = .fixed default: fatalError("Unsupported GtkTreeViewColumnSizing enum value: \(gtkEnum.rawValue)") } @@ -33,11 +33,11 @@ case GTK_TREE_VIEW_COLUMN_FIXED: public func toGtk() -> GtkTreeViewColumnSizing { switch self { case .growOnly: - return GTK_TREE_VIEW_COLUMN_GROW_ONLY -case .autosize: - return GTK_TREE_VIEW_COLUMN_AUTOSIZE -case .fixed: - return GTK_TREE_VIEW_COLUMN_FIXED + return GTK_TREE_VIEW_COLUMN_GROW_ONLY + case .autosize: + return GTK_TREE_VIEW_COLUMN_AUTOSIZE + case .fixed: + return GTK_TREE_VIEW_COLUMN_FIXED } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/TreeViewDropPosition.swift b/Sources/Gtk3/Generated/TreeViewDropPosition.swift index e846728b57..cc93464b9a 100644 --- a/Sources/Gtk3/Generated/TreeViewDropPosition.swift +++ b/Sources/Gtk3/Generated/TreeViewDropPosition.swift @@ -5,28 +5,28 @@ public enum TreeViewDropPosition: GValueRepresentableEnum { public typealias GtkEnum = GtkTreeViewDropPosition /// Dropped row is inserted before -case before -/// Dropped row is inserted after -case after -/// Dropped row becomes a child or is inserted before -case intoOrBefore -/// Dropped row becomes a child or is inserted after -case intoOrAfter + case before + /// Dropped row is inserted after + case after + /// Dropped row becomes a child or is inserted before + case intoOrBefore + /// Dropped row becomes a child or is inserted after + case intoOrAfter public static var type: GType { - gtk_tree_view_drop_position_get_type() -} + gtk_tree_view_drop_position_get_type() + } public init(from gtkEnum: GtkTreeViewDropPosition) { switch gtkEnum { case GTK_TREE_VIEW_DROP_BEFORE: - self = .before -case GTK_TREE_VIEW_DROP_AFTER: - self = .after -case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: - self = .intoOrBefore -case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: - self = .intoOrAfter + self = .before + case GTK_TREE_VIEW_DROP_AFTER: + self = .after + case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: + self = .intoOrBefore + case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: + self = .intoOrAfter default: fatalError("Unsupported GtkTreeViewDropPosition enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: public func toGtk() -> GtkTreeViewDropPosition { switch self { case .before: - return GTK_TREE_VIEW_DROP_BEFORE -case .after: - return GTK_TREE_VIEW_DROP_AFTER -case .intoOrBefore: - return GTK_TREE_VIEW_DROP_INTO_OR_BEFORE -case .intoOrAfter: - return GTK_TREE_VIEW_DROP_INTO_OR_AFTER + return GTK_TREE_VIEW_DROP_BEFORE + case .after: + return GTK_TREE_VIEW_DROP_AFTER + case .intoOrBefore: + return GTK_TREE_VIEW_DROP_INTO_OR_BEFORE + case .intoOrAfter: + return GTK_TREE_VIEW_DROP_INTO_OR_AFTER } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/TreeViewGridLines.swift b/Sources/Gtk3/Generated/TreeViewGridLines.swift index 862dc5b2d0..c170f1fce7 100644 --- a/Sources/Gtk3/Generated/TreeViewGridLines.swift +++ b/Sources/Gtk3/Generated/TreeViewGridLines.swift @@ -5,28 +5,28 @@ public enum TreeViewGridLines: GValueRepresentableEnum { public typealias GtkEnum = GtkTreeViewGridLines /// No grid lines. -case none -/// Horizontal grid lines. -case horizontal -/// Vertical grid lines. -case vertical -/// Horizontal and vertical grid lines. -case both + case none + /// Horizontal grid lines. + case horizontal + /// Vertical grid lines. + case vertical + /// Horizontal and vertical grid lines. + case both public static var type: GType { - gtk_tree_view_grid_lines_get_type() -} + gtk_tree_view_grid_lines_get_type() + } public init(from gtkEnum: GtkTreeViewGridLines) { switch gtkEnum { case GTK_TREE_VIEW_GRID_LINES_NONE: - self = .none -case GTK_TREE_VIEW_GRID_LINES_HORIZONTAL: - self = .horizontal -case GTK_TREE_VIEW_GRID_LINES_VERTICAL: - self = .vertical -case GTK_TREE_VIEW_GRID_LINES_BOTH: - self = .both + self = .none + case GTK_TREE_VIEW_GRID_LINES_HORIZONTAL: + self = .horizontal + case GTK_TREE_VIEW_GRID_LINES_VERTICAL: + self = .vertical + case GTK_TREE_VIEW_GRID_LINES_BOTH: + self = .both default: fatalError("Unsupported GtkTreeViewGridLines enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_TREE_VIEW_GRID_LINES_BOTH: public func toGtk() -> GtkTreeViewGridLines { switch self { case .none: - return GTK_TREE_VIEW_GRID_LINES_NONE -case .horizontal: - return GTK_TREE_VIEW_GRID_LINES_HORIZONTAL -case .vertical: - return GTK_TREE_VIEW_GRID_LINES_VERTICAL -case .both: - return GTK_TREE_VIEW_GRID_LINES_BOTH + return GTK_TREE_VIEW_GRID_LINES_NONE + case .horizontal: + return GTK_TREE_VIEW_GRID_LINES_HORIZONTAL + case .vertical: + return GTK_TREE_VIEW_GRID_LINES_VERTICAL + case .both: + return GTK_TREE_VIEW_GRID_LINES_BOTH } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/Unit.swift b/Sources/Gtk3/Generated/Unit.swift index 09e7754250..be1e75203d 100644 --- a/Sources/Gtk3/Generated/Unit.swift +++ b/Sources/Gtk3/Generated/Unit.swift @@ -5,28 +5,28 @@ public enum Unit: GValueRepresentableEnum { public typealias GtkEnum = GtkUnit /// No units. -case none -/// Dimensions in points. -case points -/// Dimensions in inches. -case inch -/// Dimensions in millimeters -case mm + case none + /// Dimensions in points. + case points + /// Dimensions in inches. + case inch + /// Dimensions in millimeters + case mm public static var type: GType { - gtk_unit_get_type() -} + gtk_unit_get_type() + } public init(from gtkEnum: GtkUnit) { switch gtkEnum { case GTK_UNIT_NONE: - self = .none -case GTK_UNIT_POINTS: - self = .points -case GTK_UNIT_INCH: - self = .inch -case GTK_UNIT_MM: - self = .mm + self = .none + case GTK_UNIT_POINTS: + self = .points + case GTK_UNIT_INCH: + self = .inch + case GTK_UNIT_MM: + self = .mm default: fatalError("Unsupported GtkUnit enum value: \(gtkEnum.rawValue)") } @@ -35,13 +35,13 @@ case GTK_UNIT_MM: public func toGtk() -> GtkUnit { switch self { case .none: - return GTK_UNIT_NONE -case .points: - return GTK_UNIT_POINTS -case .inch: - return GTK_UNIT_INCH -case .mm: - return GTK_UNIT_MM + return GTK_UNIT_NONE + case .points: + return GTK_UNIT_POINTS + case .inch: + return GTK_UNIT_INCH + case .mm: + return GTK_UNIT_MM } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/WidgetHelpType.swift b/Sources/Gtk3/Generated/WidgetHelpType.swift index 9c9e9cbd1f..f6ef553ae9 100644 --- a/Sources/Gtk3/Generated/WidgetHelpType.swift +++ b/Sources/Gtk3/Generated/WidgetHelpType.swift @@ -5,20 +5,20 @@ public enum WidgetHelpType: GValueRepresentableEnum { public typealias GtkEnum = GtkWidgetHelpType /// Tooltip. -case tooltip -/// What’s this. -case whatsThis + case tooltip + /// What’s this. + case whatsThis public static var type: GType { - gtk_widget_help_type_get_type() -} + gtk_widget_help_type_get_type() + } public init(from gtkEnum: GtkWidgetHelpType) { switch gtkEnum { case GTK_WIDGET_HELP_TOOLTIP: - self = .tooltip -case GTK_WIDGET_HELP_WHATS_THIS: - self = .whatsThis + self = .tooltip + case GTK_WIDGET_HELP_WHATS_THIS: + self = .whatsThis default: fatalError("Unsupported GtkWidgetHelpType enum value: \(gtkEnum.rawValue)") } @@ -27,9 +27,9 @@ case GTK_WIDGET_HELP_WHATS_THIS: public func toGtk() -> GtkWidgetHelpType { switch self { case .tooltip: - return GTK_WIDGET_HELP_TOOLTIP -case .whatsThis: - return GTK_WIDGET_HELP_WHATS_THIS + return GTK_WIDGET_HELP_TOOLTIP + case .whatsThis: + return GTK_WIDGET_HELP_WHATS_THIS } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/WindowPosition.swift b/Sources/Gtk3/Generated/WindowPosition.swift index 568a242bd9..09e0248bc0 100644 --- a/Sources/Gtk3/Generated/WindowPosition.swift +++ b/Sources/Gtk3/Generated/WindowPosition.swift @@ -7,33 +7,33 @@ public enum WindowPosition: GValueRepresentableEnum { public typealias GtkEnum = GtkWindowPosition /// No influence is made on placement. -case none -/// Windows should be placed in the center of the screen. -case center -/// Windows should be placed at the current mouse position. -case mouse -/// Keep window centered as it changes size, etc. -case centerAlways -/// Center the window on its transient -/// parent (see gtk_window_set_transient_for()). -case centerOnParent + case none + /// Windows should be placed in the center of the screen. + case center + /// Windows should be placed at the current mouse position. + case mouse + /// Keep window centered as it changes size, etc. + case centerAlways + /// Center the window on its transient + /// parent (see gtk_window_set_transient_for()). + case centerOnParent public static var type: GType { - gtk_window_position_get_type() -} + gtk_window_position_get_type() + } public init(from gtkEnum: GtkWindowPosition) { switch gtkEnum { case GTK_WIN_POS_NONE: - self = .none -case GTK_WIN_POS_CENTER: - self = .center -case GTK_WIN_POS_MOUSE: - self = .mouse -case GTK_WIN_POS_CENTER_ALWAYS: - self = .centerAlways -case GTK_WIN_POS_CENTER_ON_PARENT: - self = .centerOnParent + self = .none + case GTK_WIN_POS_CENTER: + self = .center + case GTK_WIN_POS_MOUSE: + self = .mouse + case GTK_WIN_POS_CENTER_ALWAYS: + self = .centerAlways + case GTK_WIN_POS_CENTER_ON_PARENT: + self = .centerOnParent default: fatalError("Unsupported GtkWindowPosition enum value: \(gtkEnum.rawValue)") } @@ -42,15 +42,15 @@ case GTK_WIN_POS_CENTER_ON_PARENT: public func toGtk() -> GtkWindowPosition { switch self { case .none: - return GTK_WIN_POS_NONE -case .center: - return GTK_WIN_POS_CENTER -case .mouse: - return GTK_WIN_POS_MOUSE -case .centerAlways: - return GTK_WIN_POS_CENTER_ALWAYS -case .centerOnParent: - return GTK_WIN_POS_CENTER_ON_PARENT + return GTK_WIN_POS_NONE + case .center: + return GTK_WIN_POS_CENTER + case .mouse: + return GTK_WIN_POS_MOUSE + case .centerAlways: + return GTK_WIN_POS_CENTER_ALWAYS + case .centerOnParent: + return GTK_WIN_POS_CENTER_ON_PARENT } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/WindowType.swift b/Sources/Gtk3/Generated/WindowType.swift index 7cbdb8c502..3a65c51864 100644 --- a/Sources/Gtk3/Generated/WindowType.swift +++ b/Sources/Gtk3/Generated/WindowType.swift @@ -17,20 +17,20 @@ public enum WindowType: GValueRepresentableEnum { public typealias GtkEnum = GtkWindowType /// A regular window, such as a dialog. -case toplevel -/// A special window such as a tooltip. -case popup + case toplevel + /// A special window such as a tooltip. + case popup public static var type: GType { - gtk_window_type_get_type() -} + gtk_window_type_get_type() + } public init(from gtkEnum: GtkWindowType) { switch gtkEnum { case GTK_WINDOW_TOPLEVEL: - self = .toplevel -case GTK_WINDOW_POPUP: - self = .popup + self = .toplevel + case GTK_WINDOW_POPUP: + self = .popup default: fatalError("Unsupported GtkWindowType enum value: \(gtkEnum.rawValue)") } @@ -39,9 +39,9 @@ case GTK_WINDOW_POPUP: public func toGtk() -> GtkWindowType { switch self { case .toplevel: - return GTK_WINDOW_TOPLEVEL -case .popup: - return GTK_WINDOW_POPUP + return GTK_WINDOW_TOPLEVEL + case .popup: + return GTK_WINDOW_POPUP } } -} \ No newline at end of file +} diff --git a/Sources/Gtk3/Generated/WrapMode.swift b/Sources/Gtk3/Generated/WrapMode.swift index 517cb98dc2..0e1da941eb 100644 --- a/Sources/Gtk3/Generated/WrapMode.swift +++ b/Sources/Gtk3/Generated/WrapMode.swift @@ -5,31 +5,31 @@ public enum WrapMode: GValueRepresentableEnum { public typealias GtkEnum = GtkWrapMode /// Do not wrap lines; just make the text area wider -case none -/// Wrap text, breaking lines anywhere the cursor can -/// appear (between characters, usually - if you want to be technical, -/// between graphemes, see pango_get_log_attrs()) -case character -/// Wrap text, breaking lines in between words -case word -/// Wrap text, breaking lines in between words, or if -/// that is not enough, also between graphemes -case wordCharacter + case none + /// Wrap text, breaking lines anywhere the cursor can + /// appear (between characters, usually - if you want to be technical, + /// between graphemes, see pango_get_log_attrs()) + case character + /// Wrap text, breaking lines in between words + case word + /// Wrap text, breaking lines in between words, or if + /// that is not enough, also between graphemes + case wordCharacter public static var type: GType { - gtk_wrap_mode_get_type() -} + gtk_wrap_mode_get_type() + } public init(from gtkEnum: GtkWrapMode) { switch gtkEnum { case GTK_WRAP_NONE: - self = .none -case GTK_WRAP_CHAR: - self = .character -case GTK_WRAP_WORD: - self = .word -case GTK_WRAP_WORD_CHAR: - self = .wordCharacter + self = .none + case GTK_WRAP_CHAR: + self = .character + case GTK_WRAP_WORD: + self = .word + case GTK_WRAP_WORD_CHAR: + self = .wordCharacter default: fatalError("Unsupported GtkWrapMode enum value: \(gtkEnum.rawValue)") } @@ -38,13 +38,13 @@ case GTK_WRAP_WORD_CHAR: public func toGtk() -> GtkWrapMode { switch self { case .none: - return GTK_WRAP_NONE -case .character: - return GTK_WRAP_CHAR -case .word: - return GTK_WRAP_WORD -case .wordCharacter: - return GTK_WRAP_WORD_CHAR + return GTK_WRAP_NONE + case .character: + return GTK_WRAP_CHAR + case .word: + return GTK_WRAP_WORD + case .wordCharacter: + return GTK_WRAP_WORD_CHAR } } -} \ No newline at end of file +} diff --git a/Sources/GtkCodeGen/GtkCodeGen.swift b/Sources/GtkCodeGen/GtkCodeGen.swift index ee857b0001..83f0fb728f 100644 --- a/Sources/GtkCodeGen/GtkCodeGen.swift +++ b/Sources/GtkCodeGen/GtkCodeGen.swift @@ -225,7 +225,7 @@ struct GtkCodeGen { else { return false } - + //can cause problems with gtk versions older than 4.20.0 guard member.cIdentifier != "GTK_PAD_ACTION_DIAL", From fbc4e5dfd7ba0f528217c2a47768a5f666fe5d30 Mon Sep 17 00:00:00 2001 From: Mia Koring Date: Wed, 17 Sep 2025 15:04:09 +0200 Subject: [PATCH 12/15] Comment Style, Pad Action exclusion Name changed added both "GtkPadActionDial" and "PadActionDial" because I couldn't find a definitive answer what its called --- Sources/GtkCodeGen/GtkCodeGen.swift | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Sources/GtkCodeGen/GtkCodeGen.swift b/Sources/GtkCodeGen/GtkCodeGen.swift index 83f0fb728f..04a8770e89 100644 --- a/Sources/GtkCodeGen/GtkCodeGen.swift +++ b/Sources/GtkCodeGen/GtkCodeGen.swift @@ -226,20 +226,14 @@ struct GtkCodeGen { return false } - //can cause problems with gtk versions older than 4.20.0 + // Can cause problems with gtk versions older than 4.20.0 guard member.cIdentifier != "GTK_PAD_ACTION_DIAL", - member.name != "GTK_PAD_ACTION_DIAL" + member.name != "PadActionDial", + member.name != "GtkPadActionDial" else { return false } - - if let doc = member.doc { - // Why they gotta be inconsistent like that 💀 - return !doc.contains("Since: ") && !doc.contains("Since ") - } else { - return true - } } var cases: [DeclSyntax] = [] From a4721aa169845b68ce1f486f0b0bef8bbac0d6ab Mon Sep 17 00:00:00 2001 From: Mia Koring Date: Wed, 17 Sep 2025 15:04:09 +0200 Subject: [PATCH 13/15] Comment Style, Pad Action exclusion Name changed added both "GtkPadActionDial" and "PadActionDial" because I couldn't find a definitive answer what its called # Conflicts: # Sources/GtkCodeGen/GtkCodeGen.swift --- Sources/GtkCodeGen/GtkCodeGen.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Sources/GtkCodeGen/GtkCodeGen.swift b/Sources/GtkCodeGen/GtkCodeGen.swift index 04a8770e89..71ceb7b442 100644 --- a/Sources/GtkCodeGen/GtkCodeGen.swift +++ b/Sources/GtkCodeGen/GtkCodeGen.swift @@ -225,7 +225,7 @@ struct GtkCodeGen { else { return false } - + // Can cause problems with gtk versions older than 4.20.0 guard member.cIdentifier != "GTK_PAD_ACTION_DIAL", @@ -234,6 +234,13 @@ struct GtkCodeGen { else { return false } + + if let doc = member.doc { + // Why they gotta be inconsistent like that 💀 + return !doc.contains("Since: ") && !doc.contains("Since ") + } else { + return true + } } var cases: [DeclSyntax] = [] From d7d0513f7ca96ae14bca35c217bf6b45e651b3a2 Mon Sep 17 00:00:00 2001 From: Mia Koring Date: Sat, 20 Sep 2025 14:36:24 +0200 Subject: [PATCH 14/15] requested change on gtk codegen --- Sources/GtkCodeGen/GtkCodeGen.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Sources/GtkCodeGen/GtkCodeGen.swift b/Sources/GtkCodeGen/GtkCodeGen.swift index 71ceb7b442..1c861559ac 100644 --- a/Sources/GtkCodeGen/GtkCodeGen.swift +++ b/Sources/GtkCodeGen/GtkCodeGen.swift @@ -228,9 +228,8 @@ struct GtkCodeGen { // Can cause problems with gtk versions older than 4.20.0 guard - member.cIdentifier != "GTK_PAD_ACTION_DIAL", - member.name != "PadActionDial", - member.name != "GtkPadActionDial" + !(member.cIdentifier == "GTK_PAD_ACTION_DIAL", + member.name == "PadActionType") else { return false } From 120dabf81e1dc75d07fb847bba78f9ba6ceef6a5 Mon Sep 17 00:00:00 2001 From: Mia Koring Date: Sun, 21 Sep 2025 01:03:11 +0200 Subject: [PATCH 15/15] I'm so sorry --- Sources/GtkCodeGen/GtkCodeGen.swift | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Sources/GtkCodeGen/GtkCodeGen.swift b/Sources/GtkCodeGen/GtkCodeGen.swift index 1c861559ac..921f604305 100644 --- a/Sources/GtkCodeGen/GtkCodeGen.swift +++ b/Sources/GtkCodeGen/GtkCodeGen.swift @@ -225,15 +225,14 @@ struct GtkCodeGen { else { return false } - // Can cause problems with gtk versions older than 4.20.0 guard - !(member.cIdentifier == "GTK_PAD_ACTION_DIAL", - member.name == "PadActionType") + !(member.cIdentifier == "GTK_PAD_ACTION_DIAL" + && enumeration.name == "PadActionType") else { return false } - + if let doc = member.doc { // Why they gotta be inconsistent like that 💀 return !doc.contains("Since: ") && !doc.contains("Since ")