store

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Original uint8 = 1 // Flag to restore original info
	Cached   uint8 = 2 // Flag to restore cached info
	Latest   uint8 = 3 // Flag to restore latest info
)
View Source
const (
	Stacked uint8 = 1 // Flag for stacked (all) clients
	Visible uint8 = 2 // Flag for visible (top) clients
)

Variables

View Source
var (
	X              *xgbutil.XUtil  // X connection object
	DeskCount      uint            // Number of desktops
	ScreenCount    uint            // Number of screens
	CurrentDesk    uint            // Current desktop number
	CurrentScreen  uint            // Current screen number
	CurrentPointer *common.Pointer // Pointer position
	ActiveWindow   xproto.Window   // Current active window
	Windows        []xproto.Window // List of client windows
	Displays       Heads           // Physical connected displays
	Corners        []*Corner       // Corners for pointer events
)

Functions

func ActiveWindowGet

func ActiveWindowGet(X *xgbutil.XUtil) xproto.Window

func ClientListStackingGet

func ClientListStackingGet(X *xgbutil.XUtil) []xproto.Window

func Connected

func Connected() bool

func CurrentDesktopGet

func CurrentDesktopGet(X *xgbutil.XUtil) uint

func DesktopDimensions

func DesktopDimensions(screenNum uint) (x, y, w, h int)

func GetScreenNum

func GetScreenNum(geom xrect.Rect) uint

func InitRoot

func InitRoot()

func IsIgnored

func IsIgnored(info *Info) bool

func IsMaximized

func IsMaximized(w xproto.Window) bool

func IsSpecial

func IsSpecial(info *Info) bool

func NumberOfDesktopsGet

func NumberOfDesktopsGet(X *xgbutil.XUtil) uint

func OnPointerUpdate

func OnPointerUpdate(fun func(uint16))

func OnStateUpdate

func OnStateUpdate(fun func(string))

func PointerGet

func PointerGet(X *xgbutil.XUtil) *common.Pointer

func PointerUpdate

func PointerUpdate(X *xgbutil.XUtil) *common.Pointer

func ScreenNumGet

func ScreenNumGet(p *common.Pointer) uint

func StateUpdate

func StateUpdate(X *xgbutil.XUtil, e xevent.PropertyNotifyEvent)

Types

type Client

type Client struct {
	Win      *xwindow.Window `json:"-"` // X window object
	Created  time.Time       // Internal client creation time
	Locked   bool            // Internal client move/resize lock
	Original *Info           // Original client window information
	Cached   *Info           // Cached client window information
	Latest   *Info           // Latest client window information
}

func CreateClient

func CreateClient(w xproto.Window) *Client

func (*Client) Activate

func (c *Client) Activate()

func (*Client) Cache

func (c *Client) Cache() common.Cache[*Info]

func (*Client) LimitDimensions

func (c *Client) LimitDimensions(w, h int)

func (*Client) Lock

func (c *Client) Lock()

func (*Client) MoveResize

func (c *Client) MoveResize(x, y, w, h int)

func (*Client) OuterGeometry

func (c *Client) OuterGeometry() (x, y, w, h int)

func (*Client) Read

func (c *Client) Read() *Info

func (*Client) Restore

func (c *Client) Restore(flag uint8)

func (*Client) UnDecorate

func (c *Client) UnDecorate()

func (*Client) UnLock

func (c *Client) UnLock()

func (*Client) UnMaximize

func (c *Client) UnMaximize()

func (*Client) Update

func (c *Client) Update()

func (*Client) Write

func (c *Client) Write()

type Clients

type Clients struct {
	Items      []*Client `json:"-"` // List of stored window clients
	MaxAllowed int       // Currently maximum allowed clients
}

type Corner

type Corner struct {
	Name      string     // Corner name used in config
	Active    bool       // Mouse pointer is in this corner
	ScreenNum uint       // Screen number the corner is located
	Area      xrect.Rect // Rectangle area of the corner section
}

func CreateCorner

func CreateCorner(name string, screenNum uint, x int, y int, w int, h int) *Corner

func CreateCorners

func CreateCorners() []*Corner

func (*Corner) IsActive

func (c *Corner) IsActive(p *common.Pointer) bool

type Dimensions

