ctl

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package ctl implements the main controller used for all of the available resetting schemes (e.g. multi, wall.)

Index

Constants

View Source
const (
	HookReset int = iota
	HookAltRes
	HookNormalRes
	HookFocusLost
	HookFocusGained
)

Hook types

Variables

This section is empty.

Functions

func Run

func Run(conf *cfg.Profile) error

Run creates a new controller with the given configuration profile and runs it.

Types

type Controller

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

Controller manages all of the components necessary for resetti to run and handles communication between them.

func (*Controller) FocusInstance

func (c *Controller) FocusInstance()

FocusInstance switches focus to the given instance.

func (*Controller) ResetInstance

func (c *Controller) ResetInstance() bool

ResetInstance attempts to reset the given instance and returns whether or not the reset was successful.

func (*Controller) RunHook

func (c *Controller) RunHook(hook int, hookId int)

RunHook runs the hook of the given type if it exists.

func (*Controller) ToggleResolution

func (c *Controller) ToggleResolution(resId int)

ToggleResolution switches the given instance between the normal (play) resolution and the given alternate resolution.

type Frontend

type Frontend interface {
	// Input processes a single user input.
	Input(Input)

	// Setup takes in all of the potentially needed dependencies and prepares
	// the Frontend to handle user input.
	Setup(frontendDependencies) error

	// ProcessEvent processes a miscellanous event from the X server.
	ProcessEvent(x11.Event)
}

A Frontend handles user-facing I/O (input handling, instance actions, OBS output) and communicates with a Controller.

type Input

type Input struct {
	Bind cfg.Bind
	Held bool
	X, Y int
}

An Input represents a single user input.

type Single added in v0.7.0

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

Single implements a traditional Single-instance interface with extra support for resolution binds and hooks.

func (*Single) Input added in v0.7.0

func (m *Single) Input(input Input)

Input implements Frontend.

func (*Single) ProcessEvent added in v0.7.0

func (m *Single) ProcessEvent(evt x11.Event)

ProcessEvent implements Frontend.

func (*Single) Setup added in v0.7.0

func (m *Single) Setup(deps frontendDependencies) error

Setup implements Frontend.

Jump to

Keyboard shortcuts

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