Documentation ¶
Index ¶
- Constants
- Variables
- func AddTimeout(delay time.Duration, fn TimerCallbackFn) (id uuid.UUID)
- func ArgvApplicationSignalStartup(argv ...interface{}) (app Application, display Display, ctx context.Context, ...)
- func CancelAllTimeouts()
- func DecodeCtrlKey(in Key) (key Key, mods ModMask, ok bool)
- func DescribeButton(button ButtonMask) string
- func DisplaySignalDisplayStartupArgv(argv ...interface{}) (ctx context.Context, cancel context.CancelFunc, wg *sync.WaitGroup, ok bool)
- func GetApplicationCliFlags() (flags []cli.Flag)
- func GetEncoding(charset string) encoding.Encoding
- func Go(fn func())
- func GoWithMainContext(user, host string, display *CDisplay, data interface{}, fn func())
- func Init()
- func ListEncodings() []string
- func LookupKeyName(key Key) string
- func ParseKeyMods(input string) (key Key, mods ModMask, err error)
- func RegisterEncoding(charset string, enc encoding.Encoding)
- func SetEncodingFallback(fb EncodingFallback)
- func StopTimeout(id uuid.UUID)
- func TestingMakesActiveWindow(d Display) error
- func TestingMakesNoContent(_ []interface{}, _ ...interface{}) enums.EventFlag
- func UnregisterEncoding(charset string)
- func WithApp(initFn SignalListenerFn, action AppFn) func()
- func WithDisplayManager(action DisplayManagerFn) func()
- type AppFn
- type Application
- type ApplicationInitFn
- type ApplicationMain
- type ApplicationPrepareStartupFn
- type ApplicationRunFn
- type ApplicationServer
- type ApplicationShutdownFn
- type ApplicationStartupFn
- type ButtonMask
- type CApplication
- func (app *CApplication) AddCommand(command *cli.Command)
- func (app *CApplication) AddCommands(commands []*cli.Command)
- func (app *CApplication) AddFlag(flag cli.Flag)
- func (app *CApplication) AddFlags(flags []cli.Flag)
- func (app *CApplication) CLI() *cli.App
- func (app *CApplication) CliActionFn(ctx *cli.Context) (err error)
- func (app *CApplication) Description() string
- func (app *CApplication) Destroy()
- func (app *CApplication) Display() *CDisplay
- func (app *CApplication) GetContext() *cli.Context
- func (app *CApplication) Init() (already bool)
- func (app *CApplication) MainEventsPending() (pending bool)
- func (app *CApplication) MainFinish()
- func (app *CApplication) MainInit(argv ...interface{}) (ok bool)
- func (app *CApplication) MainIterateEvents()
- func (app *CApplication) MainRun(runner ApplicationMain)
- func (app *CApplication) Name() string
- func (app *CApplication) NotifyStartupComplete()
- func (app *CApplication) Reconfigure(name, usage, description, version, tag, title, ttyPath string)
- func (app *CApplication) RemoveFlag(flag cli.Flag) (removed bool)
- func (app *CApplication) Run(args []string) (err error)
- func (app *CApplication) SetDisplay(d *CDisplay) (err error)
- func (app *CApplication) SetupDisplay()
- func (app *CApplication) StartupCompleted() bool
- func (app *CApplication) Tag() string
- func (app *CApplication) Title() string
- func (app *CApplication) Usage() string
- func (app *CApplication) Version() string
- type CApplicationServer
- func (s *CApplicationServer) App() (app *CApplication)
- func (s *CApplicationServer) ClearAuthHandlers()
- func (s *CApplicationServer) Daemon() (err error)
- func (s *CApplicationServer) Display() (display *CDisplay)
- func (s *CApplicationServer) GetClient(id uuid.UUID) (*CApplicationServerClient, error)
- func (s *CApplicationServer) GetClients() (clients []uuid.UUID)
- func (s *CApplicationServer) GetListenAddress() (address string)
- func (s *CApplicationServer) GetListenPort() (port int)
- func (s *CApplicationServer) Init() (already bool)
- func (s *CApplicationServer) InstallAuthHandler(handler ServerAuthHandler) (err error)
- func (s *CApplicationServer) SetListenAddress(address string)
- func (s *CApplicationServer) SetListenPort(port int)
- func (s *CApplicationServer) Start() (err error)
- func (s *CApplicationServer) Stop() (err error)
- func (s *CApplicationServer) UnInstallAuthHandler(handler ServerAuthHandler) (err error)
- type CApplicationServerClient
- type CClipboard
- type CDisplay
- func (d *CDisplay) App() *CApplication
- func (d *CDisplay) AsyncCall(fn DisplayCallbackFn) error
- func (d *CDisplay) AsyncCallMain(fn DisplayCallbackFn) error
- func (d *CDisplay) AwaitCall(fn DisplayCallbackFn) error
- func (d *CDisplay) AwaitCallMain(fn DisplayCallbackFn) error
- func (d *CDisplay) Call(fn cexec.Callback) (err error)
- func (d *CDisplay) CallEnabled() (enabled bool, err error)
- func (d *CDisplay) CaptureCtrlC()
- func (d *CDisplay) CaptureDisplay() (err error)
- func (d *CDisplay) CapturedCtrlC() bool
- func (d *CDisplay) Colors() (numberOfColors int)
- func (d *CDisplay) Command(name string, argv ...string) (err error)
- func (d *CDisplay) CursorPosition() (position ptypes.Point2I, moving bool)
- func (d *CDisplay) Destroy()
- func (d *CDisplay) DisplayCaptured() bool
- func (d *CDisplay) FocusNextWindow()
- func (d *CDisplay) FocusPreviousWindow()
- func (d *CDisplay) FocusWindow(w Window)
- func (d *CDisplay) FocusedWindow() Window
- func (d *CDisplay) GetClipboard() (clipboard Clipboard)
- func (d *CDisplay) GetCompressEvents() bool
- func (d *CDisplay) GetEventFocus() (widget Object)
- func (d *CDisplay) GetPriorEvent() (event Event)
- func (d *CDisplay) GetTitle() string
- func (d *CDisplay) GetTtyHandle() *os.File
- func (d *CDisplay) GetTtyPath() string
- func (d *CDisplay) GetWindowAtPoint(point ptypes.Point2I) (window Window)
- func (d *CDisplay) GetWindows() (windows []Window)
- func (d *CDisplay) HasBufferedEvents() (hasEvents bool)
- func (d *CDisplay) HasPendingEvents() (pending bool)
- func (d *CDisplay) Init() (already bool)
- func (d *CDisplay) IsMappedWindow(w Window) (mapped bool)
- func (d *CDisplay) IsMonochrome() bool
- func (d *CDisplay) IsRunning() bool
- func (d *CDisplay) IterateBufferedEvents() (refreshed bool)
- func (d *CDisplay) Main(ctx context.Context, cancel context.CancelFunc, wg *sync.WaitGroup) (err error)
- func (d *CDisplay) MainFinish()
- func (d *CDisplay) MapWindow(w Window)
- func (d *CDisplay) MapWindowWithRegion(w Window, region ptypes.Region)
- func (d *CDisplay) PostEvent(evt Event) error
- func (d *CDisplay) ProcessEvent(evt Event) enums.EventFlag
- func (d *CDisplay) ReleaseCtrlC()
- func (d *CDisplay) ReleaseDisplay()
- func (d *CDisplay) RequestDraw()
- func (d *CDisplay) RequestQuit()
- func (d *CDisplay) RequestShow()
- func (d *CDisplay) RequestSync()
- func (d *CDisplay) Run() (err error)
- func (d *CDisplay) Screen() Screen
- func (d *CDisplay) SetCompressEvents(compress bool)
- func (d *CDisplay) SetEventFocus(widget Object) error
- func (d *CDisplay) SetTheme(theme paint.Theme)
- func (d *CDisplay) SetTitle(title string)
- func (d *CDisplay) SetTtyHandle(ttyHandle *os.File)
- func (d *CDisplay) SetTtyPath(ttyPath string)
- func (d *CDisplay) Startup() (ctx context.Context, cancel context.CancelFunc, wg *sync.WaitGroup, err error)
- func (d *CDisplay) StartupComplete()
- func (d *CDisplay) UnmapWindow(w Window)
- type CLocalContextData
- type CMetaData
- func (o *CMetaData) GetBoolProperty(name Property) (value bool, err error)
- func (o *CMetaData) GetColorProperty(name Property) (value paint.Color, err error)
- func (o *CMetaData) GetFloat64Property(name Property) (value float64, err error)
- func (o *CMetaData) GetFloatProperty(name Property) (value float64, err error)
- func (o *CMetaData) GetIntProperty(name Property) (value int, err error)
- func (o *CMetaData) GetPointProperty(name Property) (value ptypes.Point2I, err error)
- func (o *CMetaData) GetProperty(name Property) *CProperty
- func (o *CMetaData) GetRectangleProperty(name Property) (value ptypes.Rectangle, err error)
- func (o *CMetaData) GetRegionProperty(name Property) (value ptypes.Region, err error)
- func (o *CMetaData) GetStringProperty(name Property) (value string, err error)
- func (o *CMetaData) GetStructProperty(name Property) (value interface{}, err error)
- func (o *CMetaData) GetStyleProperty(name Property) (value paint.Style, err error)
- func (o *CMetaData) GetThemeProperty(name Property) (value paint.Theme, err error)
- func (o *CMetaData) GetTimeProperty(name Property) (value time.Duration, err error)
- func (o *CMetaData) Init() (already bool)
- func (o *CMetaData) InstallBuildableProperty(name Property, kind PropertyType, write bool, def interface{}) error
- func (o *CMetaData) InstallProperty(name Property, kind PropertyType, write bool, def interface{}) error
- func (o *CMetaData) IsBuildableProperty(name Property) (buildable bool)
- func (o *CMetaData) IsProperty(name Property) bool
- func (o *CMetaData) ListBuildableProperties() (properties []Property)
- func (o *CMetaData) ListProperties() (properties []Property)
- func (o *CMetaData) OverloadProperty(name Property, kind PropertyType, write bool, buildable bool, def interface{}) error
- func (o *CMetaData) SetBoolProperty(name Property, value bool) error
- func (o *CMetaData) SetColorProperty(name Property, value paint.Color) error
- func (o *CMetaData) SetFloatProperty(name Property, value float64) error
- func (o *CMetaData) SetIntProperty(name Property, value int) error
- func (o *CMetaData) SetPointProperty(name Property, value ptypes.Point2I) error
- func (o *CMetaData) SetProperties(properties map[Property]string) (err error)
- func (o *CMetaData) SetProperty(name Property, value interface{}) error
- func (o *CMetaData) SetPropertyFromString(name Property, value string) error
- func (o *CMetaData) SetRectangleProperty(name Property, value ptypes.Rectangle) error
- func (o *CMetaData) SetRegionProperty(name Property, value ptypes.Region) error
- func (o *CMetaData) SetStringProperty(name Property, value string) error
- func (o *CMetaData) SetStructProperty(name Property, value interface{}) error
- func (o *CMetaData) SetStyleProperty(name Property, value paint.Style) error
- func (o *CMetaData) SetThemeProperty(name Property, value paint.Theme) error
- func (o *CMetaData) SetTimeProperty(name Property, value time.Duration) error
- type CObject
- func (o *CObject) Destroy()
- func (o *CObject) GetName() (name string)
- func (o *CObject) GetTheme() (theme paint.Theme)
- func (o *CObject) Init() (already bool)
- func (o *CObject) InitWithProperties(properties map[Property]string) (already bool, err error)
- func (o *CObject) SetName(name string)
- func (o *CObject) SetTheme(theme paint.Theme)
- type COffScreen
- func (o *COffScreen) Beep() error
- func (o *COffScreen) CanDisplay(r rune, checkFallbacks bool) bool
- func (o *COffScreen) CharacterSet() string
- func (o *COffScreen) Clear()
- func (o *COffScreen) Close()
- func (o *COffScreen) Colors() int
- func (o *COffScreen) CopyToClipboard(s string)
- func (o *COffScreen) DisableMouse()
- func (o *COffScreen) DisablePaste()
- func (o *COffScreen) EnableHostClipboard(enabled bool)
- func (o *COffScreen) EnableMouse(_ ...MouseFlags)
- func (o *COffScreen) EnablePaste()
- func (o *COffScreen) EnableTermClipboard(enabled bool)
- func (o *COffScreen) Export() *CellBuffer
- func (o *COffScreen) Fill(r rune, style paint.Style)
- func (o *COffScreen) GetContent(x, y int) (mc rune, comb []rune, style paint.Style, width int)
- func (o *COffScreen) GetContents() ([]OffscreenCell, int, int)
- func (o *COffScreen) GetCursor() (int, int, bool)
- func (o *COffScreen) GetTermType() (ttyType term.TermType)
- func (o *COffScreen) GetTtyCloseWithStiRead() (enabled bool)
- func (o *COffScreen) HasKey(Key) bool
- func (o *COffScreen) HasMouse() bool
- func (o *COffScreen) HideCursor()
- func (o *COffScreen) HostClipboardEnabled() (enabled bool)
- func (o *COffScreen) Import(cb *CellBuffer)
- func (o *COffScreen) Init() error
- func (o *COffScreen) InitWithFileHandle(ttyHandle *os.File) (err error)
- func (o *COffScreen) InitWithFilePath(ttyFile string) (err error)
- func (o *COffScreen) InjectKey(key Key, r rune, mod ModMask)
- func (o *COffScreen) InjectKeyBytes(b []byte) bool
- func (o *COffScreen) InjectMouse(x, y int, buttons ButtonMask, mod ModMask)
- func (o *COffScreen) PasteFromClipboard() (s string, ok bool)
- func (o *COffScreen) PollEvent() Event
- func (o *COffScreen) PollEventChan() (next chan Event)
- func (o *COffScreen) PostEvent(ev Event) error
- func (o *COffScreen) PostEventWait(ev Event)
- func (o *COffScreen) RegisterConsoleFallback(r rune, subst rune)
- func (o *COffScreen) RegisterRuneFallback(r rune, subst string)
- func (o *COffScreen) Resize(int, int, int, int)
- func (o *COffScreen) SetCell(x, y int, style paint.Style, ch ...rune)
- func (o *COffScreen) SetContent(x, y int, mc rune, comb []rune, st paint.Style)
- func (o *COffScreen) SetSize(w, h int)
- func (o *COffScreen) SetStyle(style paint.Style)
- func (o *COffScreen) Show()
- func (o *COffScreen) ShowCursor(x, y int)
- func (o *COffScreen) Size() (w, h int)
- func (o *COffScreen) Sync()
- func (o *COffScreen) TtyCloseWithStiRead(enabled bool)
- func (o *COffScreen) TtyKeepFileHandle(keep bool)
- func (o *COffScreen) TtyKeepingFileHandle() (keeping bool)
- func (o *COffScreen) UnregisterConsoleFallback(orig rune)
- func (o *COffScreen) UnregisterRuneFallback(r rune)
- type COffscreenWindow
- func (w *COffscreenWindow) Draw() enums.EventFlag
- func (w *COffscreenWindow) GetDisplay() Display
- func (w *COffscreenWindow) GetTitle() string
- func (w *COffscreenWindow) GetWindowType() (value enums.WindowType)
- func (w *COffscreenWindow) Init() bool
- func (w *COffscreenWindow) ProcessEvent(evt Event) enums.EventFlag
- func (w *COffscreenWindow) SetDisplay(d Display)
- func (w *COffscreenWindow) SetTitle(title string)
- func (w *COffscreenWindow) SetWindowType(hint enums.WindowType)
- type CProperty
- func (p *CProperty) Buildable() bool
- func (p *CProperty) Clone() *CProperty
- func (p *CProperty) Default() (def interface{})
- func (p *CProperty) Name() Property
- func (p *CProperty) ReadOnly() bool
- func (p *CProperty) Set(value interface{}) error
- func (p *CProperty) SetFromString(value string) error
- func (p *CProperty) Type() PropertyType
- func (p *CProperty) Value() (value interface{})
- type CScreen
- func (d *CScreen) Beep() error
- func (d *CScreen) CanDisplay(r rune, checkFallbacks bool) bool
- func (d *CScreen) CharacterSet() string
- func (d *CScreen) Clear()
- func (d *CScreen) Close()
- func (d *CScreen) Colors() int
- func (d *CScreen) CopyToClipboard(s string)
- func (d *CScreen) DisableMouse()
- func (d *CScreen) DisablePaste()
- func (d *CScreen) EnableGPM()
- func (d *CScreen) EnableHostClipboard(enabled bool)
- func (d *CScreen) EnableMouse(flags ...MouseFlags)
- func (d *CScreen) EnablePaste()
- func (d *CScreen) EnableTermClipboard(enabled bool)
- func (d *CScreen) Export() *CellBuffer
- func (d *CScreen) Fill(r rune, style paint.Style)
- func (d *CScreen) GetContent(x, y int) (rune, []rune, paint.Style, int)
- func (d *CScreen) GetTermType() (ttyType cterm.TermType)
- func (d *CScreen) GetTtyCloseWithStiRead() (enabled bool)
- func (d *CScreen) HasKey(k Key) bool
- func (d *CScreen) HasMouse() bool
- func (d *CScreen) HideCursor()
- func (d *CScreen) HostClipboardEnabled() (enabled bool)
- func (d *CScreen) Import(cb *CellBuffer)
- func (d *CScreen) Init() error
- func (d *CScreen) InitWithFileHandle(fh *os.File) error
- func (d *CScreen) InitWithFilePath(fp string) error
- func (d *CScreen) PasteFromClipboard() (s string, ok bool)
- func (d *CScreen) PollEvent() Event
- func (d *CScreen) PollEventChan() (next chan Event)
- func (d *CScreen) PostEvent(ev Event) error
- func (d *CScreen) PostEventWait(ev Event)
- func (d *CScreen) RegisterConsoleFallback(r rune, subst rune)
- func (d *CScreen) RegisterRuneFallback(orig rune, fallback string)
- func (d *CScreen) SetCell(x, y int, style paint.Style, ch ...rune)
- func (d *CScreen) SetContent(x, y int, mc rune, comb []rune, style paint.Style)
- func (d *CScreen) SetStyle(style paint.Style)
- func (d *CScreen) Show()
- func (d *CScreen) ShowCursor(x, y int)
- func (d *CScreen) Size() (w, h int)
- func (d *CScreen) Sync()
- func (d *CScreen) TPuts(s string)
- func (d *CScreen) TtyCloseWithStiRead(enabled bool)
- func (d *CScreen) TtyKeepFileHandle(keep bool)
- func (d *CScreen) TtyKeepingFileHandle() (keeping bool)
- func (d *CScreen) UnregisterConsoleFallback(orig rune)
- func (d *CScreen) UnregisterRuneFallback(orig rune)
- type CServerAuthHandler
- func (h *CServerAuthHandler) Attach(server ApplicationServer) (err error)
- func (h *CServerAuthHandler) Detach() (err error)
- func (h *CServerAuthHandler) HasArgument(arg string) (has bool)
- func (h *CServerAuthHandler) ID() (id uuid.UUID)
- func (h *CServerAuthHandler) Init() (already bool)
- func (h *CServerAuthHandler) PasswordCallback(conn ssh.ConnMetadata, password []byte) (*ssh.Permissions, error)
- func (h *CServerAuthHandler) RegisterArgument(flag cli.Flag)
- func (h *CServerAuthHandler) Reload(ctx *cli.Context) (err error)
- type CServerAuthHtpasswdHandler
- type CSignalListener
- type CSignaling
- func (o *CSignaling) Connect(signal Signal, handle string, c SignalListenerFn, data ...interface{})
- func (o *CSignaling) Disconnect(signal Signal, handle string) error
- func (o *CSignaling) DisconnectAll()
- func (o *CSignaling) Emit(signal Signal, argv ...interface{}) enums.EventFlag
- func (o *CSignaling) Freeze()
- func (o *CSignaling) Handled(signal Signal, handle string) (found bool)
- func (o *CSignaling) HasListeners(signal Signal) (has bool)
- func (o *CSignaling) Init() (already bool)
- func (o *CSignaling) IsFrozen() (frozen bool)
- func (o *CSignaling) IsSignalPassed(signals ...Signal) (passed bool)
- func (o *CSignaling) IsSignalStopped(signals ...Signal) (stopped bool)
- func (o *CSignaling) PassSignal(signals ...Signal)
- func (o *CSignaling) ResumeSignal(signals ...Signal)
- func (o *CSignaling) StopSignal(signals ...Signal)
- func (o *CSignaling) Thaw()
- type CType
- type CTypeItem
- func (o *CTypeItem) DestroyObject() (err error)
- func (o *CTypeItem) GetName() string
- func (o *CTypeItem) GetTypeTag() TypeTag
- func (o *CTypeItem) Init() (already bool)
- func (o *CTypeItem) InitTypeItem(tag TypeTag, thing interface{}) (already bool)
- func (o *CTypeItem) IsValid() bool
- func (o *CTypeItem) LogDebug(format string, argv ...interface{})
- func (o *CTypeItem) LogErr(err error)
- func (o *CTypeItem) LogError(format string, argv ...interface{})
- func (o *CTypeItem) LogInfo(format string, argv ...interface{})
- func (o *CTypeItem) LogTag() string
- func (o *CTypeItem) LogTrace(format string, argv ...interface{})
- func (o *CTypeItem) LogWarn(format string, argv ...interface{})
- func (o *CTypeItem) ObjectID() uuid.UUID
- func (o *CTypeItem) ObjectName() string
- func (o *CTypeItem) ObjectShortID() (short string)
- func (o *CTypeItem) Self() (this interface{})
- func (o *CTypeItem) SetName(name string)
- func (o *CTypeItem) String() string
- type CTypeItemList
- type CTypeRegistry
- func (r *CTypeRegistry) AddType(tag TypeTag, constructor func() interface{}, aliases ...string) error
- func (r *CTypeRegistry) AddTypeAlias(tag TypeTag, aliases ...string)
- func (r *CTypeRegistry) AddTypeItem(tag TypeTag, item interface{}) (id uuid.UUID, err error)
- func (r *CTypeRegistry) GetBuildableInfo() (info map[string]TypeTag)
- func (r *CTypeRegistry) GetType(tag TypeTag) (t Type, ok bool)
- func (r *CTypeRegistry) GetTypeItemByID(id uuid.UUID) interface{}
- func (r *CTypeRegistry) GetTypeItemByName(name string) interface{}
- func (r *CTypeRegistry) GetTypeItems(tag TypeTag) []interface{}
- func (r *CTypeRegistry) GetTypeTagByAlias(alias string) (tt TypeTag, ok bool)
- func (r *CTypeRegistry) GetTypeTags() (tags []TypeTag)
- func (r *CTypeRegistry) HasID(index uuid.UUID) bool
- func (r *CTypeRegistry) HasType(tag TypeTag) (exists bool)
- func (r *CTypeRegistry) MakeType(tag TypeTag) (thing interface{}, err error)
- func (r *CTypeRegistry) RemoveTypeItem(tag TypeTag, item TypeItem) error
- type CTypeTag
- type CWindow
- func (w *CWindow) Destroy()
- func (w *CWindow) Draw() enums.EventFlag
- func (w *CWindow) GetDisplay() Display
- func (w *CWindow) GetTitle() string
- func (w *CWindow) GetWindowType() (value enums.WindowType)
- func (w *CWindow) Init() bool
- func (w *CWindow) ProcessEvent(evt Event) enums.EventFlag
- func (w *CWindow) SetDisplay(d Display)
- func (w *CWindow) SetTitle(title string)
- func (w *CWindow) SetWindowType(hint enums.WindowType)
- type CellBuffer
- func (cb *CellBuffer) Dirty(x, y int) bool
- func (cb *CellBuffer) Fill(r rune, style paint.Style)
- func (cb *CellBuffer) GetCell(x, y int) (mainc rune, combc []rune, style paint.Style, width int)
- func (cb *CellBuffer) Invalidate()
- func (cb *CellBuffer) Resize(w, h int)
- func (cb *CellBuffer) SetCell(x int, y int, mainc rune, combc []rune, style paint.Style)
- func (cb *CellBuffer) SetDirty(x, y int, dirty bool)
- func (cb *CellBuffer) Size() (w, h int)
- type Clipboard
- type Config
- type Display
- type DisplayCallbackFn
- type DisplayCommandFn
- type DisplayManagerFn
- type EncodingFallback
- type Event
- type EventError
- type EventHandler
- type EventInterrupt
- type EventKey
- type EventMask
- type EventMouse
- func (ev *EventMouse) Button() ButtonMask
- func (ev *EventMouse) ButtonHas(check ButtonMask) bool
- func (ev *EventMouse) ButtonPressed() ButtonMask
- func (ev *EventMouse) Buttons() ButtonMask
- func (ev *EventMouse) Clone() Event
- func (ev *EventMouse) CloneForPosition(x, y int) Event
- func (ev *EventMouse) IsDragStarted() bool
- func (ev *EventMouse) IsDragStopped() bool
- func (ev *EventMouse) IsDragging() bool
- func (ev *EventMouse) IsMoving() bool
- func (ev *EventMouse) IsPressed() bool
- func (ev *EventMouse) IsReleased() bool
- func (ev *EventMouse) IsWheelImpulse() bool
- func (ev *EventMouse) Modifiers() ModMask
- func (ev *EventMouse) Point2I() (point ptypes.Point2I)
- func (ev *EventMouse) Position() (x, y int)
- func (ev *EventMouse) Report() string
- func (ev *EventMouse) State() MouseState
- func (ev *EventMouse) StateHas(check MouseState) bool
- func (ev *EventMouse) WheelImpulse() ButtonMask
- func (ev *EventMouse) When() time.Time
- type EventPaste
- type EventQuit
- type EventRender
- type EventResize
- type EventTime
- type IButtonMask
- type IMouseState
- type Key
- type MetaData
- type ModMask
- type MouseFlags
- type MouseState
- type Object
- type OffScreen
- type OffscreenCell
- type OffscreenWindow
- type Property
- type PropertyType
- type Screen
- type Sensitive
- type ServerAuthHandler
- type ServerAuthPasswordHandler
- type Signal
- type SignalListenerData
- type SignalListenerFn
- func WithArgvApplicationSignalPrepareStartup(fn ApplicationPrepareStartupFn) SignalListenerFn
- func WithArgvApplicationSignalStartup(fn ApplicationStartupFn) SignalListenerFn
- func WithArgvNoneSignal(fn func(), eventFlag enums.EventFlag) SignalListenerFn
- func WithArgvNoneWithFlagsSignal(fn func() enums.EventFlag) SignalListenerFn
- type Signaling
- type TimerCallbackFn
- type Type
- type TypeItem
- type TypeRegistry
- type TypeTag
- type Window
Constants ¶
const ( // EncodingFallbackFail behavior causes GetEncoding to fail // when it cannot find an encoding. EncodingFallbackFail = iota // EncodingFallbackASCII behaviore causes GetEncoding to fall back // to a 7-bit ASCII encoding, if no other encoding can be found. EncodingFallbackASCII // EncodingFallbackUTF8 behavior causes GetEncoding to assume // UTF8 can pass unmodified upon failure. Note that this behavior // is not recommended, unless you are sure your terminal can cope // with real UTF8 sequences. EncodingFallbackUTF8 )
const ( KeyBackspace = KeyBS KeyTab = KeyTAB KeyEsc = KeyESC KeyEscape = KeyESC KeyEnter = KeyCR KeyBackspace2 = KeyDEL )
These keys are aliases for other names.
const ( TypeMetaData CTypeTag = "cdk-metadata" SignalSetProperty Signal = "set-property" )
const ( MouseButtonEvents = MouseFlags(1) // Click events only MouseDragEvents = MouseFlags(2) // Click-drag events (includes button events) MouseMotionEvents = MouseFlags(4) // All mouse events (includes click and drag events) )
const ( TypeWindow CTypeTag = "cdk-window" PropertyWindowType Property = "window-type" SignalDraw Signal = "draw" SignalSetTitle Signal = "set-title" SignalSetDisplay Signal = "set-display" )
const ApplicationDisplayShutdownHandle = "application-display-shutdown-handler"
const ApplicationDisplayStartupHandle = "application-display-startup-handler"
const ApplicationServerDisplayStartupHandle = "application-server-display-startup-handler"
const (
DisplayStartupCompleteHandle = "display-screen-startup-complete-handler"
)
const ObjectSetPropertyHandle = "object-set-property-handle"
const OffscreenTtyPath = "<offscreen>"
Variables ¶
var ( AppCliProfileFlag = &cli.StringFlag{ Category: "Go-Curses", Name: "cdk-profile", EnvVars: []string{"GO_CDK_PROFILE"}, Usage: "profile one of: none, block, cpu, goroutine, mem, mutex, thread or trace", DefaultText: "none", } AppCliProfilePathFlag = &cli.StringFlag{ Category: "Go-Curses", Name: "cdk-profile-path", EnvVars: []string{"GO_CDK_PROFILE_PATH"}, Usage: "specify the directory path to store the profile data", DefaultText: DefaultGoProfilePath, } AppCliLogFileFlag = &cli.StringFlag{ Category: "Go-Curses", Name: "cdk-log-file", EnvVars: []string{"GO_CDK_LOG_FILE"}, Usage: "path to log file", DefaultText: log.DefaultLogPath, } AppCliLogLevelFlag = &cli.StringFlag{ Category: "Go-Curses", Name: "cdk-log-level", EnvVars: []string{"GO_CDK_LOG_LEVEL"}, Value: "error", Usage: "highest level of verbosity", DefaultText: "error", } AppCliLogFormatFlag = &cli.StringFlag{ Category: "Go-Curses", Name: "cdk-log-format", EnvVars: []string{"GO_CDK_LOG_FORMAT"}, Value: "pretty", Usage: "json, text or pretty", DefaultText: "pretty", } AppCliLogTimestampsFlag = &cli.BoolFlag{ Category: "Go-Curses", Name: "cdk-log-timestamps", EnvVars: []string{"GO_CDK_LOG_TIMESTAMPS"}, Usage: "enable timestamps", DefaultText: "false", } AppCliLogTimestampFormatFlag = &cli.StringFlag{ Category: "Go-Curses", Name: "cdk-log-timestamp-format", EnvVars: []string{"GO_CDK_LOG_TIMESTAMP_FORMAT"}, Value: log.DefaultTimestampFormat, Usage: "timestamp format", DefaultText: log.DefaultTimestampFormat, } AppCliLogFullPathsFlag = &cli.BoolFlag{ Category: "Go-Curses", Name: "cdk-log-full-paths", EnvVars: []string{"GO_CDK_LOG_FULL_PATHS"}, Usage: "log the full paths of source files", DefaultText: "false", } AppCliLogOutputFlag = &cli.StringFlag{ Category: "Go-Curses", Name: "cdk-log-output", EnvVars: []string{"GO_CDK_LOG_OUTPUT"}, Value: "file", Usage: "logging output type: stdout, stderr or file", DefaultText: "file", } AppCliLogLevelsFlag = &cli.BoolFlag{ Category: "Go-Curses", Name: "cdk-log-levels", Usage: "list the levels of logging verbosity", } AppCliTtyFlag = &cli.StringFlag{ Category: "Go-Curses", Name: "cdk-tty", Usage: "specify the display tty", EnvVars: []string{"GO_CDK_TTY"}, } )
var ( IncludeTtyFlag = "false" IncludeProfiling = "false" IncludeLogFile = "false" IncludeLogFormat = "false" IncludeLogFullPaths = "false" IncludeLogLevel = "false" IncludeLogLevels = "false" IncludeLogTimestamps = "false" IncludeLogTimestampFormat = "false" IncludeLogOutput = "false" )
Setting these globals will enable command line flags and their corresponding features. To set these, use the go build -ldflags:
go build -v -ldflags="-X 'github.com/go-curses/cdk.IncludeTtyFlag=true'"
var ( // DisplayCallCapacity limits the number of concurrent calls on main threads DisplayCallCapacity = 128 DisplayEventCapacity = 1024 DisplayMainsCapacity = 128 DisplayInboundCapacity = 1024 // MainIterateDelay is the event iteration loop delay MainIterateDelay = time.Millisecond * 25 // MainDrawInterval is the interval between renders (milliseconds) MainDrawInterval int64 = 50 MainLoopInterval int64 = 10 DisplayLoopCapacity = 1024 )
var ( // ErrTermNotFound indicates that a suitable terminal entry could // not be found. This can result from either not having TERM set, // or from the TERM failing to support certain minimal functionality, // in particular absolute cursor addressability (the cup capability) // is required. For example, legacy "adm3" lacks this capability, // whereas the slightly newer "adm3a" supports it. This failure // occurs most often with "dumb". ErrTermNotFound = terminfo.ErrTermNotFound // ErrNoDisplay indicates that no suitable display could be found. // This may result from attempting to run on a platform where there // is no support for either termios or console I/O (such as nacl), // or from running in an environment where there is no access to // a suitable console/terminal device. (For example, running on // without a controlling TTY or with no /dev/tty on POSIX platforms.) ErrNoDisplay = errors.New("no suitable display available") // ErrNoCharset indicates that the locale environment the // program is not supported by the program, because no suitable // encoding was found for it. This problem never occurs if // the environment is UTF-8 or UTF-16. ErrNoCharset = errors.New("character set not supported") // ErrEventQFull indicates that the event queue is full, and // cannot accept more events. ErrEventQFull = errors.New("event queue full") )
var ( EventQueueSize = 1024 EventKeyQueueSize = 1024 EventKeyTiming = time.Millisecond * 50 SignalQueueSize = 100 )
var Build = Config{ Profiling: false, LogFile: false, LogFormat: false, LogFullPaths: false, LogLevel: false, LogLevels: false, LogTimestamps: false, LogTimestampFormat: false, LogOutput: false, DisableLocalCall: true, DisableRemoteCall: true, }
var (
DefaultGoProfilePath = os.TempDir() + string(os.PathSeparator) + "cdk.pprof"
)
var (
DefaultServerAuthHtpasswdPath = "./htpasswd"
)
var KeyNames = map[Key]string{}/* 118 elements not displayed */
KeyNames holds the written names of special keys. Useful to echo back a key name, or to look up a key from a string value.
var (
MOUSE_STATES map[MouseState]string = map[MouseState]string{
MOUSE_NONE: "None",
MOUSE_MOVE: "Move",
BUTTON_PRESS: "Pressed",
BUTTON_RELEASE: "Released",
WHEEL_PULSE: "Impulse",
DRAG_START: "DragStart",
DRAG_MOVE: "DragMove",
DRAG_STOP: "DragStop",
}
)
var (
TypesManager = NewTypeRegistry()
)
Functions ¶
func AddTimeout ¶
func AddTimeout(delay time.Duration, fn TimerCallbackFn) (id uuid.UUID)
func ArgvApplicationSignalStartup ¶ added in v0.4.2
func ArgvApplicationSignalStartup(argv ...interface{}) (app Application, display Display, ctx context.Context, cancel context.CancelFunc, wg *sync.WaitGroup, ok bool)
func CancelAllTimeouts ¶
func CancelAllTimeouts()
func DescribeButton ¶
func DescribeButton(button ButtonMask) string
func DisplaySignalDisplayStartupArgv ¶ added in v0.4.0
func GetApplicationCliFlags ¶ added in v0.3.2
func GetApplicationCliFlags() (flags []cli.Flag)
func GetEncoding ¶
GetEncoding is used by Display implementors who want to locate an encoding for the given character set name. Note that this will return nil for either the Unicode (UTF-8) or ASCII encodings, since we don't use encodings for them but instead have our own native methods.
func GoWithMainContext ¶ added in v0.3.2
func ListEncodings ¶
func ListEncodings() []string
func LookupKeyName ¶
func ParseKeyMods ¶ added in v0.3.3
func RegisterEncoding ¶
RegisterEncoding may be called by the application to register an encoding. The presence of additional encodings will facilitate application usage with terminal environments where the I/O subsystem does not support Unicode.
Windows systems use Unicode natively, and do not need any of the encoding subsystem when using Windows Console screens.
Please see the Go documentation for golang.org/x/text/encoding -- most of the common ones exist already as stock variables. For example, ISO8859-15 can be registered using the following code:
import "golang.org/x/text/encoding/charmap" ... RegisterEncoding("ISO8859-15", charmap.ISO8859_15)
Aliases can be registered as well, for example "8859-15" could be an alias for "ISO8859-15".
For POSIX systems, the cdk package will check the environment variables LC_ALL, LC_CTYPE, and LANG (in that order) to determine the character set. These are expected to have the following pattern:
$language[.$codeset[@$variant]
We extract only the $codeset part, which will usually be something like UTF-8 or ISO8859-15 or KOI8-R. Note that if the locale is either "POSIX" or "C", then we assume US-ASCII (the POSIX 'portable character set' and assume all other characters are somehow invalid.)
Modern POSIX systems and terminal emulators may use UTF-8, and for those systems, this API is also unnecessary. For example, Darwin (MacOS X) and modern Linux running modern xterm generally will out of the box without any of this. Use of UTF-8 is recommended when possible, as it saves quite a lot processing overhead.
Note that some encodings are quite large (for example GB18030 which is a superset of Unicode) and so the application size can be expected ot increase quite a bit as each encoding is added. The East Asian encodings have been seen to add 100-200K per encoding to the application size.
func SetEncodingFallback ¶
func SetEncodingFallback(fb EncodingFallback)
SetEncodingFallback changes the behavior of GetEncoding when a suitable encoding is not found. The default is EncodingFallbackFail, which causes GetEncoding to simply return nil.
func StopTimeout ¶
func TestingMakesNoContent ¶
func UnregisterEncoding ¶
func UnregisterEncoding(charset string)
func WithApp ¶
func WithApp(initFn SignalListenerFn, action AppFn) func()
func WithDisplayManager ¶
func WithDisplayManager(action DisplayManagerFn) func()
Types ¶
type AppFn ¶
type AppFn func(app Application)
type Application ¶ added in v0.3.2
type Application interface { Object Init() (already bool) SetupDisplay() Destroy() CLI() *cli.App GetContext() *cli.Context Tag() string Title() string Name() string Usage() string Description() string Version() string Reconfigure(name, usage, description, version, tag, title, ttyPath string) AddFlag(flag cli.Flag) RemoveFlag(flag cli.Flag) (removed bool) AddFlags(flags []cli.Flag) AddCommand(command *cli.Command) AddCommands(commands []*cli.Command) Display() *CDisplay SetDisplay(d *CDisplay) (err error) NotifyStartupComplete() StartupCompleted() bool Run(args []string) (err error) MainInit(argv ...interface{}) (ok bool) MainRun(runner ApplicationMain) MainEventsPending() (pending bool) MainIterateEvents() MainFinish() CliActionFn(ctx *cli.Context) (err error) }
func ArgvApplicationSignalPrepareStartup ¶ added in v0.5.20
func ArgvApplicationSignalPrepareStartup(argv ...interface{}) (app Application, args []string, ok bool)
func LoadApplicationFromPlugin ¶ added in v0.3.6
func LoadApplicationFromPlugin(path string) (app Application, err error)
LoadApplicationFromPlugin is a wrapper around LoadApplicationFromPluginWithExport, using a default exported symbol name of `CdkApp`.
func LoadApplicationFromPluginWithExport ¶ added in v0.3.6
func LoadApplicationFromPluginWithExport(exported, path string) (app Application, err error)
LoadApplicationFromPluginWithExport opens the shared object file indicated by the path argument, looks for the exported symbol (which needs to be to a valid cdk.Application instance), recasts and returns the result.
type ApplicationInitFn ¶ added in v0.4.2
type ApplicationInitFn = func(app Application)
type ApplicationMain ¶ added in v0.4.0
type ApplicationPrepareStartupFn ¶ added in v0.5.20
type ApplicationPrepareStartupFn = func(app Application, args []string) enums.EventFlag
type ApplicationRunFn ¶ added in v0.4.0
type ApplicationRunFn = func(ctx *cli.Context) error
type ApplicationServer ¶ added in v0.3.2
type ApplicationServer interface { Object Init() (already bool) GetClients() (clients []uuid.UUID) GetClient(id uuid.UUID) (*CApplicationServerClient, error) App() (app *CApplication) Display() (display *CDisplay) SetListenAddress(address string) GetListenAddress() (address string) SetListenPort(port int) GetListenPort() (port int) Stop() (err error) Daemon() (err error) Start() (err error) ClearAuthHandlers() InstallAuthHandler(handler ServerAuthHandler) (err error) UnInstallAuthHandler(handler ServerAuthHandler) (err error) }
type ApplicationShutdownFn ¶ added in v0.4.2
type ApplicationStartupFn ¶ added in v0.4.2
type ApplicationStartupFn = func( app Application, display Display, ctx context.Context, cancel context.CancelFunc, wg *sync.WaitGroup, ) enums.EventFlag
type ButtonMask ¶
type ButtonMask int16
ButtonMask is a mask of mouse buttons and wheel events. Mouse button presses are normally delivered as both press and release events. Mouse wheel events are normally just single impulse events. Windows supports up to eight separate buttons plus all four wheel directions, but XTerm can only support mouse buttons 1-3 and wheel up/down. Its not unheard of for terminals to support only one or two buttons (think Macs). Old terminals, and true emulations (such as vt100) won't support mice at all, of course.
const ( Button1 ButtonMask = 1 << iota // Usually left mouse button. Button2 // Usually the middle mouse button. Button3 // Usually the right mouse button. Button4 // Often a side button (thumb/next). Button5 // Often a side button (thumb/prev). Button6 Button7 Button8 WheelUp // Wheel motion up/away from user. WheelDown // Wheel motion down/towards user. WheelLeft // Wheel motion to left. WheelRight // Wheel motion to right. LastButtonMask // Highest mask value ButtonNone ButtonMask = 0 // No button or wheel events. ButtonPrimary = Button1 ButtonSecondary = Button2 ButtonMiddle = Button3 )
These are the actual button values. Note that tcell version 1.x reversed buttons two and three on *nix based terminals. We use button 1 as the primary, and button 2 as the secondary, and button 3 (which is often missing) as the middle.
func (ButtonMask) Clear ¶
func (i ButtonMask) Clear(m ButtonMask) ButtonMask
return a button mask with the given flags cleared, does not modify itself
func (ButtonMask) Has ¶
func (i ButtonMask) Has(m ButtonMask) bool
check if the mask has the given flag(s)
func (ButtonMask) Set ¶
func (i ButtonMask) Set(m ButtonMask) ButtonMask
return a button mask with the given flags set, does not modify itself
func (ButtonMask) String ¶
func (i ButtonMask) String() string
func (ButtonMask) Toggle ¶
func (i ButtonMask) Toggle(m ButtonMask) ButtonMask
return a button mask with the give flags reversed, does not modify itself
type CApplication ¶ added in v0.3.2
type CApplication struct { CObject // contains filtered or unexported fields }
func NewApplication ¶ added in v0.3.6
func NewApplication(name, usage, description, version, tag, title, ttyPath string) *CApplication
func (*CApplication) AddCommand ¶ added in v0.3.2
func (app *CApplication) AddCommand(command *cli.Command)
func (*CApplication) AddCommands ¶ added in v0.3.2
func (app *CApplication) AddCommands(commands []*cli.Command)
func (*CApplication) AddFlag ¶ added in v0.3.2
func (app *CApplication) AddFlag(flag cli.Flag)
func (*CApplication) AddFlags ¶ added in v0.3.2
func (app *CApplication) AddFlags(flags []cli.Flag)
func (*CApplication) CLI ¶ added in v0.3.2
func (app *CApplication) CLI() *cli.App
func (*CApplication) CliActionFn ¶ added in v0.3.2
func (app *CApplication) CliActionFn(ctx *cli.Context) (err error)
func (*CApplication) Description ¶ added in v0.3.2
func (app *CApplication) Description() string
func (*CApplication) Destroy ¶ added in v0.3.2
func (app *CApplication) Destroy()
func (*CApplication) Display ¶ added in v0.3.2
func (app *CApplication) Display() *CDisplay
func (*CApplication) GetContext ¶ added in v0.3.2
func (app *CApplication) GetContext() *cli.Context
func (*CApplication) Init ¶ added in v0.3.6
func (app *CApplication) Init() (already bool)
func (*CApplication) MainEventsPending ¶ added in v0.3.2
func (app *CApplication) MainEventsPending() (pending bool)
func (*CApplication) MainFinish ¶ added in v0.3.2
func (app *CApplication) MainFinish()
func (*CApplication) MainInit ¶ added in v0.3.2
func (app *CApplication) MainInit(argv ...interface{}) (ok bool)
MainInit is used to initialize the Application based on the CLI arguments given at runtime.
`argv` can be one of the following cases:
nil/empty use only the environment variables, if any are set *cli.Context do not parse anything, just use existing context ...string parse the given strings as if it were os.Args
func (*CApplication) MainIterateEvents ¶ added in v0.3.2
func (app *CApplication) MainIterateEvents()
func (*CApplication) MainRun ¶ added in v0.3.2
func (app *CApplication) MainRun(runner ApplicationMain)
func (*CApplication) Name ¶ added in v0.3.2
func (app *CApplication) Name() string
func (*CApplication) NotifyStartupComplete ¶ added in v0.4.0
func (app *CApplication) NotifyStartupComplete()
func (*CApplication) Reconfigure ¶ added in v0.4.0
func (app *CApplication) Reconfigure(name, usage, description, version, tag, title, ttyPath string)
func (*CApplication) RemoveFlag ¶ added in v0.3.2
func (app *CApplication) RemoveFlag(flag cli.Flag) (removed bool)
func (*CApplication) Run ¶ added in v0.3.2
func (app *CApplication) Run(args []string) (err error)
func (*CApplication) SetDisplay ¶ added in v0.4.1
func (app *CApplication) SetDisplay(d *CDisplay) (err error)
func (*CApplication) SetupDisplay ¶ added in v0.3.2
func (app *CApplication) SetupDisplay()
func (*CApplication) StartupCompleted ¶ added in v0.5.9
func (app *CApplication) StartupCompleted() bool
func (*CApplication) Tag ¶ added in v0.3.2
func (app *CApplication) Tag() string
func (*CApplication) Title ¶ added in v0.3.2
func (app *CApplication) Title() string
func (*CApplication) Usage ¶ added in v0.3.2
func (app *CApplication) Usage() string
func (*CApplication) Version ¶ added in v0.3.2
func (app *CApplication) Version() string
type CApplicationServer ¶ added in v0.3.2
type CApplicationServer struct { CObject // contains filtered or unexported fields }
func NewApplicationServer ¶ added in v0.3.2
func NewApplicationServer(name, usage, description, version, tag, title string, clientInitFn SignalListenerFn, serverInitFn SignalListenerFn, privateKeyPath string) *CApplicationServer
func (*CApplicationServer) App ¶ added in v0.3.2
func (s *CApplicationServer) App() (app *CApplication)
func (*CApplicationServer) ClearAuthHandlers ¶ added in v0.3.2
func (s *CApplicationServer) ClearAuthHandlers()
func (*CApplicationServer) Daemon ¶ added in v0.3.2
func (s *CApplicationServer) Daemon() (err error)
func (*CApplicationServer) Display ¶ added in v0.3.2
func (s *CApplicationServer) Display() (display *CDisplay)
func (*CApplicationServer) GetClient ¶ added in v0.3.2
func (s *CApplicationServer) GetClient(id uuid.UUID) (*CApplicationServerClient, error)
func (*CApplicationServer) GetClients ¶ added in v0.3.2
func (s *CApplicationServer) GetClients() (clients []uuid.UUID)
func (*CApplicationServer) GetListenAddress ¶ added in v0.3.2
func (s *CApplicationServer) GetListenAddress() (address string)
func (*CApplicationServer) GetListenPort ¶ added in v0.3.2
func (s *CApplicationServer) GetListenPort() (port int)
func (*CApplicationServer) Init ¶ added in v0.3.2
func (s *CApplicationServer) Init() (already bool)
func (*CApplicationServer) InstallAuthHandler ¶ added in v0.3.2
func (s *CApplicationServer) InstallAuthHandler(handler ServerAuthHandler) (err error)
func (*CApplicationServer) SetListenAddress ¶ added in v0.3.2
func (s *CApplicationServer) SetListenAddress(address string)
func (*CApplicationServer) SetListenPort ¶ added in v0.3.2
func (s *CApplicationServer) SetListenPort(port int)
func (*CApplicationServer) Start ¶ added in v0.3.2
func (s *CApplicationServer) Start() (err error)
func (*CApplicationServer) Stop ¶ added in v0.3.2
func (s *CApplicationServer) Stop() (err error)
func (*CApplicationServer) UnInstallAuthHandler ¶ added in v0.3.2
func (s *CApplicationServer) UnInstallAuthHandler(handler ServerAuthHandler) (err error)
type CApplicationServerClient ¶ added in v0.3.2
type CApplicationServerClient struct {
// contains filtered or unexported fields
}
func (*CApplicationServerClient) String ¶ added in v0.3.2
func (asc *CApplicationServerClient) String() string
type CClipboard ¶ added in v0.5.10
type CClipboard struct { CObject // contains filtered or unexported fields }
func (*CClipboard) Copy ¶ added in v0.5.10
func (c *CClipboard) Copy(text string)
Copy updates the clipboard's cache of pasted content and passes the copy event to the underlying operating system (if supported) using OSC52 terminal sequences
func (*CClipboard) GetText ¶ added in v0.5.10
func (c *CClipboard) GetText() (text string)
GetText retrieves the clipboard's cache of pasted content
func (*CClipboard) Init ¶ added in v0.5.10
func (c *CClipboard) Init() (already bool)
func (*CClipboard) Paste ¶ added in v0.5.10
func (c *CClipboard) Paste(text string)
Paste updates the clipboard's cache of pasted content and emits a "Paste" event itself
func (*CClipboard) SetText ¶ added in v0.5.10
func (c *CClipboard) SetText(text string)
SetText updates the clipboard's cache of pasted content
type CDisplay ¶
type CDisplay struct { CObject // contains filtered or unexported fields }
Basic display type
func GetDefaultDisplay ¶
func GetDefaultDisplay() (display *CDisplay)
GetDefaultDisplay returns the default display for the current app context
func NewDisplay ¶
func NewDisplayWithHandle ¶
func (*CDisplay) App ¶
func (d *CDisplay) App() *CApplication
func (*CDisplay) AsyncCall ¶
func (d *CDisplay) AsyncCall(fn DisplayCallbackFn) error
AsyncCall runs the given DisplayCallbackFn on the UI thread, non-blocking
func (*CDisplay) AsyncCallMain ¶ added in v0.4.0
func (d *CDisplay) AsyncCallMain(fn DisplayCallbackFn) error
AsyncCallMain will run the given DisplayCallbackFn on the main runner thread, non-blocking
func (*CDisplay) AwaitCall ¶
func (d *CDisplay) AwaitCall(fn DisplayCallbackFn) error
AwaitCall runs the given DisplayCallbackFn on the UI thread, blocking
func (*CDisplay) AwaitCallMain ¶ added in v0.4.0
func (d *CDisplay) AwaitCallMain(fn DisplayCallbackFn) error
AwaitCallMain will run the given DisplayCallbackFn on the main runner thread, blocking
func (*CDisplay) CallEnabled ¶ added in v0.5.4
func (*CDisplay) CaptureCtrlC ¶
func (d *CDisplay) CaptureCtrlC()
func (*CDisplay) CaptureDisplay ¶
func (*CDisplay) CapturedCtrlC ¶ added in v0.5.10
func (*CDisplay) CursorPosition ¶ added in v0.4.5
func (*CDisplay) DisplayCaptured ¶
func (*CDisplay) FocusNextWindow ¶ added in v0.4.4
func (d *CDisplay) FocusNextWindow()
func (*CDisplay) FocusPreviousWindow ¶ added in v0.4.4
func (d *CDisplay) FocusPreviousWindow()
func (*CDisplay) FocusWindow ¶ added in v0.4.4
func (*CDisplay) FocusedWindow ¶ added in v0.4.4
func (*CDisplay) GetClipboard ¶ added in v0.5.10
func (*CDisplay) GetCompressEvents ¶ added in v0.3.0
func (*CDisplay) GetEventFocus ¶
func (*CDisplay) GetPriorEvent ¶
func (*CDisplay) GetTtyHandle ¶
func (*CDisplay) GetTtyPath ¶
func (*CDisplay) GetWindowAtPoint ¶ added in v0.4.4
func (*CDisplay) GetWindows ¶
func (*CDisplay) HasBufferedEvents ¶ added in v0.3.0
HasBufferedEvents returns TRUE if there are any pending events buffered.
func (*CDisplay) HasPendingEvents ¶ added in v0.3.0
HasPendingEvents returns TRUE if there are any pending events, or if the Main thread is still running (and waiting for events).
func (*CDisplay) IsMappedWindow ¶ added in v0.4.4
func (*CDisplay) IsMonochrome ¶
func (*CDisplay) IterateBufferedEvents ¶ added in v0.3.0
IterateBufferedEvents compresses the pending event buffer by reducing multiple events of the same type to just the last ones received. Each remaining pending event is then processed. If any of the events return EVENT_STOP from their signal listeners, draw and show requests are made to refresh the display contents.
func (*CDisplay) Main ¶ added in v0.4.0
func (d *CDisplay) Main(ctx context.Context, cancel context.CancelFunc, wg *sync.WaitGroup) (err error)
Main is the primary Display thread. It starts the event receiver, event processor and screen worker threads and proceeds to handle AsyncCallMain, AwaitCallMain, screen event transmitter and shutdown mechanics. When RequestQuit is called, the main loop exits, cancels all threads, destroys the display object, recovers from any go panics and finally emits a SignalDisplayShutdown.
func (*CDisplay) MainFinish ¶ added in v0.3.0
func (d *CDisplay) MainFinish()
MainFinish cleans up any pending internal processes remaining after Main() has completed processing.
func (*CDisplay) MapWindowWithRegion ¶ added in v0.4.4
func (*CDisplay) PostEvent ¶
PostEvent sends the given Event to the Display Screen for processing. This is mainly useful for synthesizing Screen events, though not a recommended practice.
func (*CDisplay) ProcessEvent ¶
ProcessEvent handles events sent from the Screen instance and manages passing those events to the active window
func (*CDisplay) ReleaseCtrlC ¶
func (d *CDisplay) ReleaseCtrlC()
func (*CDisplay) ReleaseDisplay ¶
func (d *CDisplay) ReleaseDisplay()
func (*CDisplay) RequestDraw ¶
func (d *CDisplay) RequestDraw()
RequestDraw asks the Display to process a SignalDraw event cycle, this does not actually render the contents to in Screen, just update
func (*CDisplay) RequestQuit ¶
func (d *CDisplay) RequestQuit()
RequestQuit asks the Display to quit nicely
func (*CDisplay) RequestShow ¶
func (d *CDisplay) RequestShow()
RequestShow asks the Display to render pending Screen changes
func (*CDisplay) RequestSync ¶
func (d *CDisplay) RequestSync()
RequestSync asks the Display to render everything in the Screen
func (*CDisplay) Run ¶
Run is the standard means of invoking a Display instance. It calls Startup, handles the main event look and finally calls MainFinish when all is complete.
func (*CDisplay) SetCompressEvents ¶ added in v0.3.0
func (*CDisplay) SetEventFocus ¶
func (*CDisplay) SetTtyHandle ¶
func (*CDisplay) SetTtyPath ¶
func (*CDisplay) Startup ¶ added in v0.4.0
func (d *CDisplay) Startup() (ctx context.Context, cancel context.CancelFunc, wg *sync.WaitGroup, err error)
Startup captures the Display, sets the internal running state and allocates the necessary runtime context.WithCancel and sync.WaitGroup for the main runner thread of the Display. Once setup, starts the Main runner with the necessary rigging for thread synchronization and shutdown mechanics.
func (*CDisplay) StartupComplete ¶ added in v0.4.0
func (d *CDisplay) StartupComplete()
StartupComplete emits SignalStartupComplete
func (*CDisplay) UnmapWindow ¶ added in v0.4.3
type CLocalContextData ¶ added in v0.5.3
func GetLocalContext ¶
func GetLocalContext() (acd *CLocalContextData, err error)
type CMetaData ¶
type CMetaData struct { CSignaling // contains filtered or unexported fields }
func (*CMetaData) GetBoolProperty ¶
func (*CMetaData) GetColorProperty ¶
func (*CMetaData) GetFloat64Property ¶
func (*CMetaData) GetFloatProperty ¶
func (*CMetaData) GetIntProperty ¶
func (*CMetaData) GetPointProperty ¶
func (*CMetaData) GetProperty ¶
func (*CMetaData) GetRectangleProperty ¶
func (*CMetaData) GetRegionProperty ¶
func (*CMetaData) GetStringProperty ¶
func (*CMetaData) GetStructProperty ¶
func (*CMetaData) GetStyleProperty ¶
func (*CMetaData) GetThemeProperty ¶
func (*CMetaData) GetTimeProperty ¶ added in v0.4.5
func (*CMetaData) InstallBuildableProperty ¶
func (o *CMetaData) InstallBuildableProperty(name Property, kind PropertyType, write bool, def interface{}) error
func (*CMetaData) InstallProperty ¶
func (o *CMetaData) InstallProperty(name Property, kind PropertyType, write bool, def interface{}) error
func (*CMetaData) IsBuildableProperty ¶
func (*CMetaData) IsProperty ¶
func (*CMetaData) ListBuildableProperties ¶
func (*CMetaData) ListProperties ¶
func (*CMetaData) OverloadProperty ¶
func (*CMetaData) SetBoolProperty ¶
func (*CMetaData) SetColorProperty ¶
func (*CMetaData) SetFloatProperty ¶
func (*CMetaData) SetIntProperty ¶
func (*CMetaData) SetPointProperty ¶
func (*CMetaData) SetProperties ¶
func (*CMetaData) SetProperty ¶
func (*CMetaData) SetPropertyFromString ¶
func (*CMetaData) SetRectangleProperty ¶
func (*CMetaData) SetRegionProperty ¶
func (*CMetaData) SetStringProperty ¶
func (*CMetaData) SetStructProperty ¶
func (*CMetaData) SetStyleProperty ¶
func (*CMetaData) SetThemeProperty ¶
type COffScreen ¶
func (*COffScreen) Beep ¶
func (o *COffScreen) Beep() error
func (*COffScreen) CanDisplay ¶
func (o *COffScreen) CanDisplay(r rune, checkFallbacks bool) bool
func (*COffScreen) CharacterSet ¶
func (o *COffScreen) CharacterSet() string
func (*COffScreen) Clear ¶
func (o *COffScreen) Clear()
func (*COffScreen) Close ¶
func (o *COffScreen) Close()
func (*COffScreen) Colors ¶
func (o *COffScreen) Colors() int
func (*COffScreen) CopyToClipboard ¶ added in v0.5.10
func (o *COffScreen) CopyToClipboard(s string)
func (*COffScreen) DisableMouse ¶
func (o *COffScreen) DisableMouse()
func (*COffScreen) DisablePaste ¶
func (o *COffScreen) DisablePaste()
func (*COffScreen) EnableHostClipboard ¶ added in v0.5.10
func (o *COffScreen) EnableHostClipboard(enabled bool)
func (*COffScreen) EnableMouse ¶
func (o *COffScreen) EnableMouse(_ ...MouseFlags)
func (*COffScreen) EnablePaste ¶
func (o *COffScreen) EnablePaste()
func (*COffScreen) EnableTermClipboard ¶ added in v0.5.10
func (o *COffScreen) EnableTermClipboard(enabled bool)
func (*COffScreen) Export ¶
func (o *COffScreen) Export() *CellBuffer
func (*COffScreen) GetContent ¶
func (*COffScreen) GetContents ¶
func (o *COffScreen) GetContents() ([]OffscreenCell, int, int)
func (*COffScreen) GetTermType ¶ added in v0.5.19
func (o *COffScreen) GetTermType() (ttyType term.TermType)
func (*COffScreen) GetTtyCloseWithStiRead ¶ added in v0.5.4
func (o *COffScreen) GetTtyCloseWithStiRead() (enabled bool)
func (*COffScreen) HasKey ¶
func (o *COffScreen) HasKey(Key) bool
func (*COffScreen) HasMouse ¶
func (o *COffScreen) HasMouse() bool
func (*COffScreen) HideCursor ¶
func (o *COffScreen) HideCursor()
func (*COffScreen) HostClipboardEnabled ¶ added in v0.5.10
func (o *COffScreen) HostClipboardEnabled() (enabled bool)
func (*COffScreen) Import ¶
func (o *COffScreen) Import(cb *CellBuffer)
func (*COffScreen) Init ¶
func (o *COffScreen) Init() error
func (*COffScreen) InitWithFileHandle ¶
func (o *COffScreen) InitWithFileHandle(ttyHandle *os.File) (err error)
func (*COffScreen) InitWithFilePath ¶
func (o *COffScreen) InitWithFilePath(ttyFile string) (err error)
func (*COffScreen) InjectKeyBytes ¶
func (o *COffScreen) InjectKeyBytes(b []byte) bool
func (*COffScreen) InjectMouse ¶
func (o *COffScreen) InjectMouse(x, y int, buttons ButtonMask, mod ModMask)
func (*COffScreen) PasteFromClipboard ¶ added in v0.5.10
func (o *COffScreen) PasteFromClipboard() (s string, ok bool)
func (*COffScreen) PollEvent ¶
func (o *COffScreen) PollEvent() Event
func (*COffScreen) PollEventChan ¶
func (o *COffScreen) PollEventChan() (next chan Event)
func (*COffScreen) PostEvent ¶
func (o *COffScreen) PostEvent(ev Event) error
func (*COffScreen) PostEventWait ¶
func (o *COffScreen) PostEventWait(ev Event)
func (*COffScreen) RegisterConsoleFallback ¶ added in v0.5.19
func (o *COffScreen) RegisterConsoleFallback(r rune, subst rune)
func (*COffScreen) RegisterRuneFallback ¶
func (o *COffScreen) RegisterRuneFallback(r rune, subst string)
func (*COffScreen) SetContent ¶
func (*COffScreen) SetSize ¶
func (o *COffScreen) SetSize(w, h int)
func (*COffScreen) SetStyle ¶
func (o *COffScreen) SetStyle(style paint.Style)
func (*COffScreen) Show ¶
func (o *COffScreen) Show()
func (*COffScreen) ShowCursor ¶
func (o *COffScreen) ShowCursor(x, y int)
func (*COffScreen) Size ¶
func (o *COffScreen) Size() (w, h int)
func (*COffScreen) Sync ¶
func (o *COffScreen) Sync()
func (*COffScreen) TtyCloseWithStiRead ¶ added in v0.5.4
func (o *COffScreen) TtyCloseWithStiRead(enabled bool)
func (*COffScreen) TtyKeepFileHandle ¶ added in v0.5.1
func (o *COffScreen) TtyKeepFileHandle(keep bool)
func (*COffScreen) TtyKeepingFileHandle ¶ added in v0.5.1
func (o *COffScreen) TtyKeepingFileHandle() (keeping bool)
func (*COffScreen) UnregisterConsoleFallback ¶ added in v0.5.19
func (o *COffScreen) UnregisterConsoleFallback(orig rune)
func (*COffScreen) UnregisterRuneFallback ¶
func (o *COffScreen) UnregisterRuneFallback(r rune)
type COffscreenWindow ¶
type COffscreenWindow struct { CObject // contains filtered or unexported fields }
Basic window type
func (*COffscreenWindow) Draw ¶
func (w *COffscreenWindow) Draw() enums.EventFlag
func (*COffscreenWindow) GetDisplay ¶
func (w *COffscreenWindow) GetDisplay() Display
func (*COffscreenWindow) GetTitle ¶
func (w *COffscreenWindow) GetTitle() string
func (*COffscreenWindow) GetWindowType ¶ added in v0.4.5
func (w *COffscreenWindow) GetWindowType() (value enums.WindowType)
GetWindowType returns the type of the window. See: enums.WindowType.
func (*COffscreenWindow) Init ¶
func (w *COffscreenWindow) Init() bool
func (*COffscreenWindow) ProcessEvent ¶
func (w *COffscreenWindow) ProcessEvent(evt Event) enums.EventFlag
func (*COffscreenWindow) SetDisplay ¶
func (w *COffscreenWindow) SetDisplay(d Display)
func (*COffscreenWindow) SetTitle ¶
func (w *COffscreenWindow) SetTitle(title string)
func (*COffscreenWindow) SetWindowType ¶ added in v0.4.5
func (w *COffscreenWindow) SetWindowType(hint enums.WindowType)
SetWindowType updates the type of the window. See: enums.WindowType
type CProperty ¶
func NewProperty ¶
func NewProperty(name Property, kind PropertyType, write bool, buildable bool, def interface{}) (property *CProperty)
func (*CProperty) SetFromString ¶
func (*CProperty) Type ¶
func (p *CProperty) Type() PropertyType
type CScreen ¶
CScreen represents a screen backed by a terminfo implementation.
func (*CScreen) CharacterSet ¶
func (*CScreen) CopyToClipboard ¶ added in v0.5.10
func (*CScreen) DisableMouse ¶
func (d *CScreen) DisableMouse()
func (*CScreen) DisablePaste ¶
func (d *CScreen) DisablePaste()
func (*CScreen) EnableHostClipboard ¶ added in v0.5.10
func (*CScreen) EnableMouse ¶
func (d *CScreen) EnableMouse(flags ...MouseFlags)
func (*CScreen) EnablePaste ¶
func (d *CScreen) EnablePaste()
func (*CScreen) EnableTermClipboard ¶ added in v0.5.10
func (*CScreen) Export ¶
func (d *CScreen) Export() *CellBuffer
func (*CScreen) GetContent ¶
func (*CScreen) GetTermType ¶ added in v0.5.19
func (*CScreen) GetTtyCloseWithStiRead ¶ added in v0.5.4
func (*CScreen) HideCursor ¶
func (d *CScreen) HideCursor()
func (*CScreen) HostClipboardEnabled ¶ added in v0.5.10
func (*CScreen) Import ¶
func (d *CScreen) Import(cb *CellBuffer)
func (*CScreen) InitWithFilePath ¶
func (*CScreen) PasteFromClipboard ¶ added in v0.5.10
func (*CScreen) PollEventChan ¶
func (*CScreen) PostEventWait ¶
func (*CScreen) RegisterConsoleFallback ¶ added in v0.5.19
func (*CScreen) RegisterRuneFallback ¶
func (*CScreen) SetContent ¶
func (*CScreen) ShowCursor ¶
func (*CScreen) TtyCloseWithStiRead ¶ added in v0.5.4
func (*CScreen) TtyKeepFileHandle ¶ added in v0.5.1
func (*CScreen) TtyKeepingFileHandle ¶ added in v0.5.1
func (*CScreen) UnregisterConsoleFallback ¶ added in v0.5.19
func (*CScreen) UnregisterRuneFallback ¶
type CServerAuthHandler ¶ added in v0.3.2
CServerAuthHandler is the base type for application server authentication handler implementations. This handler does no authentication and just accepts all connections.
func (*CServerAuthHandler) Attach ¶ added in v0.3.2
func (h *CServerAuthHandler) Attach(server ApplicationServer) (err error)
func (*CServerAuthHandler) Detach ¶ added in v0.3.2
func (h *CServerAuthHandler) Detach() (err error)
func (*CServerAuthHandler) HasArgument ¶ added in v0.3.2
func (h *CServerAuthHandler) HasArgument(arg string) (has bool)
func (*CServerAuthHandler) ID ¶ added in v0.3.2
func (h *CServerAuthHandler) ID() (id uuid.UUID)
func (*CServerAuthHandler) Init ¶ added in v0.3.2
func (h *CServerAuthHandler) Init() (already bool)
func (*CServerAuthHandler) PasswordCallback ¶ added in v0.3.2
func (h *CServerAuthHandler) PasswordCallback(conn ssh.ConnMetadata, password []byte) (*ssh.Permissions, error)
func (*CServerAuthHandler) RegisterArgument ¶ added in v0.3.2
func (h *CServerAuthHandler) RegisterArgument(flag cli.Flag)
func (*CServerAuthHandler) Reload ¶ added in v0.3.2
func (h *CServerAuthHandler) Reload(ctx *cli.Context) (err error)
type CServerAuthHtpasswdHandler ¶ added in v0.3.2
type CServerAuthHtpasswdHandler struct { CServerAuthHandler // contains filtered or unexported fields }
func NewServerAuthHtpasswdHandler ¶ added in v0.3.2
func NewServerAuthHtpasswdHandler(defaultHttpasswdFilePath string) (handler *CServerAuthHtpasswdHandler)
func (*CServerAuthHtpasswdHandler) Init ¶ added in v0.3.2
func (h *CServerAuthHtpasswdHandler) Init() (already bool)
func (*CServerAuthHtpasswdHandler) PasswordCallback ¶ added in v0.3.2
func (s *CServerAuthHtpasswdHandler) PasswordCallback(c ssh.ConnMetadata, pass []byte) (*ssh.Permissions, error)
func (*CServerAuthHtpasswdHandler) Reload ¶ added in v0.3.2
func (h *CServerAuthHtpasswdHandler) Reload(ctx *cli.Context) (err error)
type CSignalListener ¶
type CSignalListener struct {
// contains filtered or unexported fields
}
func (*CSignalListener) Data ¶ added in v0.4.5
func (l *CSignalListener) Data() SignalListenerData
func (*CSignalListener) Func ¶ added in v0.4.5
func (l *CSignalListener) Func() SignalListenerFn
func (*CSignalListener) Name ¶ added in v0.4.5
func (l *CSignalListener) Name() string
func (*CSignalListener) Signal ¶ added in v0.4.5
func (l *CSignalListener) Signal() Signal
type CSignaling ¶
type CSignaling struct { CTypeItem // contains filtered or unexported fields }
func (*CSignaling) Connect ¶
func (o *CSignaling) Connect(signal Signal, handle string, c SignalListenerFn, data ...interface{})
Connect callback to signal, identified by handle
Locking: write
func (*CSignaling) Disconnect ¶
func (o *CSignaling) Disconnect(signal Signal, handle string) error
Disconnect callback from signal identified by handle
Locking: write
func (*CSignaling) DisconnectAll ¶ added in v0.4.5
func (o *CSignaling) DisconnectAll()
func (*CSignaling) Emit ¶
func (o *CSignaling) Emit(signal Signal, argv ...interface{}) enums.EventFlag
Emit a signal event to all connected listener callbacks
Locking: none
func (*CSignaling) Freeze ¶
func (o *CSignaling) Freeze()
Freeze pauses all signal emissions until a corresponding Thaw is called.
Locking: write
func (*CSignaling) Handled ¶
func (o *CSignaling) Handled(signal Signal, handle string) (found bool)
Handled returns TRUE if there is at least one signal listener with the given handle.
Locking: read
func (*CSignaling) HasListeners ¶ added in v0.4.0
func (o *CSignaling) HasListeners(signal Signal) (has bool)
HasListeners returns true if there are one or more listeners connected to the given Signal.
func (*CSignaling) Init ¶
func (o *CSignaling) Init() (already bool)
func (*CSignaling) IsFrozen ¶
func (o *CSignaling) IsFrozen() (frozen bool)
IsFrozen returns TRUE if Thaw has been called at least once.
Locking: read, signal read
func (*CSignaling) IsSignalPassed ¶
func (o *CSignaling) IsSignalPassed(signals ...Signal) (passed bool)
IsSignalPassed returns TRUE if the given signal is currently passed.
Locking: none
func (*CSignaling) IsSignalStopped ¶
func (o *CSignaling) IsSignalStopped(signals ...Signal) (stopped bool)
IsSignalStopped returns TRUE if the given signal is currently stopped.
Locking: none
func (*CSignaling) PassSignal ¶
func (o *CSignaling) PassSignal(signals ...Signal)
PassSignal disables propagation of the given signal with an EVENT_PASS
Locking: write
func (*CSignaling) ResumeSignal ¶
func (o *CSignaling) ResumeSignal(signals ...Signal)
ResumeSignal enables propagation of the given signal if the signal is currently stopped.
Locking: write
func (*CSignaling) StopSignal ¶
func (o *CSignaling) StopSignal(signals ...Signal)
StopSignal disables propagation of the given signal with an EVENT_STOP
Locking: write
func (*CSignaling) Thaw ¶
func (o *CSignaling) Thaw()
Thaw restores all signal emissions after a Freeze call.
Locking: write
type CTypeItem ¶
func (*CTypeItem) DestroyObject ¶
func (*CTypeItem) GetTypeTag ¶
func (*CTypeItem) InitTypeItem ¶
func (*CTypeItem) ObjectName ¶
func (*CTypeItem) ObjectShortID ¶ added in v0.5.9
type CTypeItemList ¶
type CTypeItemList []TypeItem
func (CTypeItemList) Index ¶
func (t CTypeItemList) Index(item TypeItem) int
type CTypeRegistry ¶
type CTypeRegistry struct {
// contains filtered or unexported fields
}
func (*CTypeRegistry) AddType ¶
func (r *CTypeRegistry) AddType(tag TypeTag, constructor func() interface{}, aliases ...string) error
func (*CTypeRegistry) AddTypeAlias ¶
func (r *CTypeRegistry) AddTypeAlias(tag TypeTag, aliases ...string)
func (*CTypeRegistry) AddTypeItem ¶
func (r *CTypeRegistry) AddTypeItem(tag TypeTag, item interface{}) (id uuid.UUID, err error)
func (*CTypeRegistry) GetBuildableInfo ¶
func (r *CTypeRegistry) GetBuildableInfo() (info map[string]TypeTag)
func (*CTypeRegistry) GetTypeItemByID ¶
func (r *CTypeRegistry) GetTypeItemByID(id uuid.UUID) interface{}
func (*CTypeRegistry) GetTypeItemByName ¶
func (r *CTypeRegistry) GetTypeItemByName(name string) interface{}
func (*CTypeRegistry) GetTypeItems ¶
func (r *CTypeRegistry) GetTypeItems(tag TypeTag) []interface{}
func (*CTypeRegistry) GetTypeTagByAlias ¶
func (r *CTypeRegistry) GetTypeTagByAlias(alias string) (tt TypeTag, ok bool)
func (*CTypeRegistry) GetTypeTags ¶
func (r *CTypeRegistry) GetTypeTags() (tags []TypeTag)
func (*CTypeRegistry) HasType ¶
func (r *CTypeRegistry) HasType(tag TypeTag) (exists bool)
func (*CTypeRegistry) MakeType ¶
func (r *CTypeRegistry) MakeType(tag TypeTag) (thing interface{}, err error)
func (*CTypeRegistry) RemoveTypeItem ¶
func (r *CTypeRegistry) RemoveTypeItem(tag TypeTag, item TypeItem) error
type CTypeTag ¶
type CTypeTag string
denotes a concrete type identity
const TypeApplication CTypeTag = "cdk-application"
const TypeApplicationServer CTypeTag = "cdk-application-server"
const TypeClipboard CTypeTag = "cdk-clipboard"
const (
TypeDisplayManager CTypeTag = "cdk-display"
)
const (
TypeNil CTypeTag = ""
)
const TypeObject CTypeTag = "cdk-object"
const (
TypeOffscreenWindow CTypeTag = "cdk-offscreen-window"
)
const (
TypeSignaling CTypeTag = "cdk-signaling"
)
func (CTypeTag) GladeString ¶
returns a string representation of this type tag, translated for Gtk class naming conventions (ie: GtkCamelCase)
type CWindow ¶
type CWindow struct { CObject // contains filtered or unexported fields }
Basic window type
func (*CWindow) GetDisplay ¶
func (*CWindow) GetWindowType ¶ added in v0.4.5
func (w *CWindow) GetWindowType() (value enums.WindowType)
GetWindowType returns the type of the window. See: enums.WindowType.
func (*CWindow) SetDisplay ¶
func (*CWindow) SetWindowType ¶ added in v0.4.5
func (w *CWindow) SetWindowType(hint enums.WindowType)
SetWindowType updates the type of the window. See: enums.WindowType
type CellBuffer ¶
type CellBuffer struct {
// contains filtered or unexported fields
}
CellBuffer represents a two dimensional array of character cells. This is primarily intended for use by Screen implementors; it contains much of the common code they need. To create one, just declare a variable of its type; no explicit initialization is necessary.
CellBuffer should be thread safe, original tcell is not.
func NewCellBuffer ¶
func NewCellBuffer() *CellBuffer
func (*CellBuffer) Dirty ¶
func (cb *CellBuffer) Dirty(x, y int) bool
Dirty checks if a character at the given location needs an to be refreshed on the physical display. This returns true if the cell content is different since the last time it was marked clean.
func (*CellBuffer) Fill ¶
func (cb *CellBuffer) Fill(r rune, style paint.Style)
Fill fills the entire cell buffer array with the specified character and style. Normally choose ' ' to clear the display. This API doesn't support combining characters, or characters with a width larger than one.
func (*CellBuffer) GetCell ¶
GetCell returns the contents of a character cell, including the primary rune, any combining character runes (which will usually be nil), the style, and the display width in cells. (The width can be either 1, normally, or 2 for East Asian full-width characters.)
func (*CellBuffer) Invalidate ¶
func (cb *CellBuffer) Invalidate()
Invalidate marks all characters within the buffer as dirty.
func (*CellBuffer) Resize ¶
func (cb *CellBuffer) Resize(w, h int)
Resize is used to resize the cells array, with different dimensions, while preserving the original contents. The cells will be invalidated so that they can be redrawn.
func (*CellBuffer) SetCell ¶
SetCell sets the contents (primary rune, combining runes, and style) for a cell at a given location.
func (*CellBuffer) SetDirty ¶
func (cb *CellBuffer) SetDirty(x, y int, dirty bool)
SetDirty is normally used to indicate that a cell has been displayed (in which case dirty is false), or to manually force a cell to be marked dirty.
func (*CellBuffer) Size ¶
func (cb *CellBuffer) Size() (w, h int)
Size returns the (width, height) in cells of the buffer.
type Clipboard ¶ added in v0.5.10
type Clipboard interface { Object GetText() (text string) SetText(text string) Copy(text string) Paste(text string) }
Clipboard Hierarchy:
Object +- Clipboard
type Display ¶
type Display interface { Object Init() (already bool) App() *CApplication Destroy() GetTitle() string SetTitle(title string) GetTtyPath() string SetTtyPath(ttyPath string) GetTtyHandle() *os.File SetTtyHandle(ttyHandle *os.File) GetCompressEvents() bool SetCompressEvents(compress bool) Screen() Screen DisplayCaptured() bool CaptureDisplay() (err error) ReleaseDisplay() CallEnabled() (enabled bool, err error) Call(fn cexec.Callback) (err error) Command(name string, argv ...string) (err error) IsMonochrome() bool Colors() (numberOfColors int) CaptureCtrlC() ReleaseCtrlC() CapturedCtrlC() bool GetClipboard() (clipboard Clipboard) FocusedWindow() Window FocusWindow(w Window) FocusNextWindow() FocusPreviousWindow() MapWindow(w Window) MapWindowWithRegion(w Window, region ptypes.Region) UnmapWindow(w Window) IsMappedWindow(w Window) (mapped bool) GetWindows() (windows []Window) GetWindowAtPoint(point ptypes.Point2I) (window Window) CursorPosition() (position ptypes.Point2I, moving bool) SetEventFocus(widget Object) error GetEventFocus() (widget Object) GetPriorEvent() (event Event) ProcessEvent(evt Event) enums.EventFlag RequestDraw() RequestShow() RequestSync() RequestQuit() IsRunning() bool StartupComplete() AsyncCall(fn DisplayCallbackFn) error AwaitCall(fn DisplayCallbackFn) error AsyncCallMain(fn DisplayCallbackFn) error AwaitCallMain(fn DisplayCallbackFn) error PostEvent(evt Event) error Run() (err error) Startup() (ctx context.Context, cancel context.CancelFunc, wg *sync.WaitGroup, err error) Main(ctx context.Context, cancel context.CancelFunc, wg *sync.WaitGroup) (err error) MainFinish() HasPendingEvents() (pending bool) HasBufferedEvents() (hasEvents bool) IterateBufferedEvents() (refreshed bool) }
type DisplayCallbackFn ¶
type DisplayCommandFn ¶ added in v0.5.0
type DisplayManagerFn ¶
type DisplayManagerFn func(d Display)
type EncodingFallback ¶
type EncodingFallback int
EncodingFallback describes how the system behavees when the locale requires a character set that we do not support. The system always supports UTF-8 and US-ASCII. On Windows consoles, UTF-16LE is also supported automatically. Other character sets must be added using the RegisterEncoding API. (A large group of nearly all of them can be added using the RegisterAll function in the encoding sub package.)
type EventError ¶
type EventError struct {
// contains filtered or unexported fields
}
An EventError is an event representing some sort of error, and carries an error payload.
func NewEventError ¶
func NewEventError(err error) *EventError
NewEventError creates an ErrorEvent with the given error payload.
func (*EventError) Clone ¶
func (ev *EventError) Clone() *EventError
func (*EventError) Err ¶
func (ev *EventError) Err() error
func (*EventError) When ¶
func (ev *EventError) When() time.Time
When returns the time when the event was created.
type EventHandler ¶
EventHandler is anything that handles events. If the handler has consumed the event, it should return true. False otherwise.
type EventInterrupt ¶
type EventInterrupt struct {
// contains filtered or unexported fields
}
EventInterrupt is a generic wakeup event. Its can be used to to request a redraw. It can carry an arbitrary payload, as well.
func NewEventInterrupt ¶
func NewEventInterrupt(data interface{}) *EventInterrupt
NewEventInterrupt creates an EventInterrupt with the given payload.
func (*EventInterrupt) Data ¶
func (ev *EventInterrupt) Data() interface{}
Data is used to obtain the opaque event payload.
func (*EventInterrupt) When ¶
func (ev *EventInterrupt) When() time.Time
When returns the time when this event was created.
type EventKey ¶
type EventKey struct {
// contains filtered or unexported fields
}
EventKey represents a key press. Usually this is a key press followed by a key release, but since terminal programs don't have a way to report key release events, we usually get just one event. If a key is held down then the terminal may synthesize repeated key presses at some predefined rate. We have no control over that, nor visibility into it.
In some cases, we can have a modifier key, such as ModAlt, that can be generated with a key press. (This usually is represented by having the high bit set, or in some cases, by sending an ESC prior to the rune.)
If the value of Key() is KeyRune, then the actual key value will be available with the Rune() method. This will be the case for most keys. In most situations, the modifiers will not be set. For example, if the rune is 'A', this will be reported without the ModShift bit set, since really can't tell if the Shift key was pressed (it might have been CAPSLOCK, or a terminal that only can send capitals, or keyboard with separate capital letters from lower case letters).
Generally, terminal applications have far less visibility into keyboard activity than graphical applications. Hence, they should avoid depending overly much on availability of modifiers, or the availability of any specific keys.
func NewEventKey ¶
NewEventKey attempts to create a suitable event. It parses the various ASCII control sequences if KeyRune is passed for Key, but if the caller has more precise information it should set that specifically. Callers that aren't sure about modifier state (most) should just pass ModNone.
func (*EventKey) Key ¶
Key returns a virtual key code. We use this to identify specific key codes, such as KeyEnter, etc. Most control and function keys are reported with unique Key values. Normal alphanumeric and punctuation keys will generally return KeyRune here; the specific key can be further decoded using the Rune() function.
func (*EventKey) Modifiers ¶
Modifiers returns the modifiers that were present with the key press. Note that not all platforms and terminals support this equally well, and some cases we will not not know for sure. Hence, applications should avoid using this in most circumstances.
func (*EventKey) Name ¶
Name returns a printable value or the key stroke. This can be used when printing the event, for example.
type EventMouse ¶
type EventMouse struct {
// contains filtered or unexported fields
}
EventMouse is a mouse event. It is sent on either mouse up or mouse down events. It is also sent on mouse motion events - if the terminal supports it. We make every effort to ensure that mouse release events are delivered. Hence, click drag can be identified by a motion event with the mouse down, without any intervening button release. On some terminals only the initiating press and terminating release event will be delivered.
Mouse wheel events, when reported, may appear on their own as individual impulses; that is, there will normally not be a release event delivered for mouse wheel movements.
Most terminals cannot report the state of more than one button at a time -- and some cannot report motion events unless a button is pressed.
Applications can inspect the time between events to resolve double or triple clicks.
func NewEventMouse ¶
func NewEventMouse(x, y int, btn ButtonMask, mod ModMask) *EventMouse
NewEventMouse is used to create a new mouse event. Applications shouldn't need to use this; its mostly for display implementors.
func (*EventMouse) Button ¶
func (ev *EventMouse) Button() ButtonMask
func (*EventMouse) ButtonHas ¶
func (ev *EventMouse) ButtonHas(check ButtonMask) bool
func (*EventMouse) ButtonPressed ¶
func (ev *EventMouse) ButtonPressed() ButtonMask
func (*EventMouse) Buttons ¶
func (ev *EventMouse) Buttons() ButtonMask
Buttons returns the list of buttons that were pressed or wheel motions.
func (*EventMouse) Clone ¶
func (ev *EventMouse) Clone() Event
func (*EventMouse) CloneForPosition ¶
func (ev *EventMouse) CloneForPosition(x, y int) Event
func (*EventMouse) IsDragStarted ¶
func (ev *EventMouse) IsDragStarted() bool
func (*EventMouse) IsDragStopped ¶
func (ev *EventMouse) IsDragStopped() bool
func (*EventMouse) IsDragging ¶
func (ev *EventMouse) IsDragging() bool
func (*EventMouse) IsMoving ¶
func (ev *EventMouse) IsMoving() bool
func (*EventMouse) IsPressed ¶
func (ev *EventMouse) IsPressed() bool
func (*EventMouse) IsReleased ¶
func (ev *EventMouse) IsReleased() bool
func (*EventMouse) IsWheelImpulse ¶
func (ev *EventMouse) IsWheelImpulse() bool
func (*EventMouse) Modifiers ¶
func (ev *EventMouse) Modifiers() ModMask
Modifiers returns a list of keyboard modifiers that were pressed with the mouse button(s).
func (*EventMouse) Point2I ¶ added in v0.4.5
func (ev *EventMouse) Point2I() (point ptypes.Point2I)
func (*EventMouse) Position ¶
func (ev *EventMouse) Position() (x, y int)
Position returns the mouse position in character cells. The origin 0, 0 is at the upper left corner.
func (*EventMouse) Report ¶
func (ev *EventMouse) Report() string
func (*EventMouse) State ¶
func (ev *EventMouse) State() MouseState
func (*EventMouse) StateHas ¶
func (ev *EventMouse) StateHas(check MouseState) bool
func (*EventMouse) WheelImpulse ¶
func (ev *EventMouse) WheelImpulse() ButtonMask
func (*EventMouse) When ¶
func (ev *EventMouse) When() time.Time
When returns the time when this EventMouse was created.
type EventPaste ¶
type EventPaste struct {
// contains filtered or unexported fields
}
EventPaste is used to mark the start and end of a bracketed paste. An event with .Start() true will be sent to mark the start. Then a number of keys will be sent to indicate that the content is pasted in. At the end, an event with .Start() false will be sent.
func NewEventPaste ¶
func NewEventPaste(start bool) *EventPaste
NewEventPaste returns a new EventPaste.
func (*EventPaste) End ¶
func (ev *EventPaste) End() bool
End returns true if this is the end of a paste.
func (*EventPaste) Start ¶
func (ev *EventPaste) Start() bool
Start returns true if this is the start of a paste.
func (*EventPaste) When ¶
func (ev *EventPaste) When() time.Time
When returns the time when this EventMouse was created.
type EventQuit ¶ added in v0.5.10
type EventQuit struct {
// contains filtered or unexported fields
}
EventQuit is sent when the display needs to render the screen
func NewEventQuit ¶ added in v0.5.10
func NewEventQuit() *EventQuit
type EventRender ¶ added in v0.5.10
type EventRender struct {
// contains filtered or unexported fields
}
EventRender is sent when the display needs to render the screen
func NewEventDraw ¶ added in v0.5.10
func NewEventDraw() *EventRender
NewEventDraw creates an EventRender
func NewEventDrawAndShow ¶ added in v0.5.10
func NewEventDrawAndShow() *EventRender
NewEventDrawAndShow creates an EventRender configured to also request a show after the draw cycle completes
func NewEventDrawAndSync ¶ added in v0.5.10
func NewEventDrawAndSync() *EventRender
NewEventDrawAndSync creates an EventRender configured to also request a sync after the draw cycle completes
func NewEventRender ¶ added in v0.5.10
func NewEventRender(draw, show, sync bool) *EventRender
func NewEventShow ¶ added in v0.5.10
func NewEventShow() *EventRender
NewEventShow creates an EventRender configured to just show the screen
func NewEventSync ¶ added in v0.5.10
func NewEventSync() *EventRender
NewEventSync creates an EventRender configured to just sync the screen
func (*EventRender) Draw ¶ added in v0.5.10
func (ev *EventRender) Draw() bool
Draw returns true when the EventRender was created with one of the NewEventDraw*() functions
func (*EventRender) Show ¶ added in v0.5.10
func (ev *EventRender) Show() bool
Show returns true when the EventRender was created with either of the NewEventShow() or NewDrawAndShow() functions
func (*EventRender) Sync ¶ added in v0.5.10
func (ev *EventRender) Sync() bool
Sync returns true when the EventRender was created with either of the NewEventSync() or NewDrawAndSync() functions
func (*EventRender) When ¶ added in v0.5.10
func (ev *EventRender) When() time.Time
When returns the time when the EventRender was created
type EventResize ¶
type EventResize struct {
// contains filtered or unexported fields
}
EventResize is sent when the window size changes.
func NewEventResize ¶
func NewEventResize(width, height int) *EventResize
NewEventResize creates an EventResize with the new updated window size, which is given in character cells.
func (*EventResize) Size ¶
func (ev *EventResize) Size() (w, h int)
Size returns the new window size as width, height in character cells.
func (*EventResize) When ¶
func (ev *EventResize) When() time.Time
When returns the time when the Event was created.
type EventTime ¶
type EventTime struct {
// contains filtered or unexported fields
}
EventTime is a simple base event class, suitable for easy reuse. It can be used to deliver actual timer events as well.
func NewEventTime ¶
NewEventTime creates a Time Event for the given time
func (*EventTime) SetEventNow ¶
func (e *EventTime) SetEventNow()
SetEventNow sets the time of occurrence for the event to the current time.
func (*EventTime) SetEventTime ¶
SetEventTime sets the time of occurrence for the event.
type IButtonMask ¶
type IButtonMask interface { Has(m ButtonMask) bool Set(m ButtonMask) ButtonMask Clear(m ButtonMask) ButtonMask Toggle(m ButtonMask) ButtonMask String() string }
type IMouseState ¶
type IMouseState interface { Has(m MouseState) bool Set(m MouseState) MouseState Clear(m MouseState) MouseState Toggle(m MouseState) MouseState String() string }
type Key ¶
type Key int16
Key is a generic value for representing keys, and especially special keys (function keys, cursor movement keys, etc.) For normal keys, like ASCII letters, we use KeyRune, and then expect the application to inspect the Rune() member of the EventKey.
const ( KeyRune Key = iota + 256 KeyUp KeyDown KeyRight KeyLeft KeyUpLeft KeyUpRight KeyDownLeft KeyDownRight KeyCenter KeyPgUp KeyPgDn KeyHome KeyEnd KeyInsert KeyDelete KeyHelp KeyExit KeyClear KeyCancel KeyPrint KeyPause KeyBacktab KeyF1 KeyF2 KeyF3 KeyF4 KeyF5 KeyF6 KeyF7 KeyF8 KeyF9 KeyF10 KeyF11 KeyF12 KeyF13 KeyF14 KeyF15 KeyF16 KeyF17 KeyF18 KeyF19 KeyF20 KeyF21 KeyF22 KeyF23 KeyF24 KeyF25 KeyF26 KeyF27 KeyF28 KeyF29 KeyF30 KeyF31 KeyF32 KeyF33 KeyF34 KeyF35 KeyF36 KeyF37 KeyF38 KeyF39 KeyF40 KeyF41 KeyF42 KeyF43 KeyF44 KeyF45 KeyF46 KeyF47 KeyF48 KeyF49 KeyF50 KeyF51 KeyF52 KeyF53 KeyF54 KeyF55 KeyF56 KeyF57 KeyF58 KeyF59 KeyF60 KeyF61 KeyF62 KeyF63 KeyF64 )
This is the list of named keys. KeyRune is special however, in that it is a place holder key indicating that a printable character was sent. The actual value of the rune will be transported in the Rune of the associated EventKey.
const ( KeyCtrlSpace Key = iota KeyCtrlA KeyCtrlB KeyCtrlC KeyCtrlD KeyCtrlE KeyCtrlF KeyCtrlG KeyCtrlH KeyCtrlI KeyCtrlJ KeyCtrlK KeyCtrlL KeyCtrlM KeyCtrlN KeyCtrlO KeyCtrlP KeyCtrlQ KeyCtrlR KeyCtrlS KeyCtrlT KeyCtrlU KeyCtrlV KeyCtrlW KeyCtrlX KeyCtrlY KeyCtrlZ KeyCtrlLeftSq // Escape KeyCtrlBackslash KeyCtrlRightSq KeyCtrlCarat KeyCtrlUnderscore )
These are the control keys. Note that they overlap with other keys, perhaps. For example, KeyCtrlH is the same as KeyBackspace.
const ( KeyNUL Key = iota KeySOH KeySTX KeyETX KeyEOT KeyENQ KeyACK KeyBEL KeyBS KeyTAB KeyLF KeyVT KeyFF KeyCR KeySO KeySI KeyDLE KeyDC1 KeyDC2 KeyDC3 KeyDC4 KeyNAK KeySYN KeyETB KeyCAN KeyEM KeySUB KeyESC KeyFS KeyGS KeyRS KeyUS KeyDEL Key = 0x7F )
These are the defined ASCII values for key codes. They generally match with KeyCtrl values.
const ( KeySpacebar Key = KeyRune KeySpace Key = 32 KeyExclamationMark Key = 33 KeyDoubleQuote Key = 34 KeyNumber Key = 35 KeyDollarSign Key = 36 KeyPercent Key = 37 KeyAmpersand Key = 38 KeySingleQuote Key = 39 KeyLeftParenthesis Key = 40 KeyRightParenthesis Key = 41 KeyAsterisk Key = 42 KeyPlus Key = 43 KeyComma Key = 44 KeyMinus Key = 45 KeyPeriod Key = 46 KeySlash Key = 47 KeyZero Key = 48 KeyOne Key = 49 KeyTwo Key = 50 KeyThree Key = 51 KeyFour Key = 52 KeyFive Key = 53 KeySix Key = 54 KeySeven Key = 55 KeyEight Key = 56 KeyNine Key = 57 KeyColon Key = 58 KeySemicolon Key = 59 KeyLessThan Key = 60 KeyEqualitySign Key = 61 KeyGreaterThan Key = 62 KeyQuestionMark Key = 63 KeyAtSign Key = 64 KeyCapitalA Key = 65 KeyCapitalB Key = 66 KeyCapitalC Key = 67 KeyCapitalD Key = 68 KeyCapitalE Key = 69 KeyCapitalF Key = 70 KeyCapitalG Key = 71 KeyCapitalH Key = 72 KeyCapitalI Key = 73 KeyCapitalJ Key = 74 KeyCapitalK Key = 75 KeyCapitalL Key = 76 KeyCapitalM Key = 77 KeyCapitalN Key = 78 KeyCapitalO Key = 79 KeyCapitalP Key = 80 KeyCapitalQ Key = 81 KeyCapitalR Key = 82 KeyCapitalS Key = 83 KeyCapitalT Key = 84 KeyCapitalU Key = 85 KeyCapitalV Key = 86 KeyCapitalW Key = 87 KeyCapitalX Key = 88 KeyCapitalY Key = 89 KeyCapitalZ Key = 90 KeyLeftSquareBracket Key = 91 KeyBackslash Key = 92 KeyRightSquareBracket Key = 93 KeyCaretCircumflex Key = 94 KeyUnderscore Key = 95 KeyGraveAccent Key = 96 KeySmallA Key = 97 KeySmallB Key = 98 KeySmallC Key = 99 KeySmallD Key = 100 KeySmallE Key = 101 KeySmallF Key = 102 KeySmallG Key = 103 KeySmallH Key = 104 KeySmallI Key = 105 KeySmallJ Key = 106 KeySmallK Key = 107 KeySmallL Key = 108 KeySmallM Key = 109 KeySmallN Key = 110 KeySmallO Key = 111 KeySmallP Key = 112 KeySmallQ Key = 113 KeySmallR Key = 114 KeySmallS Key = 115 KeySmallT Key = 116 KeySmallU Key = 117 KeySmallV Key = 118 KeySmallW Key = 119 KeySmallX Key = 120 KeySmallY Key = 121 KeySmallZ Key = 122 KeyLeftCurlyBracket Key = 123 KeyVerticalBar Key = 124 KeyRightCurlyBracket Key = 125 KeyTilde Key = 126 )
ASCII Keys
func LookupKeyByName ¶ added in v0.5.6
func LookupKeyRune ¶
type MetaData ¶
type MetaData interface { Signaling Init() (already bool) InstallProperty(name Property, kind PropertyType, write bool, def interface{}) error InstallBuildableProperty(name Property, kind PropertyType, write bool, def interface{}) error OverloadProperty(name Property, kind PropertyType, write bool, buildable bool, def interface{}) error ListProperties() (properties []Property) ListBuildableProperties() (properties []Property) SetProperties(properties map[Property]string) (err error) IsProperty(name Property) bool IsBuildableProperty(name Property) (buildable bool) GetProperty(name Property) *CProperty SetPropertyFromString(name Property, value string) error SetProperty(name Property, value interface{}) error GetBoolProperty(name Property) (value bool, err error) SetBoolProperty(name Property, value bool) error GetStringProperty(name Property) (value string, err error) SetStringProperty(name Property, value string) error GetIntProperty(name Property) (value int, err error) SetIntProperty(name Property, value int) error GetFloat64Property(name Property) (value float64, err error) GetFloatProperty(name Property) (value float64, err error) SetFloatProperty(name Property, value float64) error GetColorProperty(name Property) (value paint.Color, err error) SetColorProperty(name Property, value paint.Color) error GetStyleProperty(name Property) (value paint.Style, err error) SetStyleProperty(name Property, value paint.Style) error GetThemeProperty(name Property) (value paint.Theme, err error) SetThemeProperty(name Property, value paint.Theme) error GetPointProperty(name Property) (value ptypes.Point2I, err error) SetPointProperty(name Property, value ptypes.Point2I) error GetRectangleProperty(name Property) (value ptypes.Rectangle, err error) SetRectangleProperty(name Property, value ptypes.Rectangle) error GetRegionProperty(name Property) (value ptypes.Region, err error) SetRegionProperty(name Property, value ptypes.Region) error GetStructProperty(name Property) (value interface{}, err error) SetStructProperty(name Property, value interface{}) error GetTimeProperty(name Property) (value time.Duration, err error) SetTimeProperty(name Property, value time.Duration) error }
type ModMask ¶
type ModMask int16
ModMask is a mask of modifier keys. Note that it will not always be possible to report modifier keys.
These are the modifiers keys that can be sent either with a key press, or a mouse event. Note that as of now, due to the confusion associated with Meta, and the lack of support for it on many/most platforms, the current implementations never use it. Instead, they use ModAlt, even for events that could possibly have been distinguished from ModAlt.
type MouseFlags ¶
type MouseFlags int
MouseFlags are options to modify the handling of mouse events. Actual events can be or'd together.
type MouseState ¶
type MouseState uint64
const ( MOUSE_NONE MouseState = 0 MOUSE_MOVE MouseState = 1 << iota BUTTON_PRESS BUTTON_RELEASE WHEEL_PULSE DRAG_START DRAG_MOVE DRAG_STOP )
func (MouseState) Clear ¶
func (i MouseState) Clear(m MouseState) MouseState
func (MouseState) Has ¶
func (i MouseState) Has(m MouseState) bool
func (MouseState) Set ¶
func (i MouseState) Set(m MouseState) MouseState
func (MouseState) String ¶
func (i MouseState) String() string
func (MouseState) Toggle ¶
func (i MouseState) Toggle(m MouseState) MouseState
type Object ¶
type Object interface { MetaData Init() (already bool) InitWithProperties(properties map[Property]string) (already bool, err error) Destroy() GetName() (name string) SetName(name string) GetTheme() (theme paint.Theme) SetTheme(theme paint.Theme) }
This is the base type for all complex CDK object types. The Object type provides a means of installing properties, getting and setting property values
type OffScreen ¶
type OffScreen interface { // InjectKeyBytes injects a stream of bytes corresponding to // the native encoding (see charset). It turns true if the entire // set of bytes were processed and delivered as KeyEvents, false // if any bytes were not fully understood. Any bytes that are not // fully converted are discarded. InjectKeyBytes(buf []byte) bool // InjectKey injects a key event. The rune is a UTF-8 rune, post // any translation. InjectKey(key Key, r rune, mod ModMask) // InjectMouse injects a mouse event. InjectMouse(x, y int, buttons ButtonMask, mod ModMask) // SetSize resizes the underlying physical screen. It also causes // a resize event to be injected during the next Show() or Sync(). // A new physical contents array will be allocated (with data from // the old copied), so any prior value obtained with GetContents // won't be used anymore SetSize(width, height int) // GetContents returns screen contents as an array of // cells, along with the physical width & height. Note that the // physical contents will be used until the next time SetSize() // is called. GetContents() (cells []OffscreenCell, width int, height int) // GetCursor returns the cursor details. GetCursor() (x int, y int, visible bool) Screen }
OffScreen represents a screen simulation. This is intended to be a superset of normal Screens, but also adds some important interfaces for testing.
func MakeOffScreen ¶
func NewOffScreen ¶
NewOffScreen returns a OffScreen. Note that OffScreen is also a Display.
type OffscreenCell ¶
type OffscreenCell struct { // Bytes is the actual character bytes. Normally this is // rune data, but it could be be data in another encoding system. Bytes []byte // Style is the style used to display the data. Style paint.Style // Runes is the list of runes, unadulterated, in UTF-8. Runes []rune }
OffscreenCell represents a simulated screen cell. The purpose of this is to track on screen content.
type OffscreenWindow ¶
type OffscreenWindow interface { Object Init() bool GetWindowType() (value enums.WindowType) SetWindowType(hint enums.WindowType) SetTitle(title string) GetTitle() string GetDisplay() Display SetDisplay(d Display) Draw() enums.EventFlag ProcessEvent(evt Event) enums.EventFlag }
Basic window interface
type Property ¶
type Property string
const PropertyDebug Property = "debug"
request that the object be rendered with additional features useful to debugging custom Widget development
const PropertyName Property = "name"
property wrapper around the CTypeItem name field
const PropertyText Property = "text"
const PropertyTheme Property = "theme"
type PropertyType ¶
type PropertyType string
const ( BoolProperty PropertyType = "bool" StringProperty PropertyType = "string" IntProperty PropertyType = "int" FloatProperty PropertyType = "float" ColorProperty PropertyType = "color" StyleProperty PropertyType = "style" ThemeProperty PropertyType = "theme" PointProperty PropertyType = "point" RectangleProperty PropertyType = "rectangle" RegionProperty PropertyType = "region" StructProperty PropertyType = "struct" TimeProperty PropertyType = "time" )
func (PropertyType) String ¶
func (p PropertyType) String() string
type Screen ¶
type Screen interface { // Init initializes the screen for use. Init() error InitWithFilePath(fp string) error InitWithFileHandle(fh *os.File) error TtyKeepFileHandle(keeping bool) TtyKeepingFileHandle() (keeping bool) TtyCloseWithStiRead(enabled bool) GetTtyCloseWithStiRead() (enabled bool) GetTermType() (ttyType cterm.TermType) // Close finalizes the screen also releasing resources. Close() // Clear erases the screen. The contents of any screen buffers // will also be cleared. This has the logical effect of // filling the screen with spaces, using the global default style. Clear() // Fill fills the screen with the given character and style. Fill(rune, paint.Style) // SetCell is an older API, and will be removed. Please use // SetContent instead; SetCell is implemented in terms of SetContent. SetCell(x int, y int, style paint.Style, ch ...rune) // GetContent returns the contents at the given location. If the // coordinates are out of range, then the values will be 0, nil, // StyleDefault. Note that the contents returned are logical contents // and may not actually be what is displayed, but rather are what will // be displayed if Show() or Sync() is called. The width is the width // in screen cells; most often this will be 1, but some East Asian // characters require two cells. GetContent(x, y int) (mainc rune, combc []rune, style paint.Style, width int) // SetContent sets the contents of the given cell location. If // the coordinates are out of range, then the operation is ignored. // // The first rune is the primary non-zero width rune. The array // that follows is a possible list of combining characters to append, // and will usually be nil (no combining characters.) // // The results are not displayed until Show() or Sync() is called. // // Note that wide (East Asian full width) runes occupy two cells, // and attempts to place character at next cell to the right will have // undefined effects. Wide runes that are printed in the // last column will be replaced with a single width space on output. SetContent(x int, y int, mainc rune, combc []rune, style paint.Style) // SetStyle sets the default style to use when clearing the screen // or when StyleDefault is specified. If it is also StyleDefault, // then whatever system/terminal default is relevant will be used. SetStyle(style paint.Style) // ShowCursor is used to display the cursor at a given location. // If the coordinates -1, -1 are given or are otherwise outside the // dimensions of the screen, the cursor will be hidden. ShowCursor(x int, y int) // HideCursor is used to hide the cursor. It's an alias for // ShowCursor(-1, -1). HideCursor() // Size returns the screen size as width, height. This changes in // response to a call to Clear or Flush. Size() (w, h int) // PollEvent waits for events to arrive. Main application loops // must spin on this to prevent the application from stalling. // Furthermore, this will return nil if the Screen is finalized. PollEvent() Event // PollEventChan provides a PollEvent() call response through a channel // for the purposes of using a select statement to poll for new events PollEventChan() (next chan Event) // PostEvent tries to post an event into the event stream. This // can fail if the event queue is full. In that case, the event // is dropped, and ErrEventQFull is returned. PostEvent(ev Event) error // EnableMouse enables the mouse. (If your terminal supports it.) // If no flags are specified, then all events are reported, if the // terminal supports them. EnableMouse(...MouseFlags) // DisableMouse disables the mouse. DisableMouse() // EnablePaste enables bracketed paste mode, if supported. EnablePaste() // DisablePaste disables bracketed paste mode. DisablePaste() // HasMouse returns true if the terminal (apparently) supports a // mouse. Note that the a return value of true doesn't guarantee that // a mouse/pointing device is present; a false return definitely // indicates no mouse support is available. HasMouse() bool // Colors returns the number of colors. All colors are assumed to // use the ANSI color map. If a terminal is monochrome, it will // return 0. Colors() int // Show makes all the content changes made using SetContent() visible // on the screen. // // It does so in the most efficient and least visually disruptive // manner possible. Show() // Sync works like Show(), but it updates every visible cell on the // physical screen, assuming that it is not synchronized with any // internal model. This may be both expensive and visually jarring, // so it should only be used when believed to actually be necessary. // // Typically, this is called as a result of a user-requested redraw // (e.g. to clear up on screen corruption caused by some other program), // or during a resize event. Sync() // CharacterSet returns information about the character set. // This isn't the full locale, but it does give us the input/output // character set. Note that this is just for diagnostic purposes, // we normally translate input/output to/from UTF-8, regardless of // what the user's environment is. CharacterSet() string // RegisterRuneFallback adds a fallback for runes that are not // part of the character set -- for example one could register // o as a fallback for ø. This should be done cautiously for // characters that might be displayed ordinarily in language // specific text -- characters that could change the meaning of // of written text would be dangerous. The intention here is to // facilitate fallback characters in pseudo-graphical applications. // // If the terminal has fallbacks already in place via an alternate // character set, those are used in preference. Also, standard // fallbacks for graphical characters in the ACSC terminfo string // are registered implicitly. // // The display string should be the same width as original rune. // This makes it possible to register two character replacements // for full width East Asian characters, for example. // // It is recommended that replacement strings consist only of // 7-bit ASCII, since other characters may not display everywhere. RegisterRuneFallback(r rune, subst string) // UnregisterRuneFallback unmaps a replacement. It will unmap // the implicit ASCII replacements for alternate characters as well. // When an unmapped char needs to be displayed, but no suitable // glyph is available, '?' is emitted instead. It is not possible // to "disable" the use of alternate characters that are supported // by your terminal except by changing the terminal database. UnregisterRuneFallback(r rune) RegisterConsoleFallback(r rune, subst rune) UnregisterConsoleFallback(r rune) // CanDisplay returns true if the given rune can be displayed on // this screen. Note that this is a best guess effort -- whether // your fonts support the character or not may be questionable. // Mostly this is for folks who work outside of Unicode. // // If checkFallbacks is true, then if any (possibly imperfect) // fallbacks are registered, this will return true. This will // also return true if the terminal can replace the glyph with // one that is visually indistinguishable from the one requested. CanDisplay(r rune, checkFallbacks bool) bool // HasKey returns true if the keyboard is believed to have the // key. In some cases a keyboard may have keys with this name // but no support for them, while in others a key may be reported // as supported but not actually be usable (such as some emulators // that hijack certain keys). Its best not to depend to strictly // on this function, but it can be used for hinting when building // menus, displayed hot-keys, etc. Note that KeyRune (literal // runes) is always true. HasKey(Key) bool // Beep attempts to sound an OS-dependent audible alert and returns an error // when unsuccessful. Beep() error Export() *CellBuffer Import(cb *CellBuffer) HostClipboardEnabled() (enabled bool) CopyToClipboard(s string) PasteFromClipboard() (s string, ok bool) EnableHostClipboard(enabled bool) EnableTermClipboard(enabled bool) }
Screen represents the physical (or emulated) display. This can be a terminal window or a physical console. Platforms implement this differently.
func NewScreen ¶
NewScreen returns a Screen that uses the stock TTY interface and POSIX terminal control, combined with a terminfo description taken from the $TERM environment variable. It returns an error if the terminal is not supported for any reason.
For terminals that do not support dynamic resize events, the $LINES $COLUMNS environment variables can be set to the actual window size, otherwise defaults taken from the terminal database are used.
type ServerAuthHandler ¶ added in v0.3.2
type ServerAuthHandler interface { Init() (already bool) ID() (id uuid.UUID) Attach(server ApplicationServer) (err error) Detach() (err error) Reload(ctx *cli.Context) (err error) HasArgument(arg string) (has bool) RegisterArgument(flag cli.Flag) }
func NewDefaultServerAuthHandler ¶ added in v0.3.2
func NewDefaultServerAuthHandler() (handler ServerAuthHandler)
type ServerAuthPasswordHandler ¶ added in v0.3.2
type ServerAuthPasswordHandler interface { ServerAuthHandler PasswordCallback(conn ssh.ConnMetadata, password []byte) (*ssh.Permissions, error) }
type Signal ¶
type Signal string
const ( SignalDisplayCaptured Signal = "display-captured" SignalInterrupt Signal = "sigint" SignalEvent Signal = "event" SignalEventError Signal = "event-error" SignalEventKey Signal = "event-key" SignalEventMouse Signal = "event-mouse" SignalEventResize Signal = "event-resize" SignalEventPaste Signal = "event-paste" SignalSetEventFocus Signal = "set-event-focus" SignalStartupComplete Signal = "startup-complete" SignalDisplayStartup Signal = "display-startup" SignalDisplayShutdown Signal = "display-shutdown" SignalMappedWindow Signal = "mapped-window" SignalUnmappedWindow Signal = "unmapped-window" SignalFocusedWindow Signal = "focused-window" SignalFocusNextWindow Signal = "focus-next-window" SignalFocusPreviousWindow Signal = "focus-previous-window" )
const SignalActivate Signal = "activate"
const SignalChanged Signal = "changed"
const SignalCopy Signal = "copy"
const SignalDestroy Signal = "destroy"
emitted when the object instance is destroyed
const SignalNotifyStartupComplete Signal = "notify-startup-complete"
const SignalPaste Signal = "paste"
const SignalPrepare Signal = "prepare"
const SignalPrepareStartup Signal = "prepare-startup"
const SignalReconfigure Signal = "reconfigure"
const SignalSetupDisplay Signal = "setup-display"
const SignalShutdown Signal = "shutdown"
const SignalStartup Signal = "startup"
type SignalListenerData ¶
type SignalListenerData []interface{}
type SignalListenerFn ¶
func WithArgvApplicationSignalPrepareStartup ¶ added in v0.5.20
func WithArgvApplicationSignalPrepareStartup(fn ApplicationPrepareStartupFn) SignalListenerFn
func WithArgvApplicationSignalStartup ¶ added in v0.4.2
func WithArgvApplicationSignalStartup(fn ApplicationStartupFn) SignalListenerFn
func WithArgvNoneSignal ¶ added in v0.4.2
func WithArgvNoneSignal(fn func(), eventFlag enums.EventFlag) SignalListenerFn
func WithArgvNoneWithFlagsSignal ¶ added in v0.4.2
func WithArgvNoneWithFlagsSignal(fn func() enums.EventFlag) SignalListenerFn
type Signaling ¶
type Signaling interface { TypeItem Init() (already bool) Handled(signal Signal, handle string) (found bool) Connect(signal Signal, handle string, c SignalListenerFn, data ...interface{}) Disconnect(signal Signal, handle string) error Emit(signal Signal, argv ...interface{}) enums.EventFlag HasListeners(signal Signal) (has bool) DisconnectAll() StopSignal(signals ...Signal) IsSignalStopped(signals ...Signal) (stopped bool) PassSignal(signals ...Signal) IsSignalPassed(signals ...Signal) (passed bool) ResumeSignal(signals ...Signal) Freeze() Thaw() IsFrozen() (frozen bool) }
type TimerCallbackFn ¶
type Type ¶
type TypeItem ¶
type TypeItem interface { InitTypeItem(tag TypeTag, thing interface{}) (already bool) Init() (already bool) IsValid() bool Self() (this interface{}) String() string GetTypeTag() TypeTag GetName() string SetName(name string) ObjectID() uuid.UUID ObjectName() string DestroyObject() (err error) LogTag() string LogTrace(format string, argv ...interface{}) LogDebug(format string, argv ...interface{}) LogInfo(format string, argv ...interface{}) LogWarn(format string, argv ...interface{}) LogError(format string, argv ...interface{}) LogErr(err error) Lock() Unlock() RLock() RUnlock() }
func NewTypeItem ¶
type TypeRegistry ¶
type TypeRegistry interface { GetTypeTags() (tags []TypeTag) GetBuildableInfo() (info map[string]TypeTag) MakeType(tag TypeTag) (thing interface{}, err error) AddType(tag TypeTag, constructor func() interface{}, aliases ...string) error HasType(tag TypeTag) (exists bool) GetType(tag TypeTag) (t Type, ok bool) AddTypeAlias(tag TypeTag, alias ...string) GetTypeTagByAlias(alias string) (tt TypeTag, ok bool) AddTypeItem(tag TypeTag, item interface{}) (id uuid.UUID, err error) HasID(index uuid.UUID) bool GetTypeItems(tag TypeTag) []interface{} GetTypeItemByID(id uuid.UUID) interface{} GetTypeItemByName(name string) interface{} RemoveTypeItem(tag TypeTag, item TypeItem) error }
func NewTypeRegistry ¶
func NewTypeRegistry() TypeRegistry
type TypeTag ¶
type Window ¶
type Window interface { Object Init() bool Destroy() GetWindowType() (value enums.WindowType) SetWindowType(hint enums.WindowType) SetTitle(title string) GetTitle() string GetDisplay() Display SetDisplay(d Display) Draw() enums.EventFlag ProcessEvent(evt Event) enums.EventFlag }
Basic window interface
func NewOffscreenWindow ¶
Source Files ¶
- application.go
- application_cli_flags.go
- application_plugin.go
- application_server.go
- application_server_client.go
- application_signals.go
- build_config.go
- buttonmask.go
- cdk.go
- cell.go
- cell_buffer.go
- clipboard.go
- ctype.go
- ctype_item.go
- ctype_item_list.go
- ctype_registry.go
- ctype_tag.go
- display.go
- encoding.go
- event.go
- event_error.go
- event_interrupt.go
- event_key.go
- event_mask.go
- event_mouse.go
- event_paste.go
- event_quit.go
- event_render.go
- event_resize.go
- keys_mods.go
- local_context.go
- metadata.go
- mouse_flags.go
- mouse_state.go
- object.go
- offscreen.go
- offscreen_window.go
- property.go
- property_type.go
- screen.go
- screen_unix.go
- sensitive.go
- server_auth_handler.go
- server_auth_htpasswd_handler.go
- server_auth_password_handler.go
- signal.go
- signal_listener.go
- signaling.go
- terms_default.go
- terms_dynamic.go
- testing.go
- timing.go
- window.go