-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfake-window.go
101 lines (78 loc) · 1.88 KB
/
fake-window.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
package voidterm
import (
"github.com/1f349/voidterm/termutil"
"log"
)
type FakeWindow struct {
Rows uint16
Cols uint16
}
var _ termutil.WindowManipulator = &FakeWindow{}
func (f *FakeWindow) State() termutil.WindowState {
return termutil.StateNormal
}
func (f *FakeWindow) Minimise() {
log.Println("Minimise")
}
func (f *FakeWindow) Maximise() {
log.Println("Maximise")
}
func (f *FakeWindow) Restore() {
log.Println("Restore")
}
func (f *FakeWindow) SetTitle(title string) {
log.Println("SetTitle", title)
}
func (f *FakeWindow) Position() (int, int) {
log.Println("Position")
return 0, 0
}
func (f *FakeWindow) SizeInPixels() (int, int) {
log.Println("SizeInPixels")
return 100, 80
}
func (f *FakeWindow) CellSizeInPixels() (int, int) {
log.Println("CellSizeInPixels")
return 14, 11
}
func (f *FakeWindow) SizeInChars() (int, int) {
log.Println("SizeInChars")
return int(f.Cols), int(f.Rows)
}
func (f *FakeWindow) ResizeInPixels(x int, y int) {
log.Println("ResizeInPixels", x, y)
}
func (f *FakeWindow) ResizeInChars(x int, y int) {
log.Println("ResizeInChars", x, y)
}
func (f *FakeWindow) ScreenSizeInPixels() (int, int) {
log.Println("ScreenSizeInPixels")
return 1920, 1080
}
func (f *FakeWindow) ScreenSizeInChars() (int, int) {
log.Println("ScreenSizeInChars")
return int(f.Cols), int(f.Rows)
}
func (f *FakeWindow) Move(x, y int) {
log.Println("Move", x, y)
}
func (f *FakeWindow) IsFullscreen() bool {
log.Println("IsFullscreen")
return false
}
func (f *FakeWindow) SetFullscreen(enabled bool) {
log.Println("SetFullscreen", enabled)
}
func (f *FakeWindow) GetTitle() string {
log.Println("GetTitle")
return "Title"
}
func (f *FakeWindow) SaveTitleToStack() {
log.Println("SaveTitleToStack")
}
func (f *FakeWindow) RestoreTitleFromStack() {
log.Println("RestoreTitleFromStack")
}
func (f *FakeWindow) ReportError(err error) {
log.Println("ReportError", err)
}