Package res

import "github.com/BurntSushi/xgb/res"
Overview
Index

Overview ▾

Package res is the X client API for the X-Resource extension.

Index ▾

Constants
func ClientIdSpecListBytes(buf []byte, list []ClientIdSpec) int
func ClientIdSpecRead(buf []byte, v *ClientIdSpec) int
func ClientIdSpecReadList(buf []byte, dest []ClientIdSpec) int
func ClientIdValueListBytes(buf []byte, list []ClientIdValue) int
func ClientIdValueListSize(list []ClientIdValue) int
func ClientIdValueRead(buf []byte, v *ClientIdValue) int
func ClientIdValueReadList(buf []byte, dest []ClientIdValue) int
func ClientListBytes(buf []byte, list []Client) int
func ClientRead(buf []byte, v *Client) int
func ClientReadList(buf []byte, dest []Client) int
func Init(c *xgb.Conn) error
func ResourceIdSpecListBytes(buf []byte, list []ResourceIdSpec) int
func ResourceIdSpecRead(buf []byte, v *ResourceIdSpec) int
func ResourceIdSpecReadList(buf []byte, dest []ResourceIdSpec) int
func ResourceSizeSpecListBytes(buf []byte, list []ResourceSizeSpec) int
func ResourceSizeSpecRead(buf []byte, v *ResourceSizeSpec) int
func ResourceSizeSpecReadList(buf []byte, dest []ResourceSizeSpec) int
func ResourceSizeValueListBytes(buf []byte, list []ResourceSizeValue) int
func ResourceSizeValueListSize(list []ResourceSizeValue) int
func ResourceSizeValueRead(buf []byte, v *ResourceSizeValue) int
func ResourceSizeValueReadList(buf []byte, dest []ResourceSizeValue) int
func TypeListBytes(buf []byte, list []Type) int
func TypeRead(buf []byte, v *Type) int
func TypeReadList(buf []byte, dest []Type) int
type Client
    func (v Client) Bytes() []byte
type ClientIdSpec
    func (v ClientIdSpec) Bytes() []byte
type ClientIdValue
    func (v ClientIdValue) Bytes() []byte
type QueryClientIdsCookie
    func QueryClientIds(c *xgb.Conn, NumSpecs uint32, Specs []ClientIdSpec) QueryClientIdsCookie
    func QueryClientIdsUnchecked(c *xgb.Conn, NumSpecs uint32, Specs []ClientIdSpec) QueryClientIdsCookie
    func (cook QueryClientIdsCookie) Reply() (*QueryClientIdsReply, error)
