Skip to content

Commit e960c15

Browse files
committed
Bump tile library version
1 parent 3472569 commit e960c15

File tree

5 files changed

+13
-43
lines changed

5 files changed

+13
-43
lines changed

appclip/appclip.go

-24
This file was deleted.

cmd/main.go

+5-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"github.com/codeation/impress"
1212
"github.com/codeation/tile/eventlink"
1313

14-
"github.com/codeation/lineation/appclip"
1514
"github.com/codeation/lineation/mapcontrol"
1615
"github.com/codeation/lineation/mapmodel"
1716
"github.com/codeation/lineation/mapview"
@@ -29,12 +28,12 @@ func run(ctx context.Context) error {
2928
filename := filepath.Clean(flag.Args()[0])
3029

3130
pal := palette.NewPalette()
32-
a := impress.NewApplication(pal.DefaultAppRect(), fmt.Sprintf("lineation %s", filename))
33-
app := eventlink.MainApp(a)
31+
title := fmt.Sprintf("lineation %s", filename)
32+
app := eventlink.MainApp(impress.NewApplication(pal.DefaultAppRect(), title))
3433
defer app.Close()
35-
pal.FontLink(app.Application)
34+
pal.FontLink(app.Application())
3635
defer pal.FontClose()
37-
menuevent.New(app.Application)
36+
menuevent.New(app.Application())
3837

3938
mapRoot, err := xmlfile.Open(filename)
4039
if err != nil {
@@ -45,9 +44,8 @@ func run(ctx context.Context) error {
4544
defer mapView.Destroy()
4645
modView := modified.NewView(app, pal)
4746
defer modView.Destroy()
48-
appClip := appclip.New(a)
4947

50-
mapControl := mapcontrol.New(app, mapModel, mapView, modView, appClip)
48+
mapControl := mapcontrol.New(app, mapModel, mapView, modView)
5149
app.Run(ctx, mapControl)
5250

5351
return nil

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.23.5
44

55
require (
66
github.com/codeation/impress v1.0.0
7-
github.com/codeation/tile v0.1.7
7+
github.com/codeation/tile v0.1.8
88
)
99

1010
require github.com/codeation/lru v1.3.0 // indirect

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ github.com/codeation/impress v1.0.0 h1:d42qoxGCRZ54Lum9n81gneTy5SKs7Pvodzf5EieLI
22
github.com/codeation/impress v1.0.0/go.mod h1:bf3YCBV4xnQ5aX3gladcExtRsu3hg58bDeQ/il4BQTM=
33
github.com/codeation/lru v1.3.0 h1:BZlD5G4bt0bis9FHV5q3zyyDCAx21ue2CvvM1T8hQl4=
44
github.com/codeation/lru v1.3.0/go.mod h1:1C9+zUoRETpelIbMxh6wj9APf2VnKh0tk9aRsrOQUsk=
5-
github.com/codeation/tile v0.1.7 h1:JsceqJ2vJbOS3FU6ssXJq1paOqZxNxyfKt3waOAd21M=
6-
github.com/codeation/tile v0.1.7/go.mod h1:b8srr5xVVbeuue+OJ9ggXCnLWem1xnB7S19D8P9TptQ=
5+
github.com/codeation/tile v0.1.8 h1:Kml7dlyexPvuS6aQ2s1kIBBbroAgQK5UWrHU/1rGxI4=
6+
github.com/codeation/tile v0.1.8/go.mod h1:b8srr5xVVbeuue+OJ9ggXCnLWem1xnB7S19D8P9TptQ=

mapcontrol/control.go

+5-9
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"github.com/codeation/tile/eventlink"
1212
"github.com/codeation/tile/eventlink/ctxchan"
1313

14-
"github.com/codeation/lineation/appclip"
1514
"github.com/codeation/lineation/mapmodel"
1615
"github.com/codeation/lineation/mapview"
1716
"github.com/codeation/lineation/menuevent"
@@ -33,17 +32,14 @@ type Control struct {
3332
mapModel *mapmodel.MindMap
3433
mapView *mapview.View
3534
modView *modified.View
36-
appClip *appclip.Clipboard
3735
}
3836

39-
func New(app eventlink.AppFramer, mapModel *mapmodel.MindMap, mapView *mapview.View,
40-
modView *modified.View, appClip *appclip.Clipboard,
37+
func New(app eventlink.AppFramer, mapModel *mapmodel.MindMap, mapView *mapview.View, modView *modified.View,
4138
) *Control {
4239
return &Control{
4340
mapModel: mapModel,
4441
mapView: mapView,
4542
modView: modView,
46-
appClip: appClip,
4743
}
4844
}
4945

@@ -56,7 +52,7 @@ func (c *Control) Action(ctx context.Context, app eventlink.App) {
5652
if len(app.Chan()) == 0 && maybeChanged {
5753
c.mapView.Draw(app)
5854
c.modView.Draw()
59-
app.Sync()
55+
app.Application().Sync()
6056
maybeChanged = false
6157
}
6258

@@ -112,9 +108,9 @@ func (c *Control) Action(ctx context.Context, app eventlink.App) {
112108
c.modView.Set(true)
113109

114110
case event.KeyCopy, menuevent.Copy:
115-
c.appClip.Put(c.mapModel.Selected.Value.String())
111+
app.Application().ClipboardPut(clipboard.Text(c.mapModel.Selected.Value.String()))
116112
case event.KeyPaste, menuevent.Paste:
117-
c.appClip.Get()
113+
app.Application().ClipboardGet(clipboard.TextType)
118114

119115
default:
120116
switch ev := e.(type) {
@@ -163,7 +159,7 @@ func (c *Control) dragAndDrop(ctx context.Context, app eventlink.App, node *mapm
163159
for {
164160
if len(app.Chan()) == 0 {
165161
c.mapView.Draw(app)
166-
app.Sync()
162+
app.Application().Sync()
167163
}
168164

169165
e, ok := ctxchan.Get(ctx, app.Chan())

0 commit comments

Comments
 (0)