micro/internal/display/window.go

32 lines
691 B
Go
Raw Normal View History

2018-08-28 22:44:52 +00:00
package display
2018-08-26 03:06:44 +00:00
import (
2019-02-04 04:17:24 +00:00
"github.com/zyedidia/micro/internal/buffer"
2018-08-26 03:06:44 +00:00
)
2019-01-01 03:07:01 +00:00
type View struct {
2019-01-03 01:07:48 +00:00
X, Y int // X,Y location of the view
Width, Height int // Width and height of the view
// Start line and start column of the view (vertical/horizontal scroll)
// note that since the starting column of every line is different if the view
// is scrolled, StartCol is a visual index (will be the same for every line)
StartLine, StartCol int
2019-01-01 03:07:01 +00:00
}
2018-08-28 22:44:52 +00:00
type Window interface {
Display()
Clear()
2019-01-01 03:07:01 +00:00
Relocate() bool
GetView() *View
SetView(v *View)
2019-01-02 22:39:50 +00:00
GetMouseLoc(vloc buffer.Loc) buffer.Loc
2019-01-04 22:40:56 +00:00
Resize(w, h int)
2019-01-04 23:08:11 +00:00
SetActive(b bool)
2018-08-28 22:44:52 +00:00
}
2019-01-14 05:57:39 +00:00
type BWindow interface {
Window
SetBuffer(b *buffer.Buffer)
}