Files
ghostty/macos/Sources/Ghostty/FullscreenMode+Extension.swift
Jeffrey C. Ollie ea5b07d20f core: add tests for ghostty.h
* ensure that `ghostty.h` compiles during basic Zig tests
* ensure that non-exhaustive enums are kept synchronized between
  `ghostty.h` and their respective Zig counterpart.
* adjust some enums that varied from established conventions
2026-02-27 09:22:23 -06:00

24 lines
599 B
Swift

import GhosttyKit
extension FullscreenMode {
/// Initialize from a Ghostty fullscreen action.
static func from(ghostty: ghostty_action_fullscreen_e) -> Self? {
return switch ghostty {
case GHOSTTY_FULLSCREEN_NATIVE:
.native
case GHOSTTY_FULLSCREEN_MACOS_NON_NATIVE:
.nonNative
case GHOSTTY_FULLSCREEN_MACOS_NON_NATIVE_VISIBLE_MENU:
.nonNativeVisibleMenu
case GHOSTTY_FULLSCREEN_MACOS_NON_NATIVE_PADDED_NOTCH:
.nonNativePaddedNotch
default:
nil
}
}
}