...

Package screensaver

import "github.com/jezek/xgb/screensaver"
Overview
Index

Overview ▾

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

Index ▾

Constants
func Init(c *xgb.Conn) error
func NotifyEventNew(buf []byte) xgb.Event
type NotifyEvent
    func (v NotifyEvent) Bytes() []byte
    func (v NotifyEvent) SequenceId() uint16
    func (v NotifyEvent) String() string
type QueryInfoCookie
    func QueryInfo(c *xgb.Conn, Drawable xproto.Drawable) QueryInfoCookie
    func QueryInfoUnchecked(c *xgb.Conn, Drawable xproto.Drawable) QueryInfoCookie
    func (cook QueryInfoCookie) Reply() (*QueryInfoReply, error)
type QueryInfoReply
type QueryVersionCookie
    func QueryVersion(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie
    func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie
    func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error)
type QueryVersionReply
type SelectInputCookie
    func SelectInput(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) SelectInputCookie
    func SelectInputChecked(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) SelectInputCookie
    func (cook SelectInputCookie) Check() error
type SetAttributesCookie
    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
    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
    func (cook SetAttributesCookie) Check() error
type SuspendCookie
    func Suspend(c *xgb.Conn, Suspend bool) SuspendCookie
    func SuspendChecked(c *xgb.Conn, Suspend bool) SuspendCookie
    func (cook SuspendCookie) Check() error
type UnsetAttributesCookie
    func UnsetAttributes(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie
    func UnsetAttributesChecked(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie
    func (cook UnsetAttributesCookie) Check() error

Package files

screensaver.go

Constants

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

Notify is the event number for a NotifyEvent.

const Notify = 0

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.

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

QueryInfoCookie is a cookie used only for QueryInfo requests.

type QueryInfoCookie struct {
    *xgb.Cookie
}

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

QueryInfoReply represents the data returned from a QueryInfo request.

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
}

type QueryVersionCookie

QueryVersionCookie is a cookie used only for QueryVersion requests.

type QueryVersionCookie struct {
    *xgb.Cookie
}

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

QueryVersionReply represents the data returned from a QueryVersion request.

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
}

type SelectInputCookie

SelectInputCookie is a cookie used only for SelectInput requests.

type SelectInputCookie struct {
    *xgb.Cookie
}

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

SetAttributesCookie is a cookie used only for SetAttributes requests.

type SetAttributesCookie struct {
    *xgb.Cookie
}

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

SuspendCookie is a cookie used only for Suspend requests.

type SuspendCookie struct {
    *xgb.Cookie
}

func Suspend

func Suspend(c *xgb.Conn, Suspend bool) 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 bool) 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

UnsetAttributesCookie is a cookie used only for UnsetAttributes requests.

type UnsetAttributesCookie struct {
    *xgb.Cookie
}

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.