summaryrefslogtreecommitdiff
path: root/src/renderer/State.zig
diff options
context:
space:
mode:
authorMitchell Hashimoto <mitchell.hashimoto@gmail.com>2023-08-11 12:20:48 -0700
committerMitchell Hashimoto <mitchell.hashimoto@gmail.com>2023-08-11 12:20:48 -0700
commitd62161e2c3cfb8fd005e4005bbc536628fe33595 (patch)
tree1b96c449ce51165bce6217ea6d463971aea8906a /src/renderer/State.zig
parent65c4aada02e69e47d1d8363d4fb462bf86cf18e5 (diff)
support preedit text rendering in core and metal
Diffstat (limited to 'src/renderer/State.zig')
-rw-r--r--src/renderer/State.zig17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/renderer/State.zig b/src/renderer/State.zig
index 5b1db42a0..e73a88348 100644
--- a/src/renderer/State.zig
+++ b/src/renderer/State.zig
@@ -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,
+};