type Dimensions struct {
	Geometry   Geometry          // Client window geometry
	Hints      Hints             // Client window dimension hints
	Extents    ewmh.FrameExtents // Client window geometry extents
	AdjPos     bool              // Position adjustments on move/resize
	AdjSize    bool              // Size adjustments on move/resize
	AdjRestore bool              // Disable adjustments on restore
}

type Directions

type Directions struct {
	Top    bool // Indicates proportion changes on the top
	Right  bool // Indicates proportion changes on the right
	Bottom bool // Indicates proportion changes on the bottom
	Left   bool // Indicates proportion changes on the left
}

type Geometry

type Geometry struct {
	xrect.Rect `json:"-"` // Client window geometry functions
	X          int        // Client window geometry x position
	Y          int        // Client window geometry y position
	Width      int        // Client window geometry width dimension
	Height     int        // Client window geometry height dimension
}
type Head struct {
	Id         uint32 // Head output id (display id)
	Name       string // Head output name (display name)
	Primary    bool   // Head primary flag (primary display)
	xrect.Rect        // Head dimensions (x/y/width/height)
}

func PhysicalHeadsGet

func PhysicalHeadsGet(X *xgbutil.XUtil) []Head

type Heads

type Heads struct {
	Name     string // Unique heads name (display summary)
	Screens  []Head // Screen dimensions (full display size)
	Desktops []Head // Desktop dimensions (desktop without panels)
}

func DisplaysGet

func DisplaysGet(X *xgbutil.XUtil) Heads

type Hints

type Hints struct {
	Normal icccm.NormalHints // Client window geometry hints
	Motif  motif.Hints       // Client window decoration hints
}

type Info

type Info struct {
	Class      string     // Client window application name
	Name       string     // Client window title name
	Types      []string   // Client window types
	States     []string   // Client window states
	Location   Location   // Client window location
	Dimensions Dimensions // Client window dimensions
}

func GetInfo

func GetInfo(w xproto.Window) *Info

type Location

type Location struct {
	DeskNum   uint // Client workspace desktop number
	ScreenNum uint // Client workspace screen number
}

type Manager

type Manager struct {
	Name        string       // Manager name with window clients
	Location    *Location    // Manager workspace and screen location
	Proportions *Proportions // Manager proportions of window clients
	Masters     *Clients     // List of master window clients
	Slaves      *Clients     // List of slave window clients
}

func CreateManager

func CreateManager(loc Location) *Manager

func (*Manager) AddClient

func (mg *Manager) AddClient(c *Client)

func (*Manager) Clients

func (mg *Manager) Clients(flag uint8) []*Client

func (*Manager) DecreaseMaster

func (mg *Manager) DecreaseMaster()

func (*Manager) DecreaseProportion

func (mg *Manager) DecreaseProportion()

func (*Manager) DecreaseSlave

func (mg *Manager) DecreaseSlave()

func (*Manager) IncreaseMaster

func (mg *Manager) IncreaseMaster()

func (*Manager) IncreaseProportion

func (mg *Manager) IncreaseProportion()

func (*Manager) IncreaseSlave

func (mg *Manager) IncreaseSlave()

func (*Manager) Index

func (mg *Manager) Index(windows *Clients, c *Client) int

func (*Manager) IsMaster

func (mg *Manager) IsMaster(c *Client) bool

func (*Manager) IsSlave

func (mg *Manager) IsSlave(c *Client) bool

func (*Manager) MakeMaster

func (mg *Manager) MakeMaster(c *Client)

func (*Manager) NextClient

func (mg *Manager) NextClient() *Client

func (*Manager) Ordered

func (mg *Manager) Ordered(windows *Clients) []*Client

func (*Manager) PreviousClient

func (mg *Manager) PreviousClient() *Client

func (*Manager) RemoveClient

func (mg *Manager) RemoveClient(c *Client)

func (*Manager) SetProportions

func (mg *Manager) SetProportions(ps []float64, pi float64, i int, j int) bool

func (*Manager) SwapClient

func (mg *Manager) SwapClient(c1 *Client, c2 *Client)

func (*Manager) Visible

func (mg *Manager) Visible(windows *Clients) []*Client

type Proportions

type Proportions struct {
	MasterSlave  map[int][]float64 // Master-slave proportions
	MasterMaster map[int][]float64 // Master-master proportions
	SlaveSlave   map[int][]float64 // Slave-slave proportions
}

Jump to

Keyboard shortcuts

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