x11

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultCursor is the default X11 cursor
	DefaultCursor xproto.Cursor
	// CloseCursor is the window close X11 cursor
	CloseCursor xproto.Cursor
	// ResizeBottomCursor is the bottom only resize X11 cursor
	ResizeBottomCursor xproto.Cursor
	// ResizeBottomLeftCursor is the bottom left resize X11 cursor
	ResizeBottomLeftCursor xproto.Cursor
	// ResizeBottomRightCursor is the bottom right resize X11 cursor
	ResizeBottomRightCursor xproto.Cursor
	// ResizeLeftCursor is the left resize X11 cursor
	ResizeLeftCursor xproto.Cursor
	// ResizeRightCursor is the right resize X11 cursor
	ResizeRightCursor xproto.Cursor
	// ResizeTopLeftCursor is the top left resize X11 cursor
	ResizeTopLeftCursor xproto.Cursor
	// ResizeTopRightCursor is the top right resize X11 cursor
	ResizeTopRightCursor xproto.Cursor
)
View Source
var (
	// AllowedActions is the list of actions the window manager allows
	AllowedActions = []string{
		"_NET_WM_ACTION_MOVE",
		"_NET_WM_ACTION_RESIZE",
		"_NET_WM_ACTION_MINIMIZE",
		"_NET_WM_ACTION_MAXIMIZE_HORZ",
		"_NET_WM_ACTION_MAXIMIZE_VERT",
		"_NET_WM_ACTION_CLOSE",
		"_NET_WM_ACTION_FULLSCREEN",
	}

	// SupportedHints is the complete list of hints that we support
	SupportedHints = append(AllowedActions, "_NET_ACTIVE_WINDOW",
		"_NET_CLIENT_LIST",
		"_NET_CLIENT_LIST_STACKING",
		"_NET_CURRENT_DESKTOP",
		"_NET_DESKTOP_GEOMETRY",
		"_NET_DESKTOP_VIEWPORT",
		"_NET_FRAME_EXTENTS",
		"_NET_MOVERESIZE_WINDOW",
		"_NET_NUMBER_OF_DESKTOPS",
		"_NET_WM_FULL_PLACEMENT",
		"_NET_WM_FULLSCREEN_MONITORS",
		"_NET_WM_MOVERESIZE",
		"_NET_WM_NAME",
		"_NET_WM_STATE",
		"_NET_WM_STATE_FULLSCREEN",
		"_NET_WM_STATE_HIDDEN",
		"_NET_WM_STATE_MAXIMIZED_HORZ",
		"_NET_WM_STATE_MAXIMIZED_VERT",
		"_NET_WM_STATE_SKIP_PAGER",
		"_NET_WM_STATE_SKIP_TASKBAR",
		"_NET_WORKAREA",
		"_NET_SUPPORTED",
	)
)

Functions

func BorderWidth

func BorderWidth(win XWin) uint16

BorderWidth is the number of pixels required for a border

func ButtonWidth

func ButtonWidth(win XWin) uint16

ButtonWidth is the number of pixels required for a border button

func CaptureWindow

func CaptureWindow(conn *xgb.Conn, win xproto.Window) *image.NRGBA

CaptureWindow allows x11 code to get the image representation of a screen area. The window specified will be captured according to its bounds.

func LoadCursors

func LoadCursors(x *xgbutil.XUtil)

LoadCursors sets up the X11 cursors

func TitleHeight

func TitleHeight(win XWin) uint16

TitleHeight is the number of pixels required for a title bar

func WindowActiveGet

func WindowActiveGet(x *xgbutil.XUtil) (xproto.Window, error)

WindowActiveGet returns the currently active window

func WindowExtendedHintsAdd

func WindowExtendedHintsAdd(x *xgbutil.XUtil, win xproto.Window, hint string)

WindowExtendedHintsAdd adds a hint to the window

func WindowExtendedHintsGet

func WindowExtendedHintsGet(x *xgbutil.XUtil, win xproto.Window) []string

WindowExtendedHintsGet returns a hint from the window

func WindowExtendedHintsRemove

func WindowExtendedHintsRemove(x *xgbutil.XUtil, win xproto.Window, hint string)

WindowExtendedHintsRemove removes a hint from the window

func WindowName

func WindowName(x *xgbutil.XUtil, win xproto.Window) string

WindowName gets the name of an X window

func WindowTransientForGet

func WindowTransientForGet(x *xgbutil.XUtil, win xproto.Window) xproto.Window

WindowTransientForGet returns the window ID that the requested window is transient for. A return of 0 means that it is not transient

Types

type WindowStateAction

type WindowStateAction int

WindowStateAction defines actions for manipulating window state

const (
	// WindowStateActionRemove removes a state
	WindowStateActionRemove WindowStateAction = 0
	// WindowStateActionAdd adds a state
	WindowStateActionAdd WindowStateAction = 1
	// WindowStateActionToggle inverts the state of an state
	WindowStateActionToggle WindowStateAction = 2
)

type XWM

type XWM interface {
	fynedesk.WindowManager

	X() *xgbutil.XUtil
	Conn() *xgb.Conn

	RootID() xproto.Window
}

XWM describes the additional elements that an X11 window manager exposes

type XWin

type XWin interface {
	fynedesk.Window

	FrameID() xproto.Window
	ChildID() xproto.Window

	SizeMin() (uint, uint)
	SizeMax() (int, int)
	Geometry() (int, int, uint, uint)

	Expose()
	Refresh()
	SettingsChanged()

	NotifyBorderChange()
	NotifyGeometry(int, int, uint, uint)
	NotifyMoveResizeEnded()

	NotifyMaximize()
	NotifyUnMaximize()
	NotifyFullscreen()
	NotifyUnFullscreen()
	NotifyIconify()
	NotifyUnIconify()

	NotifyMouseDrag(int16, int16)
	NotifyMouseMotion(int16, int16)
	NotifyMousePress(int16, int16, xproto.Button)
	NotifyMouseRelease(int16, int16, xproto.Button)

	QueueMoveResizeGeometry(int, int, uint, uint)
}

XWin describes the additional functions that X windows need to expose to be managed

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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