Documentation
¶
Index ¶
- Constants
- func CreateEvent(sessionID string, eventData interface{}) *pb.Event
- type DragMode
- type DragState
- type EventDispatcher
- type EventSubscriber
- type HitZone
- type MenuBarPrimitive
- func (mb *MenuBarPrimitive) AddMenu(menu *MenuEntry)
- func (mb *MenuBarPrimitive) CloseMenu()
- func (mb *MenuBarPrimitive) Draw(screen tcell.Screen)
- func (mb *MenuBarPrimitive) Focus(delegate func(p tview.Primitive))
- func (mb *MenuBarPrimitive) GetMenu(menuID string) *MenuEntry
- func (mb *MenuBarPrimitive) GetMenus() []*MenuEntry
- func (mb *MenuBarPrimitive) HasFocus() bool
- func (mb *MenuBarPrimitive) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (mb *MenuBarPrimitive) IsMenuOpen() bool
- func (mb *MenuBarPrimitive) MouseHandler() ...
- func (mb *MenuBarPrimitive) RemoveMenu(menuID string) bool
- func (mb *MenuBarPrimitive) SetActiveBackgroundColor(c tcell.Color)
- func (mb *MenuBarPrimitive) SetActiveTextColor(c tcell.Color)
- func (mb *MenuBarPrimitive) SetBarBackgroundColor(c tcell.Color)
- func (mb *MenuBarPrimitive) SetBarTextColor(c tcell.Color)
- func (mb *MenuBarPrimitive) SetOnItemSelected(fn func(menuBarID, menuID, menuItemID, label string))
- func (mb *MenuBarPrimitive) SetPreviousFocus(p tview.Primitive)
- type MenuEntry
- type MenuItemEntry
- type Rect
- type Server
- func (s *Server) App() *tview.Application
- func (s *Server) Events() *EventDispatcher
- func (s *Server) GetSimulationScreen() tcell.SimulationScreen
- func (s *Server) IsRunning() bool
- func (s *Server) IsTestMode() bool
- func (s *Server) MaxSessions() int
- func (s *Server) Run() error
- func (s *Server) Screen() tcell.Screen
- func (s *Server) Sessions() *SessionRegistry
- func (s *Server) Start() error
- func (s *Server) Stop()
- func (s *Server) Widgets() *WidgetRegistry
- type ServerOption
- type Session
- type SessionPreferences
- type SessionRegistry
- func (r *SessionRegistry) Count() int
- func (r *SessionRegistry) Create(clientName string, prefs SessionPreferences) (*Session, error)
- func (r *SessionRegistry) Delete(id string) bool
- func (r *SessionRegistry) Exists(id string) bool
- func (r *SessionRegistry) Get(id string) (*Session, bool)
- func (r *SessionRegistry) List() []string
- func (r *SessionRegistry) ListAll() []*Session
- type WidgetInfo
- type WidgetRegistry
- func (r *WidgetRegistry) AddChild(parentID, childID string) bool
- func (r *WidgetRegistry) Count() int
- func (r *WidgetRegistry) Delete(id string) bool
- func (r *WidgetRegistry) DeleteBySession(sessionID string) int
- func (r *WidgetRegistry) FindByPrimitive(p tview.Primitive) string
- func (r *WidgetRegistry) Get(id string) (tview.Primitive, bool)
- func (r *WidgetRegistry) GetInfo(id string) (*WidgetInfo, bool)
- func (r *WidgetRegistry) GetOwner(widgetID string) (string, bool)
- func (r *WidgetRegistry) GetRoot(sessionID string) (string, bool)
- func (r *WidgetRegistry) ListBySession(sessionID string) []*WidgetInfo
- func (r *WidgetRegistry) Register(sessionID string, widgetType pb.WidgetType, widget tview.Primitive, ...) string
- func (r *WidgetRegistry) RemoveChild(parentID, childID string) bool
- func (r *WidgetRegistry) SetRoot(sessionID, widgetID string) bool
- func (r *WidgetRegistry) UpdateProperties(widgetID string, properties *pb.WidgetProperties) bool
- type WindowManagerPrimitive
- func (wm *WindowManagerPrimitive) AddWindow(win *WindowPrimitive)
- func (wm *WindowManagerPrimitive) BringToFront(win *WindowPrimitive)
- func (wm *WindowManagerPrimitive) Draw(screen tcell.Screen)
- func (wm *WindowManagerPrimitive) FindWindow(win *WindowPrimitive) int
- func (wm *WindowManagerPrimitive) Focus(delegate func(p tview.Primitive))
- func (wm *WindowManagerPrimitive) GetWindows() []*WindowPrimitive
- func (wm *WindowManagerPrimitive) GetZOrder() []*WindowPrimitive
- func (wm *WindowManagerPrimitive) HasFocus() bool
- func (wm *WindowManagerPrimitive) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (wm *WindowManagerPrimitive) MouseHandler() ...
- func (wm *WindowManagerPrimitive) RemoveWindow(win *WindowPrimitive) bool
- func (wm *WindowManagerPrimitive) SendToBack(win *WindowPrimitive)
- func (wm *WindowManagerPrimitive) SetBgColor(c tcell.Color)
- func (wm *WindowManagerPrimitive) SetOnWindowActivated(f func(win *WindowPrimitive))
- func (wm *WindowManagerPrimitive) SetOnWindowClosed(f func(win *WindowPrimitive))
- func (wm *WindowManagerPrimitive) SetOnWindowMoved(f func(win *WindowPrimitive))
- func (wm *WindowManagerPrimitive) SetOnWindowResized(f func(win *WindowPrimitive))
- func (wm *WindowManagerPrimitive) SetOnWindowStateChanged(f func(win *WindowPrimitive, state WindowState))
- type WindowPrimitive
- func (w *WindowPrimitive) Close()
- func (w *WindowPrimitive) Draw(screen tcell.Screen)
- func (w *WindowPrimitive) Focus(delegate func(p tview.Primitive))
- func (w *WindowPrimitive) GetChild() tview.Primitive
- func (w *WindowPrimitive) GetMaxHeight() int
- func (w *WindowPrimitive) GetMaxWidth() int
- func (w *WindowPrimitive) GetMinHeight() int
- func (w *WindowPrimitive) GetMinWidth() int
- func (w *WindowPrimitive) GetRestoredRect() Rect
- func (w *WindowPrimitive) GetWindowState() WindowState
- func (w *WindowPrimitive) HasFocus() bool
- func (w *WindowPrimitive) HitTest(screenX, screenY int) HitZone
- func (w *WindowPrimitive) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (w *WindowPrimitive) IsActive() bool
- func (w *WindowPrimitive) IsClosable() bool
- func (w *WindowPrimitive) IsMaximizable() bool
- func (w *WindowPrimitive) IsMinimizable() bool
- func (w *WindowPrimitive) IsMovable() bool
- func (w *WindowPrimitive) IsResizable() bool
- func (w *WindowPrimitive) Maximize(parentRect Rect)
- func (w *WindowPrimitive) Minimize()
- func (w *WindowPrimitive) MouseHandler() ...
- func (w *WindowPrimitive) Restore()
- func (w *WindowPrimitive) SetActive(active bool)
- func (w *WindowPrimitive) SetActiveBorderColor(c tcell.Color)
- func (w *WindowPrimitive) SetChild(child tview.Primitive)
- func (w *WindowPrimitive) SetClosable(v bool)
- func (w *WindowPrimitive) SetInactiveBorderColor(c tcell.Color)
- func (w *WindowPrimitive) SetMaxHeight(v int)
- func (w *WindowPrimitive) SetMaxWidth(v int)
- func (w *WindowPrimitive) SetMaximizable(v bool)
- func (w *WindowPrimitive) SetMinHeight(v int)
- func (w *WindowPrimitive) SetMinWidth(v int)
- func (w *WindowPrimitive) SetMinimizable(v bool)
- func (w *WindowPrimitive) SetMovable(v bool)
- func (w *WindowPrimitive) SetOnActivated(f func())
- func (w *WindowPrimitive) SetOnClosed(f func())
- func (w *WindowPrimitive) SetOnMoved(f func(x, y int))
- func (w *WindowPrimitive) SetOnResized(f func(w, h int))
- func (w *WindowPrimitive) SetOnStateChanged(f func(state WindowState))
- func (w *WindowPrimitive) SetResizable(v bool)
- func (w *WindowPrimitive) SetRestoredRect(r Rect)
- func (w *WindowPrimitive) SetTitleBarColor(c tcell.Color)
- func (w *WindowPrimitive) SetTitleBarTextColor(c tcell.Color)
- func (w *WindowPrimitive) SetWindowState(state WindowState)
- func (w *WindowPrimitive) String() string
- type WindowState
Constants ¶
const Version = "0.1.0-alpha"
Variables ¶
This section is empty.
Functions ¶
func CreateEvent ¶
CreateEvent creates a new event with timestamp
Types ¶
type DragState ¶
type DragState struct {
Active bool
Window *WindowPrimitive
Mode DragMode
StartX int // Mouse position at drag start
StartY int
StartRect Rect // Window rect at drag start
}
DragState tracks an active drag operation.
type EventDispatcher ¶
type EventDispatcher struct {
// contains filtered or unexported fields
}
EventDispatcher manages event subscriptions and dispatching
func NewEventDispatcher ¶
func NewEventDispatcher() *EventDispatcher
NewEventDispatcher creates a new event dispatcher
func (*EventDispatcher) Dispatch ¶
func (d *EventDispatcher) Dispatch(event *pb.Event)
Dispatch sends an event to the appropriate subscriber(s)
func (*EventDispatcher) Subscribe ¶
func (d *EventDispatcher) Subscribe(sessionID string, filter *pb.EventFilter) *EventSubscriber
Subscribe creates a new event subscription for a session
func (*EventDispatcher) Unsubscribe ¶
func (d *EventDispatcher) Unsubscribe(sessionID string)
Unsubscribe removes a session's event subscription
func (*EventDispatcher) UpdateFilter ¶
func (d *EventDispatcher) UpdateFilter(sessionID string, filter *pb.EventFilter) bool
UpdateFilter updates the filter for a session's subscription
type EventSubscriber ¶
type EventSubscriber struct {
SessionID string
Filter *pb.EventFilter
Events chan *pb.Event
Done chan struct{}
// contains filtered or unexported fields
}
EventSubscriber represents a client's event subscription
func (*EventSubscriber) IsClosed ¶
func (s *EventSubscriber) IsClosed() bool
IsClosed returns true if the subscriber has been closed
type MenuBarPrimitive ¶
MenuBarPrimitive is a custom tview.Primitive that renders a horizontal menu bar with dropdown menus. It supports mouse clicks and keyboard navigation.
func NewMenuBarPrimitive ¶
func NewMenuBarPrimitive() *MenuBarPrimitive
NewMenuBarPrimitive creates a new menu bar.
func (*MenuBarPrimitive) AddMenu ¶
func (mb *MenuBarPrimitive) AddMenu(menu *MenuEntry)
AddMenu adds a menu to the menu bar.
func (*MenuBarPrimitive) CloseMenu ¶
func (mb *MenuBarPrimitive) CloseMenu()
CloseMenu closes any open dropdown.
func (*MenuBarPrimitive) Draw ¶
func (mb *MenuBarPrimitive) Draw(screen tcell.Screen)
Draw renders the menu bar and any open dropdown.
func (*MenuBarPrimitive) Focus ¶
func (mb *MenuBarPrimitive) Focus(delegate func(p tview.Primitive))
Focus is called when the menu bar receives focus.
func (*MenuBarPrimitive) GetMenu ¶
func (mb *MenuBarPrimitive) GetMenu(menuID string) *MenuEntry
GetMenu returns a menu by ID.
func (*MenuBarPrimitive) GetMenus ¶
func (mb *MenuBarPrimitive) GetMenus() []*MenuEntry
GetMenus returns all menus (for testing/introspection).
func (*MenuBarPrimitive) HasFocus ¶
func (mb *MenuBarPrimitive) HasFocus() bool
HasFocus returns true if the menu bar has focus.
func (*MenuBarPrimitive) InputHandler ¶
func (mb *MenuBarPrimitive) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
InputHandler returns the key event handler.
func (*MenuBarPrimitive) IsMenuOpen ¶
func (mb *MenuBarPrimitive) IsMenuOpen() bool
IsMenuOpen returns whether a dropdown is currently open.
func (*MenuBarPrimitive) MouseHandler ¶
func (mb *MenuBarPrimitive) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)
MouseHandler returns the mouse event handler.
func (*MenuBarPrimitive) RemoveMenu ¶
func (mb *MenuBarPrimitive) RemoveMenu(menuID string) bool
RemoveMenu removes a menu by ID.
func (*MenuBarPrimitive) SetActiveBackgroundColor ¶
func (mb *MenuBarPrimitive) SetActiveBackgroundColor(c tcell.Color)
SetActiveBackgroundColor sets the active menu title background.
func (*MenuBarPrimitive) SetActiveTextColor ¶
func (mb *MenuBarPrimitive) SetActiveTextColor(c tcell.Color)
SetActiveTextColor sets the active menu title text color.
func (*MenuBarPrimitive) SetBarBackgroundColor ¶
func (mb *MenuBarPrimitive) SetBarBackgroundColor(c tcell.Color)
SetBackgroundColor sets the menu bar background color.
func (*MenuBarPrimitive) SetBarTextColor ¶
func (mb *MenuBarPrimitive) SetBarTextColor(c tcell.Color)
SetTextColor sets the menu bar text color.
func (*MenuBarPrimitive) SetOnItemSelected ¶
func (mb *MenuBarPrimitive) SetOnItemSelected(fn func(menuBarID, menuID, menuItemID, label string))
SetOnItemSelected sets the callback for when a menu item is selected.
func (*MenuBarPrimitive) SetPreviousFocus ¶
func (mb *MenuBarPrimitive) SetPreviousFocus(p tview.Primitive)
SetPreviousFocus stores the widget that had focus before the menu opened.
type MenuEntry ¶
type MenuEntry struct {
ID string
Title string
Items []*MenuItemEntry
}
MenuEntry represents a menu that belongs to a menu bar.
type MenuItemEntry ¶
type MenuItemEntry struct {
ID string
Label string
ShortcutDisplay string
Separator bool
Disabled bool
}
MenuItemEntry represents a single item in a menu.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the Yutani display server
func New ¶
func New(cfg *config.Config, opts ...ServerOption) (*Server, error)
New creates a new Yutani server with the given configuration and options.
func NewTestServer ¶
NewTestServer creates a server for testing with simulation screen. This is a convenience wrapper around New() with test mode enabled.
func (*Server) Events ¶
func (s *Server) Events() *EventDispatcher
Events returns the event dispatcher
func (*Server) GetSimulationScreen ¶
func (s *Server) GetSimulationScreen() tcell.SimulationScreen
GetSimulationScreen returns the simulation screen if in test mode, nil otherwise. Callers should check IsTestMode() first or handle nil.
func (*Server) IsTestMode ¶
IsTestMode returns whether the server is running in test mode
func (*Server) MaxSessions ¶
MaxSessions returns the maximum number of sessions
func (*Server) Run ¶
Run starts the TUI application (blocking call) This should be called from the main goroutine
func (*Server) Sessions ¶
func (s *Server) Sessions() *SessionRegistry
Sessions returns the session registry
func (*Server) Widgets ¶
func (s *Server) Widgets() *WidgetRegistry
Widgets returns the widget registry
type ServerOption ¶
type ServerOption func(*Server)
ServerOption is a function that configures a Server.
func WithTestMode ¶
func WithTestMode(testMode bool) ServerOption
WithTestMode configures the server to run in test mode.
type Session ¶
type Session struct {
ID string
ClientName string
CreatedAt time.Time
Preferences SessionPreferences
}
Session represents a client session
type SessionPreferences ¶
type SessionPreferences struct {
ReceiveMouseEvents bool
ReceiveKeyEvents bool
ReceiveResizeEvents bool
}
SessionPreferences holds session-specific preferences
type SessionRegistry ¶
type SessionRegistry struct {
// contains filtered or unexported fields
}
SessionRegistry manages active sessions
func NewSessionRegistry ¶
func NewSessionRegistry(maxSessions int) *SessionRegistry
NewSessionRegistry creates a new session registry
func (*SessionRegistry) Count ¶
func (r *SessionRegistry) Count() int
Count returns the number of active sessions
func (*SessionRegistry) Create ¶
func (r *SessionRegistry) Create(clientName string, prefs SessionPreferences) (*Session, error)
Create creates a new session
func (*SessionRegistry) Delete ¶
func (r *SessionRegistry) Delete(id string) bool
Delete removes a session
func (*SessionRegistry) Exists ¶
func (r *SessionRegistry) Exists(id string) bool
Exists checks if a session exists
func (*SessionRegistry) Get ¶
func (r *SessionRegistry) Get(id string) (*Session, bool)
Get retrieves a session by ID
func (*SessionRegistry) List ¶
func (r *SessionRegistry) List() []string
List returns all active session IDs
func (*SessionRegistry) ListAll ¶
func (r *SessionRegistry) ListAll() []*Session
ListAll returns all active sessions
type WidgetInfo ¶
type WidgetInfo struct {
ID string
SessionID string
Type pb.WidgetType
Primitive tview.Primitive
Properties *pb.WidgetProperties
ParentID string
ChildIDs []string
}
WidgetInfo stores metadata about a widget
type WidgetRegistry ¶
type WidgetRegistry struct {
// contains filtered or unexported fields
}
WidgetRegistry manages widgets and their ownership
func NewWidgetRegistry ¶
func NewWidgetRegistry() *WidgetRegistry
NewWidgetRegistry creates a new widget registry
func (*WidgetRegistry) AddChild ¶
func (r *WidgetRegistry) AddChild(parentID, childID string) bool
AddChild adds a child widget to a parent
func (*WidgetRegistry) Count ¶
func (r *WidgetRegistry) Count() int
Count returns the total number of widgets
func (*WidgetRegistry) Delete ¶
func (r *WidgetRegistry) Delete(id string) bool
Delete removes a widget and its children recursively
func (*WidgetRegistry) DeleteBySession ¶
func (r *WidgetRegistry) DeleteBySession(sessionID string) int
DeleteBySession removes all widgets owned by a session
func (*WidgetRegistry) FindByPrimitive ¶
func (r *WidgetRegistry) FindByPrimitive(p tview.Primitive) string
FindByPrimitive returns the widget ID for a given primitive, or "" if not found.
func (*WidgetRegistry) Get ¶
func (r *WidgetRegistry) Get(id string) (tview.Primitive, bool)
Get retrieves a widget primitive by ID
func (*WidgetRegistry) GetInfo ¶
func (r *WidgetRegistry) GetInfo(id string) (*WidgetInfo, bool)
GetInfo retrieves full widget info by ID
func (*WidgetRegistry) GetOwner ¶
func (r *WidgetRegistry) GetOwner(widgetID string) (string, bool)
GetOwner returns the session ID that owns a widget
func (*WidgetRegistry) GetRoot ¶
func (r *WidgetRegistry) GetRoot(sessionID string) (string, bool)
GetRoot returns the root widget ID for a session
func (*WidgetRegistry) ListBySession ¶
func (r *WidgetRegistry) ListBySession(sessionID string) []*WidgetInfo
ListBySession returns all widget infos owned by a session
func (*WidgetRegistry) Register ¶
func (r *WidgetRegistry) Register(sessionID string, widgetType pb.WidgetType, widget tview.Primitive, properties *pb.WidgetProperties) string
Register registers a widget for a session and returns its ID
func (*WidgetRegistry) RemoveChild ¶
func (r *WidgetRegistry) RemoveChild(parentID, childID string) bool
RemoveChild removes a child widget from a parent
func (*WidgetRegistry) SetRoot ¶
func (r *WidgetRegistry) SetRoot(sessionID, widgetID string) bool
SetRoot sets the root widget for a session
func (*WidgetRegistry) UpdateProperties ¶
func (r *WidgetRegistry) UpdateProperties(widgetID string, properties *pb.WidgetProperties) bool
UpdateProperties updates widget properties
type WindowManagerPrimitive ¶
WindowManagerPrimitive manages child windows with absolute positioning, z-ordering, and drag-to-move/resize.
func NewWindowManagerPrimitive ¶
func NewWindowManagerPrimitive() *WindowManagerPrimitive
NewWindowManagerPrimitive creates a new window manager.
func (*WindowManagerPrimitive) AddWindow ¶
func (wm *WindowManagerPrimitive) AddWindow(win *WindowPrimitive)
AddWindow adds a window to the manager (on top).
func (*WindowManagerPrimitive) BringToFront ¶
func (wm *WindowManagerPrimitive) BringToFront(win *WindowPrimitive)
BringToFront moves a window to the top of the z-order.
func (*WindowManagerPrimitive) Draw ¶
func (wm *WindowManagerPrimitive) Draw(screen tcell.Screen)
Draw renders the window manager and all child windows.
func (*WindowManagerPrimitive) FindWindow ¶
func (wm *WindowManagerPrimitive) FindWindow(win *WindowPrimitive) int
FindWindow returns the window at a given pointer to WindowPrimitive.
func (*WindowManagerPrimitive) Focus ¶
func (wm *WindowManagerPrimitive) Focus(delegate func(p tview.Primitive))
Focus delegates to the frontmost window.
func (*WindowManagerPrimitive) GetWindows ¶
func (wm *WindowManagerPrimitive) GetWindows() []*WindowPrimitive
GetWindows returns the internal window list (back-to-front).
func (*WindowManagerPrimitive) GetZOrder ¶
func (wm *WindowManagerPrimitive) GetZOrder() []*WindowPrimitive
GetZOrder returns window list from front to back.
func (*WindowManagerPrimitive) HasFocus ¶
func (wm *WindowManagerPrimitive) HasFocus() bool
HasFocus returns whether any window has focus.
func (*WindowManagerPrimitive) InputHandler ¶
func (wm *WindowManagerPrimitive) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
InputHandler delegates keyboard input to the frontmost window.
func (*WindowManagerPrimitive) MouseHandler ¶
func (wm *WindowManagerPrimitive) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)
MouseHandler is the central mouse dispatcher for the window manager.
func (*WindowManagerPrimitive) RemoveWindow ¶
func (wm *WindowManagerPrimitive) RemoveWindow(win *WindowPrimitive) bool
RemoveWindow removes a window from the manager.
func (*WindowManagerPrimitive) SendToBack ¶
func (wm *WindowManagerPrimitive) SendToBack(win *WindowPrimitive)
SendToBack moves a window to the bottom of the z-order.
func (*WindowManagerPrimitive) SetBgColor ¶
func (wm *WindowManagerPrimitive) SetBgColor(c tcell.Color)
SetBgColor sets the background fill color.
func (*WindowManagerPrimitive) SetOnWindowActivated ¶
func (wm *WindowManagerPrimitive) SetOnWindowActivated(f func(win *WindowPrimitive))
func (*WindowManagerPrimitive) SetOnWindowClosed ¶
func (wm *WindowManagerPrimitive) SetOnWindowClosed(f func(win *WindowPrimitive))
func (*WindowManagerPrimitive) SetOnWindowMoved ¶
func (wm *WindowManagerPrimitive) SetOnWindowMoved(f func(win *WindowPrimitive))
func (*WindowManagerPrimitive) SetOnWindowResized ¶
func (wm *WindowManagerPrimitive) SetOnWindowResized(f func(win *WindowPrimitive))
func (*WindowManagerPrimitive) SetOnWindowStateChanged ¶
func (wm *WindowManagerPrimitive) SetOnWindowStateChanged(f func(win *WindowPrimitive, state WindowState))
type WindowPrimitive ¶
WindowPrimitive is a custom tview.Primitive that wraps a child widget with a decorated frame including a title bar with [_][^][X] buttons and resizable borders.
func NewWindowPrimitive ¶
func NewWindowPrimitive(child tview.Primitive) *WindowPrimitive
NewWindowPrimitive creates a new window wrapping the given child.
func (*WindowPrimitive) Draw ¶
func (w *WindowPrimitive) Draw(screen tcell.Screen)
Draw renders the window to the screen.
func (*WindowPrimitive) Focus ¶
func (w *WindowPrimitive) Focus(delegate func(p tview.Primitive))
Focus delegates focus to the child.
func (*WindowPrimitive) GetChild ¶
func (w *WindowPrimitive) GetChild() tview.Primitive
GetChild returns the child primitive.
func (*WindowPrimitive) GetMaxHeight ¶
func (w *WindowPrimitive) GetMaxHeight() int
func (*WindowPrimitive) GetMaxWidth ¶
func (w *WindowPrimitive) GetMaxWidth() int
func (*WindowPrimitive) GetMinHeight ¶
func (w *WindowPrimitive) GetMinHeight() int
func (*WindowPrimitive) GetMinWidth ¶
func (w *WindowPrimitive) GetMinWidth() int
func (*WindowPrimitive) GetRestoredRect ¶
func (w *WindowPrimitive) GetRestoredRect() Rect
GetRestoredRect returns the saved rect for restore from maximized/minimized.
func (*WindowPrimitive) GetWindowState ¶
func (w *WindowPrimitive) GetWindowState() WindowState
GetWindowState returns the current window state.
func (*WindowPrimitive) HasFocus ¶
func (w *WindowPrimitive) HasFocus() bool
HasFocus returns whether the child has focus.
func (*WindowPrimitive) HitTest ¶
func (w *WindowPrimitive) HitTest(screenX, screenY int) HitZone
HitTest determines which zone of the window was clicked.
func (*WindowPrimitive) InputHandler ¶
func (w *WindowPrimitive) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
InputHandler returns the input handler for keyboard events.
func (*WindowPrimitive) IsActive ¶
func (w *WindowPrimitive) IsActive() bool
IsActive returns whether the window is active.
func (*WindowPrimitive) IsClosable ¶
func (w *WindowPrimitive) IsClosable() bool
func (*WindowPrimitive) IsMaximizable ¶
func (w *WindowPrimitive) IsMaximizable() bool
func (*WindowPrimitive) IsMinimizable ¶
func (w *WindowPrimitive) IsMinimizable() bool
func (*WindowPrimitive) IsMovable ¶
func (w *WindowPrimitive) IsMovable() bool
func (*WindowPrimitive) IsResizable ¶
func (w *WindowPrimitive) IsResizable() bool
func (*WindowPrimitive) Maximize ¶
func (w *WindowPrimitive) Maximize(parentRect Rect)
Maximize expands the window to fill the parent area.
func (*WindowPrimitive) Minimize ¶
func (w *WindowPrimitive) Minimize()
Minimize collapses the window to just the title bar.
func (*WindowPrimitive) MouseHandler ¶
func (w *WindowPrimitive) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)
MouseHandler returns the mouse handler. The actual drag logic is handled by the WindowManager.
func (*WindowPrimitive) Restore ¶
func (w *WindowPrimitive) Restore()
Restore returns the window to its saved position/size.
func (*WindowPrimitive) SetActive ¶
func (w *WindowPrimitive) SetActive(active bool)
SetActive marks the window as active or inactive.
func (*WindowPrimitive) SetActiveBorderColor ¶
func (w *WindowPrimitive) SetActiveBorderColor(c tcell.Color)
func (*WindowPrimitive) SetChild ¶
func (w *WindowPrimitive) SetChild(child tview.Primitive)
SetChild sets the child primitive.
func (*WindowPrimitive) SetClosable ¶
func (w *WindowPrimitive) SetClosable(v bool)
func (*WindowPrimitive) SetInactiveBorderColor ¶
func (w *WindowPrimitive) SetInactiveBorderColor(c tcell.Color)
func (*WindowPrimitive) SetMaxHeight ¶
func (w *WindowPrimitive) SetMaxHeight(v int)
func (*WindowPrimitive) SetMaxWidth ¶
func (w *WindowPrimitive) SetMaxWidth(v int)
func (*WindowPrimitive) SetMaximizable ¶
func (w *WindowPrimitive) SetMaximizable(v bool)
func (*WindowPrimitive) SetMinHeight ¶
func (w *WindowPrimitive) SetMinHeight(v int)
func (*WindowPrimitive) SetMinWidth ¶
func (w *WindowPrimitive) SetMinWidth(v int)
func (*WindowPrimitive) SetMinimizable ¶
func (w *WindowPrimitive) SetMinimizable(v bool)
func (*WindowPrimitive) SetMovable ¶
func (w *WindowPrimitive) SetMovable(v bool)
func (*WindowPrimitive) SetOnActivated ¶
func (w *WindowPrimitive) SetOnActivated(f func())
func (*WindowPrimitive) SetOnClosed ¶
func (w *WindowPrimitive) SetOnClosed(f func())
func (*WindowPrimitive) SetOnMoved ¶
func (w *WindowPrimitive) SetOnMoved(f func(x, y int))
func (*WindowPrimitive) SetOnResized ¶
func (w *WindowPrimitive) SetOnResized(f func(w, h int))
func (*WindowPrimitive) SetOnStateChanged ¶
func (w *WindowPrimitive) SetOnStateChanged(f func(state WindowState))
func (*WindowPrimitive) SetResizable ¶
func (w *WindowPrimitive) SetResizable(v bool)
func (*WindowPrimitive) SetRestoredRect ¶
func (w *WindowPrimitive) SetRestoredRect(r Rect)
SetRestoredRect saves the rect for later restore.
func (*WindowPrimitive) SetTitleBarColor ¶
func (w *WindowPrimitive) SetTitleBarColor(c tcell.Color)
func (*WindowPrimitive) SetTitleBarTextColor ¶
func (w *WindowPrimitive) SetTitleBarTextColor(c tcell.Color)
func (*WindowPrimitive) SetWindowState ¶
func (w *WindowPrimitive) SetWindowState(state WindowState)
SetWindowState sets the window state.
func (*WindowPrimitive) String ¶
func (w *WindowPrimitive) String() string
String returns a debug representation.
type WindowState ¶
type WindowState int
WindowState represents the display state of a window.
const ( WindowStateNormal WindowState = 0 WindowStateMaximized WindowState = 1 WindowStateMinimized WindowState = 2 )