Merge pull request 'Add implementation for WrapMode initializer.' (#71) from mlm/adwaita-swift:AddInitializerImplementation into main
Some checks failed
Deploy Docs / publish (push) Has been cancelled
SwiftLint / SwiftLint (push) Has been cancelled

Reviewed-on: #71
Reviewed-by: david-swift <david-swift@noreply.aproksha.uber.space>
This commit is contained in:
david-swift 2025-09-07 10:04:46 +02:00
commit fea203fabd

View File

@ -36,8 +36,19 @@ public enum WrapMode: GtkWrapMode, RawRepresentable {
}
/// Initialize from the GtkWrapMode.
/// - Parameter rawValue: The GtkWrapMode.
/// - Parameter rawValue: The GtkWrapMode.
public init?(rawValue: GtkWrapMode) {
nil
switch rawValue {
case GTK_WRAP_NONE:
self = .none
case GTK_WRAP_CHAR:
self = .char
case GTK_WRAP_WORD:
self = .word
case GTK_WRAP_WORD_CHAR:
self = .wordChar
default:
return nil
}
}
}