actions

package
v0.0.0-...-2dd5c5f Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MoveLeft

func MoveLeft(activeConfig ActiveConfig)

func MoveRight

func MoveRight(activeConfig ActiveConfig)

func ToNextGrid

func ToNextGrid(activeConfig ActiveConfig)

func ToPreviousGrid

func ToPreviousGrid(activeConfig ActiveConfig)

Types

type ActionHandler

type ActionHandler func(activeConfig ActiveConfig)

ActionHandler defines the handler functions an actions must comply with

type ActiveConfig

type ActiveConfig interface {
	Grid() *Grid
	GridIndex() int
	OnPreviousGrid()
	OnNextGrid()
}

ActiveConfig defines the currently active configuration along with additional data like row or column span

type Grid

type Grid struct {
	Name    string
	Columns []int
	Rows    []int
	Presets []Presets
}

Grid defines a basic grid on the screen at which windows can be snapped to

func (*Grid) Validate

func (grid *Grid) Validate() (err error)

Validate determines if the grid object is setup correctly

type Presets

type Presets struct {
	Executable string
	Span       *Span
}

Presets defines values for windows which are set as defaults

type SnapActions

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

SnapActions defines a set of actions for snaping windows to a grid, this structure is NOT usable without initialization

func NewSnapActions

func NewSnapActions() *SnapActions

NewSnapActions creates a new initialized snap actions structure

func (*SnapActions) SpanHorizontal

func (snapActions *SnapActions) SpanHorizontal(increase bool) ActionHandler

SpanHorizontal increases/decrease the horizontal span of grid tiles of the target window

func (*SnapActions) SpanVertical

func (snapActions *SnapActions) SpanVertical(increase bool) ActionHandler

SpanVertical increases/decrease the vertical span of grid tiles of the target window

func (*SnapActions) ToBottom

func (snapActions *SnapActions) ToBottom() ActionHandler

ToBottom returns the action handler for snapping to the next grid line on the top

func (*SnapActions) ToLeft

func (snapActions *SnapActions) ToLeft() ActionHandler

ToLeft returns the action handler for snapping to the next grid line on the left

func (*SnapActions) ToRight

func (snapActions *SnapActions) ToRight() ActionHandler

ToRight returns the action handler for snapping to the next grid line on the right

func (*SnapActions) ToTop

func (snapActions *SnapActions) ToTop() ActionHandler

ToTop returns the action handler for snapping to the next grid line on the top

type Span

type Span struct {
	Columns int
	Rows    int
}

Span defines the amount of grid tiles the window should span over

type TargetWindow

type TargetWindow interface {
	Hwnd() winapi.Hwnd
	Size() *winapi.Rect
	DesktopSize() *winapi.Rect
	Delta() (deltaH int, deltaV int)
	Move(left int, top int, width int, height int)
}

TargetWindow provides data and functions specific to the window along with aditional general informations like size of the desktop

func GetTarget

func GetTarget() TargetWindow

GetTarget will retrieve the currently focus window

Jump to

Keyboard shortcuts

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