1
0
mirror of https://github.com/taigrr/gopher-os synced 2025-01-18 04:43:13 -08:00
Achilleas Anagnostopoulos 8dfc5d4e92 Use pwd as a workspace; move sources to src/gopheros and rewrite imports
By setting up pwd as a Go workspace, we can trim import paths from
something like "github.com/achilleasa/gopher-os/kernel" to just
"kernel".

These changes make forking easier and also allows us to move the code to
a different git hosting provider without having to rewrite the imports.
2017-07-01 20:37:09 +01:00

49 lines
966 B
Go

package console
// Attr defines a color attribute.
type Attr uint16
// The set of attributes that can be passed to Write().
const (
Black Attr = iota
Blue
Green
Cyan
Red
Magenta
Brown
LightGrey
Grey
LightBlue
LightGreen
LightCyan
LightRed
LightMagenta
LightBrown
White
)
// ScrollDir defines a scroll direction.
type ScrollDir uint8
// The supported list of scroll directions for the console Scroll() calls.
const (
Up ScrollDir = iota
Down
)
// The Console interface is implemented by objects that can function as physical consoles.
type Console interface {
// Dimensions returns the width and height of the console in characters.
Dimensions() (uint16, uint16)
// Clear clears the specified rectangular region
Clear(x, y, width, height uint16)
// Scroll a particular number of lines to the specified direction.
Scroll(dir ScrollDir, lines uint16)
// Write a char to the specified location.
Write(ch byte, attr Attr, x, y uint16)
}