app,widget: implement Editor IME support, add Android implementation

Fixes: https://todo.sr.ht/~eliasnaur/gio/116
References: https://todo.sr.ht/~eliasnaur/gio/246
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-01-13 13:04:31 +01:00
parent c22138f5f8
commit 58cdb3e1da
16 changed files with 880 additions and 55 deletions
+8 -2
View File
@@ -73,6 +73,8 @@ const (
TypeSemanticClass
TypeSemanticSelected
TypeSemanticDisabled
TypeSnippet
TypeSelection
)
type StackID struct {
@@ -154,6 +156,8 @@ const (
TypeSemanticClassLen = 2
TypeSemanticSelectedLen = 2
TypeSemanticDisabledLen = 2
TypeSnippetLen = 1 + 4 + 4
TypeSelectionLen = 1 + 4 + 4
)
func (op *ClipOp) Decode(data []byte) {
@@ -412,14 +416,16 @@ func (t OpType) Size() int {
TypeSemanticClassLen,
TypeSemanticSelectedLen,
TypeSemanticDisabledLen,
TypeSnippetLen,
TypeSelectionLen,
}[t-firstOpIndex]
}
func (t OpType) NumRefs() int {
switch t {
case TypeKeyInput, TypeKeyFocus, TypePointerInput, TypeProfile, TypeCall, TypeClipboardRead, TypeClipboardWrite, TypeCursor, TypeSemanticLabel, TypeSemanticDesc:
case TypeKeyInput, TypeKeyFocus, TypePointerInput, TypeProfile, TypeCall, TypeClipboardRead, TypeClipboardWrite, TypeCursor, TypeSemanticLabel, TypeSemanticDesc, TypeSelection:
return 1
case TypeImage, TypeSource, TypeTarget:
case TypeImage, TypeSource, TypeTarget, TypeSnippet:
return 2
case TypeOffer:
return 3