@whetware/react-native-stroke-text 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/LICENSE.md +21 -0
- package/NitroStrokeText.podspec +31 -0
- package/README.md +45 -0
- package/android/CMakeLists.txt +29 -0
- package/android/build.gradle +142 -0
- package/android/fix-prefab.gradle +51 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/stroketext/HybridStrokeTextView.kt +107 -0
- package/android/src/main/java/com/margelo/nitro/stroketext/NitroStrokeTextPackage.kt +39 -0
- package/android/src/main/java/com/margelo/nitro/stroketext/StrokeTextView.kt +429 -0
- package/ios/Bridge.h +8 -0
- package/ios/HybridStrokeTextView.swift +114 -0
- package/ios/StrokeTextColor.swift +120 -0
- package/ios/StrokeTextView.swift +326 -0
- package/ios/StrokedTextLabel.swift +72 -0
- package/lib/StrokeText.d.ts +3 -0
- package/lib/StrokeText.js +109 -0
- package/lib/StrokeText.web.d.ts +3 -0
- package/lib/StrokeText.web.js +106 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -0
- package/lib/index.web.d.ts +2 -0
- package/lib/index.web.js +1 -0
- package/lib/specs/StrokeTextView.nitro.d.ts +37 -0
- package/lib/specs/StrokeTextView.nitro.js +1 -0
- package/lib/types.d.ts +17 -0
- package/lib/types.js +1 -0
- package/nitro.json +24 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/NitroStrokeText+autolinking.cmake +83 -0
- package/nitrogen/generated/android/NitroStrokeText+autolinking.gradle +27 -0
- package/nitrogen/generated/android/NitroStrokeTextOnLoad.cpp +46 -0
- package/nitrogen/generated/android/NitroStrokeTextOnLoad.hpp +25 -0
- package/nitrogen/generated/android/c++/JHybridStrokeTextViewSpec.cpp +308 -0
- package/nitrogen/generated/android/c++/JHybridStrokeTextViewSpec.hpp +117 -0
- package/nitrogen/generated/android/c++/JStrokeTextAlign.hpp +67 -0
- package/nitrogen/generated/android/c++/JStrokeTextDecorationLine.hpp +64 -0
- package/nitrogen/generated/android/c++/JStrokeTextEllipsizeMode.hpp +64 -0
- package/nitrogen/generated/android/c++/JStrokeTextFontStyle.hpp +58 -0
- package/nitrogen/generated/android/c++/JStrokeTextTransform.hpp +64 -0
- package/nitrogen/generated/android/c++/views/JHybridStrokeTextViewStateUpdater.cpp +156 -0
- package/nitrogen/generated/android/c++/views/JHybridStrokeTextViewStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/HybridStrokeTextViewSpec.kt +209 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/NitroStrokeTextOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/StrokeTextAlign.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/StrokeTextDecorationLine.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/StrokeTextEllipsizeMode.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/StrokeTextFontStyle.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/StrokeTextTransform.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/views/HybridStrokeTextViewManager.kt +70 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/stroketext/views/HybridStrokeTextViewStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/NitroStrokeText+autolinking.rb +60 -0
- package/nitrogen/generated/ios/NitroStrokeText-Swift-Cxx-Bridge.cpp +33 -0
- package/nitrogen/generated/ios/NitroStrokeText-Swift-Cxx-Bridge.hpp +177 -0
- package/nitrogen/generated/ios/NitroStrokeText-Swift-Cxx-Umbrella.hpp +58 -0
- package/nitrogen/generated/ios/NitroStrokeTextAutolinking.mm +33 -0
- package/nitrogen/generated/ios/NitroStrokeTextAutolinking.swift +26 -0
- package/nitrogen/generated/ios/c++/HybridStrokeTextViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridStrokeTextViewSpecSwift.hpp +271 -0
- package/nitrogen/generated/ios/c++/views/HybridStrokeTextViewComponent.mm +232 -0
- package/nitrogen/generated/ios/swift/HybridStrokeTextViewSpec.swift +81 -0
- package/nitrogen/generated/ios/swift/HybridStrokeTextViewSpec_cxx.swift +620 -0
- package/nitrogen/generated/ios/swift/StrokeTextAlign.swift +52 -0
- package/nitrogen/generated/ios/swift/StrokeTextDecorationLine.swift +48 -0
- package/nitrogen/generated/ios/swift/StrokeTextEllipsizeMode.swift +48 -0
- package/nitrogen/generated/ios/swift/StrokeTextFontStyle.swift +40 -0
- package/nitrogen/generated/ios/swift/StrokeTextTransform.swift +48 -0
- package/nitrogen/generated/shared/c++/HybridStrokeTextViewSpec.cpp +72 -0
- package/nitrogen/generated/shared/c++/HybridStrokeTextViewSpec.hpp +128 -0
- package/nitrogen/generated/shared/c++/StrokeTextAlign.hpp +88 -0
- package/nitrogen/generated/shared/c++/StrokeTextDecorationLine.hpp +84 -0
- package/nitrogen/generated/shared/c++/StrokeTextEllipsizeMode.hpp +84 -0
- package/nitrogen/generated/shared/c++/StrokeTextFontStyle.hpp +76 -0
- package/nitrogen/generated/shared/c++/StrokeTextTransform.hpp +84 -0
- package/nitrogen/generated/shared/c++/views/HybridStrokeTextViewComponent.cpp +388 -0
- package/nitrogen/generated/shared/c++/views/HybridStrokeTextViewComponent.hpp +138 -0
- package/nitrogen/generated/shared/json/StrokeTextViewConfig.json +35 -0
- package/package.json +124 -0
- package/react-native.config.js +16 -0
|
@@ -0,0 +1,620 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridStrokeTextViewSpec_cxx.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A class implementation that bridges HybridStrokeTextViewSpec over to C++.
|
|
13
|
+
* In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
|
|
14
|
+
*
|
|
15
|
+
* Also, some Swift types need to be bridged with special handling:
|
|
16
|
+
* - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
|
|
17
|
+
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
18
|
+
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
19
|
+
*/
|
|
20
|
+
open class HybridStrokeTextViewSpec_cxx {
|
|
21
|
+
/**
|
|
22
|
+
* The Swift <> C++ bridge's namespace (`margelo::nitro::stroketext::bridge::swift`)
|
|
23
|
+
* from `NitroStrokeText-Swift-Cxx-Bridge.hpp`.
|
|
24
|
+
* This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
|
|
25
|
+
*/
|
|
26
|
+
public typealias bridge = margelo.nitro.stroketext.bridge.swift
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Holds an instance of the `HybridStrokeTextViewSpec` Swift protocol.
|
|
30
|
+
*/
|
|
31
|
+
private var __implementation: any HybridStrokeTextViewSpec
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
35
|
+
*/
|
|
36
|
+
private var __cxxPart: bridge.std__weak_ptr_HybridStrokeTextViewSpec_
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Create a new `HybridStrokeTextViewSpec_cxx` that wraps the given `HybridStrokeTextViewSpec`.
|
|
40
|
+
* All properties and methods bridge to C++ types.
|
|
41
|
+
*/
|
|
42
|
+
public init(_ implementation: any HybridStrokeTextViewSpec) {
|
|
43
|
+
self.__implementation = implementation
|
|
44
|
+
self.__cxxPart = .init()
|
|
45
|
+
/* no base class */
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get the actual `HybridStrokeTextViewSpec` instance this class wraps.
|
|
50
|
+
*/
|
|
51
|
+
@inline(__always)
|
|
52
|
+
public func getHybridStrokeTextViewSpec() -> any HybridStrokeTextViewSpec {
|
|
53
|
+
return __implementation
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
58
|
+
* This acquires one additional strong reference on the object!
|
|
59
|
+
*/
|
|
60
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
61
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Casts an unsafe pointer to a `HybridStrokeTextViewSpec_cxx`.
|
|
66
|
+
* The pointer has to be a retained opaque `Unmanaged<HybridStrokeTextViewSpec_cxx>`.
|
|
67
|
+
* This removes one strong reference from the object!
|
|
68
|
+
*/
|
|
69
|
+
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridStrokeTextViewSpec_cxx {
|
|
70
|
+
return Unmanaged<HybridStrokeTextViewSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
75
|
+
* The C++ part is a `std::shared_ptr<HybridStrokeTextViewSpec>`.
|
|
76
|
+
*/
|
|
77
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridStrokeTextViewSpec_ {
|
|
78
|
+
let cachedCxxPart = self.__cxxPart.lock()
|
|
79
|
+
if Bool(fromCxx: cachedCxxPart) {
|
|
80
|
+
return cachedCxxPart
|
|
81
|
+
} else {
|
|
82
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridStrokeTextViewSpec_(self.toUnsafe())
|
|
83
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridStrokeTextViewSpec_(newCxxPart)
|
|
84
|
+
return newCxxPart
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Get the memory size of the Swift class (plus size of any other allocations)
|
|
92
|
+
* so the JS VM can properly track it and garbage-collect the JS object if needed.
|
|
93
|
+
*/
|
|
94
|
+
@inline(__always)
|
|
95
|
+
public var memorySize: Int {
|
|
96
|
+
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Compares this object with the given [other] object for reference equality.
|
|
101
|
+
*/
|
|
102
|
+
@inline(__always)
|
|
103
|
+
public func equals(other: HybridStrokeTextViewSpec_cxx) -> Bool {
|
|
104
|
+
return self.__implementation === other.__implementation
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Call dispose() on the Swift class.
|
|
109
|
+
* This _may_ be called manually from JS.
|
|
110
|
+
*/
|
|
111
|
+
@inline(__always)
|
|
112
|
+
public func dispose() {
|
|
113
|
+
self.__implementation.dispose()
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Call toString() on the Swift class.
|
|
118
|
+
*/
|
|
119
|
+
@inline(__always)
|
|
120
|
+
public func toString() -> String {
|
|
121
|
+
return self.__implementation.toString()
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Properties
|
|
125
|
+
public final var text: std.string {
|
|
126
|
+
@inline(__always)
|
|
127
|
+
get {
|
|
128
|
+
return std.string(self.__implementation.text)
|
|
129
|
+
}
|
|
130
|
+
@inline(__always)
|
|
131
|
+
set {
|
|
132
|
+
self.__implementation.text = String(newValue)
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
public final var color: bridge.std__optional_std__string_ {
|
|
137
|
+
@inline(__always)
|
|
138
|
+
get {
|
|
139
|
+
return { () -> bridge.std__optional_std__string_ in
|
|
140
|
+
if let __unwrappedValue = self.__implementation.color {
|
|
141
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
142
|
+
} else {
|
|
143
|
+
return .init()
|
|
144
|
+
}
|
|
145
|
+
}()
|
|
146
|
+
}
|
|
147
|
+
@inline(__always)
|
|
148
|
+
set {
|
|
149
|
+
self.__implementation.color = { () -> String? in
|
|
150
|
+
if bridge.has_value_std__optional_std__string_(newValue) {
|
|
151
|
+
let __unwrapped = bridge.get_std__optional_std__string_(newValue)
|
|
152
|
+
return String(__unwrapped)
|
|
153
|
+
} else {
|
|
154
|
+
return nil
|
|
155
|
+
}
|
|
156
|
+
}()
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
public final var strokeColor: bridge.std__optional_std__string_ {
|
|
161
|
+
@inline(__always)
|
|
162
|
+
get {
|
|
163
|
+
return { () -> bridge.std__optional_std__string_ in
|
|
164
|
+
if let __unwrappedValue = self.__implementation.strokeColor {
|
|
165
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
166
|
+
} else {
|
|
167
|
+
return .init()
|
|
168
|
+
}
|
|
169
|
+
}()
|
|
170
|
+
}
|
|
171
|
+
@inline(__always)
|
|
172
|
+
set {
|
|
173
|
+
self.__implementation.strokeColor = { () -> String? in
|
|
174
|
+
if bridge.has_value_std__optional_std__string_(newValue) {
|
|
175
|
+
let __unwrapped = bridge.get_std__optional_std__string_(newValue)
|
|
176
|
+
return String(__unwrapped)
|
|
177
|
+
} else {
|
|
178
|
+
return nil
|
|
179
|
+
}
|
|
180
|
+
}()
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
public final var strokeWidth: bridge.std__optional_double_ {
|
|
185
|
+
@inline(__always)
|
|
186
|
+
get {
|
|
187
|
+
return { () -> bridge.std__optional_double_ in
|
|
188
|
+
if let __unwrappedValue = self.__implementation.strokeWidth {
|
|
189
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
190
|
+
} else {
|
|
191
|
+
return .init()
|
|
192
|
+
}
|
|
193
|
+
}()
|
|
194
|
+
}
|
|
195
|
+
@inline(__always)
|
|
196
|
+
set {
|
|
197
|
+
self.__implementation.strokeWidth = newValue.value
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
public final var fontSize: bridge.std__optional_double_ {
|
|
202
|
+
@inline(__always)
|
|
203
|
+
get {
|
|
204
|
+
return { () -> bridge.std__optional_double_ in
|
|
205
|
+
if let __unwrappedValue = self.__implementation.fontSize {
|
|
206
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
207
|
+
} else {
|
|
208
|
+
return .init()
|
|
209
|
+
}
|
|
210
|
+
}()
|
|
211
|
+
}
|
|
212
|
+
@inline(__always)
|
|
213
|
+
set {
|
|
214
|
+
self.__implementation.fontSize = newValue.value
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
public final var fontWeight: bridge.std__optional_std__string_ {
|
|
219
|
+
@inline(__always)
|
|
220
|
+
get {
|
|
221
|
+
return { () -> bridge.std__optional_std__string_ in
|
|
222
|
+
if let __unwrappedValue = self.__implementation.fontWeight {
|
|
223
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
224
|
+
} else {
|
|
225
|
+
return .init()
|
|
226
|
+
}
|
|
227
|
+
}()
|
|
228
|
+
}
|
|
229
|
+
@inline(__always)
|
|
230
|
+
set {
|
|
231
|
+
self.__implementation.fontWeight = { () -> String? in
|
|
232
|
+
if bridge.has_value_std__optional_std__string_(newValue) {
|
|
233
|
+
let __unwrapped = bridge.get_std__optional_std__string_(newValue)
|
|
234
|
+
return String(__unwrapped)
|
|
235
|
+
} else {
|
|
236
|
+
return nil
|
|
237
|
+
}
|
|
238
|
+
}()
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
public final var fontFamily: bridge.std__optional_std__string_ {
|
|
243
|
+
@inline(__always)
|
|
244
|
+
get {
|
|
245
|
+
return { () -> bridge.std__optional_std__string_ in
|
|
246
|
+
if let __unwrappedValue = self.__implementation.fontFamily {
|
|
247
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
248
|
+
} else {
|
|
249
|
+
return .init()
|
|
250
|
+
}
|
|
251
|
+
}()
|
|
252
|
+
}
|
|
253
|
+
@inline(__always)
|
|
254
|
+
set {
|
|
255
|
+
self.__implementation.fontFamily = { () -> String? in
|
|
256
|
+
if bridge.has_value_std__optional_std__string_(newValue) {
|
|
257
|
+
let __unwrapped = bridge.get_std__optional_std__string_(newValue)
|
|
258
|
+
return String(__unwrapped)
|
|
259
|
+
} else {
|
|
260
|
+
return nil
|
|
261
|
+
}
|
|
262
|
+
}()
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
public final var fontStyle: bridge.std__optional_StrokeTextFontStyle_ {
|
|
267
|
+
@inline(__always)
|
|
268
|
+
get {
|
|
269
|
+
return { () -> bridge.std__optional_StrokeTextFontStyle_ in
|
|
270
|
+
if let __unwrappedValue = self.__implementation.fontStyle {
|
|
271
|
+
return bridge.create_std__optional_StrokeTextFontStyle_(__unwrappedValue)
|
|
272
|
+
} else {
|
|
273
|
+
return .init()
|
|
274
|
+
}
|
|
275
|
+
}()
|
|
276
|
+
}
|
|
277
|
+
@inline(__always)
|
|
278
|
+
set {
|
|
279
|
+
self.__implementation.fontStyle = newValue.value
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
public final var lineHeight: bridge.std__optional_double_ {
|
|
284
|
+
@inline(__always)
|
|
285
|
+
get {
|
|
286
|
+
return { () -> bridge.std__optional_double_ in
|
|
287
|
+
if let __unwrappedValue = self.__implementation.lineHeight {
|
|
288
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
289
|
+
} else {
|
|
290
|
+
return .init()
|
|
291
|
+
}
|
|
292
|
+
}()
|
|
293
|
+
}
|
|
294
|
+
@inline(__always)
|
|
295
|
+
set {
|
|
296
|
+
self.__implementation.lineHeight = newValue.value
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
public final var letterSpacing: bridge.std__optional_double_ {
|
|
301
|
+
@inline(__always)
|
|
302
|
+
get {
|
|
303
|
+
return { () -> bridge.std__optional_double_ in
|
|
304
|
+
if let __unwrappedValue = self.__implementation.letterSpacing {
|
|
305
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
306
|
+
} else {
|
|
307
|
+
return .init()
|
|
308
|
+
}
|
|
309
|
+
}()
|
|
310
|
+
}
|
|
311
|
+
@inline(__always)
|
|
312
|
+
set {
|
|
313
|
+
self.__implementation.letterSpacing = newValue.value
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
public final var textAlign: bridge.std__optional_StrokeTextAlign_ {
|
|
318
|
+
@inline(__always)
|
|
319
|
+
get {
|
|
320
|
+
return { () -> bridge.std__optional_StrokeTextAlign_ in
|
|
321
|
+
if let __unwrappedValue = self.__implementation.textAlign {
|
|
322
|
+
return bridge.create_std__optional_StrokeTextAlign_(__unwrappedValue)
|
|
323
|
+
} else {
|
|
324
|
+
return .init()
|
|
325
|
+
}
|
|
326
|
+
}()
|
|
327
|
+
}
|
|
328
|
+
@inline(__always)
|
|
329
|
+
set {
|
|
330
|
+
self.__implementation.textAlign = newValue.value
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
public final var textDecorationLine: bridge.std__optional_StrokeTextDecorationLine_ {
|
|
335
|
+
@inline(__always)
|
|
336
|
+
get {
|
|
337
|
+
return { () -> bridge.std__optional_StrokeTextDecorationLine_ in
|
|
338
|
+
if let __unwrappedValue = self.__implementation.textDecorationLine {
|
|
339
|
+
return bridge.create_std__optional_StrokeTextDecorationLine_(__unwrappedValue)
|
|
340
|
+
} else {
|
|
341
|
+
return .init()
|
|
342
|
+
}
|
|
343
|
+
}()
|
|
344
|
+
}
|
|
345
|
+
@inline(__always)
|
|
346
|
+
set {
|
|
347
|
+
self.__implementation.textDecorationLine = newValue.value
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
public final var textTransform: bridge.std__optional_StrokeTextTransform_ {
|
|
352
|
+
@inline(__always)
|
|
353
|
+
get {
|
|
354
|
+
return { () -> bridge.std__optional_StrokeTextTransform_ in
|
|
355
|
+
if let __unwrappedValue = self.__implementation.textTransform {
|
|
356
|
+
return bridge.create_std__optional_StrokeTextTransform_(__unwrappedValue)
|
|
357
|
+
} else {
|
|
358
|
+
return .init()
|
|
359
|
+
}
|
|
360
|
+
}()
|
|
361
|
+
}
|
|
362
|
+
@inline(__always)
|
|
363
|
+
set {
|
|
364
|
+
self.__implementation.textTransform = newValue.value
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
public final var opacity: bridge.std__optional_double_ {
|
|
369
|
+
@inline(__always)
|
|
370
|
+
get {
|
|
371
|
+
return { () -> bridge.std__optional_double_ in
|
|
372
|
+
if let __unwrappedValue = self.__implementation.opacity {
|
|
373
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
374
|
+
} else {
|
|
375
|
+
return .init()
|
|
376
|
+
}
|
|
377
|
+
}()
|
|
378
|
+
}
|
|
379
|
+
@inline(__always)
|
|
380
|
+
set {
|
|
381
|
+
self.__implementation.opacity = newValue.value
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
public final var allowFontScaling: bridge.std__optional_bool_ {
|
|
386
|
+
@inline(__always)
|
|
387
|
+
get {
|
|
388
|
+
return { () -> bridge.std__optional_bool_ in
|
|
389
|
+
if let __unwrappedValue = self.__implementation.allowFontScaling {
|
|
390
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
391
|
+
} else {
|
|
392
|
+
return .init()
|
|
393
|
+
}
|
|
394
|
+
}()
|
|
395
|
+
}
|
|
396
|
+
@inline(__always)
|
|
397
|
+
set {
|
|
398
|
+
self.__implementation.allowFontScaling = { () -> Bool? in
|
|
399
|
+
if bridge.has_value_std__optional_bool_(newValue) {
|
|
400
|
+
let __unwrapped = bridge.get_std__optional_bool_(newValue)
|
|
401
|
+
return __unwrapped
|
|
402
|
+
} else {
|
|
403
|
+
return nil
|
|
404
|
+
}
|
|
405
|
+
}()
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
public final var maxFontSizeMultiplier: bridge.std__optional_double_ {
|
|
410
|
+
@inline(__always)
|
|
411
|
+
get {
|
|
412
|
+
return { () -> bridge.std__optional_double_ in
|
|
413
|
+
if let __unwrappedValue = self.__implementation.maxFontSizeMultiplier {
|
|
414
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
415
|
+
} else {
|
|
416
|
+
return .init()
|
|
417
|
+
}
|
|
418
|
+
}()
|
|
419
|
+
}
|
|
420
|
+
@inline(__always)
|
|
421
|
+
set {
|
|
422
|
+
self.__implementation.maxFontSizeMultiplier = newValue.value
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
public final var includeFontPadding: bridge.std__optional_bool_ {
|
|
427
|
+
@inline(__always)
|
|
428
|
+
get {
|
|
429
|
+
return { () -> bridge.std__optional_bool_ in
|
|
430
|
+
if let __unwrappedValue = self.__implementation.includeFontPadding {
|
|
431
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
432
|
+
} else {
|
|
433
|
+
return .init()
|
|
434
|
+
}
|
|
435
|
+
}()
|
|
436
|
+
}
|
|
437
|
+
@inline(__always)
|
|
438
|
+
set {
|
|
439
|
+
self.__implementation.includeFontPadding = { () -> Bool? in
|
|
440
|
+
if bridge.has_value_std__optional_bool_(newValue) {
|
|
441
|
+
let __unwrapped = bridge.get_std__optional_bool_(newValue)
|
|
442
|
+
return __unwrapped
|
|
443
|
+
} else {
|
|
444
|
+
return nil
|
|
445
|
+
}
|
|
446
|
+
}()
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
public final var numberOfLines: bridge.std__optional_double_ {
|
|
451
|
+
@inline(__always)
|
|
452
|
+
get {
|
|
453
|
+
return { () -> bridge.std__optional_double_ in
|
|
454
|
+
if let __unwrappedValue = self.__implementation.numberOfLines {
|
|
455
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
456
|
+
} else {
|
|
457
|
+
return .init()
|
|
458
|
+
}
|
|
459
|
+
}()
|
|
460
|
+
}
|
|
461
|
+
@inline(__always)
|
|
462
|
+
set {
|
|
463
|
+
self.__implementation.numberOfLines = newValue.value
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
public final var ellipsizeMode: bridge.std__optional_StrokeTextEllipsizeMode_ {
|
|
468
|
+
@inline(__always)
|
|
469
|
+
get {
|
|
470
|
+
return { () -> bridge.std__optional_StrokeTextEllipsizeMode_ in
|
|
471
|
+
if let __unwrappedValue = self.__implementation.ellipsizeMode {
|
|
472
|
+
return bridge.create_std__optional_StrokeTextEllipsizeMode_(__unwrappedValue)
|
|
473
|
+
} else {
|
|
474
|
+
return .init()
|
|
475
|
+
}
|
|
476
|
+
}()
|
|
477
|
+
}
|
|
478
|
+
@inline(__always)
|
|
479
|
+
set {
|
|
480
|
+
self.__implementation.ellipsizeMode = newValue.value
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
public final var padding: bridge.std__optional_double_ {
|
|
485
|
+
@inline(__always)
|
|
486
|
+
get {
|
|
487
|
+
return { () -> bridge.std__optional_double_ in
|
|
488
|
+
if let __unwrappedValue = self.__implementation.padding {
|
|
489
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
490
|
+
} else {
|
|
491
|
+
return .init()
|
|
492
|
+
}
|
|
493
|
+
}()
|
|
494
|
+
}
|
|
495
|
+
@inline(__always)
|
|
496
|
+
set {
|
|
497
|
+
self.__implementation.padding = newValue.value
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
public final var paddingVertical: bridge.std__optional_double_ {
|
|
502
|
+
@inline(__always)
|
|
503
|
+
get {
|
|
504
|
+
return { () -> bridge.std__optional_double_ in
|
|
505
|
+
if let __unwrappedValue = self.__implementation.paddingVertical {
|
|
506
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
507
|
+
} else {
|
|
508
|
+
return .init()
|
|
509
|
+
}
|
|
510
|
+
}()
|
|
511
|
+
}
|
|
512
|
+
@inline(__always)
|
|
513
|
+
set {
|
|
514
|
+
self.__implementation.paddingVertical = newValue.value
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
public final var paddingHorizontal: bridge.std__optional_double_ {
|
|
519
|
+
@inline(__always)
|
|
520
|
+
get {
|
|
521
|
+
return { () -> bridge.std__optional_double_ in
|
|
522
|
+
if let __unwrappedValue = self.__implementation.paddingHorizontal {
|
|
523
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
524
|
+
} else {
|
|
525
|
+
return .init()
|
|
526
|
+
}
|
|
527
|
+
}()
|
|
528
|
+
}
|
|
529
|
+
@inline(__always)
|
|
530
|
+
set {
|
|
531
|
+
self.__implementation.paddingHorizontal = newValue.value
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
public final var paddingTop: bridge.std__optional_double_ {
|
|
536
|
+
@inline(__always)
|
|
537
|
+
get {
|
|
538
|
+
return { () -> bridge.std__optional_double_ in
|
|
539
|
+
if let __unwrappedValue = self.__implementation.paddingTop {
|
|
540
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
541
|
+
} else {
|
|
542
|
+
return .init()
|
|
543
|
+
}
|
|
544
|
+
}()
|
|
545
|
+
}
|
|
546
|
+
@inline(__always)
|
|
547
|
+
set {
|
|
548
|
+
self.__implementation.paddingTop = newValue.value
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
public final var paddingRight: bridge.std__optional_double_ {
|
|
553
|
+
@inline(__always)
|
|
554
|
+
get {
|
|
555
|
+
return { () -> bridge.std__optional_double_ in
|
|
556
|
+
if let __unwrappedValue = self.__implementation.paddingRight {
|
|
557
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
558
|
+
} else {
|
|
559
|
+
return .init()
|
|
560
|
+
}
|
|
561
|
+
}()
|
|
562
|
+
}
|
|
563
|
+
@inline(__always)
|
|
564
|
+
set {
|
|
565
|
+
self.__implementation.paddingRight = newValue.value
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
public final var paddingBottom: bridge.std__optional_double_ {
|
|
570
|
+
@inline(__always)
|
|
571
|
+
get {
|
|
572
|
+
return { () -> bridge.std__optional_double_ in
|
|
573
|
+
if let __unwrappedValue = self.__implementation.paddingBottom {
|
|
574
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
575
|
+
} else {
|
|
576
|
+
return .init()
|
|
577
|
+
}
|
|
578
|
+
}()
|
|
579
|
+
}
|
|
580
|
+
@inline(__always)
|
|
581
|
+
set {
|
|
582
|
+
self.__implementation.paddingBottom = newValue.value
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
public final var paddingLeft: bridge.std__optional_double_ {
|
|
587
|
+
@inline(__always)
|
|
588
|
+
get {
|
|
589
|
+
return { () -> bridge.std__optional_double_ in
|
|
590
|
+
if let __unwrappedValue = self.__implementation.paddingLeft {
|
|
591
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
592
|
+
} else {
|
|
593
|
+
return .init()
|
|
594
|
+
}
|
|
595
|
+
}()
|
|
596
|
+
}
|
|
597
|
+
@inline(__always)
|
|
598
|
+
set {
|
|
599
|
+
self.__implementation.paddingLeft = newValue.value
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
// Methods
|
|
604
|
+
public final func getView() -> UnsafeMutableRawPointer {
|
|
605
|
+
return Unmanaged.passRetained(__implementation.view).toOpaque()
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
public final func beforeUpdate() {
|
|
609
|
+
__implementation.beforeUpdate()
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
public final func afterUpdate() {
|
|
613
|
+
__implementation.afterUpdate()
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
public final func maybePrepareForRecycle() {
|
|
617
|
+
guard let recyclable = __implementation as? RecyclableView else { return }
|
|
618
|
+
recyclable.prepareForRecycle()
|
|
619
|
+
}
|
|
620
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// StrokeTextAlign.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents the JS union `StrokeTextAlign`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias StrokeTextAlign = margelo.nitro.stroketext.StrokeTextAlign
|
|
12
|
+
|
|
13
|
+
public extension StrokeTextAlign {
|
|
14
|
+
/**
|
|
15
|
+
* Get a StrokeTextAlign for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "auto":
|
|
21
|
+
self = .auto
|
|
22
|
+
case "left":
|
|
23
|
+
self = .left
|
|
24
|
+
case "right":
|
|
25
|
+
self = .right
|
|
26
|
+
case "center":
|
|
27
|
+
self = .center
|
|
28
|
+
case "justify":
|
|
29
|
+
self = .justify
|
|
30
|
+
default:
|
|
31
|
+
return nil
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get the String value this StrokeTextAlign represents.
|
|
37
|
+
*/
|
|
38
|
+
var stringValue: String {
|
|
39
|
+
switch self {
|
|
40
|
+
case .auto:
|
|
41
|
+
return "auto"
|
|
42
|
+
case .left:
|
|
43
|
+
return "left"
|
|
44
|
+
case .right:
|
|
45
|
+
return "right"
|
|
46
|
+
case .center:
|
|
47
|
+
return "center"
|
|
48
|
+
case .justify:
|
|
49
|
+
return "justify"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// StrokeTextDecorationLine.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents the JS union `StrokeTextDecorationLine`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias StrokeTextDecorationLine = margelo.nitro.stroketext.StrokeTextDecorationLine
|
|
12
|
+
|
|
13
|
+
public extension StrokeTextDecorationLine {
|
|
14
|
+
/**
|
|
15
|
+
* Get a StrokeTextDecorationLine for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "none":
|
|
21
|
+
self = .none
|
|
22
|
+
case "underline":
|
|
23
|
+
self = .underline
|
|
24
|
+
case "line-through":
|
|
25
|
+
self = .lineThrough
|
|
26
|
+
case "underline line-through":
|
|
27
|
+
self = .underlineLineThrough
|
|
28
|
+
default:
|
|
29
|
+
return nil
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Get the String value this StrokeTextDecorationLine represents.
|
|
35
|
+
*/
|
|
36
|
+
var stringValue: String {
|
|
37
|
+
switch self {
|
|
38
|
+
case .none:
|
|
39
|
+
return "none"
|
|
40
|
+
case .underline:
|
|
41
|
+
return "underline"
|
|
42
|
+
case .lineThrough:
|
|
43
|
+
return "line-through"
|
|
44
|
+
case .underlineLineThrough:
|
|
45
|
+
return "underline line-through"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|