overlay

package
v0.0.0-...-75edfd4 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlendImage

func BlendImage(dst *image.RGBA, src image.Image, x, y int, opacity float64)

BlendImage blends a source image onto a destination image at the given position with the specified opacity

func DrawRectangle

func DrawRectangle(dst *image.RGBA, x, y, width, height int, color image.Image, opacity float64)

DrawRectangle draws a filled rectangle with the specified color and opacity

Types

type BaseWidget

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

BaseWidget provides common functionality for all widgets

func NewBaseWidget

func NewBaseWidget(id string, x, y int, opacity float64) *BaseWidget

NewBaseWidget creates a new base widget

func (*BaseWidget) GetOpacity

func (w *BaseWidget) GetOpacity() float64

GetOpacity returns the widget's opacity

func (*BaseWidget) GetPosition

func (w *BaseWidget) GetPosition() (int, int)

GetPosition returns the widget's position

func (*BaseWidget) ID

func (w *BaseWidget) ID() string

ID returns the widget's unique identifier

func (*BaseWidget) IsEnabled

func (w *BaseWidget) IsEnabled() bool

IsEnabled returns whether the widget should be rendered

func (*BaseWidget) SetEnabled

func (w *BaseWidget) SetEnabled(enabled bool)

SetEnabled sets whether the widget should be rendered

func (*BaseWidget) SetOpacity

func (w *BaseWidget) SetOpacity(opacity float64)

SetOpacity sets the widget's opacity (0.0 to 1.0)

func (*BaseWidget) SetPosition

func (w *BaseWidget) SetPosition(x, y int)

SetPosition sets the widget's position

type GitHubWidget

type GitHubWidget struct {
	*BaseWidget
	// contains filtered or unexported fields
}

GitHubWidget displays GitHub Actions workflow status

func NewGitHubWidget

func NewGitHubWidget(id string, config map[string]interface{}) (*GitHubWidget, error)

NewGitHubWidget creates a new GitHub Actions status widget

func (*GitHubWidget) GetConfig

func (w *GitHubWidget) GetConfig() map[string]interface{}

GetConfig returns the widget configuration

func (*GitHubWidget) Render

func (w *GitHubWidget) Render(img *image.RGBA) error

Render draws the GitHub Actions status widget

func (*GitHubWidget) Stop

func (w *GitHubWidget) Stop()

Stop stops the background polling

func (*GitHubWidget) Type

func (w *GitHubWidget) Type() string

Type returns the widget type

func (*GitHubWidget) UpdateConfig

func (w *GitHubWidget) UpdateConfig(config map[string]interface{}) error

UpdateConfig updates the widget configuration

type GitHubWorkflowRun

type GitHubWorkflowRun struct {
	ID         int64  `json:"id"`
	Name       string `json:"name"`
	Status     string `json:"status"`     // queued, in_progress, completed
	Conclusion string `json:"conclusion"` // success, failure, cancelled, skipped, etc.
	CreatedAt  string `json:"created_at"`
	UpdatedAt  string `json:"updated_at"`
}

GitHubWorkflowRun represents a simplified GitHub Actions workflow run

type GitHubWorkflowRunsResponse

type GitHubWorkflowRunsResponse struct {
	TotalCount   int                 `json:"total_count"`
	WorkflowRuns []GitHubWorkflowRun `json:"workflow_runs"`
}

GitHubWorkflowRunsResponse represents the GitHub API response

type Manager

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

Manager handles overlay widgets and rendering

func NewManager

func NewManager() *Manager

NewManager creates a new overlay manager

func (*Manager) AddWidget

func (m *Manager) AddWidget(widget Widget) error

AddWidget adds a widget to the overlay

func (*Manager) Clear

func (m *Manager) Clear()

Clear removes all widgets

func (*Manager) CreateWidget

func (m *Manager) CreateWidget(widgetType string, id string, config map[string]interface{}) (Widget, error)

CreateWidget creates a new widget instance from configuration

func (*Manager) ExportConfig

func (m *Manager) ExportConfig() []map[string]interface{}

ExportConfig exports all widget configurations

func (*Manager) GetAllWidgets

func (m *Manager) GetAllWidgets() []Widget

GetAllWidgets returns all widgets

func (*Manager) GetAvailableWidgetTypes

func (m *Manager) GetAvailableWidgetTypes() []map[string]interface{}

GetAvailableWidgetTypes returns a list of available widget types

func (*Manager) GetWidget

func (m *Manager) GetWidget(id string) (Widget, bool)

GetWidget retrieves a widget by ID

func (*Manager) IsEnabled

func (m *Manager) IsEnabled() bool

IsEnabled returns whether the overlay is enabled

func (*Manager) LoadFromConfig

func (m *Manager) LoadFromConfig(configs []map[string]interface{}) error

LoadFromConfig loads widget configurations and creates widget instances

func (*Manager) RemoveWidget

func (m *Manager) RemoveWidget(id string) error

RemoveWidget removes a widget from the overlay

func (*Manager) Render

func (m *Manager) Render(img *image.RGBA) error

Render renders all enabled widgets onto the provided image

func (*Manager) SetEnabled

func (m *Manager) SetEnabled(enabled bool)

SetEnabled enables or disables the entire overlay

func (*Manager) UpdateWidget

func (m *Manager) UpdateWidget(id string, config map[string]interface{}) error

UpdateWidget updates a widget's configuration

type TextWidget

type TextWidget struct {
	*BaseWidget
	// contains filtered or unexported fields
}

TextWidget displays text on the overlay

func NewTextWidget

func NewTextWidget(id string, config map[string]interface{}) (*TextWidget, error)

NewTextWidget creates a new text widget

func (*TextWidget) GetConfig

func (w *TextWidget) GetConfig() map[string]interface{}

GetConfig returns the widget configuration

func (*TextWidget) GetText

func (w *TextWidget) GetText() string

GetText returns the current text

func (*TextWidget) Render

func (w *TextWidget) Render(img *image.RGBA) error

Render draws the text widget

func (*TextWidget) SetBackground

func (w *TextWidget) SetBackground(c *color.RGBA)

SetBackground sets the background color (nil for transparent)

func (*TextWidget) SetColor

func (w *TextWidget) SetColor(c color.RGBA)

SetColor sets the text color

func (*TextWidget) SetText

func (w *TextWidget) SetText(text string)

SetText updates the text content

func (*TextWidget) Type

func (w *TextWidget) Type() string

Type returns the widget type

func (*TextWidget) UpdateConfig

func (w *TextWidget) UpdateConfig(config map[string]interface{}) error

UpdateConfig updates the widget configuration

func (*TextWidget) Validate

func (w *TextWidget) Validate() error

Validate ensures the widget configuration is valid

type Widget

type Widget interface {
	// ID returns the unique identifier for this widget instance
	ID() string

	// Type returns the widget type name
	Type() string

	// Render draws the widget onto the provided image at the configured position
	Render(img *image.RGBA) error

	// GetConfig returns the widget's configuration as a map
	GetConfig() map[string]interface{}

	// UpdateConfig updates the widget's configuration
	UpdateConfig(config map[string]interface{}) error

	// IsEnabled returns whether the widget should be rendered
	IsEnabled() bool

	// SetEnabled sets whether the widget should be rendered
	SetEnabled(enabled bool)
}

Widget represents a renderable overlay widget

Jump to

Keyboard shortcuts

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