...

Package record

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

Overview ▾

Package record is the X client API for the RECORD extension.

Index ▾

Constants
func BadContextErrorNew(buf []byte) xgb.Error
func ClientInfoListBytes(buf []byte, list []ClientInfo) int
func ClientInfoListSize(list []ClientInfo) int
func ClientInfoRead(buf []byte, v *ClientInfo) int
func ClientInfoReadList(buf []byte, dest []ClientInfo) int
func ExtRangeListBytes(buf []byte, list []ExtRange) int
func ExtRangeRead(buf []byte, v *ExtRange) int
func ExtRangeReadList(buf []byte, dest []ExtRange) int
func Init(c *xgb.Conn) error
func Range16ListBytes(buf []byte, list []Range16) int
func Range16Read(buf []byte, v *Range16) int
func Range16ReadList(buf []byte, dest []Range16) int
func Range8ListBytes(buf []byte, list []Range8) int
func Range8Read(buf []byte, v *Range8) int
func Range8ReadList(buf []byte, dest []Range8) int
func RangeListBytes(buf []byte, list []Range) int
func RangeRead(buf []byte, v *Range) int
func RangeReadList(buf []byte, dest []Range) int
type BadContextError
    func (err BadContextError) BadId() uint32
    func (err BadContextError) Error() string
    func (err BadContextError) SequenceId() uint16
type ClientInfo
    func (v ClientInfo) Bytes() []byte
type ClientSpec
type Context
    func NewContextId(c *xgb.Conn) (Context, error)
type CreateContextCookie
    func CreateContext(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie
    func CreateContextChecked(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie
    func (cook CreateContextCookie) Check() error
type DisableContextCookie
    func DisableContext(c *xgb.Conn, Context Context) DisableContextCookie
    func DisableContextChecked(c *xgb.Conn, Context Context) DisableContextCookie
    func (cook DisableContextCookie) Check() error
type ElementHeader
type EnableContextCookie
    func EnableContext(c *xgb.Conn, Context Context) EnableContextCookie
    func EnableContextUnchecked(c *xgb.Conn, Context Context) EnableContextCookie
    func (cook EnableContextCookie) Reply() (*EnableContextReply, error)
type EnableContextReply
type ExtRange
    func (v ExtRange) Bytes() []byte
type FreeContextCookie
    func FreeContext(c *xgb.Conn, Context Context) FreeContextCookie
    func FreeContextChecked(c *xgb.Conn, Context Context) FreeContextCookie
    func (cook FreeContextCookie) Check() error
type GetContextCookie
    func GetContext(c *xgb.Conn, Context Context) GetContextCookie
    func GetContextUnchecked(c *xgb.Conn, Context Context) GetContextCookie
    func (cook GetContextCookie) Reply() (*GetContextReply, error)
type GetContextReply
type QueryVersionCookie
    func QueryVersion(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) QueryVersionCookie
    func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) QueryVersionCookie
    func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error)
type QueryVersionReply
type Range
    func (v Range) Bytes() []byte
type Range16
    func (v Range16) Bytes() []byte
type Range8
    func (v Range8) Bytes() []byte
type RegisterClientsCookie
    func RegisterClients(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) RegisterClientsCookie
    func RegisterClientsChecked(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) RegisterClientsCookie
    func (cook RegisterClientsCookie) Check() error
type UnregisterClientsCookie
    func UnregisterClients(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) UnregisterClientsCookie
    func UnregisterClientsChecked(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) UnregisterClientsCookie
    func (cook UnregisterClientsCookie) Check() error

Package files

record.go

Constants

const (
    CsCurrentClients = 1
    CsFutureClients  = 2
    CsAllClients     = 3
)
const (
    HTypeFromServerTime     = 1
    HTypeFromClientTime     = 2
    HTypeFromClientSequence = 4
)

BadBadContext is the error number for a BadBadContext.

const BadBadContext = 0

func BadContextErrorNew

func BadContextErrorNew(buf []byte) xgb.Error

BadContextErrorNew constructs a BadContextError value that implements xgb.Error from a byte slice.

func ClientInfoListBytes

func ClientInfoListBytes(buf []byte, list []ClientInfo) int

