Documentation ¶
Index ¶
- Constants
- Variables
- func NewLexer(h func(Event)) *lexer
- type CursorAction
- type CursorEvent
- type DeviceAction
- type DeviceEvent
- type DisplayAttribute
- type DisplayEvent
- type EofEvent
- type EraseEvent
- type EraseTarget
- type Event
- func NewCursorEvent(text string, offset int) Event
- func NewDeviceEvent(text string, offset int) Event
- func NewDisplayEvent(text string, offset int) Event
- func NewEofEvent(text string, offset int) Event
- func NewEraseEvent(text string, offset int) Event
- func NewFoldEvent(text string, offset int) Event
- func NewFontEvent(text string, offset int) Event
- func NewNotImplementedEvent(text string, offset int) Event
- func NewPrintEvent(text string, offset int) Event
- func NewScrollEvent(text string, offset int) Event
- func NewTabEvent(text string, offset int) Event
- func NewTextEvent(text string, offset int) Event
- type EventData
- type FoldAction
- type FoldEvent
- type FontEvent
- type LexerEvent
- type NotImplementedEvent
- type PrintAction
- type PrintEvent
- type ScrollAction
- type ScrollEvent
- type SerializedEvent
- type TabAction
- type TabEvent
- type TextEvent
- type TextRenderer
Constants ¶
View Source
const ( DisplayNone = -1 DisplayReset = 0 DisplayBright = 1 DisplayDim = 2 DisplayUnderscore = 4 DisplayBlink = 5 DisplayReverse = 7 DisplayHidden = 8 )
Variables ¶
View Source
var EOF = NewEofEvent("", 0)
Functions ¶
Types ¶
type CursorAction ¶
type CursorAction int
const ( CursorSave CursorAction = 1 + iota CursorRestore CursorSaveWithAttributes CursorRestoreWithAttributes CursorHome CursorForce CursorUp CursorDown CursorForward CursorBackward CursorBell CursorBackspace CursorCarriageReturn CursorFormFeed CursorHorizontalTab CursorLineFeed CursorVerticalTab )
func (CursorAction) MarshalJSON ¶
func (a CursorAction) MarshalJSON() ([]byte, error)
func (CursorAction) String ¶
func (a CursorAction) String() string
type CursorEvent ¶
type CursorEvent struct { EventData Action CursorAction `json:"action"` Count int `json:"count"` Row int `json:"row"` Column int `json:"col"` }
type DeviceAction ¶
type DeviceAction int
const ( DeviceActionReset DeviceAction = 1 + iota DeviceEnableLineWrap DeviceDisableLineWrap DeviceQueryCode DeviceCode DeviceQueryStatus DeviceStatus DeviceQueryCursor DeviceCursor )
func (DeviceAction) MarshalJSON ¶
func (d DeviceAction) MarshalJSON() ([]byte, error)
func (DeviceAction) String ¶
func (d DeviceAction) String() string
type DeviceEvent ¶
type DisplayAttribute ¶
type DisplayAttribute int
func (DisplayAttribute) MarshalJSON ¶
func (a DisplayAttribute) MarshalJSON() ([]byte, error)
func (DisplayAttribute) String ¶
func (a DisplayAttribute) String() string
type DisplayEvent ¶
type DisplayEvent struct { EventData Attribute DisplayAttribute `json:"attr"` // Foreground is the foreground color to use. If it is 0, the // foreground color doesn't change. If it is greater than // zero it is the index into the color palette + 1 Foreground int `json:"fg"` // Background is the background color to use. If it is 0, the // background color doesn't change. If it is greater than // zero it is the index into the color palette + 1 Background int `json:"bg"` }
type EraseEvent ¶
type EraseEvent struct { EventData Target EraseTarget `json:"target"` }
type EraseTarget ¶
type EraseTarget int
const ( EraseToEOL EraseTarget = 1 + iota EraseToBOL EraseLine EraseDown EraseUp EraseScreen )
func (EraseTarget) MarshalJSON ¶
func (t EraseTarget) MarshalJSON() ([]byte, error)
func (EraseTarget) String ¶
func (t EraseTarget) String() string
type Event ¶
type Event interface {
EventType() string
}
func NewCursorEvent ¶
func NewDeviceEvent ¶
func NewDisplayEvent ¶
func NewEofEvent ¶
func NewEraseEvent ¶
func NewFoldEvent ¶
func NewFontEvent ¶
func NewNotImplementedEvent ¶
func NewPrintEvent ¶
func NewScrollEvent ¶
func NewTabEvent ¶
func NewTextEvent ¶
type EventData ¶
type FoldAction ¶
type FoldAction int
const ( FoldOpen FoldAction = 1 + iota FoldClose )
func (FoldAction) MarshalJSON ¶
func (self FoldAction) MarshalJSON() ([]byte, error)
func (FoldAction) String ¶
func (self FoldAction) String() string
type FoldEvent ¶
type FoldEvent struct { EventData Action FoldAction `json:"action"` Title string `json:"title"` }
type LexerEvent ¶
func (*LexerEvent) MarshalJSON ¶
func (self *LexerEvent) MarshalJSON() ([]byte, error)
type NotImplementedEvent ¶
type NotImplementedEvent struct {
EventData
}
type PrintAction ¶
type PrintAction int
const ( PrintScreen PrintAction = 1 + iota PrintLine PrintStartLog PrintStopLog )
func (PrintAction) MarshalJSON ¶
func (a PrintAction) MarshalJSON() ([]byte, error)
func (PrintAction) String ¶
func (a PrintAction) String() string
type PrintEvent ¶
type PrintEvent struct { EventData Action PrintAction `json:"action"` }
type ScrollAction ¶
type ScrollAction int
const ( ScrollDown ScrollAction = 1 + iota ScrollUp ScrollScreen ScrollRegion )
func (ScrollAction) MarshalJSON ¶
func (a ScrollAction) MarshalJSON() ([]byte, error)
func (ScrollAction) String ¶
func (a ScrollAction) String() string
type ScrollEvent ¶
type ScrollEvent struct { EventData Action ScrollAction `json:"action"` Start int `json:"start"` End int `json:"end"` }
type SerializedEvent ¶
type SerializedEvent struct {
Inner Event
}
func (*SerializedEvent) MarshalJSON ¶
func (self *SerializedEvent) MarshalJSON() ([]byte, error)
func (*SerializedEvent) UnmarshalJSON ¶
func (self *SerializedEvent) UnmarshalJSON(data []byte) error
type TextRenderer ¶
type TextRenderer struct {
// contains filtered or unexported fields
}
func NewTextRenderer ¶
func NewTextRenderer() *TextRenderer
func (*TextRenderer) Handle ¶
func (self *TextRenderer) Handle(event Event)
func (*TextRenderer) String ¶
func (self *TextRenderer) String() string
Click to show internal directories.
Click to hide internal directories.