Emoji picker (Super+.): search, tabs, skin tones, recents, text-input-v3 insertion
CI / test (push) Canceled after 0s
CI / test (push) Canceled after 0s
Compositor-drawn Win+. style picker. The focused app keeps keyboard focus so
its text-input-v3 field stays enabled; the emoji goes in with commit_string,
or onto the clipboard with a visible notice when the app has no text field.
Shortcut lives in the shortcut table (rebindable in Settings > Shortcuts).
- compositor/wayland/text_input.mbt: zwp_text_input_manager_v3 (global 12)
- compositor/emoji: Emoji 18.0 + CLDR 49 data (Unicode License), search,
picker model, CBDT/CBLC + GSUB reader for Noto Color Emoji
- Chandra's own pinned bitmap Noto Color Emoji (scripts/fetch-emoji-font.sh,
just emoji-font); Fedora's COLRv1 copy can't be drawn. Missing font shows
an error panel.
- raster WIT: emoji-font, emoji-has, emoji-image; served by wasmhost
- state.edn :emoji {:recent [...] :skin-tone n}
- tests incl. a fake text-input client; docs/emoji-picker.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkABDGJixotaqFv2X2
This commit is contained in:
39 files changed
+4942
-41
No files matched your search
+28
-1
@@ -848,6 +848,21 @@ fn load_image(path : String) -> Int {
|
||||
h
|
||||
}
|
||||
|
||||
///| The colour emoji font, for the emoji picker (`emoji-*`).
|
||||
let emoji_source : @emoji.EmojiSource = @emoji.EmojiSource::new()
|
||||
|
||||
///| Handles of the emoji pictures made so far (shared, like path images: never overwritten).
|
||||
let emoji_handles : Array[Int] = []
|
||||
|
||||
///|
|
||||
fn emoji_image(text : String, px : Int) -> UInt {
|
||||
emoji_source.image(text, px, p => {
|
||||
let h = rs_image_put(0, p.width, p.height, p.data)
|
||||
emoji_handles.push(h)
|
||||
h.reinterpret_as_uint()
|
||||
})
|
||||
}
|
||||
|
||||
///|
|
||||
fn is_path_image(h : Int) -> Bool {
|
||||
for _, v in image_paths {
|
||||
@@ -855,7 +870,7 @@ fn is_path_image(h : Int) -> Bool {
|
||||
return true
|
||||
}
|
||||
}
|
||||
false
|
||||
emoji_handles.contains(h)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- the interfaces
|
||||
@@ -918,6 +933,18 @@ fn raster_funcs() -> Array[(String, (Array[@wt.Val]) -> Array[@wt.Val])] {
|
||||
},
|
||||
),
|
||||
("load-image", a => [U32(load_image(a[0].to_string()).reinterpret_as_uint())]),
|
||||
(
|
||||
"emoji-font",
|
||||
_ => match emoji_source.font() {
|
||||
Ok(path) => [Result(true, Some(Str(path)))]
|
||||
Err(why) => [Result(false, Some(Str(why)))]
|
||||
},
|
||||
),
|
||||
(
|
||||
"emoji-has",
|
||||
a => [List(emoji_source.has(a[0].to_list().map(v => v.to_string())).map(b => Bool(b)))],
|
||||
),
|
||||
("emoji-image", a => [U32(emoji_image(a[0].to_string(), a[1].to_int()))]),
|
||||
(
|
||||
"image-pixels",
|
||||
a => {
|
||||
|
||||
Reference in new issue
Block a user