ClientInfoListBytes writes a list of ClientInfo values to a byte slice.

func ClientInfoListSize

func ClientInfoListSize(list []ClientInfo) int

ClientInfoListSize computes the size (bytes) of a list of ClientInfo values.

func ClientInfoRead

func ClientInfoRead(buf []byte, v *ClientInfo) int

ClientInfoRead reads a byte slice into a ClientInfo value.

func ClientInfoReadList

func ClientInfoReadList(buf []byte, dest []ClientInfo) int

ClientInfoReadList reads a byte slice into a list of ClientInfo values.

func ExtRangeListBytes

func ExtRangeListBytes(buf []byte, list []ExtRange) int

ExtRangeListBytes writes a list of ExtRange values to a byte slice.

func ExtRangeRead

func ExtRangeRead(buf []byte, v *ExtRange) int

ExtRangeRead reads a byte slice into a ExtRange value.

func ExtRangeReadList

func ExtRangeReadList(buf []byte, dest []ExtRange) int

ExtRangeReadList reads a byte slice into a list of ExtRange values.

func Init

func Init(c *xgb.Conn) error

Init must be called before using the RECORD extension.

func Range16ListBytes

func Range16ListBytes(buf []byte, list []Range16) int

Range16ListBytes writes a list of Range16 values to a byte slice.

func Range16Read

func Range16Read(buf []byte, v *Range16) int

Range16Read reads a byte slice into a Range16 value.

func Range16ReadList

func Range16ReadList(buf []byte, dest []Range16) int

Range16ReadList reads a byte slice into a list of Range16 values.

func Range8ListBytes

func Range8ListBytes(buf []byte, list []Range8) int

Range8ListBytes writes a list of Range8 values to a byte slice.

func Range8Read

func Range8Read(buf []byte, v *Range8) int

Range8Read reads a byte slice into a Range8 value.

func Range8ReadList

func Range8ReadList(buf []byte, dest []Range8) int

Range8ReadList reads a byte slice into a list of Range8 values.

func RangeListBytes

func RangeListBytes(buf []byte, list []Range) int

RangeListBytes writes a list of Range values to a byte slice.

func RangeRead

func RangeRead(buf []byte, v *Range) int

RangeRead reads a byte slice into a Range value.

func RangeReadList

func RangeReadList(buf []byte, dest []Range) int

RangeReadList reads a byte slice into a list of Range values.

type BadContextError

type BadContextError struct {
    Sequence      uint16
    NiceName      string
    InvalidRecord uint32
}

func (BadContextError) BadId

func (err BadContextError) BadId() uint32

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

func (BadContextError) Error

func (err BadContextError) Error() string

func (BadContextError) SequenceId

func (err BadContextError) SequenceId() uint16

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

type ClientInfo

type ClientInfo struct {
    ClientResource ClientSpec
    NumRanges      uint32
    Ranges         []Range // size: xgb.Pad((int(NumRanges) * 24))
}

func (ClientInfo) Bytes

func (v ClientInfo) Bytes() []byte

Bytes writes a ClientInfo value to a byte slice.

type ClientSpec

type ClientSpec uint32

type Context

type Context uint32

func NewContextId

func NewContextId(c *xgb.Conn) (Context, error)

type CreateContextCookie

CreateContextCookie is a cookie used only for CreateContext requests.

type CreateContextCookie struct {
    *xgb.Cookie
}

func CreateContext

