damage

package
v0.0.0-...-103704b Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: 0BSD, BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package damage is the X client API for the DAMAGE extension.

Index

Constants

View Source
const (
	MajorVersion = 1
	MinorVersion = 1
)
View Source
const (
	ReportLevelRawRectangles   = 0
	ReportLevelDeltaRectangles = 1
	ReportLevelBoundingBox     = 2
	ReportLevelNonEmpty        = 3
)
View Source
const BadBadDamage = 0

BadBadDamage is the error number for a BadBadDamage.

View Source
const Notify = 0

Notify is the event number for a NotifyEvent.

Variables

This section is empty.

Functions

func BadDamageErrorNew

func BadDamageErrorNew(buf []byte) xgb.Error

BadDamageErrorNew constructs a BadDamageError value that implements xgb.Error from a byte slice.

func Init

func Init(c *xgb.Conn) error

Init must be called before using the DAMAGE extension.

func NotifyEventNew

func NotifyEventNew(buf []byte) xgb.Event

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

Types

type AddCookie

type AddCookie struct {
	*xgb.Cookie
}

AddCookie is a cookie used only for Add requests.

func Add

func Add(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie

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

func AddChecked

func AddChecked(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie

AddChecked sends a checked request. If an error occurs, it can be retrieved using AddCookie.Check.

func (AddCookie) Check

func (cook AddCookie) 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 BadDamageError

type BadDamageError struct {
	Sequence uint16
	NiceName string
}

func (BadDamageError) BadId

func (err BadDamageError) BadId() uint32

BadId returns the 'BadValue' number if one exists for the BadBadDamage error. If no bad value exists, 0 is returned.

func (BadDamageError) Error

func (err BadDamageError) Error() string

func (BadDamageError) SequenceId

func (err BadDamageError) SequenceId() uint16

SequenceId returns the sequence id attached to the BadBadDamage error. This is mostly used internally.

type CreateCookie

type CreateCookie struct {
	*xgb.Cookie
}

CreateCookie is a cookie used only for Create requests.

func Create

func Create(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) CreateCookie

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

func CreateChecked

func CreateChecked(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) CreateCookie

CreateChecked sends a checked request. If an error occurs, it can be retrieved using CreateCookie.Check.

func (CreateCookie) Check

func (cook CreateCookie) 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 Damage

type Damage uint32

func NewDamageId

func NewDamageId(c *xgb.Conn) (Damage, error)

type DestroyCookie

type DestroyCookie struct {
	*xgb.Cookie
}

DestroyCookie is a cookie used only for Destroy requests.

func Destroy

func Destroy(c *xgb.Conn, Damage Damage) DestroyCookie

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

func DestroyChecked

func DestroyChecked(c *xgb.Conn, Damage Damage) DestroyCookie

DestroyChecked sends a checked request. If an error occurs, it can be retrieved using DestroyCookie.Check.

func (DestroyCookie) Check

func (cook DestroyCookie) 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 NotifyEvent

type NotifyEvent struct {
	Sequence  uint16
	Level     byte
	Drawable  xproto.Drawable
	Damage    Damage
	Timestamp xproto.Timestamp
	Area      xproto.Rectangle
	Geometry  xproto.Rectangle
}

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 QueryVersionCookie

type QueryVersionCookie struct {
	*xgb.Cookie
}

QueryVersionCookie is a cookie used only for QueryVersion requests.

func QueryVersion

func QueryVersion(c *xgb.Conn, ClientMajorVersion, ClientMinorVersion uint32) 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, ClientMinorVersion uint32) 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
	MajorVersion uint32
	MinorVersion uint32
}

QueryVersionReply represents the data returned from a QueryVersion request.

type SubtractCookie

type SubtractCookie struct {
	*xgb.Cookie
}

SubtractCookie is a cookie used only for Subtract requests.

func Subtract

func Subtract(c *xgb.Conn, Damage Damage, Repair, Parts xfixes.Region) SubtractCookie

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

func SubtractChecked

func SubtractChecked(c *xgb.Conn, Damage Damage, Repair, Parts xfixes.Region) SubtractCookie

SubtractChecked sends a checked request. If an error occurs, it can be retrieved using SubtractCookie.Check.

func (SubtractCookie) Check

func (cook SubtractCookie) 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