Skip to content

Commit badbdfb

Browse files
committed
post format_and_lint
1 parent b8b3912 commit badbdfb

File tree

147 files changed

+8160
-7909
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+8160
-7909
lines changed

Examples/Sources/HoverExample/HoverApp.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import DefaultBackend
2-
import SwiftCrossUI
32
import Foundation
3+
import SwiftCrossUI
44

55
#if canImport(SwiftBundlerRuntime)
66
import SwiftBundlerRuntime
@@ -32,7 +32,7 @@ struct CellView: View {
3232
@State var timer: Timer?
3333
@Environment(\.colorScheme) var colorScheme
3434
@State var opacity: Float = 0.0
35-
35+
3636
var body: some View {
3737
Rectangle()
3838
.foregroundColor(Color.blue.opacity(opacity))

Sources/AppKitBackend/AppKitBackend.swift

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,7 @@ public final class AppKitBackend: AppBackend {
14241424
tapGestureTarget.longPressHandler = action
14251425
}
14261426
}
1427-
1427+
14281428
public func createHoverTarget(wrapping child: Widget) -> Widget {
14291429
let container = NSView()
14301430

@@ -1449,7 +1449,7 @@ public final class AppKitBackend: AppBackend {
14491449

14501450
return container
14511451
}
1452-
1452+
14531453
public func updateHoverTarget(
14541454
_ container: Widget,
14551455
environment: EnvironmentValues,
@@ -1764,12 +1764,13 @@ final class NSCustomHoverTarget: NSView {
17641764
if hoverChangesHandler != nil && trackingArea == nil {
17651765
let options: NSTrackingArea.Options = [
17661766
.mouseEnteredAndExited,
1767-
.activeInKeyWindow
1767+
.activeInKeyWindow,
17681768
]
1769-
let area = NSTrackingArea(rect: self.bounds,
1770-
options: options,
1771-
owner: self,
1772-
userInfo: nil)
1769+
let area = NSTrackingArea(
1770+
rect: self.bounds,
1771+
options: options,
1772+
owner: self,
1773+
userInfo: nil)
17731774
addTrackingArea(area)
17741775
trackingArea = area
17751776
} else if hoverChangesHandler == nil, let trackingArea {
@@ -1790,20 +1791,21 @@ final class NSCustomHoverTarget: NSView {
17901791
}
17911792
let options: NSTrackingArea.Options = [
17921793
.mouseEnteredAndExited,
1793-
.activeInKeyWindow
1794+
.activeInKeyWindow,
17941795
]
1795-
1796-
trackingArea = NSTrackingArea(rect: self.bounds,
1797-
options: options,
1798-
owner: self,
1799-
userInfo: nil)
1796+
1797+
trackingArea = NSTrackingArea(
1798+
rect: self.bounds,
1799+
options: options,
1800+
owner: self,
1801+
userInfo: nil)
18001802
self.addTrackingArea(trackingArea!)
18011803
}
1802-
1804+
18031805
override func mouseEntered(with event: NSEvent) {
18041806
hoverChangesHandler?(true)
18051807
}
1806-
1808+
18071809
override func mouseExited(with event: NSEvent) {
18081810
// Mouse exited the view's bounds
18091811
hoverChangesHandler?(false)
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
11
import CGtk
22

33
/// An interface for describing UI elements for Assistive Technologies.
4-
///
4+
///
55
/// Every accessible implementation has:
6-
///
6+
///
77
/// - a “role”, represented by a value of the [[email protected]] enumeration
88
/// - “attributes”, represented by a set of [[email protected]],
99
10-
///
10+
///
1111
/// The role cannot be changed after instantiating a `GtkAccessible`
1212
/// implementation.
13-
///
13+
///
1414
/// The attributes are updated every time a UI element's state changes in
1515
/// a way that should be reflected by assistive technologies. For instance,
1616
/// if a `GtkWidget` visibility changes, the %GTK_ACCESSIBLE_STATE_HIDDEN
1717
/// state will also change to reflect the [[email protected]:visible] property.
18-
///
18+
///
1919
/// Every accessible implementation is part of a tree of accessible objects.
2020
/// Normally, this tree corresponds to the widget tree, but can be customized
2121
/// by reimplementing the [[email protected]_accessible_parent],
2222
/// [[email protected]_first_accessible_child] and
2323
/// [[email protected]_next_accessible_sibling] virtual functions.
24-
///
24+
///
2525
/// Note that you can not create a top-level accessible object as of now,
2626
/// which means that you must always have a parent accessible object.
27-
///
27+
///
2828
/// Also note that when an accessible object does not correspond to a widget,
2929
/// and it has children, whose implementation you don't control,
3030
/// it is necessary to ensure the correct shape of the a11y tree
3131
/// by calling [[email protected]_accessible_parent] and
3232
/// updating the sibling by [[email protected]_next_accessible_sibling].
3333
public protocol Accessible: GObjectRepresentable {
3434
/// The accessible role of the given `GtkAccessible` implementation.
35-
///
36-
/// The accessible role cannot be changed once set.
37-
var accessibleRole: AccessibleRole { get set }
35+
///
36+
/// The accessible role cannot be changed once set.
37+
var accessibleRole: AccessibleRole { get set }
3838

39-
40-
}
39+
}

Sources/Gtk/Generated/AccessibleAutocomplete.swift

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,36 @@ public enum AccessibleAutocomplete: GValueRepresentableEnum {
66
public typealias GtkEnum = GtkAccessibleAutocomplete
77

88
/// Automatic suggestions are not displayed.
9-
case none
10-
/// When a user is providing input, text
11-
/// suggesting one way to complete the provided input may be dynamically
12-
/// inserted after the caret.
13-
case inline
14-
/// When a user is providing input, an element
15-
/// containing a collection of values that could complete the provided input
16-
/// may be displayed.
17-
case list
18-
/// When a user is providing input, an element
19-
/// containing a collection of values that could complete the provided input
20-
/// may be displayed. If displayed, one value in the collection is automatically
21-
/// selected, and the text needed to complete the automatically selected value
22-
/// appears after the caret in the input.
23-
case both
9+
case none
10+
/// When a user is providing input, text
11+
/// suggesting one way to complete the provided input may be dynamically
12+
/// inserted after the caret.
13+
case inline
14+
/// When a user is providing input, an element
15+
/// containing a collection of values that could complete the provided input
16+
/// may be displayed.
17+
case list
18+
/// When a user is providing input, an element
19+
/// containing a collection of values that could complete the provided input
20+
/// may be displayed. If displayed, one value in the collection is automatically
21+
/// selected, and the text needed to complete the automatically selected value
22+
/// appears after the caret in the input.
23+
case both
2424

2525
public static var type: GType {
26-
gtk_accessible_autocomplete_get_type()
27-
}
26+
gtk_accessible_autocomplete_get_type()
27+
}
2828

2929
public init(from gtkEnum: GtkAccessibleAutocomplete) {
3030
switch gtkEnum {
3131
case GTK_ACCESSIBLE_AUTOCOMPLETE_NONE:
32-
self = .none
33-
case GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE:
34-
self = .inline
35-
case GTK_ACCESSIBLE_AUTOCOMPLETE_LIST:
36-
self = .list
37-
case GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH:
38-
self = .both
32+
self = .none
33+
case GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE:
34+
self = .inline
35+
case GTK_ACCESSIBLE_AUTOCOMPLETE_LIST:
36+
self = .list
37+
case GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH:
38+
self = .both
3939
default:
4040
fatalError("Unsupported GtkAccessibleAutocomplete enum value: \(gtkEnum.rawValue)")
4141
}
@@ -44,13 +44,13 @@ case GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH:
4444
public func toGtk() -> GtkAccessibleAutocomplete {
4545
switch self {
4646
case .none:
47-
return GTK_ACCESSIBLE_AUTOCOMPLETE_NONE
48-
case .inline:
49-
return GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE
50-
case .list:
51-
return GTK_ACCESSIBLE_AUTOCOMPLETE_LIST
52-
case .both:
53-
return GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH
47+
return GTK_ACCESSIBLE_AUTOCOMPLETE_NONE
48+
case .inline:
49+
return GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE
50+
case .list:
51+
return GTK_ACCESSIBLE_AUTOCOMPLETE_LIST
52+
case .both:
53+
return GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH
5454
}
5555
}
56-
}
56+
}

Sources/Gtk/Generated/AccessibleInvalidState.swift

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,36 @@ import CGtk
22

33
/// The possible values for the %GTK_ACCESSIBLE_STATE_INVALID
44
/// accessible state.
5-
///
5+
///
66
/// Note that the %GTK_ACCESSIBLE_INVALID_FALSE and
77
/// %GTK_ACCESSIBLE_INVALID_TRUE have the same values
88
/// as %FALSE and %TRUE.
99
public enum AccessibleInvalidState: GValueRepresentableEnum {
1010
public typealias GtkEnum = GtkAccessibleInvalidState
1111

1212
/// There are no detected errors in the value
13-
case false_
14-
/// The value entered by the user has failed validation
15-
case true_
16-
/// A grammatical error was detected
17-
case grammar
18-
/// A spelling error was detected
19-
case spelling
13+
case false_
14+
/// The value entered by the user has failed validation
15+
case true_
16+
/// A grammatical error was detected
17+
case grammar
18+
/// A spelling error was detected
19+
case spelling
2020

2121
public static var type: GType {
22-
gtk_accessible_invalid_state_get_type()
23-
}
22+
gtk_accessible_invalid_state_get_type()
23+
}
2424

2525
public init(from gtkEnum: GtkAccessibleInvalidState) {
2626
switch gtkEnum {
2727
case GTK_ACCESSIBLE_INVALID_FALSE:
28-
self = .false_
29-
case GTK_ACCESSIBLE_INVALID_TRUE:
30-
self = .true_
31-
case GTK_ACCESSIBLE_INVALID_GRAMMAR:
32-
self = .grammar
33-
case GTK_ACCESSIBLE_INVALID_SPELLING:
34-
self = .spelling
28+
self = .false_
29+
case GTK_ACCESSIBLE_INVALID_TRUE:
30+
self = .true_
31+
case GTK_ACCESSIBLE_INVALID_GRAMMAR:
32+
self = .grammar
33+
case GTK_ACCESSIBLE_INVALID_SPELLING:
34+
self = .spelling
3535
default:
3636
fatalError("Unsupported GtkAccessibleInvalidState enum value: \(gtkEnum.rawValue)")
3737
}
@@ -40,13 +40,13 @@ case GTK_ACCESSIBLE_INVALID_SPELLING:
4040
public func toGtk() -> GtkAccessibleInvalidState {
4141
switch self {
4242
case .false_:
43-
return GTK_ACCESSIBLE_INVALID_FALSE
44-
case .true_:
45-
return GTK_ACCESSIBLE_INVALID_TRUE
46-
case .grammar:
47-
return GTK_ACCESSIBLE_INVALID_GRAMMAR
48-
case .spelling:
49-
return GTK_ACCESSIBLE_INVALID_SPELLING
43+
return GTK_ACCESSIBLE_INVALID_FALSE
44+
case .true_:
45+
return GTK_ACCESSIBLE_INVALID_TRUE
46+
case .grammar:
47+
return GTK_ACCESSIBLE_INVALID_GRAMMAR
48+
case .spelling:
49+
return GTK_ACCESSIBLE_INVALID_SPELLING
5050
}
5151
}
52-
}
52+
}

0 commit comments

Comments
 (0)