support preedit text rendering in core and metal

This commit is contained in:
Mitchell Hashimoto
2023-08-11 12:20:48 -07:00
parent 65c4aada02
commit d62161e2c3
4 changed files with 142 additions and 19 deletions

View File

@@ -18,6 +18,12 @@ cursor: Cursor,
/// The terminal data.
terminal: *terminal.Terminal,
/// Dead key state. This will render the current dead key preedit text
/// over the cursor. This currently only ever renders a single codepoint.
/// Preedit can in theory be multiple codepoints long but that is left as
/// a future exercise.
preedit: ?Preedit = null,
/// The devmode data.
devmode: ?*const DevMode = null,
@@ -31,3 +37,14 @@ pub const Cursor = struct {
/// cursor ON or OFF.
visible: bool = true,
};
/// The pre-edit state. See Surface.preeditCallback for more information.
pub const Preedit = struct {
/// The codepoint to render as preedit text. We only support single
/// codepoint for now. In theory this can be multiple codepoints but
/// that is left as a future exercise.
///
/// This can also be "0" in which case we can know we're in a preedit
/// mode but we don't have any preedit text to render.
codepoint: u21 = 0,
};