micro/internal/display/window.go

38 lines
774 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 (
2020-05-04 14:16:15 +00:00
"github.com/zyedidia/micro/v2/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 of the view (for vertical scroll)
StartLine SLoc
// Start column of the view (for horizontal scroll)
2019-01-03 01:07:48 +00:00
// 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)
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-12-24 21:01:08 +00:00
LocFromVisual(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)
2019-08-04 06:53:33 +00:00
IsActive() bool
2018-08-28 22:44:52 +00:00
}
2019-01-14 05:57:39 +00:00
type BWindow interface {
Window
SoftWrap
2019-01-14 05:57:39 +00:00
SetBuffer(b *buffer.Buffer)
BufView() View
2019-01-14 05:57:39 +00:00
}