screensaver

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: BSD-3-Clause, GooglePatentClause Imports: 2 Imported by: 3

Documentation

Overview

Package screensaver is the X client API for the MIT-SCREEN-SAVER extension.

Index

Constants

View Source
const (
	EventNotifyMask = 1
	EventCycleMask  = 2
)
View Source
const (
	KindBlanked  = 0
	KindInternal = 1
	KindExternal = 2
)
View Source
const (
	StateOff      = 0
	StateOn       = 1
	StateCycle    = 2
	StateDisabled = 3
)
View Source
const Notify = 0

Notify is the event number for a NotifyEvent.

Variables

This section is empty.

Functions

func Init

func Init(c *xgb.Conn) error

Init must be called before using the MIT-SCREEN-SAVER extension.

func NotifyEventNew

func NotifyEventNew(buf []byte) xgb.Event

NotifyEventNew constructs a NotifyEvent value that implements xgb.Event from a byte slice.

Types

type NotifyEvent

type NotifyEvent struct {
	Sequence uint16
	State    byte
	Time     xproto.Timestamp
	Root     xproto.Window
	Window   xproto.Window
	Kind     byte
	Forced   bool
}

func (NotifyEvent) Bytes

func (v NotifyEvent) Bytes() []byte

Bytes writes a NotifyEvent value to a byte slice.

func (NotifyEvent) SequenceId

func (v NotifyEvent) SequenceId() uint16

SequenceId returns the sequence id attached to the Notify event. Events without a sequence number (KeymapNotify) return 0. This is mostly used internally.

func (NotifyEvent) String

func (v NotifyEvent) String() string

String is a rudimentary string representation of NotifyEvent.

type QueryInfoCookie

type QueryInfoCookie struct {
	*xgb.Cookie
}

QueryInfoCookie is a cookie used only for QueryInfo requests.

func QueryInfo

func QueryInfo(c *xgb.Conn, Drawable xproto.Drawable) QueryInfoCookie

QueryInfo sends a checked request. If an error occurs, it will be returned with the reply by calling QueryInfoCookie.Reply()

func QueryInfoUnchecked

func QueryInfoUnchecked(c *xgb.Conn, Drawable xproto.Drawable) QueryInfoCookie

QueryInfoUnchecked sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func (QueryInfoCookie) Reply

func (cook QueryInfoCookie) Reply() (*QueryInfoReply, error)

Reply blocks and returns the reply data for a QueryInfo request.

type QueryInfoReply

type QueryInfoReply struct {
	Sequence         uint16 // sequence number of the request for this reply
	Length           uint32 // number of bytes in this reply
	State            byte
	SaverWindow      xproto.Window
	MsUntilServer    uint32
	MsSinceUserInput uint32
	EventMask        uint32
	Kind             byte
}

QueryInfoReply represents the data returned from a QueryInfo request.

type QueryVersionCookie

type QueryVersionCookie struct {
	*xgb.Cookie
}

QueryVersionCookie is a cookie used only for QueryVersion requests.

func QueryVersion

func QueryVersion(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie

QueryVersion sends a checked request. If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()

func QueryVersionUnchecked

func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie

QueryVersionUnchecked sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func (QueryVersionCookie) Reply

func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error)

Reply blocks and returns the reply data for a QueryVersion request.

type QueryVersionReply

type QueryVersionReply struct {
	Sequence uint16 // sequence number of the request for this reply
	Length   uint32 // number of bytes in this reply
	// padding: 1 bytes
	ServerMajorVersion uint16
	ServerMinorVersion uint16
}

QueryVersionReply represents the data returned from a QueryVersion request.

type SelectInputCookie

type SelectInputCookie struct {
	*xgb.Cookie
}

SelectInputCookie is a cookie used only for SelectInput requests.

func SelectInput

func SelectInput(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) SelectInputCookie

SelectInput sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func SelectInputChecked

func SelectInputChecked(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) SelectInputCookie

SelectInputChecked sends a checked request. If an error occurs, it can be retrieved using SelectInputCookie.Check()

func (SelectInputCookie) Check

func (cook SelectInputCookie) Check() error

Check returns an error if one occurred for checked requests that are not expecting a reply. This cannot be called for requests expecting a reply, nor for unchecked requests.

type SetAttributesCookie

type SetAttributesCookie struct {
	*xgb.Cookie
}

SetAttributesCookie is a cookie used only for SetAttributes requests.

func SetAttributes

func SetAttributes(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual xproto.Visualid, ValueMask uint32, ValueList []uint32) SetAttributesCookie

SetAttributes sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func SetAttributesChecked

func SetAttributesChecked(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual xproto.Visualid, ValueMask uint32, ValueList []uint32) SetAttributesCookie

SetAttributesChecked sends a checked request. If an error occurs, it can be retrieved using SetAttributesCookie.Check()

func (SetAttributesCookie) Check

func (cook SetAttributesCookie) Check() error

Check returns an error if one occurred for checked requests that are not expecting a reply. This cannot be called for requests expecting a reply, nor for unchecked requests.

type SuspendCookie

type SuspendCookie struct {
	*xgb.Cookie
}

SuspendCookie is a cookie used only for Suspend requests.

func Suspend

func Suspend(c *xgb.Conn, Suspend uint32) SuspendCookie

Suspend sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func SuspendChecked

func SuspendChecked(c *xgb.Conn, Suspend uint32) SuspendCookie

SuspendChecked sends a checked request. If an error occurs, it can be retrieved using SuspendCookie.Check()

func (SuspendCookie) Check

func (cook SuspendCookie) Check() error

Check returns an error if one occurred for checked requests that are not expecting a reply. This cannot be called for requests expecting a reply, nor for unchecked requests.

type UnsetAttributesCookie

type UnsetAttributesCookie struct {
	*xgb.Cookie
}

UnsetAttributesCookie is a cookie used only for UnsetAttributes requests.

func UnsetAttributes

func UnsetAttributes(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie

UnsetAttributes sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func UnsetAttributesChecked

func UnsetAttributesChecked(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie

UnsetAttributesChecked sends a checked request. If an error occurs, it can be retrieved using UnsetAttributesCookie.Check()

func (UnsetAttributesCookie) Check

func (cook UnsetAttributesCookie) Check() error

Check returns an error if one occurred for checked requests that are not expecting a reply. This cannot be called for requests expecting a reply, nor for unchecked requests.

Jump to

Keyboard shortcuts

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