diff --git a/.goreleaser.yml b/.goreleaser.yml index f8db096..6ec6f7e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,6 +1,6 @@ # This is an example .goreleaser.yml file with some sensible defaults. # Make sure to check the documentation at https://goreleaser.com -project_name: npc +project_name: ppf before: hooks: # You may remove this if you don't use go modules. @@ -8,9 +8,9 @@ before: # you may remove this if you don't need go generate - go generate ./... builds: - - main: ./cmd/npc/main.go - id: "npc" - binary: npc + - main: ./cmd/ppf/main.go + id: "ppf" + binary: ppf # env: # - CGO_ENABLED=0 goarch: diff --git a/app.go b/app.go index d10de80..bfbfd54 100644 --- a/app.go +++ b/app.go @@ -1,4 +1,4 @@ -package npc +package ppf import ( "fyne.io/fyne/v2" @@ -9,7 +9,7 @@ import ( func Appmain() { a := app.New() - w := a.NewWindow("Hello") + w := a.NewWindow("ProtocolPacketForger") w.Resize(fyne.NewSize(800, 600)) hello := widget.NewLabel("Hello Fyne!") @@ -26,3 +26,31 @@ func Appmain() { w.ShowAndRun() } + +type ppfApp struct { + Toolbar *fyne.Container + Metadata *fyne.Container + Extensions *fyne.Container + ContextBar *fyne.Container + Workarea *fyne.Container + Settings map[string]string + ProtocolForging bool +} + +var application ppfApp + +func CreateApp() *fyne.Container { + + return container.NewBorder( + application.Toolbar, + application.Metadata, + application.ContextBar, + application.Extensions, + container.NewVScroll(application.Workarea), + ) +} + +func CreateToolbar() *fyne.Container { + + return nil +} diff --git a/cmd/npc/main.go b/cmd/npc/main.go deleted file mode 100644 index d6e1e0b..0000000 --- a/cmd/npc/main.go +++ /dev/null @@ -1,9 +0,0 @@ -package main - -import ( - "gitea.mmo.to/NetworkPacketComposer/npc" -) - -func main() { - npc.Appmain() -} diff --git a/cmd/ppf/main.go b/cmd/ppf/main.go new file mode 100644 index 0000000..776b5a8 --- /dev/null +++ b/cmd/ppf/main.go @@ -0,0 +1,9 @@ +package main + +import ( + "gitea.mmo.to/ProtocolPacketForger/ppf" +) + +func main() { + ppf.Appmain() +} diff --git a/controller.go b/controller.go index 2d8362d..218ff97 100644 --- a/controller.go +++ b/controller.go @@ -1,4 +1,4 @@ -package npc +package ppf func NewDataModel(name string) *DataModel { return &DataModel{ @@ -26,7 +26,7 @@ func (dm *DataModel) SaveNewProtocol(editorContent ProtocolEditor) { } -func (dm *DataModel) GetPackageEditor() *PackageEditor { +func (dm *DataModel) GetPacketEditor() *PacketEditor { return nil } @@ -35,7 +35,7 @@ func (dm *DataModel) SwitchToProtocolEditor() { } -func (dm *DataModel) SyncPackageEditor(pkgedt *PackageEditor) { +func (dm *DataModel) SyncPacketEditor(pkgedt *PacketEditor) { } diff --git a/fieldadd.go b/fieldadd.go index a4e7c99..f515cff 100644 --- a/fieldadd.go +++ b/fieldadd.go @@ -1,4 +1,4 @@ -package npc +package ppf import ( "fyne.io/fyne/v2/widget" diff --git a/fieldcreator.go b/fieldcreator.go index 05b4873..7cc4554 100644 --- a/fieldcreator.go +++ b/fieldcreator.go @@ -1,4 +1,4 @@ -package npc +package ppf import ( "fyne.io/fyne/v2" diff --git a/fieldview.go b/fieldview.go index 9de3869..899a709 100644 --- a/fieldview.go +++ b/fieldview.go @@ -1,4 +1,4 @@ -package npc +package ppf import "fyne.io/fyne/v2/widget" diff --git a/flowlayout.go b/flowlayout.go index 4e63168..d1cef17 100644 --- a/flowlayout.go +++ b/flowlayout.go @@ -1,4 +1,4 @@ -package npc +package ppf import ( "fyne.io/fyne/v2" diff --git a/flowlayout_test.go b/flowlayout_test.go deleted file mode 100644 index 47b0a26..0000000 --- a/flowlayout_test.go +++ /dev/null @@ -1,24 +0,0 @@ -package npc - -import ( - "fmt" - "testing" - - "fyne.io/fyne/v2" - "fyne.io/fyne/v2/test" - "fyne.io/fyne/v2/widget" -) - -func TestFlowLayout_Simple(t *testing.T) { - //padding := theme.Padding() - objs := []fyne.CanvasObject{ - widget.NewLabel("Hello World"), - } - layout := NewFlowLayout(objs...) - win := test.NewWindow(layout) - defer win.Close() - - win.Resize(fyne.NewSize(200, 200)) - size := layout.Size() - fmt.Printf("%v", size) -} diff --git a/go.mod b/go.mod index b04f4c0..b2e33be 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module gitea.mmo.to/NetworkPacketComposer/npc +module gitea.mmo.to/ProtocolPacketForger/ppf go 1.19 @@ -18,7 +18,6 @@ require ( github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff // indirect github.com/gopherjs/gopherjs v1.17.2 // indirect github.com/jsummers/gobmp v0.0.0-20151104160322-e2ba15ffa76e // indirect - github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564 // indirect github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9 // indirect diff --git a/go.sum b/go.sum index bd9bc42..d87edee 100644 --- a/go.sum +++ b/go.sum @@ -207,8 +207,6 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= -github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lucor/goinfo v0.0.0-20210802170112-c078a2b0f08b/go.mod h1:PRq09yoB+Q2OJReAmwzKivcYyremnibWGbK7WfftHzc= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= diff --git a/packageeditor.go b/packeteditor.go similarity index 60% rename from packageeditor.go rename to packeteditor.go index 83b5e6e..433c20c 100644 --- a/packageeditor.go +++ b/packeteditor.go @@ -1,7 +1,7 @@ -package npc +package ppf import "fyne.io/fyne/v2" -type PackageEditor struct { +type PacketEditor struct { Representation *fyne.Container } diff --git a/protocoleditor.go b/protocoleditor.go index 885faf2..edc3bab 100644 --- a/protocoleditor.go +++ b/protocoleditor.go @@ -1,4 +1,4 @@ -package npc +package ppf import ( "fyne.io/fyne/v2" diff --git a/structure.go b/structure.go index 88b2803..2c2a85b 100644 --- a/structure.go +++ b/structure.go @@ -1,4 +1,4 @@ -package npc +package ppf type Field struct { Name string // Name of the Field