type QueryClientIdsReply
type QueryClientPixmapBytesCookie
    func QueryClientPixmapBytes(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie
    func QueryClientPixmapBytesUnchecked(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie
    func (cook QueryClientPixmapBytesCookie) Reply() (*QueryClientPixmapBytesReply, error)
type QueryClientPixmapBytesReply
type QueryClientResourcesCookie
    func QueryClientResources(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie
    func QueryClientResourcesUnchecked(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie
    func (cook QueryClientResourcesCookie) Reply() (*QueryClientResourcesReply, error)
type QueryClientResourcesReply
type QueryClientsCookie
    func QueryClients(c *xgb.Conn) QueryClientsCookie
    func QueryClientsUnchecked(c *xgb.Conn) QueryClientsCookie
    func (cook QueryClientsCookie) Reply() (*QueryClientsReply, error)
type QueryClientsReply
type QueryResourceBytesCookie
    func QueryResourceBytes(c *xgb.Conn, Client uint32, NumSpecs uint32, Specs []ResourceIdSpec) QueryResourceBytesCookie
    func QueryResourceBytesUnchecked(c *xgb.Conn, Client uint32, NumSpecs uint32, Specs []ResourceIdSpec) QueryResourceBytesCookie
    func (cook QueryResourceBytesCookie) Reply() (*QueryResourceBytesReply, error)
type QueryResourceBytesReply
type QueryVersionCookie
    func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie
    func QueryVersionUnchecked(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie
    func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error)
type QueryVersionReply
type ResourceIdSpec
    func (v ResourceIdSpec) Bytes() []byte
type ResourceSizeSpec
    func (v ResourceSizeSpec) Bytes() []byte
type ResourceSizeValue
    func (v ResourceSizeValue) Bytes() []byte
type Type
    func (v Type) Bytes() []byte

Package files

res.go

Constants

const (
    ClientIdMaskClientXID      = 1
    ClientIdMaskLocalClientPID = 2
)

func ClientIdSpecListBytes

func ClientIdSpecListBytes(buf []byte, list []ClientIdSpec) int

ClientIdSpecListBytes writes a list of ClientIdSpec values to a byte slice.

func ClientIdSpecRead

func ClientIdSpecRead(buf []byte, v *ClientIdSpec) int

ClientIdSpecRead reads a byte slice into a ClientIdSpec value.

func ClientIdSpecReadList

func ClientIdSpecReadList(buf []byte, dest []ClientIdSpec) int

ClientIdSpecReadList reads a byte slice into a list of ClientIdSpec values.

func ClientIdValueListBytes

func ClientIdValueListBytes(buf []byte, list []ClientIdValue) int

ClientIdValueListBytes writes a list of ClientIdValue values to a byte slice.

func ClientIdValueListSize

func ClientIdValueListSize(list []ClientIdValue) int

ClientIdValueListSize computes the size (bytes) of a list of ClientIdValue values.

func ClientIdValueRead

func ClientIdValueRead(buf []byte, v *ClientIdValue) int

ClientIdValueRead reads a byte slice into a ClientIdValue value.

func ClientIdValueReadList

func ClientIdValueReadList(buf []byte, dest []ClientIdValue) int

ClientIdValueReadList reads a byte slice into a list of ClientIdValue values.

func ClientListBytes

func ClientListBytes(buf []byte, list []Client) int

ClientListBytes writes a list of Client values to a byte slice.

func ClientRead

func ClientRead(buf []byte, v *Client) int

ClientRead reads a byte slice into a Client value.

func ClientReadList

func ClientReadList(buf []byte, dest []Client) int

ClientReadList reads a byte slice into a list of Client values.

func Init

func Init(c *xgb.Conn) error

Init must be called before using the X-Resource extension.

func ResourceIdSpecListBytes

func ResourceIdSpecListBytes(buf []byte, list []ResourceIdSpec) int

ResourceIdSpecListBytes writes a list of ResourceIdSpec values to a byte slice.

func ResourceIdSpecRead

func ResourceIdSpecRead(buf []byte, v *ResourceIdSpec) int

ResourceIdSpecRead reads a byte slice into a ResourceIdSpec value.

func ResourceIdSpecReadList

func ResourceIdSpecReadList(buf []byte, dest []ResourceIdSpec) int

ResourceIdSpecReadList reads a byte slice into a list of ResourceIdSpec values.

func ResourceSizeSpecListBytes

func ResourceSizeSpecListBytes(buf []byte, list []ResourceSizeSpec) int

ResourceSizeSpecListBytes writes a list of ResourceSizeSpec values to a byte slice.

func ResourceSizeSpecRead

func ResourceSizeSpecRead(buf []byte, v *ResourceSizeSpec) int

ResourceSizeSpecRead reads a byte slice into a ResourceSizeSpec value.

func ResourceSizeSpecReadList

func ResourceSizeSpecReadList(buf []byte, dest []ResourceSizeSpec) int

ResourceSizeSpecReadList reads a byte slice into a list of ResourceSizeSpec values.

func ResourceSizeValueListBytes

func ResourceSizeValueListBytes(buf []byte, list []ResourceSizeValue) int

ResourceSizeValueListBytes writes a list of ResourceSizeValue values to a byte slice.

func ResourceSizeValueListSize

func ResourceSizeValueListSize(list []ResourceSizeValue) int

ResourceSizeValueListSize computes the size (bytes) of a list of ResourceSizeValue values.

func ResourceSizeValueRead

func ResourceSizeValueRead(buf []byte, v *ResourceSizeValue) int

ResourceSizeValueRead reads a byte slice into a ResourceSizeValue value.

func ResourceSizeValueReadList

func ResourceSizeValueReadList(buf []byte, dest []ResourceSizeValue) int

ResourceSizeValueReadList reads a byte slice into a list of ResourceSizeValue values.

func TypeListBytes

func TypeListBytes(buf []byte, list []Type) int

TypeListBytes writes a list of Type values to a byte slice.

func TypeRead

func TypeRead(buf []byte, v *Type) int

TypeRead reads a byte slice into a Type value.

func TypeReadList

func TypeReadList(buf []byte, dest []Type) int

TypeReadList reads a byte slice into a list of Type values.

type Client

type Client struct {
    ResourceBase uint32
    ResourceMask uint32
}

func (Client) Bytes

func (v Client) Bytes() []byte

Bytes writes a Client value to a byte slice.

type ClientIdSpec

type ClientIdSpec struct {
    Client uint32
    Mask   uint32
}

func (ClientIdSpec) Bytes

func (v ClientIdSpec) Bytes() []byte

Bytes writes a ClientIdSpec value to a byte slice.

type ClientIdValue

type ClientIdValue struct {
    Spec   ClientIdSpec
    Length uint32
    Value  []uint32 // size: xgb.Pad((int(Length) * 4))
}

func (ClientIdValue) Bytes

func (v ClientIdValue) Bytes() []byte

Bytes writes a ClientIdValue value to a byte slice.

type QueryClientIdsCookie

type QueryClientIdsCookie struct {
    *xgb.Cookie
}

QueryClientIdsCookie is a cookie used only for QueryClientIds requests.

func QueryClientIds

func QueryClientIds(c *xgb.Conn, NumSpecs uint32, Specs []ClientIdSpec) QueryClientIdsCookie

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

func QueryClientIdsUnchecked

func QueryClientIdsUnchecked(c *xgb.Conn, NumSpecs uint32, Specs []ClientIdSpec) QueryClientIdsCookie

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

func (QueryClientIdsCookie) Reply

func (cook QueryClientIdsCookie) Reply() (*QueryClientIdsReply, error)

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

type QueryClientIdsReply

type QueryClientIdsReply struct {
    Sequence uint16 // sequence number of the request for this reply
    Length   uint32 // number of bytes in this reply
    // padding: 1 bytes
    NumIds uint32
    // padding: 20 bytes
    Ids []ClientIdValue // size: ClientIdValueListSize(Ids)
}

QueryClientIdsReply represents the data returned from a QueryClientIds request.

type QueryClientPixmapBytesCookie

type QueryClientPixmapBytesCookie struct {
    *xgb.Cookie
}

QueryClientPixmapBytesCookie is a cookie used only for QueryClientPixmapBytes requests.

func QueryClientPixmapBytes

func QueryClientPixmapBytes(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie

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

func QueryClientPixmapBytesUnchecked

func QueryClientPixmapBytesUnchecked(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie

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

func (QueryClientPixmapBytesCookie) Reply

func (cook QueryClientPixmapBytesCookie) Reply() (*QueryClientPixmapBytesReply, error)

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

type QueryClientPixmapBytesReply

type QueryClientPixmapBytesReply struct {
    Sequence uint16 // sequence number of the request for this reply
    Length   uint32 // number of bytes in this reply
    // padding: 1 bytes
    Bytes         uint32
    BytesOverflow uint32
}

QueryClientPixmapBytesReply represents the data returned from a QueryClientPixmapBytes request.

type QueryClientResourcesCookie

type QueryClientResourcesCookie struct {
    *xgb.Cookie
}

QueryClientResourcesCookie is a cookie used only for QueryClientResources requests.

func QueryClientResources

func QueryClientResources(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie

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

func QueryClientResourcesUnchecked

func QueryClientResourcesUnchecked(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie

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

func (QueryClientResourcesCookie) Reply

func (cook QueryClientResourcesCookie) Reply() (*QueryClientResourcesReply, error)

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

type QueryClientResourcesReply

type QueryClientResourcesReply struct {
    Sequence uint16 // sequence number of the request for this reply
    Length   uint32 // number of bytes in this reply
    // padding: 1 bytes
    NumTypes uint32
    // padding: 20 bytes
    Types []Type // size: xgb.Pad((int(NumTypes) * 8))
}

QueryClientResourcesReply represents the data returned from a QueryClientResources request.

type QueryClientsCookie

type QueryClientsCookie struct {
    *xgb.Cookie
}

QueryClientsCookie is a cookie used only for QueryClients requests.

func QueryClients

func QueryClients(c *xgb.Conn) QueryClientsCookie

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

func QueryClientsUnchecked

func QueryClientsUnchecked(c *xgb.Conn) QueryClientsCookie

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

func (QueryClientsCookie) Reply

func (cook QueryClientsCookie) Reply() (*QueryClientsReply, error)

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

type QueryClientsReply

type QueryClientsReply struct {
    Sequence uint16 // sequence number of the request for this reply
    Length   uint32 // number of bytes in this reply
    // padding: 1 bytes
    NumClients uint32
    // padding: 20 bytes
    Clients []Client // size: xgb.Pad((int(NumClients) * 8))
}

QueryClientsReply represents the data returned from a QueryClients request.

type QueryResourceBytesCookie

type QueryResourceBytesCookie struct {
    *xgb.Cookie
}

QueryResourceBytesCookie is a cookie used only for QueryResourceBytes requests.

func QueryResourceBytes

func QueryResourceBytes(c *xgb.Conn, Client uint32, NumSpecs uint32, Specs []ResourceIdSpec) QueryResourceBytesCookie

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

func QueryResourceBytesUnchecked

func QueryResourceBytesUnchecked(c *xgb.Conn, Client uint32, NumSpecs uint32, Specs []ResourceIdSpec) QueryResourceBytesCookie

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

func (QueryResourceBytesCookie) Reply

func (cook QueryResourceBytesCookie) Reply() (*QueryResourceBytesReply, error)

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

type QueryResourceBytesReply

type QueryResourceBytesReply struct {
    Sequence uint16 // sequence number of the request for this reply
    Length   uint32 // number of bytes in this reply
    // padding: 1 bytes
    NumSizes uint32
    // padding: 20 bytes
    Sizes []ResourceSizeValue // size: ResourceSizeValueListSize(Sizes)
}

QueryResourceBytesReply represents the data returned from a QueryResourceBytes request.

type QueryVersionCookie

type QueryVersionCookie struct {
    *xgb.Cookie
}

QueryVersionCookie is a cookie used only for QueryVersion requests.

func QueryVersion

func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor 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, ClientMajor byte, ClientMinor 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
    ServerMajor uint16
    ServerMinor uint16
}

QueryVersionReply represents the data returned from a QueryVersion request.

type ResourceIdSpec

type ResourceIdSpec struct {
    Resource uint32
    Type     uint32
}

func (ResourceIdSpec) Bytes

func (v ResourceIdSpec) Bytes() []byte

Bytes writes a ResourceIdSpec value to a byte slice.

type ResourceSizeSpec

type ResourceSizeSpec struct {
    Spec     ResourceIdSpec
    Bytes    uint32
    RefCount uint32
    UseCount uint32
}

func (ResourceSizeSpec) Bytes

func (v ResourceSizeSpec) Bytes() []byte

Bytes writes a ResourceSizeSpec value to a byte slice.

type ResourceSizeValue

type ResourceSizeValue struct {
    Size               ResourceSizeSpec
    NumCrossReferences uint32
    CrossReferences    []ResourceSizeSpec // size: xgb.Pad((int(NumCrossReferences) * 20))
}

func (ResourceSizeValue) Bytes

func (v ResourceSizeValue) Bytes() []byte

Bytes writes a ResourceSizeValue value to a byte slice.

type Type

type Type struct {
    ResourceType xproto.Atom
    Count        uint32
}

func (Type) Bytes

func (v Type) Bytes() []byte

Bytes writes a Type value to a byte slice.