Skip to content

Commit

Permalink
add support for gomobile
Browse files Browse the repository at this point in the history
missing features and problems:

- stuff gets drawn under the status bar
- orientation changes aren't handled at all and after the first one the
  app will not respond to touches correctly
- pinch or any other gesture is unsupported
- scrolling by dragging anywhere is unsupported
- no way to show/hide software keyboard (either automatically or manually)
- software rendering is probably too slow for ARM CPUs
  • Loading branch information
aarzilli committed Mar 20, 2019
1 parent 24b1359 commit 4926841
Show file tree
Hide file tree
Showing 88 changed files with 11,441 additions and 507 deletions.
3 changes: 3 additions & 0 deletions _examples/demo/overview.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ func (od *overviewDemo) overviewMenubar(w *nucular.Window) {
w.Progress(&od.Prog, 100, true)
w.SliderInt(0, &od.Slider, 16, 1)
w.CheckboxText("check", &od.Check)
perf := w.Master().GetPerf()
w.CheckboxText("Show perf", &perf)
w.Master().SetPerf(perf)
if w.MenuItem(label.TA("Close", "LC")) {
go w.Master().Close()
}
Expand Down
3 changes: 3 additions & 0 deletions _examples/overview/overview.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@ func (od *overviewDemo) overviewMenubar(w *nucular.Window) {
w.Progress(&od.Prog, 100, true)
w.SliderInt(0, &od.Slider, 16, 1)
w.CheckboxText("check", &od.Check)
perf := w.Master().GetPerf()
w.CheckboxText("Show perf", &perf)
w.Master().SetPerf(perf)
}
if w := w.Menu(label.TA("THEME", "CC"), 180, nil); w != nil {
w.Row(25).Dynamic(1)
Expand Down
2 changes: 2 additions & 0 deletions clipboard/clipboard_linux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !android

package clipboard

import (
Expand Down
17 changes: 17 additions & 0 deletions clipboard/clipboard_other.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// +build !windows,!linux,!darwin android

package clipboard

func Start() {
}

func Get() string {
return ""
}

func GetPrimary() string {
return ""
}

func Set(text string) {
}
28 changes: 0 additions & 28 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,6 @@ import (
"golang.org/x/mobile/event/mouse"
)

type MasterWindow interface {
context() *context

Main()
Changed()
Close()
Closed() bool
ActivateEditor(ed *TextEditor)

Style() *nstyle.Style
SetStyle(*nstyle.Style)

GetPerf() bool
SetPerf(bool)

Input() *Input

PopupOpen(title string, flags WindowFlags, rect rect.Rect, scale bool, updateFn UpdateFn)

Walk(WindowWalkFn)
ResetWindows() *DockSplit

Lock()
Unlock()
}

type WindowWalkFn func(title string, data interface{}, docked bool, splitSize int, rect rect.Rect)

const perfUpdate = false
const dumpFrame = false

Expand Down
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ require (
github.com/BurntSushi/xgb v0.0.0-20160522221800-27f122750802
github.com/golang/freetype v0.0.0-20161208064710-d9be45aaf745
github.com/hashicorp/golang-lru v0.0.0-20160813221303-0a025b7e63ad
golang.org/x/exp v0.0.0-20171209012058-072991165226
golang.org/x/image v0.0.0-20170331233916-ce0faa1867f5
golang.org/x/mobile v0.0.0-20170307115833-eb9032959f05
golang.org/x/sys v0.0.0-20160717071931-a646d33e2ee3 // indirect
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067
golang.org/x/mobile v0.0.0-20190318164015-6bd122906c08
)
9 changes: 9 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,18 @@ github.com/hashicorp/golang-lru v0.0.0-20160813221303-0a025b7e63ad h1:eMxs9EL0Pv
github.com/hashicorp/golang-lru v0.0.0-20160813221303-0a025b7e63ad/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
golang.org/x/exp v0.0.0-20171209012058-072991165226 h1:sb67HiWk98LHu6TtgnfVTHraZYkXLgFRJlXcNahrXCc=
golang.org/x/exp v0.0.0-20171209012058-072991165226/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8 h1:idBdZTd9UioThJp8KpM/rTSinK/ChZFBE43/WtIy8zg=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/image v0.0.0-20170331233916-ce0faa1867f5 h1:Y8k2xgnl71xxKST1qLiv87kmWlHW0oAu9SaUXmIxE1s=
golang.org/x/image v0.0.0-20170331233916-ce0faa1867f5/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067 h1:KYGJGHOQy8oSi1fDlSpcZF0+juKwk/hEMv5SiwHogR0=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/mobile v0.0.0-20170307115833-eb9032959f05 h1:SfnKURPqpZR7R25slH48KrxWWFWNkMWMkE9ntmoPgTg=
golang.org/x/mobile v0.0.0-20170307115833-eb9032959f05/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190318164015-6bd122906c08 h1:REhdg1qxVTaAJcvh9BOGNgt2kd+KiUZ148XXlLp08FU=
golang.org/x/mobile v0.0.0-20190318164015-6bd122906c08/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/sys v0.0.0-20160717071931-a646d33e2ee3 h1:ZLExsLvnoqWSw6JB6k6RjWobIHGR3NG9dzVANJ7SVKc=
golang.org/x/sys v0.0.0-20160717071931-a646d33e2ee3/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313 h1:pczuHS43Cp2ktBEEmLwScxgjWsBSzdaQiKzUyf3DTTc=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Loading

0 comments on commit 4926841

Please sign in to comment.