...

Package damage

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

Overview ▾

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

Index ▾

Constants
func BadDamageErrorNew(buf []byte) xgb.Error
func Init(c *xgb.Conn) error
func NotifyEventNew(buf []byte) xgb.Event
type AddCookie
    func Add(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie
    func AddChecked(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie
    func (cook AddCookie) Check() error
type BadDamageError
    func (err BadDamageError) BadId() uint32
    func (err BadDamageError) Error() string
    func (err BadDamageError) SequenceId() uint16
type CreateCookie
    func Create(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) CreateCookie
    func CreateChecked(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) CreateCookie
    func (cook CreateCookie) Check() error
type Damage
    func NewDamageId(c *xgb.Conn) (Damage, error)
type DestroyCookie
    func Destroy(c *xgb.Conn, Damage Damage) DestroyCookie
    func DestroyChecked(c *xgb.Conn, Damage Damage) DestroyCookie
    func (cook DestroyCookie) Check() error
type NotifyEvent
    func (v NotifyEvent) Bytes() []byte
    func (v NotifyEvent) SequenceId() uint16
    func (v NotifyEvent) String() string
type QueryVersionCookie
    func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie
    func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie
    func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error)
type QueryVersionReply
type SubtractCookie
    func Subtract(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Region) SubtractCookie
    func SubtractChecked(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Region) SubtractCookie
    func (cook SubtractCookie) Check() error

Package files

damage.go

Constants

const (
    ReportLevelRawRectangles   = 0
    ReportLevelDeltaRectangles = 1
    ReportLevelBoundingBox     = 2
    ReportLevelNonEmpty        = 3
)

BadBadDamage is the error number for a BadBadDamage.

const BadBadDamage = 0

Notify is the event number for a NotifyEvent.

const Notify = 0

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.

type AddCookie

AddCookie is a cookie used only for Add requests.

type AddCookie struct {
    *xgb.Cookie
}

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

CreateCookie is a cookie used only for Create requests.

type CreateCookie struct {
    *xgb.Cookie
}

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

DestroyCookie is a cookie used only for Destroy requests.

type DestroyCookie struct {
    *xgb.Cookie
}

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

QueryVersionCookie is a cookie used only for QueryVersion requests.

type QueryVersionCookie struct {
    *xgb.Cookie
}

func QueryVersion

func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, 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 uint32, 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

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
    MajorVersion uint32
    MinorVersion uint32
}

type SubtractCookie

SubtractCookie is a cookie used only for Subtract requests.

type SubtractCookie struct {
    *xgb.Cookie
}

func Subtract

func Subtract(c *xgb.Conn, Damage Damage, Repair xfixes.Region, 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 xfixes.Region, 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.