ui

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ALIGN_LEFT = iota
	ALIGN_RIGHT
	ALIGN_CENTER
)
View Source
const (
	DIR_LTR_ICN = "▶" // u+25b6
	DIR_RTL_ICN = "◀" // u+25c0
	SD_ONE_ICN  = "|"
	SD_TWO_ICN  = "||"
	SD_DBL_ICN  = "█" // u+2588
)
View Source
const (
	APP_HLP_ICN = "?"
)
View Source
const TICK = 3000

Variables

This section is empty.

Functions

func AddCommand

func AddCommand(commands *CommandList, command *Command)

Types

type Command

type Command struct {
	Name        string
	DisplayName string
	BindKeys    []uint
	Args        []any
	Callback    func(args ...any)
}

func NewCommand

func NewCommand(name string, displayName string, bindKeys []uint, callback func(args ...any)) *Command

func (*Command) Execute

func (c *Command) Execute(args ...any)

type CommandList

type CommandList struct {
	Names    map[string]*Command
	KeyCodes map[uint]*Command
}

func NewCommands

func NewCommands(m *model.Model, u *UI) *CommandList

type OnePageSpread

type OnePageSpread struct {
	// contains filtered or unexported fields
}

type PagePosition

type PagePosition int

type PageView

type PageView struct {
	// contains filtered or unexported fields
}

func (*PageView) Connect

func (v *PageView) Connect(m *model.Model, u *UI)

func (*PageView) Disconnect

func (v *PageView) Disconnect(m *model.Model, u *UI)

func (*PageView) Render

func (v *PageView) Render(m *model.Model)

type PageViewHdrControl

type PageViewHdrControl struct {
	// contains filtered or unexported fields
}

func NewHdrControl

func NewHdrControl(m *model.Model, u *UI) *PageViewHdrControl

func (*PageViewHdrControl) Render

func (c *PageViewHdrControl) Render(m *model.Model)

type PageViewNavControl

type PageViewNavControl struct {
	// contains filtered or unexported fields
}

func NewNavControl

func NewNavControl(m *model.Model, u *UI) *PageViewNavControl

func (*PageViewNavControl) Render

func (c *PageViewNavControl) Render(m *model.Model)

type StripView

type StripView struct {
	// contains filtered or unexported fields
}

func (*StripView) Connect

func (v *StripView) Connect(m *model.Model, u *UI)

func (*StripView) Disconnect

func (v *StripView) Disconnect(m *model.Model, u *UI)

func (*StripView) Render

func (v *StripView) Render(m *model.Model)

func (*StripView) ScrollToBottom

func (v *StripView) ScrollToBottom()

func (*StripView) ScrollToTop

func (v *StripView) ScrollToTop()

type StripViewHdrControl

type StripViewHdrControl struct {
	// contains filtered or unexported fields
}

func NewStripViewHdrControl

func NewStripViewHdrControl(m *model.Model, u *UI) *StripViewHdrControl

func (*StripViewHdrControl) Render

func (c *StripViewHdrControl) Render(m *model.Model)

type StripViewNavControl

type StripViewNavControl struct {
	// contains filtered or unexported fields
}

func NewStripViewNavControl

func NewStripViewNavControl(m *model.Model, u *UI) *StripViewNavControl

func (*StripViewNavControl) Render

func (c *StripViewNavControl) Render(m *model.Model)

type TwoPageSpread

type TwoPageSpread struct {
	// contains filtered or unexported fields
}

type UI

type UI struct {
	SendMessage util.Messenger
	MainWindow  *gtk.Window
	PageView    View
	StripView   View
	View        View
	Commands    *CommandList
}

func NewUI

func NewUI(m *model.Model, messenger util.Messenger) *UI

func (*UI) DisplayErrorDlg added in v0.4.4

func (u *UI) DisplayErrorDlg(message string)

func (*UI) Dispose

func (u *UI) Dispose()

func (*UI) HideCursor added in v0.5.2

func (u *UI) HideCursor()

func (*UI) Quit

func (u *UI) Quit()

func (*UI) Render

func (u *UI) Render(m *model.Model)

func (*UI) Run

func (u *UI) Run()

func (*UI) RunFunc

func (u *UI) RunFunc(f interface{})

func (*UI) ShowCursor added in v0.5.2

func (u *UI) ShowCursor()

type View

type View interface {
	Connect(m *model.Model, u *UI)
	Disconnect(m *model.Model, u *UI)
	Render(m *model.Model)
}

func NewPageView

func NewPageView(m *model.Model, u *UI, messenger util.Messenger) View

func NewStripView

func NewStripView(m *model.Model, u *UI) View

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL