Toolbar commands

This commit is contained in:
Ivan Izaguirre 2020-10-11 20:31:55 +02:00 committed by Iván Izaguirre
parent adcf87c29a
commit 17f1121980
13 changed files with 168 additions and 34 deletions

View File

@ -9,18 +9,17 @@ import (
)
type keyboard struct {
a *izapple2.Apple2
s *state
keyChannel *izapple2.KeyboardChannel
controlLeft bool
controlRight bool
showPages bool
}
func newKeyboard(a *izapple2.Apple2) *keyboard {
func newKeyboard(s *state) *keyboard {
var k keyboard
k.a = a
k.keyChannel = izapple2.NewKeyboardChannel(a)
k.s = s
k.keyChannel = izapple2.NewKeyboardChannel(s.a)
return &k
}
@ -95,34 +94,34 @@ func (k *keyboard) putKey(keyEvent *fyne.KeyEvent) {
// Control of the emulator
case fyne.KeyF1:
if ctrl {
k.a.SendCommand(izapple2.CommandReset)
k.s.a.SendCommand(izapple2.CommandReset)
}
case fyne.KeyF5:
if ctrl {
k.a.SendCommand(izapple2.CommandShowSpeed)
k.s.a.SendCommand(izapple2.CommandShowSpeed)
} else {
k.a.SendCommand(izapple2.CommandToggleSpeed)
k.s.a.SendCommand(izapple2.CommandToggleSpeed)
}
case fyne.KeyF6:
k.a.SendCommand(izapple2.CommandToggleColor)
k.s.a.SendCommand(izapple2.CommandToggleColor)
case fyne.KeyF7:
k.showPages = !k.showPages
k.s.showPages = !k.s.showPages
case fyne.KeyF9:
k.a.SendCommand(izapple2.CommandDumpDebugInfo)
k.s.a.SendCommand(izapple2.CommandDumpDebugInfo)
case fyne.KeyF10:
k.a.SendCommand(izapple2.CommandNextCharGenPage)
k.s.a.SendCommand(izapple2.CommandNextCharGenPage)
case fyne.KeyF11:
k.a.SendCommand(izapple2.CommandToggleCPUTrace)
k.s.a.SendCommand(izapple2.CommandToggleCPUTrace)
case fyne.KeyF12:
case fyne.KeyPrintScreen:
err := izapple2.SaveSnapshot(k.a, "snapshot.png")
err := izapple2.SaveSnapshot(k.s.a, "snapshot.png")
if err != nil {
fmt.Printf("Error saving snapshoot: %v.\n.", err)
} else {
fmt.Println("Saving snapshot")
}
case fyne.KeyPause:
k.a.SendCommand(izapple2.CommandPauseUnpauseEmulator)
k.s.a.SendCommand(izapple2.CommandPauseUnpauseEmulator)
}
// Missing values 91 to 95. Usually control for [\]^_

View File

@ -1,6 +1,8 @@
package main
import (
"fmt"
"image"
"time"
"github.com/ivanizag/izapple2"
@ -12,42 +14,90 @@ import (
"fyne.io/fyne/canvas"
"fyne.io/fyne/driver/desktop"
"fyne.io/fyne/layout"
"fyne.io/fyne/theme"
"fyne.io/fyne/widget"
)
type state struct {
a *izapple2.Apple2
showPages bool
}
func main() {
a := izapple2.MainApple()
if a != nil {
if a.IsProfiling() {
var s state
s.a = izapple2.MainApple()
if s.a != nil {
if s.a.IsProfiling() {
// See the log with:
// go tool pprof --pdf ~/go/bin/izapple2sdl /tmp/profile329536248/cpu.pprof > profile.pdf
defer profile.Start().Stop()
}
fyneRun(a)
fyneRun(&s)
}
}
func fyneRun(a *izapple2.Apple2) {
func fyneRun(s *state) {
app := app.New()
// app.SetIcon(xxx)
window := app.NewWindow("iz-" + a.Name)
window := app.NewWindow("iz-" + s.a.Name)
// window.SetIcon(xxx)
bottom := widget.NewToolbar(
widget.NewToolbarAction(
theme.NewThemedResource(resourceRestartSvg, nil), func() {
s.a.SendCommand(izapple2.CommandReset)
}),
widget.NewToolbarAction(
theme.NewThemedResource(resourcePauseSvg, nil), func() {
s.a.SendCommand(izapple2.CommandPauseUnpauseEmulator)
}),
widget.NewToolbarAction(
theme.NewThemedResource(resourceFastForwardSvg, nil), func() {
s.a.SendCommand(izapple2.CommandToggleSpeed)
}),
widget.NewToolbarSeparator(),
widget.NewToolbarAction(
theme.NewThemedResource(resourcePaletteSvg, nil), func() {
s.a.SendCommand(izapple2.CommandToggleColor)
}),
widget.NewToolbarAction(
theme.NewThemedResource(resourceLayersTripleSvg, nil), func() {
s.showPages = !s.showPages
if !s.showPages {
window.SetTitle("iz-" + s.a.Name)
}
}),
widget.NewToolbarAction(
theme.NewThemedResource(resourceCameraSvg, nil), func() {
err := izapple2.SaveSnapshot(s.a, "snapshot.png")
if err != nil {
app.SendNotification(fyne.NewNotification(window.Title(),
fmt.Sprintf("Error saving snapshoot: %v.\n.", err)))
} else {
app.SendNotification(fyne.NewNotification(window.Title(),
"Saving snapshot on 'snapshot.png'"))
}
}),
widget.NewToolbarSpacer(),
widget.NewToolbarAction(theme.ViewFullScreenIcon(), func() {
window.SetFullScreen(!window.FullScreen())
}),
)
screen := canvas.NewImageFromImage(nil)
top := widget.NewLabel("Top")
bottom := widget.NewLabel("Bottom")
right := widget.NewLabel("Right")
screen.SetMinSize(fyne.NewSize(380, 192))
container := fyne.NewContainerWithLayout(
layout.NewBorderLayout(top, bottom, nil, right),
screen, top, bottom, right,
layout.NewBorderLayout(nil, bottom, nil, nil),
screen, bottom,
)
window.SetContent(container)
window.SetPadded(false)
registerKeyboardEvents(a, window.Canvas())
registerKeyboardEvents(s, window.Canvas())
go a.Run()
go s.a.Run()
ticker := time.NewTicker(60 * time.Millisecond)
done := make(chan bool)
@ -57,8 +107,14 @@ func fyneRun(a *izapple2.Apple2) {
case <-done:
return
case <-ticker.C:
if !a.IsPaused() {
img := a.Snapshot()
if !s.a.IsPaused() {
var img *image.RGBA
if s.showPages {
img = s.a.SnapshotParts()
window.SetTitle(fmt.Sprintf("%v %v %vx%v", s.a.Name, s.a.VideoModeName(), img.Rect.Dx()/2, img.Rect.Dy()/2))
} else {
img = s.a.Snapshot()
}
screen.Image = img
canvas.Refresh(screen)
}
@ -75,8 +131,8 @@ func fyneRun(a *izapple2.Apple2) {
}
func registerKeyboardEvents(a *izapple2.Apple2, canvas fyne.Canvas) {
kp := newKeyboard(a)
func registerKeyboardEvents(s *state, canvas fyne.Canvas) {
kp := newKeyboard(s)
// Koyboard events
canvas.SetOnTypedKey(func(ke *fyne.KeyEvent) {

13
izapple2fyne/notes.md Normal file
View File

@ -0,0 +1,13 @@
# Fyne
- Tooltip on widgets. As there is a Hoverable, it would be nice to have Tooltipable¿? and check on mouse move.
```
type Tooltipable interface {
Tooltip() string
}
```
- Text on the toolabar items, at least tooltips
- Missing keys for Pause and for PrintScreen.
- RunOnMain()
- Buttons with state: pressed, disabled

43
izapple2fyne/resources.go Normal file
View File

@ -0,0 +1,43 @@
package main
import "fyne.io/fyne"
var resourceCameraSvg = &fyne.StaticResource{
StaticName: "camera.svg",
StaticContent: []byte{
60, 63, 120, 109, 108, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 32, 101, 110, 99, 111, 100, 105, 110, 103, 61, 34, 85, 84, 70, 45, 56, 34, 63, 62, 60, 33, 68, 79, 67, 84, 89, 80, 69, 32, 115, 118, 103, 32, 80, 85, 66, 76, 73, 67, 32, 34, 45, 47, 47, 87, 51, 67, 47, 47, 68, 84, 68, 32, 83, 86, 71, 32, 49, 46, 49, 47, 47, 69, 78, 34, 32, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 71, 114, 97, 112, 104, 105, 99, 115, 47, 83, 86, 71, 47, 49, 46, 49, 47, 68, 84, 68, 47, 115, 118, 103, 49, 49, 46, 100, 116, 100, 34, 62, 60, 115, 118, 103, 32, 120, 109, 108, 110, 115, 61, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 50, 48, 48, 48, 47, 115, 118, 103, 34, 32, 120, 109, 108, 110, 115, 58, 120, 108, 105, 110, 107, 61, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 49, 57, 57, 57, 47, 120, 108, 105, 110, 107, 34, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 49, 34, 32, 119, 105, 100, 116, 104, 61, 34, 50, 52, 34, 32, 104, 101, 105, 103, 104, 116, 61, 34, 50, 52, 34, 32, 118, 105, 101, 119, 66, 111, 120, 61, 34, 48, 32, 48, 32, 50, 52, 32, 50, 52, 34, 62, 60, 112, 97, 116, 104, 32, 100, 61, 34, 77, 52, 44, 52, 72, 55, 76, 57, 44, 50, 72, 49, 53, 76, 49, 55, 44, 52, 72, 50, 48, 65, 50, 44, 50, 32, 48, 32, 48, 44, 49, 32, 50, 50, 44, 54, 86, 49, 56, 65, 50, 44, 50, 32, 48, 32, 48, 44, 49, 32, 50, 48, 44, 50, 48, 72, 52, 65, 50, 44, 50, 32, 48, 32, 48, 44, 49, 32, 50, 44, 49, 56, 86, 54, 65, 50, 44, 50, 32, 48, 32, 48, 44, 49, 32, 52, 44, 52, 77, 49, 50, 44, 55, 65, 53, 44, 53, 32, 48, 32, 48, 44, 48, 32, 55, 44, 49, 50, 65, 53, 44, 53, 32, 48, 32, 48, 44, 48, 32, 49, 50, 44, 49, 55, 65, 53, 44, 53, 32, 48, 32, 48, 44, 48, 32, 49, 55, 44, 49, 50, 65, 53, 44, 53, 32, 48, 32, 48, 44, 48, 32, 49, 50, 44, 55, 77, 49, 50, 44, 57, 65, 51, 44, 51, 32, 48, 32, 48, 44, 49, 32, 49, 53, 44, 49, 50, 65, 51, 44, 51, 32, 48, 32, 48, 44, 49, 32, 49, 50, 44, 49, 53, 65, 51, 44, 51, 32, 48, 32, 48, 44, 49, 32, 57, 44, 49, 50, 65, 51, 44, 51, 32, 48, 32, 48, 44, 49, 32, 49, 50, 44, 57, 90, 34, 32, 47, 62, 60, 47, 115, 118, 103, 62}}
var resourceFastForwardSvg = &fyne.StaticResource{
StaticName: "fast-forward.svg",
StaticContent: []byte{
60, 63, 120, 109, 108, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 32, 101, 110, 99, 111, 100, 105, 110, 103, 61, 34, 85, 84, 70, 45, 56, 34, 63, 62, 60, 33, 68, 79, 67, 84, 89, 80, 69, 32, 115, 118, 103, 32, 80, 85, 66, 76, 73, 67, 32, 34, 45, 47, 47, 87, 51, 67, 47, 47, 68, 84, 68, 32, 83, 86, 71, 32, 49, 46, 49, 47, 47, 69, 78, 34, 32, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 71, 114, 97, 112, 104, 105, 99, 115, 47, 83, 86, 71, 47, 49, 46, 49, 47, 68, 84, 68, 47, 115, 118, 103, 49, 49, 46, 100, 116, 100, 34, 62, 60, 115, 118, 103, 32, 120, 109, 108, 110, 115, 61, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 50, 48, 48, 48, 47, 115, 118, 103, 34, 32, 120, 109, 108, 110, 115, 58, 120, 108, 105, 110, 107, 61, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 49, 57, 57, 57, 47, 120, 108, 105, 110, 107, 34, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 49, 34, 32, 119, 105, 100, 116, 104, 61, 34, 50, 52, 34, 32, 104, 101, 105, 103, 104, 116, 61, 34, 50, 52, 34, 32, 118, 105, 101, 119, 66, 111, 120, 61, 34, 48, 32, 48, 32, 50, 52, 32, 50, 52, 34, 62, 60, 112, 97, 116, 104, 32, 100, 61, 34, 77, 49, 51, 44, 54, 86, 49, 56, 76, 50, 49, 46, 53, 44, 49, 50, 77, 52, 44, 49, 56, 76, 49, 50, 46, 53, 44, 49, 50, 76, 52, 44, 54, 86, 49, 56, 90, 34, 32, 47, 62, 60, 47, 115, 118, 103, 62}}
var resourceFormatFontSvg = &fyne.StaticResource{
StaticName: "format-font.svg",
StaticContent: []byte{
60, 63, 120, 109, 108, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 32, 101, 110, 99, 111, 100, 105, 110, 103, 61, 34, 85, 84, 70, 45, 56, 34, 63, 62, 60, 33, 68, 79, 67, 84, 89, 80, 69, 32, 115, 118, 103, 32, 80, 85, 66, 76, 73, 67, 32, 34, 45, 47, 47, 87, 51, 67, 47, 47, 68, 84, 68, 32, 83, 86, 71, 32, 49, 46, 49, 47, 47, 69, 78, 34, 32, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 71, 114, 97, 112, 104, 105, 99, 115, 47, 83, 86, 71, 47, 49, 46, 49, 47, 68, 84, 68, 47, 115, 118, 103, 49, 49, 46, 100, 116, 100, 34, 62, 60, 115, 118, 103, 32, 120, 109, 108, 110, 115, 61, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 50, 48, 48, 48, 47, 115, 118, 103, 34, 32, 120, 109, 108, 110, 115, 58, 120, 108, 105, 110, 107, 61, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 49, 57, 57, 57, 47, 120, 108, 105, 110, 107, 34, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 49, 34, 32, 119, 105, 100, 116, 104, 61, 34, 50, 52, 34, 32, 104, 101, 105, 103, 104, 116, 61, 34, 50, 52, 34, 32, 118, 105, 101, 119, 66, 111, 120, 61, 34, 48, 32, 48, 32, 50, 52, 32, 50, 52, 34, 62, 60, 112, 97, 116, 104, 32, 100, 61, 34, 77, 49, 55, 44, 56, 72, 50, 48, 86, 50, 48, 72, 50, 49, 86, 50, 49, 72, 49, 55, 86, 50, 48, 72, 49, 56, 86, 49, 55, 72, 49, 52, 76, 49, 50, 46, 53, 44, 50, 48, 72, 49, 52, 86, 50, 49, 72, 49, 48, 86, 50, 48, 72, 49, 49, 76, 49, 55, 44, 56, 77, 49, 56, 44, 57, 76, 49, 52, 46, 53, 44, 49, 54, 72, 49, 56, 86, 57, 77, 53, 44, 51, 72, 49, 48, 67, 49, 49, 46, 49, 49, 44, 51, 32, 49, 50, 44, 51, 46, 56, 57, 32, 49, 50, 44, 53, 86, 49, 54, 72, 57, 86, 49, 49, 72, 54, 86, 49, 54, 72, 51, 86, 53, 67, 51, 44, 51, 46, 56, 57, 32, 51, 46, 56, 57, 44, 51, 32, 53, 44, 51, 77, 54, 44, 53, 86, 57, 72, 57, 86, 53, 72, 54, 90, 34, 32, 47, 62, 60, 47, 115, 118, 103, 62}}
var resourceLayersTripleSvg = &fyne.StaticResource{
StaticName: "layers-triple.svg",
StaticContent: []byte{
60, 63, 120, 109, 108, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 32, 101, 110, 99, 111, 100, 105, 110, 103, 61, 34, 85, 84, 70, 45, 56, 34, 63, 62, 60, 33, 68, 79, 67, 84, 89, 80, 69, 32, 115, 118, 103, 32, 80, 85, 66, 76, 73, 67, 32, 34, 45, 47, 47, 87, 51, 67, 47, 47, 68, 84, 68, 32, 83, 86, 71, 32, 49, 46, 49, 47, 47, 69, 78, 34, 32, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 71, 114, 97, 112, 104, 105, 99, 115, 47, 83, 86, 71, 47, 49, 46, 49, 47, 68, 84, 68, 47, 115, 118, 103, 49, 49, 46, 100, 116, 100, 34, 62, 60, 115, 118, 103, 32, 120, 109, 108, 110, 115, 61, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 50, 48, 48, 48, 47, 115, 118, 103, 34, 32, 120, 109, 108, 110, 115, 58, 120, 108, 105, 110, 107, 61, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 49, 57, 57, 57, 47, 120, 108, 105, 110, 107, 34, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 49, 34, 32, 119, 105, 100, 116, 104, 61, 34, 50, 52, 34, 32, 104, 101, 105, 103, 104, 116, 61, 34, 50, 52, 34, 32, 118, 105, 101, 119, 66, 111, 120, 61, 34, 48, 32, 48, 32, 50, 52, 32, 50, 52, 34, 62, 60, 112, 97, 116, 104, 32, 100, 61, 34, 77, 49, 50, 32, 48, 76, 51, 32, 55, 76, 52, 46, 54, 51, 32, 56, 46, 50, 55, 76, 49, 50, 32, 49, 52, 76, 49, 57, 46, 51, 54, 32, 56, 46, 50, 55, 76, 50, 49, 32, 55, 76, 49, 50, 32, 48, 77, 49, 57, 46, 51, 55, 32, 49, 48, 46, 55, 51, 76, 49, 50, 32, 49, 54, 46, 52, 55, 76, 52, 46, 54, 50, 32, 49, 48, 46, 55, 52, 76, 51, 32, 49, 50, 76, 49, 50, 32, 49, 57, 76, 50, 49, 32, 49, 50, 76, 49, 57, 46, 51, 55, 32, 49, 48, 46, 55, 51, 77, 49, 57, 46, 51, 55, 32, 49, 53, 46, 55, 51, 76, 49, 50, 32, 50, 49, 46, 52, 55, 76, 52, 46, 54, 50, 32, 49, 53, 46, 55, 52, 76, 51, 32, 49, 55, 76, 49, 50, 32, 50, 52, 76, 50, 49, 32, 49, 55, 76, 49, 57, 46, 51, 55, 32, 49, 53, 46, 55, 51, 90, 34, 32, 47, 62, 60, 47, 115, 118, 103, 62}}
var resourcePaletteSvg = &fyne.StaticResource{
StaticName: "palette.svg",
StaticContent: []byte{
60, 63, 120, 109, 108, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 32, 101, 110, 99, 111, 100, 105, 110, 103, 61, 34, 85, 84, 70, 45, 56, 34, 63, 62, 60, 33, 68, 79, 67, 84, 89, 80, 69, 32, 115, 118, 103, 32, 80, 85, 66, 76, 73, 67, 32, 34, 45, 47, 47, 87, 51, 67, 47, 47, 68, 84, 68, 32, 83, 86, 71, 32, 49, 46, 49, 47, 47, 69, 78, 34, 32, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 71, 114, 97, 112, 104, 105, 99, 115, 47, 83, 86, 71, 47, 49, 46, 49, 47, 68, 84, 68, 47, 115, 118, 103, 49, 49, 46, 100, 116, 100, 34, 62, 60, 115, 118, 103, 32, 120, 109, 108, 110, 115, 61, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 50, 48, 48, 48, 47, 115, 118, 103, 34, 32, 120, 109, 108, 110, 115, 58, 120, 108, 105, 110, 107, 61, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 49, 57, 57, 57, 47, 120, 108, 105, 110, 107, 34, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 49, 34, 32, 119, 105, 100, 116, 104, 61, 34, 50, 52, 34, 32, 104, 101, 105, 103, 104, 116, 61, 34, 50, 52, 34, 32, 118, 105, 101, 119, 66, 111, 120, 61, 34, 48, 32, 48, 32, 50, 52, 32, 50, 52, 34, 62, 60, 112, 97, 116, 104, 32, 100, 61, 34, 77, 49, 55, 46, 53, 44, 49, 50, 65, 49, 46, 53, 44, 49, 46, 53, 32, 48, 32, 48, 44, 49, 32, 49, 54, 44, 49, 48, 46, 53, 65, 49, 46, 53, 44, 49, 46, 53, 32, 48, 32, 48, 44, 49, 32, 49, 55, 46, 53, 44, 57, 65, 49, 46, 53, 44, 49, 46, 53, 32, 48, 32, 48, 44, 49, 32, 49, 57, 44, 49, 48, 46, 53, 65, 49, 46, 53, 44, 49, 46, 53, 32, 48, 32, 48, 44, 49, 32, 49, 55, 46, 53, 44, 49, 50, 77, 49, 52, 46, 53, 44, 56, 65, 49, 46, 53, 44, 49, 46, 53, 32, 48, 32, 48, 44, 49, 32, 49, 51, 44, 54, 46, 53, 65, 49, 46, 53, 44, 49, 46, 53, 32, 48, 32, 48, 44, 49, 32, 49, 52, 46, 53, 44, 53, 65, 49, 46, 53, 44, 49, 46, 53, 32, 48, 32, 48, 44, 49, 32, 49, 54, 44, 54, 46, 53, 65, 49, 46, 53, 44, 49, 46, 53, 32, 48, 32, 48, 44, 49, 32, 49, 52, 46, 53, 44, 56, 77, 57, 46, 53, 44, 56, 65, 49, 46, 53, 44, 49, 46, 53, 32, 48, 32, 48, 44, 49, 32, 56, 44, 54, 46, 53, 65, 49, 46, 53, 44, 49, 46, 53, 32, 48, 32, 48, 44, 49, 32, 57, 46, 53, 44, 53, 65, 49, 46, 53, 44, 49, 46, 53, 32, 48, 32, 48, 44, 49, 32, 49, 49, 44, 54, 46, 53, 65, 49, 46, 53, 44, 49, 46, 53, 32, 48, 32, 48, 44, 49, 32, 57, 46, 53, 44, 56, 77, 54, 46, 53, 44, 49, 50, 65, 49, 46, 53, 44, 49, 46, 53, 32, 48, 32, 48, 44, 49, 32, 53, 44, 49, 48, 46, 53, 65, 49, 46, 53, 44, 49, 46, 53, 32, 48, 32, 48, 44, 49, 32, 54, 46, 53, 44, 57, 65, 49, 46, 53, 44, 49, 46, 53, 32, 48, 32, 48, 44, 49, 32, 56, 44, 49, 48, 46, 53, 65, 49, 46, 53, 44, 49, 46, 53, 32, 48, 32, 48, 44, 49, 32, 54, 46, 53, 44, 49, 50, 77, 49, 50, 44, 51, 65, 57, 44, 57, 32, 48, 32, 48, 44, 48, 32, 51, 44, 49, 50, 65, 57, 44, 57, 32, 48, 32, 48, 44, 48, 32, 49, 50, 44, 50, 49, 65, 49, 46, 53, 44, 49, 46, 53, 32, 48, 32, 48, 44, 48, 32, 49, 51, 46, 53, 44, 49, 57, 46, 53, 67, 49, 51, 46, 53, 44, 49, 57, 46, 49, 49, 32, 49, 51, 46, 51, 53, 44, 49, 56, 46, 55, 54, 32, 49, 51, 46, 49, 49, 44, 49, 56, 46, 53, 67, 49, 50, 46, 56, 56, 44, 49, 56, 46, 50, 51, 32, 49, 50, 46, 55, 51, 44, 49, 55, 46, 56, 56, 32, 49, 50, 46, 55, 51, 44, 49, 55, 46, 53, 65, 49, 46, 53, 44, 49, 46, 53, 32, 48, 32, 48, 44, 49, 32, 49, 52, 46, 50, 51, 44, 49, 54, 72, 49, 54, 65, 53, 44, 53, 32, 48, 32, 48, 44, 48, 32, 50, 49, 44, 49, 49, 67, 50, 49, 44, 54, 46, 53, 56, 32, 49, 54, 46, 57, 55, 44, 51, 32, 49, 50, 44, 51, 90, 34, 32, 47, 62, 60, 47, 115, 118, 103, 62}}
var resourcePauseSvg = &fyne.StaticResource{
StaticName: "pause.svg",
StaticContent: []byte{
60, 63, 120, 109, 108, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 32, 101, 110, 99, 111, 100, 105, 110, 103, 61, 34, 85, 84, 70, 45, 56, 34, 63, 62, 60, 33, 68, 79, 67, 84, 89, 80, 69, 32, 115, 118, 103, 32, 80, 85, 66, 76, 73, 67, 32, 34, 45, 47, 47, 87, 51, 67, 47, 47, 68, 84, 68, 32, 83, 86, 71, 32, 49, 46, 49, 47, 47, 69, 78, 34, 32, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 71, 114, 97, 112, 104, 105, 99, 115, 47, 83, 86, 71, 47, 49, 46, 49, 47, 68, 84, 68, 47, 115, 118, 103, 49, 49, 46, 100, 116, 100, 34, 62, 60, 115, 118, 103, 32, 120, 109, 108, 110, 115, 61, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 50, 48, 48, 48, 47, 115, 118, 103, 34, 32, 120, 109, 108, 110, 115, 58, 120, 108, 105, 110, 107, 61, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 49, 57, 57, 57, 47, 120, 108, 105, 110, 107, 34, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 49, 34, 32, 119, 105, 100, 116, 104, 61, 34, 50, 52, 34, 32, 104, 101, 105, 103, 104, 116, 61, 34, 50, 52, 34, 32, 118, 105, 101, 119, 66, 111, 120, 61, 34, 48, 32, 48, 32, 50, 52, 32, 50, 52, 34, 62, 60, 112, 97, 116, 104, 32, 100, 61, 34, 77, 49, 52, 44, 49, 57, 72, 49, 56, 86, 53, 72, 49, 52, 77, 54, 44, 49, 57, 72, 49, 48, 86, 53, 72, 54, 86, 49, 57, 90, 34, 32, 47, 62, 60, 47, 115, 118, 103, 62}}
var resourceResourcesMd = &fyne.StaticResource{
StaticName: "resources.md",
StaticContent: []byte{
35, 32, 82, 101, 115, 111, 117, 114, 99, 101, 115, 10, 10, 35, 35, 32, 83, 111, 117, 114, 99, 101, 115, 10, 10, 45, 32, 70, 114, 111, 109, 32, 104, 116, 116, 112, 115, 58, 47, 47, 109, 97, 116, 101, 114, 105, 97, 108, 100, 101, 115, 105, 103, 110, 105, 99, 111, 110, 115, 46, 99, 111, 109, 47, 105, 99, 111, 110, 123, 105, 99, 111, 110, 45, 110, 97, 109, 101, 125, 58, 10, 32, 32, 32, 32, 45, 32, 114, 101, 115, 116, 97, 114, 116, 10, 32, 32, 32, 32, 45, 32, 102, 97, 115, 116, 45, 102, 111, 114, 119, 97, 114, 100, 10, 32, 32, 32, 32, 45, 32, 112, 97, 117, 115, 101, 10, 32, 32, 32, 32, 45, 32, 112, 97, 108, 101, 116, 116, 101, 10, 32, 32, 32, 32, 45, 32, 108, 97, 121, 101, 114, 115, 45, 116, 114, 105, 112, 108, 101, 10, 32, 32, 32, 32, 45, 32, 102, 111, 114, 109, 97, 116, 45, 102, 111, 110, 116, 10, 10, 35, 35, 32, 66, 117, 105, 108, 100, 105, 110, 103, 32, 114, 101, 115, 111, 117, 114, 99, 101, 115, 46, 103, 111, 10, 10, 96, 96, 96, 10, 126, 47, 103, 111, 47, 98, 105, 110, 47, 102, 121, 110, 101, 32, 98, 117, 110, 100, 108, 101, 32, 114, 101, 115, 111, 117, 114, 99, 101, 115, 32, 62, 32, 114, 101, 115, 111, 117, 114, 99, 101, 115, 46, 103, 111, 10, 96, 96, 96, 10}}
var resourceRestartSvg = &fyne.StaticResource{
StaticName: "restart.svg",
StaticContent: []byte{
60, 63, 120, 109, 108, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 32, 101, 110, 99, 111, 100, 105, 110, 103, 61, 34, 85, 84, 70, 45, 56, 34, 63, 62, 60, 33, 68, 79, 67, 84, 89, 80, 69, 32, 115, 118, 103, 32, 80, 85, 66, 76, 73, 67, 32, 34, 45, 47, 47, 87, 51, 67, 47, 47, 68, 84, 68, 32, 83, 86, 71, 32, 49, 46, 49, 47, 47, 69, 78, 34, 32, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 71, 114, 97, 112, 104, 105, 99, 115, 47, 83, 86, 71, 47, 49, 46, 49, 47, 68, 84, 68, 47, 115, 118, 103, 49, 49, 46, 100, 116, 100, 34, 62, 60, 115, 118, 103, 32, 120, 109, 108, 110, 115, 61, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 50, 48, 48, 48, 47, 115, 118, 103, 34, 32, 120, 109, 108, 110, 115, 58, 120, 108, 105, 110, 107, 61, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 49, 57, 57, 57, 47, 120, 108, 105, 110, 107, 34, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 49, 34, 32, 119, 105, 100, 116, 104, 61, 34, 50, 52, 34, 32, 104, 101, 105, 103, 104, 116, 61, 34, 50, 52, 34, 32, 118, 105, 101, 119, 66, 111, 120, 61, 34, 48, 32, 48, 32, 50, 52, 32, 50, 52, 34, 62, 60, 112, 97, 116, 104, 32, 100, 61, 34, 77, 49, 50, 44, 52, 67, 49, 52, 46, 49, 44, 52, 32, 49, 54, 46, 49, 44, 52, 46, 56, 32, 49, 55, 46, 54, 44, 54, 46, 51, 67, 50, 48, 46, 55, 44, 57, 46, 52, 32, 50, 48, 46, 55, 44, 49, 52, 46, 53, 32, 49, 55, 46, 54, 44, 49, 55, 46, 54, 67, 49, 53, 46, 56, 44, 49, 57, 46, 53, 32, 49, 51, 46, 51, 44, 50, 48, 46, 50, 32, 49, 48, 46, 57, 44, 49, 57, 46, 57, 76, 49, 49, 46, 52, 44, 49, 55, 46, 57, 67, 49, 51, 46, 49, 44, 49, 56, 46, 49, 32, 49, 52, 46, 57, 44, 49, 55, 46, 53, 32, 49, 54, 46, 50, 44, 49, 54, 46, 50, 67, 49, 56, 46, 53, 44, 49, 51, 46, 57, 32, 49, 56, 46, 53, 44, 49, 48, 46, 49, 32, 49, 54, 46, 50, 44, 55, 46, 55, 67, 49, 53, 46, 49, 44, 54, 46, 54, 32, 49, 51, 46, 53, 44, 54, 32, 49, 50, 44, 54, 86, 49, 48, 46, 54, 76, 55, 44, 53, 46, 54, 76, 49, 50, 44, 48, 46, 54, 86, 52, 77, 54, 46, 51, 44, 49, 55, 46, 54, 67, 51, 46, 55, 44, 49, 53, 32, 51, 46, 51, 44, 49, 49, 32, 53, 46, 49, 44, 55, 46, 57, 76, 54, 46, 54, 44, 57, 46, 52, 67, 53, 46, 53, 44, 49, 49, 46, 54, 32, 53, 46, 57, 44, 49, 52, 46, 52, 32, 55, 46, 56, 44, 49, 54, 46, 50, 67, 56, 46, 51, 44, 49, 54, 46, 55, 32, 56, 46, 57, 44, 49, 55, 46, 49, 32, 57, 46, 54, 44, 49, 55, 46, 52, 76, 57, 44, 49, 57, 46, 52, 67, 56, 44, 49, 57, 32, 55, 46, 49, 44, 49, 56, 46, 52, 32, 54, 46, 51, 44, 49, 55, 46, 54, 90, 34, 32, 47, 62, 60, 47, 115, 118, 103, 62}}

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M4,4H7L9,2H15L17,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9Z" /></svg>

After

Width:  |  Height:  |  Size: 518 B

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M13,6V18L21.5,12M4,18L12.5,12L4,6V18Z" /></svg>

After

Width:  |  Height:  |  Size: 332 B

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M17,8H20V20H21V21H17V20H18V17H14L12.5,20H14V21H10V20H11L17,8M18,9L14.5,16H18V9M5,3H10C11.11,3 12,3.89 12,5V16H9V11H6V16H3V5C3,3.89 3.89,3 5,3M6,5V9H9V5H6Z" /></svg>

After

Width:  |  Height:  |  Size: 449 B

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M12 0L3 7L4.63 8.27L12 14L19.36 8.27L21 7L12 0M19.37 10.73L12 16.47L4.62 10.74L3 12L12 19L21 12L19.37 10.73M19.37 15.73L12 21.47L4.62 15.74L3 17L12 24L21 17L19.37 15.73Z" /></svg>

After

Width:  |  Height:  |  Size: 464 B

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z" /></svg>

After

Width:  |  Height:  |  Size: 851 B

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M14,19H18V5H14M6,19H10V5H6V19Z" /></svg>

After

Width:  |  Height:  |  Size: 325 B

View File

@ -0,0 +1,18 @@
# Resources
## Sources
- From https://materialdesignicons.com/icon{icon-name}:
- restart
- fast-forward
- pause
- palette
- layers-triple
- format-font
- camera
## Building resources.go
```
~/go/bin/fyne bundle resources > resources.go
```

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M12,4C14.1,4 16.1,4.8 17.6,6.3C20.7,9.4 20.7,14.5 17.6,17.6C15.8,19.5 13.3,20.2 10.9,19.9L11.4,17.9C13.1,18.1 14.9,17.5 16.2,16.2C18.5,13.9 18.5,10.1 16.2,7.7C15.1,6.6 13.5,6 12,6V10.6L7,5.6L12,0.6V4M6.3,17.6C3.7,15 3.3,11 5.1,7.9L6.6,9.4C5.5,11.6 5.9,14.4 7.8,16.2C8.3,16.7 8.9,17.1 9.6,17.4L9,19.4C8,19 7.1,18.4 6.3,17.6Z" /></svg>

After

Width:  |  Height:  |  Size: 618 B

View File

@ -1,7 +1,6 @@
package izapple2
import (
"fmt"
"image"
"image/color"
"image/png"
@ -225,7 +224,6 @@ func SaveSnapshot(a *Apple2, filename string) error {
func squarishPixelsFilter(in *image.RGBA) *image.RGBA {
b := in.Bounds()
factor := 1200 / b.Dx()
fmt.Println(factor)
size := image.Rect(0, 0, factor*b.Dx(), b.Dy())
out := image.NewRGBA(size)
for x := b.Min.X; x < b.Max.X; x++ {