2
0
mirror of https://github.com/OrbTools/OrbBind synced 2024-10-31 03:20:26 +00:00

refactoring

This commit is contained in:
Minizbot2012 2021-02-09 14:02:50 -08:00
parent 302551f439
commit 9804803369
7 changed files with 11 additions and 34 deletions

1
go.mod
View File

@ -4,6 +4,7 @@ go 1.15
require (
fyne.io/fyne v1.4.3
github.com/OrbTools/OrbCommon v0.0.0-20210209215542-e5d03278f0d5
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20201108214237-06ea97f0c265 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/srwiley/oksvg v0.0.0-20210209000435-a757b9cbd472 // indirect

4
go.sum
View File

@ -1,6 +1,10 @@
fyne.io/fyne v1.4.3 h1:356CnXCiYrrfaLGsB7qLK3c6ktzyh8WR05v/2RBu51I=
fyne.io/fyne v1.4.3/go.mod h1:8kiPBNSDmuplxs9WnKCkaWYqbcXFy0DeAzwa6PBO9Z8=
github.com/Kodeworks/golang-image-ico v0.0.0-20141118225523-73f0f4cfade9/go.mod h1:7uhhqiBaR4CpN0k9rMjOtjpcfGd6DG2m04zQxKnWQ0I=
github.com/OrbTools/OrbCommon v0.0.0-20210209212230-c28d897d2760 h1:2eOcDeOxaRpMd0OIt3jsSl7EjPSzu8FYsGOqM+ilOgE=
github.com/OrbTools/OrbCommon v0.0.0-20210209212230-c28d897d2760/go.mod h1:ErdpS2Y/8Ik89IDNsH+yaOWo/XcKzf4riEBfPG3xK+o=
github.com/OrbTools/OrbCommon v0.0.0-20210209215542-e5d03278f0d5 h1:W48w6MC69gxrqfR2xPUjaPyB7SWOAP6szppMvIKwauI=
github.com/OrbTools/OrbCommon v0.0.0-20210209215542-e5d03278f0d5/go.mod h1:ErdpS2Y/8Ik89IDNsH+yaOWo/XcKzf4riEBfPG3xK+o=
github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -1,28 +0,0 @@
package orbweaver
import (
"encoding/binary"
"fyne.io/fyne"
)
//PKM format for altering the keymap
type PKM struct {
MIP [20]uint16
SIP [6]uint16
COL [3]byte
}
//SaveIntoKeymap saves an orb
func SaveIntoKeymap(mapped *PKM, file fyne.URIWriteCloser) {
binary.Write(file, binary.LittleEndian, mapped)
file.Close()
}
//LoadFile loads an orb
func LoadFile(file fyne.URIReadCloser) *PKM {
mapped := new(PKM)
binary.Read(file, binary.LittleEndian, mapped)
file.Close()
return mapped
}

View File

@ -5,10 +5,10 @@ import (
"fyne.io/fyne/app"
"fyne.io/fyne/dialog"
"fyne.io/fyne/widget"
"github.com/OrbTools/OrbBind/keymap/orbweaver"
"github.com/OrbTools/OrbBind/ui/baseui"
"github.com/OrbTools/OrbBind/ui/mainpage"
"github.com/OrbTools/OrbBind/ui/sidepage"
"github.com/OrbTools/OrbCommon/devices/orbweaver"
)
func main() {
@ -31,7 +31,7 @@ func main() {
return
}
if writer != nil {
orbweaver.SaveIntoKeymap(omap, writer)
orbweaver.SavePKMKeymap(omap, writer)
}
}, window)
}), fyne.NewMenuItem("Load", func() {
@ -41,7 +41,7 @@ func main() {
return
}
if reader != nil {
omap = orbweaver.LoadFile(reader)
omap = orbweaver.LoadPKMKeymap(reader)
pages["main"].SetBindings(omap)
pages["side"].SetBindings(omap)
}

View File

@ -3,7 +3,7 @@ package baseui
import (
"fyne.io/fyne"
"fyne.io/fyne/widget"
"github.com/OrbTools/OrbBind/keymap/orbweaver"
"github.com/OrbTools/OrbCommon/devices/orbweaver"
)
//BasicPage creates a very basic Page

View File

@ -7,8 +7,8 @@ import (
"fyne.io/fyne/dialog"
"fyne.io/fyne/layout"
"fyne.io/fyne/widget"
"github.com/OrbTools/OrbBind/keymap/orbweaver"
"github.com/OrbTools/OrbBind/ui/bind"
"github.com/OrbTools/OrbCommon/devices/orbweaver"
)
//Page is a basic page

View File

@ -7,8 +7,8 @@ import (
"fyne.io/fyne/dialog"
"fyne.io/fyne/layout"
"fyne.io/fyne/widget"
"github.com/OrbTools/OrbBind/keymap/orbweaver"
"github.com/OrbTools/OrbBind/ui/bind"
"github.com/OrbTools/OrbCommon/devices/orbweaver"
)
//Page Overweave side button configs