gui

package
v0.0.0-...-8f83222 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cfg *Config) error

Types

type Config

type Config struct {
	Debug        bool
	ClientConfig client.Config
}

type GUI

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

func NewGUI

func NewGUI(clientObj client.Client) *GUI

func (*GUI) Close

func (g *GUI) Close() error

Close shuts down the GUI. nolint:unparam // We want to match the io.Closer interface.

func (*GUI) DetermineTickersForRender

func (g *GUI) DetermineTickersForRender(globalOffset float32) []*models.Ticker

DetermineTickersForRender takes a global offset and returns the ticker indices which are within visiable positions ( should be rendered ).

func (*GUI) RenderLoop

func (g *GUI) RenderLoop(ctx context.Context) error

func (*GUI) Run

func (g *GUI) Run(ctx context.Context) error

func (*GUI) Setup

func (g *GUI) Setup() error

func (*GUI) SystemPanel

func (g *GUI) SystemPanel()

func (*GUI) TickerOffset

func (g *GUI) TickerOffset(globalOffset float32, ticker *models.Ticker) float32

TickerOffset determines what the offset should be for this ticker, on this screen. TODO: We should calculate each tickers offset and allow for dynamic width tickers. When

there is a 4 letter ticker with a 4 digit price, it's much wider than a 2 letter ticker and 2 digit price
type Logo struct {
	Status     logoStatus
	NanovImgID int
	// contains filtered or unexported fields
}

type LogoManager

type LogoManager struct {
	sync.RWMutex

	// NeedsRenderAccess is a flag we set when we need access to the main render thread.
	// We cannot load images into context unless it's on the main render thread.
	NeedsRenderAccess bool
	// contains filtered or unexported fields
}

func NewLogosManager

func NewLogosManager() *LogoManager
func (l *LogoManager) DownloadLogo(ticker *models.Ticker) error

func (*LogoManager) GetTickerImage

func (l *LogoManager) GetTickerImage(ticker *models.Ticker) *Logo

GetTickerImage attempts to get the tickers logo. If it does not exist it will start the download process and return a placeholder image instead.

func (*LogoManager) RenderThread

func (l *LogoManager) RenderThread()

RenderThread is called in the main rendering thread ( so be fast ). This is required to change the context. Without being in the main thread it will cause panics.

func (*LogoManager) Setup

func (l *LogoManager) Setup(nanoCtx *nanovgo.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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