Documentation ¶
Index ¶
- func CursorDown(g *gocui.Gui, v *gocui.View) error
- func CursorStep(g *gocui.Gui, v *gocui.View, step int) error
- func CursorUp(g *gocui.Gui, v *gocui.View) error
- type Debug
- func (v *Debug) IsVisible() bool
- func (v *Debug) Layout(g *gocui.Gui, minX, minY, maxX, maxY int) error
- func (v *Debug) Name() string
- func (v *Debug) OnLayoutChange() error
- func (v *Debug) Render() error
- func (v *Debug) RequestedSize(available int) *int
- func (v *Debug) SetCurrentView(r Helper)
- func (v *Debug) Setup(view *gocui.View, header *gocui.View) error
- func (v *Debug) Update() error
- type Details
- func (v *Details) CursorDown() error
- func (v *Details) CursorUp() error
- func (v *Details) IsVisible() bool
- func (v *Details) KeyHelp() string
- func (v *Details) Name() string
- func (v *Details) OnLayoutChange() error
- func (v *Details) Render() error
- func (v *Details) SetCurrentLayer(layer *image.Layer)
- func (v *Details) Setup(view *gocui.View, header *gocui.View) error
- func (v *Details) Update() error
- type FileTree
- func (v *FileTree) AddViewOptionChangeListener(listener ...ViewOptionChangeListener)
- func (v *FileTree) CursorDown() error
- func (v *FileTree) CursorLeft() error
- func (v *FileTree) CursorRight() error
- func (v *FileTree) CursorUp() error
- func (v *FileTree) IsVisible() bool
- func (v *FileTree) KeyHelp() string
- func (v *FileTree) Layout(g *gocui.Gui, minX, minY, maxX, maxY int) error
- func (v *FileTree) Name() string
- func (v *FileTree) OnLayoutChange() error
- func (v *FileTree) PageDown() error
- func (v *FileTree) PageUp() error
- func (v *FileTree) Render() error
- func (v *FileTree) RequestedSize(available int) *int
- func (v *FileTree) SetFilterRegex(filterRegex *regexp.Regexp)
- func (v *FileTree) SetTitle(title string)
- func (v *FileTree) SetTree(bottomTreeStart, bottomTreeStop, topTreeStart, topTreeStop int) error
- func (v *FileTree) Setup(view *gocui.View, header *gocui.View) error
- func (v *FileTree) Update() error
- type Filter
- func (v *Filter) AddFilterEditListener(listener ...FilterEditListener)
- func (v *Filter) Edit(view *gocui.View, key gocui.Key, ch rune, mod gocui.Modifier)
- func (v *Filter) IsVisible() bool
- func (v *Filter) KeyHelp() string
- func (v *Filter) Layout(g *gocui.Gui, minX, minY, maxX, maxY int) error
- func (v *Filter) Name() string
- func (v *Filter) OnLayoutChange() error
- func (v *Filter) Render() error
- func (v *Filter) RequestedSize(available int) *int
- func (v *Filter) Setup(view *gocui.View, header *gocui.View) error
- func (v *Filter) ToggleVisible() error
- func (v *Filter) Update() error
- type FilterEditListener
- type Helper
- type Layer
- func (v *Layer) AddLayerChangeListener(listener ...LayerChangeListener)
- func (v *Layer) CompareMode() viewmodel.LayerCompareMode
- func (v *Layer) ConstrainLayout()
- func (v *Layer) CurrentLayer() *image.Layer
- func (v *Layer) CursorDown() error
- func (v *Layer) CursorUp() error
- func (v *Layer) ExpandLayout()
- func (v *Layer) IsVisible() bool
- func (v *Layer) KeyHelp() string
- func (v *Layer) LayerCount() int
- func (v *Layer) Name() string
- func (v *Layer) OnLayoutChange() error
- func (v *Layer) PageDown() error
- func (v *Layer) PageUp() error
- func (v *Layer) Render() error
- func (v *Layer) SetCursor(layer int) error
- func (v *Layer) Setup(view *gocui.View, header *gocui.View) error
- func (v *Layer) Update() error
- type LayerChangeListener
- type Renderer
- type Status
- func (v *Status) AddHelpKeys(keys ...*key.Binding)
- func (v *Status) IsVisible() bool
- func (v *Status) KeyHelp() string
- func (v *Status) Layout(g *gocui.Gui, minX, minY, maxX, maxY int) error
- func (v *Status) Name() string
- func (v *Status) OnLayoutChange() error
- func (v *Status) Render() error
- func (v *Status) RequestedSize(available int) *int
- func (v *Status) SetCurrentView(r Helper)
- func (v *Status) Setup(view *gocui.View) error
- func (v *Status) Update() error
- type ViewOptionChangeListener
- type Views
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CursorDown ¶
CursorDown moves the cursor down in the currently selected gocui pane, scrolling the screen as needed.
func CursorStep ¶
Moves the cursor the given step distance, setting the origin to the new cursor line
Types ¶
type Debug ¶
type Debug struct {
// contains filtered or unexported fields
}
Debug is just for me :)
func (*Debug) OnLayoutChange ¶
OnLayoutChange is called whenever the screen dimensions are changed
func (*Debug) RequestedSize ¶
func (*Debug) SetCurrentView ¶
type Details ¶
type Details struct {
// contains filtered or unexported fields
}
Details holds the UI objects and data models for populating the lower-left pane. Specifically the pane that shows the layer details and image statistics.
func (*Details) CursorDown ¶
CursorDown moves the cursor down in the details pane (currently indicates nothing).
func (*Details) CursorUp ¶
CursorUp moves the cursor up in the details pane (currently indicates nothing).
func (*Details) KeyHelp ¶
KeyHelp indicates all the possible actions a user can take while the current pane is selected (currently does nothing).
func (*Details) OnLayoutChange ¶
OnLayoutChange is called whenever the screen dimensions are changed
func (*Details) Render ¶
Render flushes the state objects to the screen. The details pane reports: 1. the current selected layer's command string 2. the image efficiency score 3. the estimated wasted image space 4. a list of inefficient file allocations
func (*Details) SetCurrentLayer ¶
type FileTree ¶
type FileTree struct {
// contains filtered or unexported fields
}
FileTree holds the UI objects and data models for populating the right pane. Specifically the pane that shows selected layer or aggregate file ASCII tree.
func (*FileTree) AddViewOptionChangeListener ¶
func (v *FileTree) AddViewOptionChangeListener(listener ...ViewOptionChangeListener)
func (*FileTree) CursorDown ¶
CursorDown moves the cursor down and renders the view. Note: we cannot use the gocui buffer since any state change requires writing the entire tree to the buffer. Instead we are keeping an upper and lower bounds of the tree string to render and only flushing this range into the view buffer. This is much faster when tree sizes are large.
func (*FileTree) CursorLeft ¶
CursorLeft moves the cursor up until we reach the Parent Node or top of the tree
func (*FileTree) CursorRight ¶
CursorRight descends into directory expanding it if needed
func (*FileTree) CursorUp ¶
CursorUp moves the cursor up and renders the view. Note: we cannot use the gocui buffer since any state change requires writing the entire tree to the buffer. Instead we are keeping an upper and lower bounds of the tree string to render and only flushing this range into the view buffer. This is much faster when tree sizes are large.
func (*FileTree) IsVisible ¶
IsVisible indicates if the file tree view pane is currently initialized
func (*FileTree) KeyHelp ¶
KeyHelp indicates all the possible actions a user can take while the current pane is selected.
func (*FileTree) OnLayoutChange ¶
OnLayoutChange is called by the UI framework to inform the view-model of the new screen dimensions
func (*FileTree) RequestedSize ¶
func (*FileTree) SetFilterRegex ¶
func (*FileTree) SetTree ¶
SetTreeByLayer populates the view model by stacking the indicated image layer file trees.
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter holds the UI objects and data models for populating the bottom row. Specifically the pane that allows the user to filter the file tree by path.
func (*Filter) AddFilterEditListener ¶
func (v *Filter) AddFilterEditListener(listener ...FilterEditListener)
func (*Filter) Edit ¶
Edit intercepts the key press events in the filer view to update the file view in real time.
func (*Filter) KeyHelp ¶
KeyHelp indicates all the possible actions a user can take while the current pane is selected.
func (*Filter) OnLayoutChange ¶
OnLayoutChange is called whenever the screen dimensions are changed
func (*Filter) Render ¶
Render flushes the state objects to the screen. Currently this is the users path filter input.
func (*Filter) RequestedSize ¶
func (*Filter) Setup ¶
Setup initializes the UI concerns within the context of a global gocui view object.
func (*Filter) ToggleVisible ¶
ToggleFilterView shows/hides the file tree filter pane.
type FilterEditListener ¶
type Layer ¶
type Layer struct {
// contains filtered or unexported fields
}
Layer holds the UI objects and data models for populating the lower-left pane. Specifically the pane that shows the image layers and layer selector.
func (*Layer) AddLayerChangeListener ¶
func (v *Layer) AddLayerChangeListener(listener ...LayerChangeListener)
func (*Layer) CompareMode ¶
func (v *Layer) CompareMode() viewmodel.LayerCompareMode
func (*Layer) ConstrainLayout ¶
func (v *Layer) ConstrainLayout()
func (*Layer) CurrentLayer ¶
CurrentLayer returns the Layer object currently selected.
func (*Layer) CursorDown ¶
CursorDown moves the cursor down in the layer pane (selecting a higher layer).
func (*Layer) ExpandLayout ¶
func (v *Layer) ExpandLayout()
func (*Layer) KeyHelp ¶
KeyHelp indicates all the possible actions a user can take while the current pane is selected.
func (*Layer) LayerCount ¶
func (*Layer) OnLayoutChange ¶
OnLayoutChange is called whenever the screen dimensions are changed
func (*Layer) Render ¶
Render flushes the state objects to the screen. The layers pane reports: 1. the layers of the image + metadata 2. the current selected image
func (*Layer) SetCursor ¶
SetCursor resets the cursor and orients the file tree view based on the given layer index.
type LayerChangeListener ¶
type LayerChangeListener func(viewmodel.LayerSelection) error
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
Status holds the UI objects and data models for populating the bottom-most pane. Specifically the panel shows the user a set of possible actions to take in the window and currently selected pane.
func (*Status) AddHelpKeys ¶
func (*Status) KeyHelp ¶
KeyHelp indicates all the possible global actions a user can take when any pane is selected.
func (*Status) OnLayoutChange ¶
OnLayoutChange is called whenever the screen dimensions are changed
func (*Status) RequestedSize ¶
func (*Status) SetCurrentView ¶
type ViewOptionChangeListener ¶
type ViewOptionChangeListener func() error