func CreateContext(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie

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

func CreateContextChecked

func CreateContextChecked(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie

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

func (CreateContextCookie) Check

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

DisableContextCookie is a cookie used only for DisableContext requests.

type DisableContextCookie struct {
    *xgb.Cookie
}

func DisableContext

func DisableContext(c *xgb.Conn, Context Context) DisableContextCookie

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

func DisableContextChecked

func DisableContextChecked(c *xgb.Conn, Context Context) DisableContextCookie

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

func (DisableContextCookie) Check

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

type ElementHeader byte

type EnableContextCookie

EnableContextCookie is a cookie used only for EnableContext requests.

type EnableContextCookie struct {
    *xgb.Cookie
}

func EnableContext

func EnableContext(c *xgb.Conn, Context Context) EnableContextCookie

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

func EnableContextUnchecked

func EnableContextUnchecked(c *xgb.Conn, Context Context) EnableContextCookie

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

func (EnableContextCookie) Reply

func (cook EnableContextCookie) Reply() (*EnableContextReply, error)

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

type EnableContextReply

EnableContextReply represents the data returned from a EnableContext request.

type EnableContextReply struct {
    Sequence      uint16 // sequence number of the request for this reply
    Length        uint32 // number of bytes in this reply
    Category      byte
    ElementHeader ElementHeader
    ClientSwapped bool
    // padding: 2 bytes
    XidBase        uint32
    ServerTime     uint32
    RecSequenceNum uint32
    // padding: 8 bytes
    Data []byte // size: xgb.Pad(((int(Length) * 4) * 1))
}

type ExtRange

type ExtRange struct {
    Major Range8
    Minor Range16
}

func (ExtRange) Bytes

func (v ExtRange) Bytes() []byte

Bytes writes a ExtRange value to a byte slice.

type FreeContextCookie

FreeContextCookie is a cookie used only for FreeContext requests.

type FreeContextCookie struct {
    *xgb.Cookie
}

func FreeContext

func FreeContext(c *xgb.Conn, Context Context) FreeContextCookie

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

func FreeContextChecked

func FreeContextChecked(c *xgb.Conn, Context Context) FreeContextCookie

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

func (FreeContextCookie) Check

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

GetContextCookie is a cookie used only for GetContext requests.

type GetContextCookie struct {
    *xgb.Cookie
}

func GetContext

func GetContext(c *xgb.Conn, Context Context) GetContextCookie

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

func GetContextUnchecked

func GetContextUnchecked(c *xgb.Conn, Context Context) GetContextCookie

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

func (GetContextCookie) Reply

func (cook GetContextCookie) Reply() (*GetContextReply, error)

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

type GetContextReply

GetContextReply represents the data returned from a GetContext request.

type GetContextReply struct {
    Sequence      uint16 // sequence number of the request for this reply
    Length        uint32 // number of bytes in this reply
    Enabled       bool
    ElementHeader ElementHeader
    // padding: 3 bytes
    NumInterceptedClients uint32
    // padding: 16 bytes
    InterceptedClients []ClientInfo // size: ClientInfoListSize(InterceptedClients)
}

type QueryVersionCookie

QueryVersionCookie is a cookie used only for QueryVersion requests.

type QueryVersionCookie struct {
    *xgb.Cookie
}

func QueryVersion

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

type Range

type Range struct {
    CoreRequests    Range8
    CoreReplies     Range8
    ExtRequests     ExtRange
    ExtReplies      ExtRange
    DeliveredEvents Range8
    DeviceEvents    Range8
    Errors          Range8
    ClientStarted   bool
    ClientDied      bool
}

func (Range) Bytes

func (v Range) Bytes() []byte

Bytes writes a Range value to a byte slice.

type Range16

type Range16 struct {
    First uint16
    Last  uint16
}

func (Range16) Bytes

func (v Range16) Bytes() []byte

Bytes writes a Range16 value to a byte slice.

type Range8

type Range8 struct {
    First byte
    Last  byte
}

func (Range8) Bytes

func (v Range8) Bytes() []byte

Bytes writes a Range8 value to a byte slice.

type RegisterClientsCookie

RegisterClientsCookie is a cookie used only for RegisterClients requests.

type RegisterClientsCookie struct {
    *xgb.Cookie
}

func RegisterClients

func RegisterClients(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) RegisterClientsCookie

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

func RegisterClientsChecked

func RegisterClientsChecked(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) RegisterClientsCookie

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

func (RegisterClientsCookie) Check

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

UnregisterClientsCookie is a cookie used only for UnregisterClients requests.

type UnregisterClientsCookie struct {
    *xgb.Cookie
}

func UnregisterClients

func UnregisterClients(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) UnregisterClientsCookie

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

func UnregisterClientsChecked

func UnregisterClientsChecked(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) UnregisterClientsCookie

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

func (UnregisterClientsCookie) Check

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