feat: port the client to MyGo native UI (0.3.0)
Switch from Asuka to MyGo, keeping the API client and the feature set: - servers: saved servers, passwordless and password login, proxy, self-signed certificates, per-server device tokens (Keystore), connect form, instance list sheet with switch/disconnect - sessions: virtualized list, search, new session, rename/archive/delete, running indicator, event stream keeps it live - chat: pushed window with system back bar, streaming Markdown via ui/markdown, reasoning and tool rows with image previews, footer menu (read aloud via a Kotlin TTS plugin, copy, fork), user message menu (copy, revert, fork), context usage ring and detail sheet, attachments (photos/files via the document picker), permissions - release builds allow plain http:// LAN servers (Go's net/http dials directly, no cleartext manifest needed) - a local fork of MyGo (third_party/mygo) lowers the Android host's minSdk to 24 (Android 7.0); Go 1.27.4 via mise Version 0.3.0.
This commit is contained in:
1 parent
2fb4a8ea79
commit
6c0ee61750
2538 files changed
+675779
-4792
No files matched your search
+59
@@ -0,0 +1,59 @@
|
||||
//go:build linux && !android && (amd64 || arm64)
|
||||
|
||||
package linux
|
||||
|
||||
import (
|
||||
"slices"
|
||||
|
||||
"github.com/egoist/mygo/internal/platform"
|
||||
)
|
||||
|
||||
// The fingers' taps, scrolls and pinches are platform.TouchGesture's
|
||||
// (surface.go gives it GTK's touches).
|
||||
|
||||
// touchPoints numbers the fingers on a surface for the views that follow
|
||||
// each (platform.TouchDown): GDK's sequences, which it frees and gives the
|
||||
// fingers after, become IDs counted from 1.
|
||||
type touchPoints struct {
|
||||
down []touchPoint
|
||||
last uint64
|
||||
}
|
||||
|
||||
type touchPoint struct {
|
||||
seq uintptr
|
||||
id uint64
|
||||
}
|
||||
|
||||
// event returns the kind and the finger's ID of the touch event of a
|
||||
// GdkEventTouch of type typ (GDK_TOUCH_BEGIN 37, UPDATE 38, END 39, CANCEL
|
||||
// 40) of seq, and false for a sequence that did not begin here.
|
||||
func (p *touchPoints) event(typ int32, seq uintptr) (kind platform.SurfaceEventKind, id uint64, ok bool) {
|
||||
i := slices.IndexFunc(p.down, func(t touchPoint) bool { return t.seq == seq })
|
||||
switch {
|
||||
case typ == 37 && i < 0:
|
||||
p.last++
|
||||
p.down = append(p.down, touchPoint{seq, p.last})
|
||||
return platform.TouchDown, p.last, true
|
||||
case i < 0, typ == 37:
|
||||
return 0, 0, false
|
||||
case typ == 38:
|
||||
return platform.TouchMove, p.down[i].id, true
|
||||
}
|
||||
id = p.down[i].id
|
||||
p.down = slices.Delete(p.down, i, i+1)
|
||||
if typ == 40 {
|
||||
return platform.TouchCancel, id, true
|
||||
}
|
||||
return platform.TouchUp, id, true
|
||||
}
|
||||
|
||||
// reset forgets the fingers down, whose ends went unseen, returning their
|
||||
// IDs, which the surface cancels.
|
||||
func (p *touchPoints) reset() []uint64 {
|
||||
var ids []uint64
|
||||
for _, t := range p.down {
|
||||
ids = append(ids, t.id)
|
||||
}
|
||||
p.down = p.down[:0]
|
||||
return ids
|
||||
}
|
||||
Reference in new issue
Block a user