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
|
|
|
|
|
|
2021-04-07 20:18:51 +00:00
|
|
|
// 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)
|
2021-04-07 20:18:51 +00:00
|
|
|
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
|
2021-04-07 20:18:51 +00:00
|
|
|
SoftWrap
|
2019-01-14 05:57:39 +00:00
|
|
|
SetBuffer(b *buffer.Buffer)
|
2021-04-08 21:32:00 +00:00
|
|
|
BufView() View
|
2019-01-14 05:57:39 +00:00
|
|
|
}
|