a huge commit. splitting extensions into their own sub-packages.
This commit is contained in:
+19
-6
@@ -16,17 +16,30 @@ all: build-xgbgen \
|
||||
build-xgbgen:
|
||||
(cd xgbgen && go build)
|
||||
|
||||
%.xml:
|
||||
xgbgen/xgbgen --proto-path $(XPROTO) $(XPROTO)/$*.xml > auto_$*.go
|
||||
build-all: bigreq.b composite.b damage.b dpms.b dri2.b ge.b glx.b randr.b \
|
||||
record.b render.b res.b screensaver.b shape.b shm.b sync.b xcmisc.b \
|
||||
xevie.b xf86dri.b xf86vidmode.b xfixes.b xinerama.b xinput.b \
|
||||
xprint.b xproto.b xselinux.b xtest.b xv.b xvmc.b
|
||||
|
||||
%.b:
|
||||
(cd $* ; go build)
|
||||
|
||||
xc_misc.xml: build-xgbgen
|
||||
mkdir -p xcmisc
|
||||
xgbgen/xgbgen --proto-path $(XPROTO) $(XPROTO)/xc_misc.xml > xcmisc/xcmisc.go
|
||||
|
||||
%.xml: build-xgbgen
|
||||
mkdir -p $*
|
||||
xgbgen/xgbgen --proto-path $(XPROTO) $(XPROTO)/$*.xml > $*/$*.go
|
||||
|
||||
test:
|
||||
go test
|
||||
(cd xproto ; go test)
|
||||
|
||||
bench:
|
||||
go test -run 'nomatch' -bench '.*' -cpu 1,2,6
|
||||
(cd xproto ; go test -run 'nomatch' -bench '.*' -cpu 1,2,6)
|
||||
|
||||
gofmt:
|
||||
gofmt -w *.go xgbgen/*.go examples/*.go examples/*/*.go
|
||||
colcheck xgbgen/*.go examples/*.go examples/*/*.go \
|
||||
auth.go conn.go cookie.go doc.go xgb.go xgb_help.go xgb_test.go
|
||||
colcheck xgbgen/*.go examples/*.go examples/*/*.go xproto/xproto_test.go \
|
||||
auth.go conn.go cookie.go doc.go xgb.go xgb_help.go
|
||||
|
||||
|
||||
@@ -1,138 +0,0 @@
|
||||
package xgb
|
||||
|
||||
/*
|
||||
This file was generated by bigreq.xml on May 10 2012 12:39:33pm EDT.
|
||||
This file is automatically generated. Edit at your peril!
|
||||
*/
|
||||
|
||||
// BigreqInit must be called before using the BIG-REQUESTS extension.
|
||||
func (c *Conn) BigreqInit() error {
|
||||
reply, err := c.QueryExtension(12, "BIG-REQUESTS").Reply()
|
||||
switch {
|
||||
case err != nil:
|
||||
return err
|
||||
case !reply.Present:
|
||||
return errorf("No extension named BIG-REQUESTS could be found on on the server.")
|
||||
}
|
||||
|
||||
c.extLock.Lock()
|
||||
c.extensions["BIG-REQUESTS"] = reply.MajorOpcode
|
||||
for evNum, fun := range newExtEventFuncs["BIG-REQUESTS"] {
|
||||
newEventFuncs[int(reply.FirstEvent)+evNum] = fun
|
||||
}
|
||||
for errNum, fun := range newExtErrorFuncs["BIG-REQUESTS"] {
|
||||
newErrorFuncs[int(reply.FirstError)+errNum] = fun
|
||||
}
|
||||
c.extLock.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtEventFuncs["BIG-REQUESTS"] = make(map[int]newEventFun)
|
||||
newExtErrorFuncs["BIG-REQUESTS"] = make(map[int]newErrorFun)
|
||||
}
|
||||
|
||||
// Skipping definition for base type 'Card16'
|
||||
|
||||
// Skipping definition for base type 'Char'
|
||||
|
||||
// Skipping definition for base type 'Card32'
|
||||
|
||||
// Skipping definition for base type 'Double'
|
||||
|
||||
// Skipping definition for base type 'Bool'
|
||||
|
||||
// Skipping definition for base type 'Float'
|
||||
|
||||
// Skipping definition for base type 'Card8'
|
||||
|
||||
// Skipping definition for base type 'Int16'
|
||||
|
||||
// Skipping definition for base type 'Int32'
|
||||
|
||||
// Skipping definition for base type 'Void'
|
||||
|
||||
// Skipping definition for base type 'Byte'
|
||||
|
||||
// Skipping definition for base type 'Int8'
|
||||
|
||||
// Request BigreqEnable
|
||||
// size: 4
|
||||
type BigreqEnableCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) BigreqEnable() BigreqEnableCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.bigreqEnableRequest(), cookie)
|
||||
return BigreqEnableCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) BigreqEnableUnchecked() BigreqEnableCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.bigreqEnableRequest(), cookie)
|
||||
return BigreqEnableCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for BigreqEnable
|
||||
// size: 12
|
||||
type BigreqEnableReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
MaximumRequestLength uint32
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request BigreqEnable
|
||||
func (cook BigreqEnableCookie) Reply() (*BigreqEnableReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return bigreqEnableReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for BigreqEnable
|
||||
func bigreqEnableReply(buf []byte) *BigreqEnableReply {
|
||||
v := new(BigreqEnableReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.MaximumRequestLength = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook BigreqEnableCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for BigreqEnable
|
||||
func (c *Conn) bigreqEnableRequest() []byte {
|
||||
size := 4
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["BIG-REQUESTS"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 0 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
@@ -1,581 +0,0 @@
|
||||
package xgb
|
||||
|
||||
/*
|
||||
This file was generated by composite.xml on May 10 2012 12:39:33pm EDT.
|
||||
This file is automatically generated. Edit at your peril!
|
||||
*/
|
||||
|
||||
// Imports are not necessary for XGB because everything is
|
||||
// in one package. They are still listed here for reference.
|
||||
// import "xproto"
|
||||
// import "xfixes"
|
||||
|
||||
// CompositeInit must be called before using the Composite extension.
|
||||
func (c *Conn) CompositeInit() error {
|
||||
reply, err := c.QueryExtension(9, "Composite").Reply()
|
||||
switch {
|
||||
case err != nil:
|
||||
return err
|
||||
case !reply.Present:
|
||||
return errorf("No extension named Composite could be found on on the server.")
|
||||
}
|
||||
|
||||
c.extLock.Lock()
|
||||
c.extensions["Composite"] = reply.MajorOpcode
|
||||
for evNum, fun := range newExtEventFuncs["Composite"] {
|
||||
newEventFuncs[int(reply.FirstEvent)+evNum] = fun
|
||||
}
|
||||
for errNum, fun := range newExtErrorFuncs["Composite"] {
|
||||
newErrorFuncs[int(reply.FirstError)+errNum] = fun
|
||||
}
|
||||
c.extLock.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtEventFuncs["Composite"] = make(map[int]newEventFun)
|
||||
newExtErrorFuncs["Composite"] = make(map[int]newErrorFun)
|
||||
}
|
||||
|
||||
// Skipping definition for base type 'Int32'
|
||||
|
||||
// Skipping definition for base type 'Void'
|
||||
|
||||
// Skipping definition for base type 'Byte'
|
||||
|
||||
// Skipping definition for base type 'Int8'
|
||||
|
||||
// Skipping definition for base type 'Card16'
|
||||
|
||||
// Skipping definition for base type 'Char'
|
||||
|
||||
// Skipping definition for base type 'Card32'
|
||||
|
||||
// Skipping definition for base type 'Double'
|
||||
|
||||
// Skipping definition for base type 'Bool'
|
||||
|
||||
// Skipping definition for base type 'Float'
|
||||
|
||||
// Skipping definition for base type 'Card8'
|
||||
|
||||
// Skipping definition for base type 'Int16'
|
||||
|
||||
const (
|
||||
CompositeRedirectAutomatic = 0
|
||||
CompositeRedirectManual = 1
|
||||
)
|
||||
|
||||
// Request CompositeQueryVersion
|
||||
// size: 12
|
||||
type CompositeQueryVersionCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) CompositeQueryVersion(ClientMajorVersion uint32, ClientMinorVersion uint32) CompositeQueryVersionCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.compositeQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie)
|
||||
return CompositeQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) CompositeQueryVersionUnchecked(ClientMajorVersion uint32, ClientMinorVersion uint32) CompositeQueryVersionCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.compositeQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie)
|
||||
return CompositeQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for CompositeQueryVersion
|
||||
// size: 32
|
||||
type CompositeQueryVersionReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
MajorVersion uint32
|
||||
MinorVersion uint32
|
||||
// padding: 16 bytes
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request CompositeQueryVersion
|
||||
func (cook CompositeQueryVersionCookie) Reply() (*CompositeQueryVersionReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return compositeQueryVersionReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for CompositeQueryVersion
|
||||
func compositeQueryVersionReply(buf []byte) *CompositeQueryVersionReply {
|
||||
v := new(CompositeQueryVersionReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.MajorVersion = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
v.MinorVersion = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
b += 16 // padding
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook CompositeQueryVersionCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for CompositeQueryVersion
|
||||
func (c *Conn) compositeQueryVersionRequest(ClientMajorVersion uint32, ClientMinorVersion uint32) []byte {
|
||||
size := 12
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["COMPOSITE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 0 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], ClientMajorVersion)
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], ClientMinorVersion)
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request CompositeRedirectWindow
|
||||
// size: 12
|
||||
type CompositeRedirectWindowCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for CompositeRedirectWindow
|
||||
func (c *Conn) CompositeRedirectWindow(Window Window, Update byte) CompositeRedirectWindowCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.compositeRedirectWindowRequest(Window, Update), cookie)
|
||||
return CompositeRedirectWindowCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) CompositeRedirectWindowChecked(Window Window, Update byte) CompositeRedirectWindowCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.compositeRedirectWindowRequest(Window, Update), cookie)
|
||||
return CompositeRedirectWindowCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook CompositeRedirectWindowCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for CompositeRedirectWindow
|
||||
func (c *Conn) compositeRedirectWindowRequest(Window Window, Update byte) []byte {
|
||||
size := 12
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["COMPOSITE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 1 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Window))
|
||||
b += 4
|
||||
|
||||
buf[b] = Update
|
||||
b += 1
|
||||
|
||||
b += 3 // padding
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request CompositeRedirectSubwindows
|
||||
// size: 12
|
||||
type CompositeRedirectSubwindowsCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for CompositeRedirectSubwindows
|
||||
func (c *Conn) CompositeRedirectSubwindows(Window Window, Update byte) CompositeRedirectSubwindowsCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.compositeRedirectSubwindowsRequest(Window, Update), cookie)
|
||||
return CompositeRedirectSubwindowsCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) CompositeRedirectSubwindowsChecked(Window Window, Update byte) CompositeRedirectSubwindowsCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.compositeRedirectSubwindowsRequest(Window, Update), cookie)
|
||||
return CompositeRedirectSubwindowsCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook CompositeRedirectSubwindowsCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for CompositeRedirectSubwindows
|
||||
func (c *Conn) compositeRedirectSubwindowsRequest(Window Window, Update byte) []byte {
|
||||
size := 12
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["COMPOSITE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 2 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Window))
|
||||
b += 4
|
||||
|
||||
buf[b] = Update
|
||||
b += 1
|
||||
|
||||
b += 3 // padding
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request CompositeUnredirectWindow
|
||||
// size: 12
|
||||
type CompositeUnredirectWindowCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for CompositeUnredirectWindow
|
||||
func (c *Conn) CompositeUnredirectWindow(Window Window, Update byte) CompositeUnredirectWindowCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.compositeUnredirectWindowRequest(Window, Update), cookie)
|
||||
return CompositeUnredirectWindowCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) CompositeUnredirectWindowChecked(Window Window, Update byte) CompositeUnredirectWindowCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.compositeUnredirectWindowRequest(Window, Update), cookie)
|
||||
return CompositeUnredirectWindowCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook CompositeUnredirectWindowCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for CompositeUnredirectWindow
|
||||
func (c *Conn) compositeUnredirectWindowRequest(Window Window, Update byte) []byte {
|
||||
size := 12
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["COMPOSITE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 3 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Window))
|
||||
b += 4
|
||||
|
||||
buf[b] = Update
|
||||
b += 1
|
||||
|
||||
b += 3 // padding
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request CompositeUnredirectSubwindows
|
||||
// size: 12
|
||||
type CompositeUnredirectSubwindowsCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for CompositeUnredirectSubwindows
|
||||
func (c *Conn) CompositeUnredirectSubwindows(Window Window, Update byte) CompositeUnredirectSubwindowsCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.compositeUnredirectSubwindowsRequest(Window, Update), cookie)
|
||||
return CompositeUnredirectSubwindowsCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) CompositeUnredirectSubwindowsChecked(Window Window, Update byte) CompositeUnredirectSubwindowsCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.compositeUnredirectSubwindowsRequest(Window, Update), cookie)
|
||||
return CompositeUnredirectSubwindowsCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook CompositeUnredirectSubwindowsCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for CompositeUnredirectSubwindows
|
||||
func (c *Conn) compositeUnredirectSubwindowsRequest(Window Window, Update byte) []byte {
|
||||
size := 12
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["COMPOSITE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 4 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Window))
|
||||
b += 4
|
||||
|
||||
buf[b] = Update
|
||||
b += 1
|
||||
|
||||
b += 3 // padding
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request CompositeCreateRegionFromBorderClip
|
||||
// size: 12
|
||||
type CompositeCreateRegionFromBorderClipCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for CompositeCreateRegionFromBorderClip
|
||||
func (c *Conn) CompositeCreateRegionFromBorderClip(Region XfixesRegion, Window Window) CompositeCreateRegionFromBorderClipCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.compositeCreateRegionFromBorderClipRequest(Region, Window), cookie)
|
||||
return CompositeCreateRegionFromBorderClipCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) CompositeCreateRegionFromBorderClipChecked(Region XfixesRegion, Window Window) CompositeCreateRegionFromBorderClipCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.compositeCreateRegionFromBorderClipRequest(Region, Window), cookie)
|
||||
return CompositeCreateRegionFromBorderClipCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook CompositeCreateRegionFromBorderClipCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for CompositeCreateRegionFromBorderClip
|
||||
func (c *Conn) compositeCreateRegionFromBorderClipRequest(Region XfixesRegion, Window Window) []byte {
|
||||
size := 12
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["COMPOSITE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 5 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Region))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], uint32(Window))
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request CompositeNameWindowPixmap
|
||||
// size: 12
|
||||
type CompositeNameWindowPixmapCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for CompositeNameWindowPixmap
|
||||
func (c *Conn) CompositeNameWindowPixmap(Window Window, Pixmap Pixmap) CompositeNameWindowPixmapCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.compositeNameWindowPixmapRequest(Window, Pixmap), cookie)
|
||||
return CompositeNameWindowPixmapCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) CompositeNameWindowPixmapChecked(Window Window, Pixmap Pixmap) CompositeNameWindowPixmapCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.compositeNameWindowPixmapRequest(Window, Pixmap), cookie)
|
||||
return CompositeNameWindowPixmapCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook CompositeNameWindowPixmapCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for CompositeNameWindowPixmap
|
||||
func (c *Conn) compositeNameWindowPixmapRequest(Window Window, Pixmap Pixmap) []byte {
|
||||
size := 12
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["COMPOSITE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 6 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Window))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], uint32(Pixmap))
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request CompositeGetOverlayWindow
|
||||
// size: 8
|
||||
type CompositeGetOverlayWindowCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) CompositeGetOverlayWindow(Window Window) CompositeGetOverlayWindowCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.compositeGetOverlayWindowRequest(Window), cookie)
|
||||
return CompositeGetOverlayWindowCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) CompositeGetOverlayWindowUnchecked(Window Window) CompositeGetOverlayWindowCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.compositeGetOverlayWindowRequest(Window), cookie)
|
||||
return CompositeGetOverlayWindowCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for CompositeGetOverlayWindow
|
||||
// size: 32
|
||||
type CompositeGetOverlayWindowReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
OverlayWin Window
|
||||
// padding: 20 bytes
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request CompositeGetOverlayWindow
|
||||
func (cook CompositeGetOverlayWindowCookie) Reply() (*CompositeGetOverlayWindowReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return compositeGetOverlayWindowReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for CompositeGetOverlayWindow
|
||||
func compositeGetOverlayWindowReply(buf []byte) *CompositeGetOverlayWindowReply {
|
||||
v := new(CompositeGetOverlayWindowReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.OverlayWin = Window(Get32(buf[b:]))
|
||||
b += 4
|
||||
|
||||
b += 20 // padding
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook CompositeGetOverlayWindowCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for CompositeGetOverlayWindow
|
||||
func (c *Conn) compositeGetOverlayWindowRequest(Window Window) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["COMPOSITE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 7 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Window))
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request CompositeReleaseOverlayWindow
|
||||
// size: 8
|
||||
type CompositeReleaseOverlayWindowCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for CompositeReleaseOverlayWindow
|
||||
func (c *Conn) CompositeReleaseOverlayWindow(Window Window) CompositeReleaseOverlayWindowCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.compositeReleaseOverlayWindowRequest(Window), cookie)
|
||||
return CompositeReleaseOverlayWindowCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) CompositeReleaseOverlayWindowChecked(Window Window) CompositeReleaseOverlayWindowCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.compositeReleaseOverlayWindowRequest(Window), cookie)
|
||||
return CompositeReleaseOverlayWindowCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook CompositeReleaseOverlayWindowCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for CompositeReleaseOverlayWindow
|
||||
func (c *Conn) compositeReleaseOverlayWindowRequest(Window Window) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["COMPOSITE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 8 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Window))
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
@@ -1,513 +0,0 @@
|
||||
package xgb
|
||||
|
||||
/*
|
||||
This file was generated by damage.xml on May 10 2012 12:39:33pm EDT.
|
||||
This file is automatically generated. Edit at your peril!
|
||||
*/
|
||||
|
||||
// Imports are not necessary for XGB because everything is
|
||||
// in one package. They are still listed here for reference.
|
||||
// import "xproto"
|
||||
// import "xfixes"
|
||||
|
||||
// DamageInit must be called before using the DAMAGE extension.
|
||||
func (c *Conn) DamageInit() error {
|
||||
reply, err := c.QueryExtension(6, "DAMAGE").Reply()
|
||||
switch {
|
||||
case err != nil:
|
||||
return err
|
||||
case !reply.Present:
|
||||
return errorf("No extension named DAMAGE could be found on on the server.")
|
||||
}
|
||||
|
||||
c.extLock.Lock()
|
||||
c.extensions["DAMAGE"] = reply.MajorOpcode
|
||||
for evNum, fun := range newExtEventFuncs["DAMAGE"] {
|
||||
newEventFuncs[int(reply.FirstEvent)+evNum] = fun
|
||||
}
|
||||
for errNum, fun := range newExtErrorFuncs["DAMAGE"] {
|
||||
newErrorFuncs[int(reply.FirstError)+errNum] = fun
|
||||
}
|
||||
c.extLock.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtEventFuncs["DAMAGE"] = make(map[int]newEventFun)
|
||||
newExtErrorFuncs["DAMAGE"] = make(map[int]newErrorFun)
|
||||
}
|
||||
|
||||
// Skipping definition for base type 'Int16'
|
||||
|
||||
// Skipping definition for base type 'Int32'
|
||||
|
||||
// Skipping definition for base type 'Void'
|
||||
|
||||
// Skipping definition for base type 'Byte'
|
||||
|
||||
// Skipping definition for base type 'Int8'
|
||||
|
||||
// Skipping definition for base type 'Card16'
|
||||
|
||||
// Skipping definition for base type 'Char'
|
||||
|
||||
// Skipping definition for base type 'Card32'
|
||||
|
||||
// Skipping definition for base type 'Double'
|
||||
|
||||
// Skipping definition for base type 'Bool'
|
||||
|
||||
// Skipping definition for base type 'Float'
|
||||
|
||||
// Skipping definition for base type 'Card8'
|
||||
|
||||
const (
|
||||
DamageReportLevelRawRectangles = 0
|
||||
DamageReportLevelDeltaRectangles = 1
|
||||
DamageReportLevelBoundingBox = 2
|
||||
DamageReportLevelNonEmpty = 3
|
||||
)
|
||||
|
||||
type DamageDamage uint32
|
||||
|
||||
func (c *Conn) NewDamageDamageId() (DamageDamage, error) {
|
||||
id, err := c.NewId()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return DamageDamage(id), nil
|
||||
}
|
||||
|
||||
// Event definition DamageNotify (0)
|
||||
// Size: 32
|
||||
|
||||
const DamageNotify = 0
|
||||
|
||||
type DamageNotifyEvent struct {
|
||||
Sequence uint16
|
||||
Level byte
|
||||
Drawable Drawable
|
||||
Damage DamageDamage
|
||||
Timestamp Timestamp
|
||||
Area Rectangle
|
||||
Geometry Rectangle
|
||||
}
|
||||
|
||||
// Event read DamageNotify
|
||||
func NewDamageNotifyEvent(buf []byte) Event {
|
||||
v := DamageNotifyEvent{}
|
||||
b := 1 // don't read event number
|
||||
|
||||
v.Level = buf[b]
|
||||
b += 1
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Drawable = Drawable(Get32(buf[b:]))
|
||||
b += 4
|
||||
|
||||
v.Damage = DamageDamage(Get32(buf[b:]))
|
||||
b += 4
|
||||
|
||||
v.Timestamp = Timestamp(Get32(buf[b:]))
|
||||
b += 4
|
||||
|
||||
v.Area = Rectangle{}
|
||||
b += ReadRectangle(buf[b:], &v.Area)
|
||||
|
||||
v.Geometry = Rectangle{}
|
||||
b += ReadRectangle(buf[b:], &v.Geometry)
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
// Event write DamageNotify
|
||||
func (v DamageNotifyEvent) Bytes() []byte {
|
||||
buf := make([]byte, 32)
|
||||
b := 0
|
||||
|
||||
// write event number
|
||||
buf[b] = 0
|
||||
b += 1
|
||||
|
||||
buf[b] = v.Level
|
||||
b += 1
|
||||
|
||||
b += 2 // skip sequence number
|
||||
|
||||
Put32(buf[b:], uint32(v.Drawable))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], uint32(v.Damage))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], uint32(v.Timestamp))
|
||||
b += 4
|
||||
|
||||
{
|
||||
structBytes := v.Area.Bytes()
|
||||
copy(buf[b:], structBytes)
|
||||
b += pad(len(structBytes))
|
||||
}
|
||||
|
||||
{
|
||||
structBytes := v.Geometry.Bytes()
|
||||
copy(buf[b:], structBytes)
|
||||
b += pad(len(structBytes))
|
||||
}
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
func (v DamageNotifyEvent) ImplementsEvent() {}
|
||||
|
||||
func (v DamageNotifyEvent) SequenceId() uint16 {
|
||||
return v.Sequence
|
||||
}
|
||||
|
||||
func (v DamageNotifyEvent) String() string {
|
||||
fieldVals := make([]string, 0, 6)
|
||||
fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence))
|
||||
fieldVals = append(fieldVals, sprintf("Level: %d", v.Level))
|
||||
fieldVals = append(fieldVals, sprintf("Drawable: %d", v.Drawable))
|
||||
fieldVals = append(fieldVals, sprintf("Damage: %d", v.Damage))
|
||||
fieldVals = append(fieldVals, sprintf("Timestamp: %d", v.Timestamp))
|
||||
return "DamageNotify {" + stringsJoin(fieldVals, ", ") + "}"
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtEventFuncs["DAMAGE"][0] = NewDamageNotifyEvent
|
||||
}
|
||||
|
||||
// Error definition DamageBadDamage (0)
|
||||
// Size: 32
|
||||
|
||||
const BadDamageBadDamage = 0
|
||||
|
||||
type DamageBadDamageError struct {
|
||||
Sequence uint16
|
||||
NiceName string
|
||||
}
|
||||
|
||||
// Error read DamageBadDamage
|
||||
func NewDamageBadDamageError(buf []byte) Error {
|
||||
v := DamageBadDamageError{}
|
||||
v.NiceName = "DamageBadDamage"
|
||||
|
||||
b := 1 // skip error determinant
|
||||
b += 1 // don't read error number
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (err DamageBadDamageError) ImplementsError() {}
|
||||
|
||||
func (err DamageBadDamageError) SequenceId() uint16 {
|
||||
return err.Sequence
|
||||
}
|
||||
|
||||
func (err DamageBadDamageError) BadId() uint32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (err DamageBadDamageError) Error() string {
|
||||
fieldVals := make([]string, 0, 0)
|
||||
fieldVals = append(fieldVals, "NiceName: "+err.NiceName)
|
||||
fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence))
|
||||
return "BadDamageBadDamage {" + stringsJoin(fieldVals, ", ") + "}"
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtErrorFuncs["DAMAGE"][0] = NewDamageBadDamageError
|
||||
}
|
||||
|
||||
// Request DamageQueryVersion
|
||||
// size: 12
|
||||
type DamageQueryVersionCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) DamageQueryVersion(ClientMajorVersion uint32, ClientMinorVersion uint32) DamageQueryVersionCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.damageQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie)
|
||||
return DamageQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) DamageQueryVersionUnchecked(ClientMajorVersion uint32, ClientMinorVersion uint32) DamageQueryVersionCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.damageQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie)
|
||||
return DamageQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for DamageQueryVersion
|
||||
// size: 32
|
||||
type DamageQueryVersionReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
MajorVersion uint32
|
||||
MinorVersion uint32
|
||||
// padding: 16 bytes
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request DamageQueryVersion
|
||||
func (cook DamageQueryVersionCookie) Reply() (*DamageQueryVersionReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return damageQueryVersionReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for DamageQueryVersion
|
||||
func damageQueryVersionReply(buf []byte) *DamageQueryVersionReply {
|
||||
v := new(DamageQueryVersionReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.MajorVersion = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
v.MinorVersion = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
b += 16 // padding
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook DamageQueryVersionCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for DamageQueryVersion
|
||||
func (c *Conn) damageQueryVersionRequest(ClientMajorVersion uint32, ClientMinorVersion uint32) []byte {
|
||||
size := 12
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["DAMAGE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 0 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], ClientMajorVersion)
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], ClientMinorVersion)
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request DamageCreate
|
||||
// size: 16
|
||||
type DamageCreateCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for DamageCreate
|
||||
func (c *Conn) DamageCreate(Damage DamageDamage, Drawable Drawable, Level byte) DamageCreateCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.damageCreateRequest(Damage, Drawable, Level), cookie)
|
||||
return DamageCreateCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) DamageCreateChecked(Damage DamageDamage, Drawable Drawable, Level byte) DamageCreateCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.damageCreateRequest(Damage, Drawable, Level), cookie)
|
||||
return DamageCreateCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook DamageCreateCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for DamageCreate
|
||||
func (c *Conn) damageCreateRequest(Damage DamageDamage, Drawable Drawable, Level byte) []byte {
|
||||
size := 16
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["DAMAGE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 1 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Damage))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], uint32(Drawable))
|
||||
b += 4
|
||||
|
||||
buf[b] = Level
|
||||
b += 1
|
||||
|
||||
b += 3 // padding
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request DamageDestroy
|
||||
// size: 8
|
||||
type DamageDestroyCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for DamageDestroy
|
||||
func (c *Conn) DamageDestroy(Damage DamageDamage) DamageDestroyCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.damageDestroyRequest(Damage), cookie)
|
||||
return DamageDestroyCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) DamageDestroyChecked(Damage DamageDamage) DamageDestroyCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.damageDestroyRequest(Damage), cookie)
|
||||
return DamageDestroyCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook DamageDestroyCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for DamageDestroy
|
||||
func (c *Conn) damageDestroyRequest(Damage DamageDamage) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["DAMAGE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 2 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Damage))
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request DamageSubtract
|
||||
// size: 16
|
||||
type DamageSubtractCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for DamageSubtract
|
||||
func (c *Conn) DamageSubtract(Damage DamageDamage, Repair XfixesRegion, Parts XfixesRegion) DamageSubtractCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.damageSubtractRequest(Damage, Repair, Parts), cookie)
|
||||
return DamageSubtractCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) DamageSubtractChecked(Damage DamageDamage, Repair XfixesRegion, Parts XfixesRegion) DamageSubtractCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.damageSubtractRequest(Damage, Repair, Parts), cookie)
|
||||
return DamageSubtractCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook DamageSubtractCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for DamageSubtract
|
||||
func (c *Conn) damageSubtractRequest(Damage DamageDamage, Repair XfixesRegion, Parts XfixesRegion) []byte {
|
||||
size := 16
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["DAMAGE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 3 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Damage))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], uint32(Repair))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], uint32(Parts))
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request DamageAdd
|
||||
// size: 12
|
||||
type DamageAddCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for DamageAdd
|
||||
func (c *Conn) DamageAdd(Drawable Drawable, Region XfixesRegion) DamageAddCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.damageAddRequest(Drawable, Region), cookie)
|
||||
return DamageAddCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) DamageAddChecked(Drawable Drawable, Region XfixesRegion) DamageAddCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.damageAddRequest(Drawable, Region), cookie)
|
||||
return DamageAddCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook DamageAddCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for DamageAdd
|
||||
func (c *Conn) damageAddRequest(Drawable Drawable, Region XfixesRegion) []byte {
|
||||
size := 12
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["DAMAGE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 4 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Drawable))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], uint32(Region))
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
@@ -1,600 +0,0 @@
|
||||
package xgb
|
||||
|
||||
/*
|
||||
This file was generated by dpms.xml on May 10 2012 12:39:33pm EDT.
|
||||
This file is automatically generated. Edit at your peril!
|
||||
*/
|
||||
|
||||
// DpmsInit must be called before using the DPMS extension.
|
||||
func (c *Conn) DpmsInit() error {
|
||||
reply, err := c.QueryExtension(4, "DPMS").Reply()
|
||||
switch {
|
||||
case err != nil:
|
||||
return err
|
||||
case !reply.Present:
|
||||
return errorf("No extension named DPMS could be found on on the server.")
|
||||
}
|
||||
|
||||
c.extLock.Lock()
|
||||
c.extensions["DPMS"] = reply.MajorOpcode
|
||||
for evNum, fun := range newExtEventFuncs["DPMS"] {
|
||||
newEventFuncs[int(reply.FirstEvent)+evNum] = fun
|
||||
}
|
||||
for errNum, fun := range newExtErrorFuncs["DPMS"] {
|
||||
newErrorFuncs[int(reply.FirstError)+errNum] = fun
|
||||
}
|
||||
c.extLock.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtEventFuncs["DPMS"] = make(map[int]newEventFun)
|
||||
newExtErrorFuncs["DPMS"] = make(map[int]newErrorFun)
|
||||
}
|
||||
|
||||
// Skipping definition for base type 'Float'
|
||||
|
||||
// Skipping definition for base type 'Card8'
|
||||
|
||||
// Skipping definition for base type 'Int16'
|
||||
|
||||
// Skipping definition for base type 'Int32'
|
||||
|
||||
// Skipping definition for base type 'Void'
|
||||
|
||||
// Skipping definition for base type 'Byte'
|
||||
|
||||
// Skipping definition for base type 'Int8'
|
||||
|
||||
// Skipping definition for base type 'Card16'
|
||||
|
||||
// Skipping definition for base type 'Char'
|
||||
|
||||
// Skipping definition for base type 'Card32'
|
||||
|
||||
// Skipping definition for base type 'Double'
|
||||
|
||||
// Skipping definition for base type 'Bool'
|
||||
|
||||
const (
|
||||
DpmsDPMSModeOn = 0
|
||||
DpmsDPMSModeStandby = 1
|
||||
DpmsDPMSModeSuspend = 2
|
||||
DpmsDPMSModeOff = 3
|
||||
)
|
||||
|
||||
// Request DpmsGetVersion
|
||||
// size: 8
|
||||
type DpmsGetVersionCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) DpmsGetVersion(ClientMajorVersion uint16, ClientMinorVersion uint16) DpmsGetVersionCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.dpmsGetVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie)
|
||||
return DpmsGetVersionCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) DpmsGetVersionUnchecked(ClientMajorVersion uint16, ClientMinorVersion uint16) DpmsGetVersionCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.dpmsGetVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie)
|
||||
return DpmsGetVersionCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for DpmsGetVersion
|
||||
// size: 12
|
||||
type DpmsGetVersionReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
ServerMajorVersion uint16
|
||||
ServerMinorVersion uint16
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request DpmsGetVersion
|
||||
func (cook DpmsGetVersionCookie) Reply() (*DpmsGetVersionReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return dpmsGetVersionReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for DpmsGetVersion
|
||||
func dpmsGetVersionReply(buf []byte) *DpmsGetVersionReply {
|
||||
v := new(DpmsGetVersionReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.ServerMajorVersion = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.ServerMinorVersion = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook DpmsGetVersionCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for DpmsGetVersion
|
||||
func (c *Conn) dpmsGetVersionRequest(ClientMajorVersion uint16, ClientMinorVersion uint16) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["DPMS"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 0 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], ClientMajorVersion)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], ClientMinorVersion)
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request DpmsCapable
|
||||
// size: 4
|
||||
type DpmsCapableCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) DpmsCapable() DpmsCapableCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.dpmsCapableRequest(), cookie)
|
||||
return DpmsCapableCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) DpmsCapableUnchecked() DpmsCapableCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.dpmsCapableRequest(), cookie)
|
||||
return DpmsCapableCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for DpmsCapable
|
||||
// size: 32
|
||||
type DpmsCapableReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
Capable bool
|
||||
// padding: 23 bytes
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request DpmsCapable
|
||||
func (cook DpmsCapableCookie) Reply() (*DpmsCapableReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return dpmsCapableReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for DpmsCapable
|
||||
func dpmsCapableReply(buf []byte) *DpmsCapableReply {
|
||||
v := new(DpmsCapableReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
if buf[b] == 1 {
|
||||
v.Capable = true
|
||||
} else {
|
||||
v.Capable = false
|
||||
}
|
||||
b += 1
|
||||
|
||||
b += 23 // padding
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook DpmsCapableCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for DpmsCapable
|
||||
func (c *Conn) dpmsCapableRequest() []byte {
|
||||
size := 4
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["DPMS"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 1 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request DpmsGetTimeouts
|
||||
// size: 4
|
||||
type DpmsGetTimeoutsCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) DpmsGetTimeouts() DpmsGetTimeoutsCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.dpmsGetTimeoutsRequest(), cookie)
|
||||
return DpmsGetTimeoutsCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) DpmsGetTimeoutsUnchecked() DpmsGetTimeoutsCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.dpmsGetTimeoutsRequest(), cookie)
|
||||
return DpmsGetTimeoutsCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for DpmsGetTimeouts
|
||||
// size: 32
|
||||
type DpmsGetTimeoutsReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
StandbyTimeout uint16
|
||||
SuspendTimeout uint16
|
||||
OffTimeout uint16
|
||||
// padding: 18 bytes
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request DpmsGetTimeouts
|
||||
func (cook DpmsGetTimeoutsCookie) Reply() (*DpmsGetTimeoutsReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return dpmsGetTimeoutsReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for DpmsGetTimeouts
|
||||
func dpmsGetTimeoutsReply(buf []byte) *DpmsGetTimeoutsReply {
|
||||
v := new(DpmsGetTimeoutsReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.StandbyTimeout = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.SuspendTimeout = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.OffTimeout = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
b += 18 // padding
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook DpmsGetTimeoutsCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for DpmsGetTimeouts
|
||||
func (c *Conn) dpmsGetTimeoutsRequest() []byte {
|
||||
size := 4
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["DPMS"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 2 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request DpmsSetTimeouts
|
||||
// size: 12
|
||||
type DpmsSetTimeoutsCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for DpmsSetTimeouts
|
||||
func (c *Conn) DpmsSetTimeouts(StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) DpmsSetTimeoutsCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.dpmsSetTimeoutsRequest(StandbyTimeout, SuspendTimeout, OffTimeout), cookie)
|
||||
return DpmsSetTimeoutsCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) DpmsSetTimeoutsChecked(StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) DpmsSetTimeoutsCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.dpmsSetTimeoutsRequest(StandbyTimeout, SuspendTimeout, OffTimeout), cookie)
|
||||
return DpmsSetTimeoutsCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook DpmsSetTimeoutsCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for DpmsSetTimeouts
|
||||
func (c *Conn) dpmsSetTimeoutsRequest(StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) []byte {
|
||||
size := 12
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["DPMS"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 3 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], StandbyTimeout)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], SuspendTimeout)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], OffTimeout)
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request DpmsEnable
|
||||
// size: 4
|
||||
type DpmsEnableCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for DpmsEnable
|
||||
func (c *Conn) DpmsEnable() DpmsEnableCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.dpmsEnableRequest(), cookie)
|
||||
return DpmsEnableCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) DpmsEnableChecked() DpmsEnableCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.dpmsEnableRequest(), cookie)
|
||||
return DpmsEnableCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook DpmsEnableCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for DpmsEnable
|
||||
func (c *Conn) dpmsEnableRequest() []byte {
|
||||
size := 4
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["DPMS"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 4 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request DpmsDisable
|
||||
// size: 4
|
||||
type DpmsDisableCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for DpmsDisable
|
||||
func (c *Conn) DpmsDisable() DpmsDisableCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.dpmsDisableRequest(), cookie)
|
||||
return DpmsDisableCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) DpmsDisableChecked() DpmsDisableCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.dpmsDisableRequest(), cookie)
|
||||
return DpmsDisableCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook DpmsDisableCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for DpmsDisable
|
||||
func (c *Conn) dpmsDisableRequest() []byte {
|
||||
size := 4
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["DPMS"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 5 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request DpmsForceLevel
|
||||
// size: 8
|
||||
type DpmsForceLevelCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for DpmsForceLevel
|
||||
func (c *Conn) DpmsForceLevel(PowerLevel uint16) DpmsForceLevelCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.dpmsForceLevelRequest(PowerLevel), cookie)
|
||||
return DpmsForceLevelCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) DpmsForceLevelChecked(PowerLevel uint16) DpmsForceLevelCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.dpmsForceLevelRequest(PowerLevel), cookie)
|
||||
return DpmsForceLevelCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook DpmsForceLevelCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for DpmsForceLevel
|
||||
func (c *Conn) dpmsForceLevelRequest(PowerLevel uint16) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["DPMS"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 6 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], PowerLevel)
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request DpmsInfo
|
||||
// size: 4
|
||||
type DpmsInfoCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) DpmsInfo() DpmsInfoCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.dpmsInfoRequest(), cookie)
|
||||
return DpmsInfoCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) DpmsInfoUnchecked() DpmsInfoCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.dpmsInfoRequest(), cookie)
|
||||
return DpmsInfoCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for DpmsInfo
|
||||
// size: 32
|
||||
type DpmsInfoReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
PowerLevel uint16
|
||||
State bool
|
||||
// padding: 21 bytes
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request DpmsInfo
|
||||
func (cook DpmsInfoCookie) Reply() (*DpmsInfoReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return dpmsInfoReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for DpmsInfo
|
||||
func dpmsInfoReply(buf []byte) *DpmsInfoReply {
|
||||
v := new(DpmsInfoReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.PowerLevel = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
if buf[b] == 1 {
|
||||
v.State = true
|
||||
} else {
|
||||
v.State = false
|
||||
}
|
||||
b += 1
|
||||
|
||||
b += 21 // padding
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook DpmsInfoCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for DpmsInfo
|
||||
func (c *Conn) dpmsInfoRequest() []byte {
|
||||
size := 4
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["DPMS"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 7 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
-1560
File diff suppressed because it is too large
Load Diff
@@ -1,151 +0,0 @@
|
||||
package xgb
|
||||
|
||||
/*
|
||||
This file was generated by ge.xml on May 10 2012 12:39:33pm EDT.
|
||||
This file is automatically generated. Edit at your peril!
|
||||
*/
|
||||
|
||||
// GeInit must be called before using the Generic Event Extension extension.
|
||||
func (c *Conn) GeInit() error {
|
||||
reply, err := c.QueryExtension(23, "Generic Event Extension").Reply()
|
||||
switch {
|
||||
case err != nil:
|
||||
return err
|
||||
case !reply.Present:
|
||||
return errorf("No extension named Generic Event Extension could be found on on the server.")
|
||||
}
|
||||
|
||||
c.extLock.Lock()
|
||||
c.extensions["Generic Event Extension"] = reply.MajorOpcode
|
||||
for evNum, fun := range newExtEventFuncs["Generic Event Extension"] {
|
||||
newEventFuncs[int(reply.FirstEvent)+evNum] = fun
|
||||
}
|
||||
for errNum, fun := range newExtErrorFuncs["Generic Event Extension"] {
|
||||
newErrorFuncs[int(reply.FirstError)+errNum] = fun
|
||||
}
|
||||
c.extLock.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtEventFuncs["Generic Event Extension"] = make(map[int]newEventFun)
|
||||
newExtErrorFuncs["Generic Event Extension"] = make(map[int]newErrorFun)
|
||||
}
|
||||
|
||||
// Skipping definition for base type 'Int8'
|
||||
|
||||
// Skipping definition for base type 'Card16'
|
||||
|
||||
// Skipping definition for base type 'Char'
|
||||
|
||||
// Skipping definition for base type 'Card32'
|
||||
|
||||
// Skipping definition for base type 'Double'
|
||||
|
||||
// Skipping definition for base type 'Bool'
|
||||
|
||||
// Skipping definition for base type 'Float'
|
||||
|
||||
// Skipping definition for base type 'Card8'
|
||||
|
||||
// Skipping definition for base type 'Int16'
|
||||
|
||||
// Skipping definition for base type 'Int32'
|
||||
|
||||
// Skipping definition for base type 'Void'
|
||||
|
||||
// Skipping definition for base type 'Byte'
|
||||
|
||||
// Request GeQueryVersion
|
||||
// size: 8
|
||||
type GeQueryVersionCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) GeQueryVersion(ClientMajorVersion uint16, ClientMinorVersion uint16) GeQueryVersionCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.geQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie)
|
||||
return GeQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) GeQueryVersionUnchecked(ClientMajorVersion uint16, ClientMinorVersion uint16) GeQueryVersionCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.geQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie)
|
||||
return GeQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for GeQueryVersion
|
||||
// size: 32
|
||||
type GeQueryVersionReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
MajorVersion uint16
|
||||
MinorVersion uint16
|
||||
// padding: 20 bytes
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request GeQueryVersion
|
||||
func (cook GeQueryVersionCookie) Reply() (*GeQueryVersionReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return geQueryVersionReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for GeQueryVersion
|
||||
func geQueryVersionReply(buf []byte) *GeQueryVersionReply {
|
||||
v := new(GeQueryVersionReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.MajorVersion = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.MinorVersion = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
b += 20 // padding
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook GeQueryVersionCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for GeQueryVersion
|
||||
func (c *Conn) geQueryVersionRequest(ClientMajorVersion uint16, ClientMinorVersion uint16) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["GENERIC EVENT EXTENSION"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 0 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], ClientMajorVersion)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], ClientMinorVersion)
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
-9430
File diff suppressed because it is too large
Load Diff
-4038
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,528 +0,0 @@
|
||||
package xgb
|
||||
|
||||
/*
|
||||
This file was generated by res.xml on May 10 2012 12:39:33pm EDT.
|
||||
This file is automatically generated. Edit at your peril!
|
||||
*/
|
||||
|
||||
// Imports are not necessary for XGB because everything is
|
||||
// in one package. They are still listed here for reference.
|
||||
// import "xproto"
|
||||
|
||||
// ResInit must be called before using the X-Resource extension.
|
||||
func (c *Conn) ResInit() error {
|
||||
reply, err := c.QueryExtension(10, "X-Resource").Reply()
|
||||
switch {
|
||||
case err != nil:
|
||||
return err
|
||||
case !reply.Present:
|
||||
return errorf("No extension named X-Resource could be found on on the server.")
|
||||
}
|
||||
|
||||
c.extLock.Lock()
|
||||
c.extensions["X-Resource"] = reply.MajorOpcode
|
||||
for evNum, fun := range newExtEventFuncs["X-Resource"] {
|
||||
newEventFuncs[int(reply.FirstEvent)+evNum] = fun
|
||||
}
|
||||
for errNum, fun := range newExtErrorFuncs["X-Resource"] {
|
||||
newErrorFuncs[int(reply.FirstError)+errNum] = fun
|
||||
}
|
||||
c.extLock.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtEventFuncs["X-Resource"] = make(map[int]newEventFun)
|
||||
newExtErrorFuncs["X-Resource"] = make(map[int]newErrorFun)
|
||||
}
|
||||
|
||||
// Skipping definition for base type 'Int8'
|
||||
|
||||
// Skipping definition for base type 'Card16'
|
||||
|
||||
// Skipping definition for base type 'Char'
|
||||
|
||||
// Skipping definition for base type 'Card32'
|
||||
|
||||
// Skipping definition for base type 'Double'
|
||||
|
||||
// Skipping definition for base type 'Bool'
|
||||
|
||||
// Skipping definition for base type 'Float'
|
||||
|
||||
// Skipping definition for base type 'Card8'
|
||||
|
||||
// Skipping definition for base type 'Int16'
|
||||
|
||||
// Skipping definition for base type 'Int32'
|
||||
|
||||
// Skipping definition for base type 'Void'
|
||||
|
||||
// Skipping definition for base type 'Byte'
|
||||
|
||||
// 'ResClient' struct definition
|
||||
// Size: 8
|
||||
type ResClient struct {
|
||||
ResourceBase uint32
|
||||
ResourceMask uint32
|
||||
}
|
||||
|
||||
// Struct read ResClient
|
||||
func ReadResClient(buf []byte, v *ResClient) int {
|
||||
b := 0
|
||||
|
||||
v.ResourceBase = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
v.ResourceMask = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
return b
|
||||
}
|
||||
|
||||
// Struct list read ResClient
|
||||
func ReadResClientList(buf []byte, dest []ResClient) int {
|
||||
b := 0
|
||||
for i := 0; i < len(dest); i++ {
|
||||
dest[i] = ResClient{}
|
||||
b += ReadResClient(buf[b:], &dest[i])
|
||||
}
|
||||
return pad(b)
|
||||
}
|
||||
|
||||
// Struct write ResClient
|
||||
func (v ResClient) Bytes() []byte {
|
||||
buf := make([]byte, 8)
|
||||
b := 0
|
||||
|
||||
Put32(buf[b:], v.ResourceBase)
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], v.ResourceMask)
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Write struct list ResClient
|
||||
func ResClientListBytes(buf []byte, list []ResClient) int {
|
||||
b := 0
|
||||
var structBytes []byte
|
||||
for _, item := range list {
|
||||
structBytes = item.Bytes()
|
||||
copy(buf[b:], structBytes)
|
||||
b += pad(len(structBytes))
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// 'ResType' struct definition
|
||||
// Size: 8
|
||||
type ResType struct {
|
||||
ResourceType Atom
|
||||
Count uint32
|
||||
}
|
||||
|
||||
// Struct read ResType
|
||||
func ReadResType(buf []byte, v *ResType) int {
|
||||
b := 0
|
||||
|
||||
v.ResourceType = Atom(Get32(buf[b:]))
|
||||
b += 4
|
||||
|
||||
v.Count = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
return b
|
||||
}
|
||||
|
||||
// Struct list read ResType
|
||||
func ReadResTypeList(buf []byte, dest []ResType) int {
|
||||
b := 0
|
||||
for i := 0; i < len(dest); i++ {
|
||||
dest[i] = ResType{}
|
||||
b += ReadResType(buf[b:], &dest[i])
|
||||
}
|
||||
return pad(b)
|
||||
}
|
||||
|
||||
// Struct write ResType
|
||||
func (v ResType) Bytes() []byte {
|
||||
buf := make([]byte, 8)
|
||||
b := 0
|
||||
|
||||
Put32(buf[b:], uint32(v.ResourceType))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], v.Count)
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Write struct list ResType
|
||||
func ResTypeListBytes(buf []byte, list []ResType) int {
|
||||
b := 0
|
||||
var structBytes []byte
|
||||
for _, item := range list {
|
||||
structBytes = item.Bytes()
|
||||
copy(buf[b:], structBytes)
|
||||
b += pad(len(structBytes))
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// Request ResQueryVersion
|
||||
// size: 8
|
||||
type ResQueryVersionCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) ResQueryVersion(ClientMajor byte, ClientMinor byte) ResQueryVersionCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.resQueryVersionRequest(ClientMajor, ClientMinor), cookie)
|
||||
return ResQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ResQueryVersionUnchecked(ClientMajor byte, ClientMinor byte) ResQueryVersionCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.resQueryVersionRequest(ClientMajor, ClientMinor), cookie)
|
||||
return ResQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for ResQueryVersion
|
||||
// size: 12
|
||||
type ResQueryVersionReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
ServerMajor uint16
|
||||
ServerMinor uint16
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request ResQueryVersion
|
||||
func (cook ResQueryVersionCookie) Reply() (*ResQueryVersionReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return resQueryVersionReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for ResQueryVersion
|
||||
func resQueryVersionReply(buf []byte) *ResQueryVersionReply {
|
||||
v := new(ResQueryVersionReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.ServerMajor = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.ServerMinor = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook ResQueryVersionCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ResQueryVersion
|
||||
func (c *Conn) resQueryVersionRequest(ClientMajor byte, ClientMinor byte) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["X-RESOURCE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 0 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
buf[b] = ClientMajor
|
||||
b += 1
|
||||
|
||||
buf[b] = ClientMinor
|
||||
b += 1
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ResQueryClients
|
||||
// size: 4
|
||||
type ResQueryClientsCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) ResQueryClients() ResQueryClientsCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.resQueryClientsRequest(), cookie)
|
||||
return ResQueryClientsCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ResQueryClientsUnchecked() ResQueryClientsCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.resQueryClientsRequest(), cookie)
|
||||
return ResQueryClientsCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for ResQueryClients
|
||||
// size: (32 + pad((int(NumClients) * 8)))
|
||||
type ResQueryClientsReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
NumClients uint32
|
||||
// padding: 20 bytes
|
||||
Clients []ResClient // size: pad((int(NumClients) * 8))
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request ResQueryClients
|
||||
func (cook ResQueryClientsCookie) Reply() (*ResQueryClientsReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return resQueryClientsReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for ResQueryClients
|
||||
func resQueryClientsReply(buf []byte) *ResQueryClientsReply {
|
||||
v := new(ResQueryClientsReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.NumClients = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
b += 20 // padding
|
||||
|
||||
v.Clients = make([]ResClient, v.NumClients)
|
||||
b += ReadResClientList(buf[b:], v.Clients)
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook ResQueryClientsCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ResQueryClients
|
||||
func (c *Conn) resQueryClientsRequest() []byte {
|
||||
size := 4
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["X-RESOURCE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 1 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ResQueryClientResources
|
||||
// size: 8
|
||||
type ResQueryClientResourcesCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) ResQueryClientResources(Xid uint32) ResQueryClientResourcesCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.resQueryClientResourcesRequest(Xid), cookie)
|
||||
return ResQueryClientResourcesCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ResQueryClientResourcesUnchecked(Xid uint32) ResQueryClientResourcesCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.resQueryClientResourcesRequest(Xid), cookie)
|
||||
return ResQueryClientResourcesCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for ResQueryClientResources
|
||||
// size: (32 + pad((int(NumTypes) * 8)))
|
||||
type ResQueryClientResourcesReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
NumTypes uint32
|
||||
// padding: 20 bytes
|
||||
Types []ResType // size: pad((int(NumTypes) * 8))
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request ResQueryClientResources
|
||||
func (cook ResQueryClientResourcesCookie) Reply() (*ResQueryClientResourcesReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return resQueryClientResourcesReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for ResQueryClientResources
|
||||
func resQueryClientResourcesReply(buf []byte) *ResQueryClientResourcesReply {
|
||||
v := new(ResQueryClientResourcesReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.NumTypes = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
b += 20 // padding
|
||||
|
||||
v.Types = make([]ResType, v.NumTypes)
|
||||
b += ReadResTypeList(buf[b:], v.Types)
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook ResQueryClientResourcesCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ResQueryClientResources
|
||||
func (c *Conn) resQueryClientResourcesRequest(Xid uint32) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["X-RESOURCE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 2 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], Xid)
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ResQueryClientPixmapBytes
|
||||
// size: 8
|
||||
type ResQueryClientPixmapBytesCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) ResQueryClientPixmapBytes(Xid uint32) ResQueryClientPixmapBytesCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.resQueryClientPixmapBytesRequest(Xid), cookie)
|
||||
return ResQueryClientPixmapBytesCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ResQueryClientPixmapBytesUnchecked(Xid uint32) ResQueryClientPixmapBytesCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.resQueryClientPixmapBytesRequest(Xid), cookie)
|
||||
return ResQueryClientPixmapBytesCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for ResQueryClientPixmapBytes
|
||||
// size: 16
|
||||
type ResQueryClientPixmapBytesReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
Bytes uint32
|
||||
BytesOverflow uint32
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request ResQueryClientPixmapBytes
|
||||
func (cook ResQueryClientPixmapBytesCookie) Reply() (*ResQueryClientPixmapBytesReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return resQueryClientPixmapBytesReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for ResQueryClientPixmapBytes
|
||||
func resQueryClientPixmapBytesReply(buf []byte) *ResQueryClientPixmapBytesReply {
|
||||
v := new(ResQueryClientPixmapBytesReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.Bytes = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
v.BytesOverflow = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook ResQueryClientPixmapBytesCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ResQueryClientPixmapBytes
|
||||
func (c *Conn) resQueryClientPixmapBytesRequest(Xid uint32) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["X-RESOURCE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 3 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], Xid)
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
@@ -1,627 +0,0 @@
|
||||
package xgb
|
||||
|
||||
/*
|
||||
This file was generated by screensaver.xml on May 10 2012 12:39:34pm EDT.
|
||||
This file is automatically generated. Edit at your peril!
|
||||
*/
|
||||
|
||||
// Imports are not necessary for XGB because everything is
|
||||
// in one package. They are still listed here for reference.
|
||||
// import "xproto"
|
||||
|
||||
// ScreensaverInit must be called before using the MIT-SCREEN-SAVER extension.
|
||||
func (c *Conn) ScreensaverInit() error {
|
||||
reply, err := c.QueryExtension(16, "MIT-SCREEN-SAVER").Reply()
|
||||
switch {
|
||||
case err != nil:
|
||||
return err
|
||||
case !reply.Present:
|
||||
return errorf("No extension named MIT-SCREEN-SAVER could be found on on the server.")
|
||||
}
|
||||
|
||||
c.extLock.Lock()
|
||||
c.extensions["MIT-SCREEN-SAVER"] = reply.MajorOpcode
|
||||
for evNum, fun := range newExtEventFuncs["MIT-SCREEN-SAVER"] {
|
||||
newEventFuncs[int(reply.FirstEvent)+evNum] = fun
|
||||
}
|
||||
for errNum, fun := range newExtErrorFuncs["MIT-SCREEN-SAVER"] {
|
||||
newErrorFuncs[int(reply.FirstError)+errNum] = fun
|
||||
}
|
||||
c.extLock.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtEventFuncs["MIT-SCREEN-SAVER"] = make(map[int]newEventFun)
|
||||
newExtErrorFuncs["MIT-SCREEN-SAVER"] = make(map[int]newErrorFun)
|
||||
}
|
||||
|
||||
// Skipping definition for base type 'Card8'
|
||||
|
||||
// Skipping definition for base type 'Int16'
|
||||
|
||||
// Skipping definition for base type 'Int32'
|
||||
|
||||
// Skipping definition for base type 'Void'
|
||||
|
||||
// Skipping definition for base type 'Byte'
|
||||
|
||||
// Skipping definition for base type 'Int8'
|
||||
|
||||
// Skipping definition for base type 'Card16'
|
||||
|
||||
// Skipping definition for base type 'Char'
|
||||
|
||||
// Skipping definition for base type 'Card32'
|
||||
|
||||
// Skipping definition for base type 'Double'
|
||||
|
||||
// Skipping definition for base type 'Bool'
|
||||
|
||||
// Skipping definition for base type 'Float'
|
||||
|
||||
const (
|
||||
ScreensaverKindBlanked = 0
|
||||
ScreensaverKindInternal = 1
|
||||
ScreensaverKindExternal = 2
|
||||
)
|
||||
|
||||
const (
|
||||
ScreensaverEventNotifyMask = 1
|
||||
ScreensaverEventCycleMask = 2
|
||||
)
|
||||
|
||||
const (
|
||||
ScreensaverStateOff = 0
|
||||
ScreensaverStateOn = 1
|
||||
ScreensaverStateCycle = 2
|
||||
ScreensaverStateDisabled = 3
|
||||
)
|
||||
|
||||
// Event definition ScreensaverNotify (0)
|
||||
// Size: 32
|
||||
|
||||
const ScreensaverNotify = 0
|
||||
|
||||
type ScreensaverNotifyEvent struct {
|
||||
Sequence uint16
|
||||
Code byte
|
||||
State byte
|
||||
// padding: 1 bytes
|
||||
SequenceNumber uint16
|
||||
Time Timestamp
|
||||
Root Window
|
||||
Window Window
|
||||
Kind byte
|
||||
Forced bool
|
||||
// padding: 14 bytes
|
||||
}
|
||||
|
||||
// Event read ScreensaverNotify
|
||||
func NewScreensaverNotifyEvent(buf []byte) Event {
|
||||
v := ScreensaverNotifyEvent{}
|
||||
b := 1 // don't read event number
|
||||
|
||||
v.Code = buf[b]
|
||||
b += 1
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.State = buf[b]
|
||||
b += 1
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.SequenceNumber = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Time = Timestamp(Get32(buf[b:]))
|
||||
b += 4
|
||||
|
||||
v.Root = Window(Get32(buf[b:]))
|
||||
b += 4
|
||||
|
||||
v.Window = Window(Get32(buf[b:]))
|
||||
b += 4
|
||||
|
||||
v.Kind = buf[b]
|
||||
b += 1
|
||||
|
||||
if buf[b] == 1 {
|
||||
v.Forced = true
|
||||
} else {
|
||||
v.Forced = false
|
||||
}
|
||||
b += 1
|
||||
|
||||
b += 14 // padding
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
// Event write ScreensaverNotify
|
||||
func (v ScreensaverNotifyEvent) Bytes() []byte {
|
||||
buf := make([]byte, 32)
|
||||
b := 0
|
||||
|
||||
// write event number
|
||||
buf[b] = 0
|
||||
b += 1
|
||||
|
||||
buf[b] = v.Code
|
||||
b += 1
|
||||
|
||||
b += 2 // skip sequence number
|
||||
|
||||
buf[b] = v.State
|
||||
b += 1
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
Put16(buf[b:], v.SequenceNumber)
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(v.Time))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], uint32(v.Root))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], uint32(v.Window))
|
||||
b += 4
|
||||
|
||||
buf[b] = v.Kind
|
||||
b += 1
|
||||
|
||||
if v.Forced {
|
||||
buf[b] = 1
|
||||
} else {
|
||||
buf[b] = 0
|
||||
}
|
||||
b += 1
|
||||
|
||||
b += 14 // padding
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
func (v ScreensaverNotifyEvent) ImplementsEvent() {}
|
||||
|
||||
func (v ScreensaverNotifyEvent) SequenceId() uint16 {
|
||||
return v.Sequence
|
||||
}
|
||||
|
||||
func (v ScreensaverNotifyEvent) String() string {
|
||||
fieldVals := make([]string, 0, 10)
|
||||
fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence))
|
||||
fieldVals = append(fieldVals, sprintf("Code: %d", v.Code))
|
||||
fieldVals = append(fieldVals, sprintf("State: %d", v.State))
|
||||
fieldVals = append(fieldVals, sprintf("SequenceNumber: %d", v.SequenceNumber))
|
||||
fieldVals = append(fieldVals, sprintf("Time: %d", v.Time))
|
||||
fieldVals = append(fieldVals, sprintf("Root: %d", v.Root))
|
||||
fieldVals = append(fieldVals, sprintf("Window: %d", v.Window))
|
||||
fieldVals = append(fieldVals, sprintf("Kind: %d", v.Kind))
|
||||
fieldVals = append(fieldVals, sprintf("Forced: %t", v.Forced))
|
||||
return "ScreensaverNotify {" + stringsJoin(fieldVals, ", ") + "}"
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtEventFuncs["MIT-SCREEN-SAVER"][0] = NewScreensaverNotifyEvent
|
||||
}
|
||||
|
||||
// Request ScreensaverQueryVersion
|
||||
// size: 8
|
||||
type ScreensaverQueryVersionCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) ScreensaverQueryVersion(ClientMajorVersion byte, ClientMinorVersion byte) ScreensaverQueryVersionCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.screensaverQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie)
|
||||
return ScreensaverQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ScreensaverQueryVersionUnchecked(ClientMajorVersion byte, ClientMinorVersion byte) ScreensaverQueryVersionCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.screensaverQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie)
|
||||
return ScreensaverQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for ScreensaverQueryVersion
|
||||
// size: 32
|
||||
type ScreensaverQueryVersionReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
ServerMajorVersion uint16
|
||||
ServerMinorVersion uint16
|
||||
// padding: 20 bytes
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request ScreensaverQueryVersion
|
||||
func (cook ScreensaverQueryVersionCookie) Reply() (*ScreensaverQueryVersionReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return screensaverQueryVersionReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for ScreensaverQueryVersion
|
||||
func screensaverQueryVersionReply(buf []byte) *ScreensaverQueryVersionReply {
|
||||
v := new(ScreensaverQueryVersionReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.ServerMajorVersion = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.ServerMinorVersion = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
b += 20 // padding
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook ScreensaverQueryVersionCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ScreensaverQueryVersion
|
||||
func (c *Conn) screensaverQueryVersionRequest(ClientMajorVersion byte, ClientMinorVersion byte) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["MIT-SCREEN-SAVER"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 0 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
buf[b] = ClientMajorVersion
|
||||
b += 1
|
||||
|
||||
buf[b] = ClientMinorVersion
|
||||
b += 1
|
||||
|
||||
b += 2 // padding
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ScreensaverQueryInfo
|
||||
// size: 8
|
||||
type ScreensaverQueryInfoCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) ScreensaverQueryInfo(Drawable Drawable) ScreensaverQueryInfoCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.screensaverQueryInfoRequest(Drawable), cookie)
|
||||
return ScreensaverQueryInfoCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ScreensaverQueryInfoUnchecked(Drawable Drawable) ScreensaverQueryInfoCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.screensaverQueryInfoRequest(Drawable), cookie)
|
||||
return ScreensaverQueryInfoCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for ScreensaverQueryInfo
|
||||
// size: 32
|
||||
type ScreensaverQueryInfoReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
State byte
|
||||
SaverWindow Window
|
||||
MsUntilServer uint32
|
||||
MsSinceUserInput uint32
|
||||
EventMask uint32
|
||||
Kind byte
|
||||
// padding: 7 bytes
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request ScreensaverQueryInfo
|
||||
func (cook ScreensaverQueryInfoCookie) Reply() (*ScreensaverQueryInfoReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return screensaverQueryInfoReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for ScreensaverQueryInfo
|
||||
func screensaverQueryInfoReply(buf []byte) *ScreensaverQueryInfoReply {
|
||||
v := new(ScreensaverQueryInfoReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
v.State = buf[b]
|
||||
b += 1
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.SaverWindow = Window(Get32(buf[b:]))
|
||||
b += 4
|
||||
|
||||
v.MsUntilServer = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
v.MsSinceUserInput = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
v.EventMask = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
v.Kind = buf[b]
|
||||
b += 1
|
||||
|
||||
b += 7 // padding
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook ScreensaverQueryInfoCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ScreensaverQueryInfo
|
||||
func (c *Conn) screensaverQueryInfoRequest(Drawable Drawable) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["MIT-SCREEN-SAVER"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 1 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Drawable))
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ScreensaverSelectInput
|
||||
// size: 12
|
||||
type ScreensaverSelectInputCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for ScreensaverSelectInput
|
||||
func (c *Conn) ScreensaverSelectInput(Drawable Drawable, EventMask uint32) ScreensaverSelectInputCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.screensaverSelectInputRequest(Drawable, EventMask), cookie)
|
||||
return ScreensaverSelectInputCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ScreensaverSelectInputChecked(Drawable Drawable, EventMask uint32) ScreensaverSelectInputCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.screensaverSelectInputRequest(Drawable, EventMask), cookie)
|
||||
return ScreensaverSelectInputCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook ScreensaverSelectInputCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ScreensaverSelectInput
|
||||
func (c *Conn) screensaverSelectInputRequest(Drawable Drawable, EventMask uint32) []byte {
|
||||
size := 12
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["MIT-SCREEN-SAVER"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 2 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Drawable))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], EventMask)
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ScreensaverSetAttributes
|
||||
// size: pad((24 + (4 + pad((4 * popCount(int(ValueMask)))))))
|
||||
type ScreensaverSetAttributesCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for ScreensaverSetAttributes
|
||||
func (c *Conn) ScreensaverSetAttributes(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual Visualid, ValueMask uint32, ValueList []uint32) ScreensaverSetAttributesCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.screensaverSetAttributesRequest(Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie)
|
||||
return ScreensaverSetAttributesCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ScreensaverSetAttributesChecked(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual Visualid, ValueMask uint32, ValueList []uint32) ScreensaverSetAttributesCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.screensaverSetAttributesRequest(Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie)
|
||||
return ScreensaverSetAttributesCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook ScreensaverSetAttributesCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ScreensaverSetAttributes
|
||||
func (c *Conn) screensaverSetAttributesRequest(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual Visualid, ValueMask uint32, ValueList []uint32) []byte {
|
||||
size := pad((24 + (4 + pad((4 * popCount(int(ValueMask)))))))
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["MIT-SCREEN-SAVER"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 3 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Drawable))
|
||||
b += 4
|
||||
|
||||
Put16(buf[b:], uint16(X))
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], uint16(Y))
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], Width)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], Height)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], BorderWidth)
|
||||
b += 2
|
||||
|
||||
buf[b] = Class
|
||||
b += 1
|
||||
|
||||
buf[b] = Depth
|
||||
b += 1
|
||||
|
||||
Put32(buf[b:], uint32(Visual))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], ValueMask)
|
||||
b += 4
|
||||
for i := 0; i < popCount(int(ValueMask)); i++ {
|
||||
Put32(buf[b:], ValueList[i])
|
||||
b += 4
|
||||
}
|
||||
b = pad(b)
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ScreensaverUnsetAttributes
|
||||
// size: 8
|
||||
type ScreensaverUnsetAttributesCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for ScreensaverUnsetAttributes
|
||||
func (c *Conn) ScreensaverUnsetAttributes(Drawable Drawable) ScreensaverUnsetAttributesCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.screensaverUnsetAttributesRequest(Drawable), cookie)
|
||||
return ScreensaverUnsetAttributesCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ScreensaverUnsetAttributesChecked(Drawable Drawable) ScreensaverUnsetAttributesCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.screensaverUnsetAttributesRequest(Drawable), cookie)
|
||||
return ScreensaverUnsetAttributesCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook ScreensaverUnsetAttributesCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ScreensaverUnsetAttributes
|
||||
func (c *Conn) screensaverUnsetAttributesRequest(Drawable Drawable) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["MIT-SCREEN-SAVER"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 4 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Drawable))
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ScreensaverSuspend
|
||||
// size: 8
|
||||
type ScreensaverSuspendCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for ScreensaverSuspend
|
||||
func (c *Conn) ScreensaverSuspend(Suspend bool) ScreensaverSuspendCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.screensaverSuspendRequest(Suspend), cookie)
|
||||
return ScreensaverSuspendCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ScreensaverSuspendChecked(Suspend bool) ScreensaverSuspendCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.screensaverSuspendRequest(Suspend), cookie)
|
||||
return ScreensaverSuspendCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook ScreensaverSuspendCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ScreensaverSuspend
|
||||
func (c *Conn) screensaverSuspendRequest(Suspend bool) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["MIT-SCREEN-SAVER"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 5 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
if Suspend {
|
||||
buf[b] = 1
|
||||
} else {
|
||||
buf[b] = 0
|
||||
}
|
||||
b += 1
|
||||
|
||||
b += 3 // padding
|
||||
|
||||
return buf
|
||||
}
|
||||
@@ -1,897 +0,0 @@
|
||||
package xgb
|
||||
|
||||
/*
|
||||
This file was generated by shape.xml on May 10 2012 12:39:34pm EDT.
|
||||
This file is automatically generated. Edit at your peril!
|
||||
*/
|
||||
|
||||
// Imports are not necessary for XGB because everything is
|
||||
// in one package. They are still listed here for reference.
|
||||
// import "xproto"
|
||||
|
||||
// ShapeInit must be called before using the SHAPE extension.
|
||||
func (c *Conn) ShapeInit() error {
|
||||
reply, err := c.QueryExtension(5, "SHAPE").Reply()
|
||||
switch {
|
||||
case err != nil:
|
||||
return err
|
||||
case !reply.Present:
|
||||
return errorf("No extension named SHAPE could be found on on the server.")
|
||||
}
|
||||
|
||||
c.extLock.Lock()
|
||||
c.extensions["SHAPE"] = reply.MajorOpcode
|
||||
for evNum, fun := range newExtEventFuncs["SHAPE"] {
|
||||
newEventFuncs[int(reply.FirstEvent)+evNum] = fun
|
||||
}
|
||||
for errNum, fun := range newExtErrorFuncs["SHAPE"] {
|
||||
newErrorFuncs[int(reply.FirstError)+errNum] = fun
|
||||
}
|
||||
c.extLock.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtEventFuncs["SHAPE"] = make(map[int]newEventFun)
|
||||
newExtErrorFuncs["SHAPE"] = make(map[int]newErrorFun)
|
||||
}
|
||||
|
||||
// Skipping definition for base type 'Int16'
|
||||
|
||||
// Skipping definition for base type 'Int32'
|
||||
|
||||
// Skipping definition for base type 'Void'
|
||||
|
||||
// Skipping definition for base type 'Byte'
|
||||
|
||||
// Skipping definition for base type 'Int8'
|
||||
|
||||
// Skipping definition for base type 'Card16'
|
||||
|
||||
// Skipping definition for base type 'Char'
|
||||
|
||||
// Skipping definition for base type 'Card32'
|
||||
|
||||
// Skipping definition for base type 'Double'
|
||||
|
||||
// Skipping definition for base type 'Bool'
|
||||
|
||||
// Skipping definition for base type 'Float'
|
||||
|
||||
// Skipping definition for base type 'Card8'
|
||||
|
||||
const (
|
||||
ShapeSoSet = 0
|
||||
ShapeSoUnion = 1
|
||||
ShapeSoIntersect = 2
|
||||
ShapeSoSubtract = 3
|
||||
ShapeSoInvert = 4
|
||||
)
|
||||
|
||||
const (
|
||||
ShapeSkBounding = 0
|
||||
ShapeSkClip = 1
|
||||
ShapeSkInput = 2
|
||||
)
|
||||
|
||||
type ShapeOp byte
|
||||
|
||||
type ShapeKind byte
|
||||
|
||||
// Event definition ShapeNotify (0)
|
||||
// Size: 32
|
||||
|
||||
const ShapeNotify = 0
|
||||
|
||||
type ShapeNotifyEvent struct {
|
||||
Sequence uint16
|
||||
ShapeKind ShapeKind
|
||||
AffectedWindow Window
|
||||
ExtentsX int16
|
||||
ExtentsY int16
|
||||
ExtentsWidth uint16
|
||||
ExtentsHeight uint16
|
||||
ServerTime Timestamp
|
||||
Shaped bool
|
||||
// padding: 11 bytes
|
||||
}
|
||||
|
||||
// Event read ShapeNotify
|
||||
func NewShapeNotifyEvent(buf []byte) Event {
|
||||
v := ShapeNotifyEvent{}
|
||||
b := 1 // don't read event number
|
||||
|
||||
v.ShapeKind = ShapeKind(buf[b])
|
||||
b += 1
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.AffectedWindow = Window(Get32(buf[b:]))
|
||||
b += 4
|
||||
|
||||
v.ExtentsX = int16(Get16(buf[b:]))
|
||||
b += 2
|
||||
|
||||
v.ExtentsY = int16(Get16(buf[b:]))
|
||||
b += 2
|
||||
|
||||
v.ExtentsWidth = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.ExtentsHeight = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.ServerTime = Timestamp(Get32(buf[b:]))
|
||||
b += 4
|
||||
|
||||
if buf[b] == 1 {
|
||||
v.Shaped = true
|
||||
} else {
|
||||
v.Shaped = false
|
||||
}
|
||||
b += 1
|
||||
|
||||
b += 11 // padding
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
// Event write ShapeNotify
|
||||
func (v ShapeNotifyEvent) Bytes() []byte {
|
||||
buf := make([]byte, 32)
|
||||
b := 0
|
||||
|
||||
// write event number
|
||||
buf[b] = 0
|
||||
b += 1
|
||||
|
||||
buf[b] = byte(v.ShapeKind)
|
||||
b += 1
|
||||
|
||||
b += 2 // skip sequence number
|
||||
|
||||
Put32(buf[b:], uint32(v.AffectedWindow))
|
||||
b += 4
|
||||
|
||||
Put16(buf[b:], uint16(v.ExtentsX))
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], uint16(v.ExtentsY))
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], v.ExtentsWidth)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], v.ExtentsHeight)
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(v.ServerTime))
|
||||
b += 4
|
||||
|
||||
if v.Shaped {
|
||||
buf[b] = 1
|
||||
} else {
|
||||
buf[b] = 0
|
||||
}
|
||||
b += 1
|
||||
|
||||
b += 11 // padding
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
func (v ShapeNotifyEvent) ImplementsEvent() {}
|
||||
|
||||
func (v ShapeNotifyEvent) SequenceId() uint16 {
|
||||
return v.Sequence
|
||||
}
|
||||
|
||||
func (v ShapeNotifyEvent) String() string {
|
||||
fieldVals := make([]string, 0, 9)
|
||||
fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence))
|
||||
fieldVals = append(fieldVals, sprintf("ShapeKind: %d", v.ShapeKind))
|
||||
fieldVals = append(fieldVals, sprintf("AffectedWindow: %d", v.AffectedWindow))
|
||||
fieldVals = append(fieldVals, sprintf("ExtentsX: %d", v.ExtentsX))
|
||||
fieldVals = append(fieldVals, sprintf("ExtentsY: %d", v.ExtentsY))
|
||||
fieldVals = append(fieldVals, sprintf("ExtentsWidth: %d", v.ExtentsWidth))
|
||||
fieldVals = append(fieldVals, sprintf("ExtentsHeight: %d", v.ExtentsHeight))
|
||||
fieldVals = append(fieldVals, sprintf("ServerTime: %d", v.ServerTime))
|
||||
fieldVals = append(fieldVals, sprintf("Shaped: %t", v.Shaped))
|
||||
return "ShapeNotify {" + stringsJoin(fieldVals, ", ") + "}"
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtEventFuncs["SHAPE"][0] = NewShapeNotifyEvent
|
||||
}
|
||||
|
||||
// Request ShapeQueryVersion
|
||||
// size: 4
|
||||
type ShapeQueryVersionCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) ShapeQueryVersion() ShapeQueryVersionCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.shapeQueryVersionRequest(), cookie)
|
||||
return ShapeQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ShapeQueryVersionUnchecked() ShapeQueryVersionCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.shapeQueryVersionRequest(), cookie)
|
||||
return ShapeQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for ShapeQueryVersion
|
||||
// size: 12
|
||||
type ShapeQueryVersionReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
MajorVersion uint16
|
||||
MinorVersion uint16
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request ShapeQueryVersion
|
||||
func (cook ShapeQueryVersionCookie) Reply() (*ShapeQueryVersionReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return shapeQueryVersionReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for ShapeQueryVersion
|
||||
func shapeQueryVersionReply(buf []byte) *ShapeQueryVersionReply {
|
||||
v := new(ShapeQueryVersionReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.MajorVersion = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.MinorVersion = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook ShapeQueryVersionCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ShapeQueryVersion
|
||||
func (c *Conn) shapeQueryVersionRequest() []byte {
|
||||
size := 4
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["SHAPE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 0 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ShapeRectangles
|
||||
// size: pad((16 + pad((len(Rectangles) * 8))))
|
||||
type ShapeRectanglesCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for ShapeRectangles
|
||||
func (c *Conn) ShapeRectangles(Operation ShapeOp, DestinationKind ShapeKind, Ordering byte, DestinationWindow Window, XOffset int16, YOffset int16, Rectangles []Rectangle) ShapeRectanglesCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.shapeRectanglesRequest(Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie)
|
||||
return ShapeRectanglesCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ShapeRectanglesChecked(Operation ShapeOp, DestinationKind ShapeKind, Ordering byte, DestinationWindow Window, XOffset int16, YOffset int16, Rectangles []Rectangle) ShapeRectanglesCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.shapeRectanglesRequest(Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie)
|
||||
return ShapeRectanglesCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook ShapeRectanglesCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ShapeRectangles
|
||||
func (c *Conn) shapeRectanglesRequest(Operation ShapeOp, DestinationKind ShapeKind, Ordering byte, DestinationWindow Window, XOffset int16, YOffset int16, Rectangles []Rectangle) []byte {
|
||||
size := pad((16 + pad((len(Rectangles) * 8))))
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["SHAPE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 1 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
buf[b] = byte(Operation)
|
||||
b += 1
|
||||
|
||||
buf[b] = byte(DestinationKind)
|
||||
b += 1
|
||||
|
||||
buf[b] = Ordering
|
||||
b += 1
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
Put32(buf[b:], uint32(DestinationWindow))
|
||||
b += 4
|
||||
|
||||
Put16(buf[b:], uint16(XOffset))
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], uint16(YOffset))
|
||||
b += 2
|
||||
|
||||
b += RectangleListBytes(buf[b:], Rectangles)
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ShapeMask
|
||||
// size: 20
|
||||
type ShapeMaskCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for ShapeMask
|
||||
func (c *Conn) ShapeMask(Operation ShapeOp, DestinationKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16, SourceBitmap Pixmap) ShapeMaskCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.shapeMaskRequest(Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie)
|
||||
return ShapeMaskCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ShapeMaskChecked(Operation ShapeOp, DestinationKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16, SourceBitmap Pixmap) ShapeMaskCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.shapeMaskRequest(Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie)
|
||||
return ShapeMaskCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook ShapeMaskCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ShapeMask
|
||||
func (c *Conn) shapeMaskRequest(Operation ShapeOp, DestinationKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16, SourceBitmap Pixmap) []byte {
|
||||
size := 20
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["SHAPE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 2 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
buf[b] = byte(Operation)
|
||||
b += 1
|
||||
|
||||
buf[b] = byte(DestinationKind)
|
||||
b += 1
|
||||
|
||||
b += 2 // padding
|
||||
|
||||
Put32(buf[b:], uint32(DestinationWindow))
|
||||
b += 4
|
||||
|
||||
Put16(buf[b:], uint16(XOffset))
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], uint16(YOffset))
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(SourceBitmap))
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ShapeCombine
|
||||
// size: 20
|
||||
type ShapeCombineCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for ShapeCombine
|
||||
func (c *Conn) ShapeCombine(Operation ShapeOp, DestinationKind ShapeKind, SourceKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16, SourceWindow Window) ShapeCombineCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.shapeCombineRequest(Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie)
|
||||
return ShapeCombineCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ShapeCombineChecked(Operation ShapeOp, DestinationKind ShapeKind, SourceKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16, SourceWindow Window) ShapeCombineCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.shapeCombineRequest(Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie)
|
||||
return ShapeCombineCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook ShapeCombineCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ShapeCombine
|
||||
func (c *Conn) shapeCombineRequest(Operation ShapeOp, DestinationKind ShapeKind, SourceKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16, SourceWindow Window) []byte {
|
||||
size := 20
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["SHAPE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 3 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
buf[b] = byte(Operation)
|
||||
b += 1
|
||||
|
||||
buf[b] = byte(DestinationKind)
|
||||
b += 1
|
||||
|
||||
buf[b] = byte(SourceKind)
|
||||
b += 1
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
Put32(buf[b:], uint32(DestinationWindow))
|
||||
b += 4
|
||||
|
||||
Put16(buf[b:], uint16(XOffset))
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], uint16(YOffset))
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(SourceWindow))
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ShapeOffset
|
||||
// size: 16
|
||||
type ShapeOffsetCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for ShapeOffset
|
||||
func (c *Conn) ShapeOffset(DestinationKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16) ShapeOffsetCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.shapeOffsetRequest(DestinationKind, DestinationWindow, XOffset, YOffset), cookie)
|
||||
return ShapeOffsetCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ShapeOffsetChecked(DestinationKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16) ShapeOffsetCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.shapeOffsetRequest(DestinationKind, DestinationWindow, XOffset, YOffset), cookie)
|
||||
return ShapeOffsetCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook ShapeOffsetCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ShapeOffset
|
||||
func (c *Conn) shapeOffsetRequest(DestinationKind ShapeKind, DestinationWindow Window, XOffset int16, YOffset int16) []byte {
|
||||
size := 16
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["SHAPE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 4 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
buf[b] = byte(DestinationKind)
|
||||
b += 1
|
||||
|
||||
b += 3 // padding
|
||||
|
||||
Put32(buf[b:], uint32(DestinationWindow))
|
||||
b += 4
|
||||
|
||||
Put16(buf[b:], uint16(XOffset))
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], uint16(YOffset))
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ShapeQueryExtents
|
||||
// size: 8
|
||||
type ShapeQueryExtentsCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) ShapeQueryExtents(DestinationWindow Window) ShapeQueryExtentsCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.shapeQueryExtentsRequest(DestinationWindow), cookie)
|
||||
return ShapeQueryExtentsCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ShapeQueryExtentsUnchecked(DestinationWindow Window) ShapeQueryExtentsCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.shapeQueryExtentsRequest(DestinationWindow), cookie)
|
||||
return ShapeQueryExtentsCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for ShapeQueryExtents
|
||||
// size: 28
|
||||
type ShapeQueryExtentsReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
BoundingShaped bool
|
||||
ClipShaped bool
|
||||
// padding: 2 bytes
|
||||
BoundingShapeExtentsX int16
|
||||
BoundingShapeExtentsY int16
|
||||
BoundingShapeExtentsWidth uint16
|
||||
BoundingShapeExtentsHeight uint16
|
||||
ClipShapeExtentsX int16
|
||||
ClipShapeExtentsY int16
|
||||
ClipShapeExtentsWidth uint16
|
||||
ClipShapeExtentsHeight uint16
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request ShapeQueryExtents
|
||||
func (cook ShapeQueryExtentsCookie) Reply() (*ShapeQueryExtentsReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return shapeQueryExtentsReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for ShapeQueryExtents
|
||||
func shapeQueryExtentsReply(buf []byte) *ShapeQueryExtentsReply {
|
||||
v := new(ShapeQueryExtentsReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
if buf[b] == 1 {
|
||||
v.BoundingShaped = true
|
||||
} else {
|
||||
v.BoundingShaped = false
|
||||
}
|
||||
b += 1
|
||||
|
||||
if buf[b] == 1 {
|
||||
v.ClipShaped = true
|
||||
} else {
|
||||
v.ClipShaped = false
|
||||
}
|
||||
b += 1
|
||||
|
||||
b += 2 // padding
|
||||
|
||||
v.BoundingShapeExtentsX = int16(Get16(buf[b:]))
|
||||
b += 2
|
||||
|
||||
v.BoundingShapeExtentsY = int16(Get16(buf[b:]))
|
||||
b += 2
|
||||
|
||||
v.BoundingShapeExtentsWidth = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.BoundingShapeExtentsHeight = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.ClipShapeExtentsX = int16(Get16(buf[b:]))
|
||||
b += 2
|
||||
|
||||
v.ClipShapeExtentsY = int16(Get16(buf[b:]))
|
||||
b += 2
|
||||
|
||||
v.ClipShapeExtentsWidth = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.ClipShapeExtentsHeight = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook ShapeQueryExtentsCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ShapeQueryExtents
|
||||
func (c *Conn) shapeQueryExtentsRequest(DestinationWindow Window) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["SHAPE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 5 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(DestinationWindow))
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ShapeSelectInput
|
||||
// size: 12
|
||||
type ShapeSelectInputCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for ShapeSelectInput
|
||||
func (c *Conn) ShapeSelectInput(DestinationWindow Window, Enable bool) ShapeSelectInputCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.shapeSelectInputRequest(DestinationWindow, Enable), cookie)
|
||||
return ShapeSelectInputCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ShapeSelectInputChecked(DestinationWindow Window, Enable bool) ShapeSelectInputCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.shapeSelectInputRequest(DestinationWindow, Enable), cookie)
|
||||
return ShapeSelectInputCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook ShapeSelectInputCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ShapeSelectInput
|
||||
func (c *Conn) shapeSelectInputRequest(DestinationWindow Window, Enable bool) []byte {
|
||||
size := 12
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["SHAPE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 6 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(DestinationWindow))
|
||||
b += 4
|
||||
|
||||
if Enable {
|
||||
buf[b] = 1
|
||||
} else {
|
||||
buf[b] = 0
|
||||
}
|
||||
b += 1
|
||||
|
||||
b += 3 // padding
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ShapeInputSelected
|
||||
// size: 8
|
||||
type ShapeInputSelectedCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) ShapeInputSelected(DestinationWindow Window) ShapeInputSelectedCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.shapeInputSelectedRequest(DestinationWindow), cookie)
|
||||
return ShapeInputSelectedCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ShapeInputSelectedUnchecked(DestinationWindow Window) ShapeInputSelectedCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.shapeInputSelectedRequest(DestinationWindow), cookie)
|
||||
return ShapeInputSelectedCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for ShapeInputSelected
|
||||
// size: 8
|
||||
type ShapeInputSelectedReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
Enabled bool
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request ShapeInputSelected
|
||||
func (cook ShapeInputSelectedCookie) Reply() (*ShapeInputSelectedReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return shapeInputSelectedReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for ShapeInputSelected
|
||||
func shapeInputSelectedReply(buf []byte) *ShapeInputSelectedReply {
|
||||
v := new(ShapeInputSelectedReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
if buf[b] == 1 {
|
||||
v.Enabled = true
|
||||
} else {
|
||||
v.Enabled = false
|
||||
}
|
||||
b += 1
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook ShapeInputSelectedCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ShapeInputSelected
|
||||
func (c *Conn) shapeInputSelectedRequest(DestinationWindow Window) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["SHAPE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 7 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(DestinationWindow))
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ShapeGetRectangles
|
||||
// size: 12
|
||||
type ShapeGetRectanglesCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) ShapeGetRectangles(Window Window, SourceKind ShapeKind) ShapeGetRectanglesCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.shapeGetRectanglesRequest(Window, SourceKind), cookie)
|
||||
return ShapeGetRectanglesCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ShapeGetRectanglesUnchecked(Window Window, SourceKind ShapeKind) ShapeGetRectanglesCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.shapeGetRectanglesRequest(Window, SourceKind), cookie)
|
||||
return ShapeGetRectanglesCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for ShapeGetRectangles
|
||||
// size: (32 + pad((int(RectanglesLen) * 8)))
|
||||
type ShapeGetRectanglesReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
Ordering byte
|
||||
RectanglesLen uint32
|
||||
// padding: 20 bytes
|
||||
Rectangles []Rectangle // size: pad((int(RectanglesLen) * 8))
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request ShapeGetRectangles
|
||||
func (cook ShapeGetRectanglesCookie) Reply() (*ShapeGetRectanglesReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return shapeGetRectanglesReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for ShapeGetRectangles
|
||||
func shapeGetRectanglesReply(buf []byte) *ShapeGetRectanglesReply {
|
||||
v := new(ShapeGetRectanglesReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
v.Ordering = buf[b]
|
||||
b += 1
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.RectanglesLen = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
b += 20 // padding
|
||||
|
||||
v.Rectangles = make([]Rectangle, v.RectanglesLen)
|
||||
b += ReadRectangleList(buf[b:], v.Rectangles)
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook ShapeGetRectanglesCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ShapeGetRectangles
|
||||
func (c *Conn) shapeGetRectanglesRequest(Window Window, SourceKind ShapeKind) []byte {
|
||||
size := 12
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["SHAPE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 8 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Window))
|
||||
b += 4
|
||||
|
||||
buf[b] = byte(SourceKind)
|
||||
b += 1
|
||||
|
||||
b += 3 // padding
|
||||
|
||||
return buf
|
||||
}
|
||||
@@ -1,678 +0,0 @@
|
||||
package xgb
|
||||
|
||||
/*
|
||||
This file was generated by shm.xml on May 10 2012 12:39:34pm EDT.
|
||||
This file is automatically generated. Edit at your peril!
|
||||
*/
|
||||
|
||||
// Imports are not necessary for XGB because everything is
|
||||
// in one package. They are still listed here for reference.
|
||||
// import "xproto"
|
||||
|
||||
// ShmInit must be called before using the MIT-SHM extension.
|
||||
func (c *Conn) ShmInit() error {
|
||||
reply, err := c.QueryExtension(7, "MIT-SHM").Reply()
|
||||
switch {
|
||||
case err != nil:
|
||||
return err
|
||||
case !reply.Present:
|
||||
return errorf("No extension named MIT-SHM could be found on on the server.")
|
||||
}
|
||||
|
||||
c.extLock.Lock()
|
||||
c.extensions["MIT-SHM"] = reply.MajorOpcode
|
||||
for evNum, fun := range newExtEventFuncs["MIT-SHM"] {
|
||||
newEventFuncs[int(reply.FirstEvent)+evNum] = fun
|
||||
}
|
||||
for errNum, fun := range newExtErrorFuncs["MIT-SHM"] {
|
||||
newErrorFuncs[int(reply.FirstError)+errNum] = fun
|
||||
}
|
||||
c.extLock.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtEventFuncs["MIT-SHM"] = make(map[int]newEventFun)
|
||||
newExtErrorFuncs["MIT-SHM"] = make(map[int]newErrorFun)
|
||||
}
|
||||
|
||||
// Skipping definition for base type 'Card16'
|
||||
|
||||
// Skipping definition for base type 'Char'
|
||||
|
||||
// Skipping definition for base type 'Card32'
|
||||
|
||||
// Skipping definition for base type 'Double'
|
||||
|
||||
// Skipping definition for base type 'Bool'
|
||||
|
||||
// Skipping definition for base type 'Float'
|
||||
|
||||
// Skipping definition for base type 'Card8'
|
||||
|
||||
// Skipping definition for base type 'Int16'
|
||||
|
||||
// Skipping definition for base type 'Int32'
|
||||
|
||||
// Skipping definition for base type 'Void'
|
||||
|
||||
// Skipping definition for base type 'Byte'
|
||||
|
||||
// Skipping definition for base type 'Int8'
|
||||
|
||||
type ShmSeg uint32
|
||||
|
||||
func (c *Conn) NewShmSegId() (ShmSeg, error) {
|
||||
id, err := c.NewId()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return ShmSeg(id), nil
|
||||
}
|
||||
|
||||
// Event definition ShmCompletion (0)
|
||||
// Size: 32
|
||||
|
||||
const ShmCompletion = 0
|
||||
|
||||
type ShmCompletionEvent struct {
|
||||
Sequence uint16
|
||||
// padding: 1 bytes
|
||||
Drawable Drawable
|
||||
MinorEvent uint16
|
||||
MajorEvent byte
|
||||
// padding: 1 bytes
|
||||
Shmseg ShmSeg
|
||||
Offset uint32
|
||||
}
|
||||
|
||||
// Event read ShmCompletion
|
||||
func NewShmCompletionEvent(buf []byte) Event {
|
||||
v := ShmCompletionEvent{}
|
||||
b := 1 // don't read event number
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Drawable = Drawable(Get32(buf[b:]))
|
||||
b += 4
|
||||
|
||||
v.MinorEvent = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.MajorEvent = buf[b]
|
||||
b += 1
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Shmseg = ShmSeg(Get32(buf[b:]))
|
||||
b += 4
|
||||
|
||||
v.Offset = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
// Event write ShmCompletion
|
||||
func (v ShmCompletionEvent) Bytes() []byte {
|
||||
buf := make([]byte, 32)
|
||||
b := 0
|
||||
|
||||
// write event number
|
||||
buf[b] = 0
|
||||
b += 1
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
b += 2 // skip sequence number
|
||||
|
||||
Put32(buf[b:], uint32(v.Drawable))
|
||||
b += 4
|
||||
|
||||
Put16(buf[b:], v.MinorEvent)
|
||||
b += 2
|
||||
|
||||
buf[b] = v.MajorEvent
|
||||
b += 1
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
Put32(buf[b:], uint32(v.Shmseg))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], v.Offset)
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
func (v ShmCompletionEvent) ImplementsEvent() {}
|
||||
|
||||
func (v ShmCompletionEvent) SequenceId() uint16 {
|
||||
return v.Sequence
|
||||
}
|
||||
|
||||
func (v ShmCompletionEvent) String() string {
|
||||
fieldVals := make([]string, 0, 7)
|
||||
fieldVals = append(fieldVals, sprintf("Sequence: %d", v.Sequence))
|
||||
fieldVals = append(fieldVals, sprintf("Drawable: %d", v.Drawable))
|
||||
fieldVals = append(fieldVals, sprintf("MinorEvent: %d", v.MinorEvent))
|
||||
fieldVals = append(fieldVals, sprintf("MajorEvent: %d", v.MajorEvent))
|
||||
fieldVals = append(fieldVals, sprintf("Shmseg: %d", v.Shmseg))
|
||||
fieldVals = append(fieldVals, sprintf("Offset: %d", v.Offset))
|
||||
return "ShmCompletion {" + stringsJoin(fieldVals, ", ") + "}"
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtEventFuncs["MIT-SHM"][0] = NewShmCompletionEvent
|
||||
}
|
||||
|
||||
// ErrorCopy definition ShmBadSeg (0)
|
||||
|
||||
const BadShmBadSeg = 0
|
||||
|
||||
type ShmBadSegError ValueError
|
||||
|
||||
func NewShmBadSegError(buf []byte) Error {
|
||||
v := ShmBadSegError(NewValueError(buf).(ValueError))
|
||||
v.NiceName = "ShmBadSeg"
|
||||
return v
|
||||
}
|
||||
|
||||
func (err ShmBadSegError) ImplementsError() {}
|
||||
|
||||
func (err ShmBadSegError) SequenceId() uint16 {
|
||||
return err.Sequence
|
||||
}
|
||||
|
||||
func (err ShmBadSegError) BadId() uint32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (err ShmBadSegError) Error() string {
|
||||
fieldVals := make([]string, 0, 4)
|
||||
fieldVals = append(fieldVals, "NiceName: "+err.NiceName)
|
||||
fieldVals = append(fieldVals, sprintf("Sequence: %d", err.Sequence))
|
||||
fieldVals = append(fieldVals, sprintf("BadValue: %d", err.BadValue))
|
||||
fieldVals = append(fieldVals, sprintf("MinorOpcode: %d", err.MinorOpcode))
|
||||
fieldVals = append(fieldVals, sprintf("MajorOpcode: %d", err.MajorOpcode))
|
||||
return "BadShmBadSeg {" + stringsJoin(fieldVals, ", ") + "}"
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtErrorFuncs["MIT-SHM"][0] = NewShmBadSegError
|
||||
}
|
||||
|
||||
// Request ShmQueryVersion
|
||||
// size: 4
|
||||
type ShmQueryVersionCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) ShmQueryVersion() ShmQueryVersionCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.shmQueryVersionRequest(), cookie)
|
||||
return ShmQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ShmQueryVersionUnchecked() ShmQueryVersionCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.shmQueryVersionRequest(), cookie)
|
||||
return ShmQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for ShmQueryVersion
|
||||
// size: 32
|
||||
type ShmQueryVersionReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
SharedPixmaps bool
|
||||
MajorVersion uint16
|
||||
MinorVersion uint16
|
||||
Uid uint16
|
||||
Gid uint16
|
||||
PixmapFormat byte
|
||||
// padding: 15 bytes
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request ShmQueryVersion
|
||||
func (cook ShmQueryVersionCookie) Reply() (*ShmQueryVersionReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return shmQueryVersionReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for ShmQueryVersion
|
||||
func shmQueryVersionReply(buf []byte) *ShmQueryVersionReply {
|
||||
v := new(ShmQueryVersionReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
if buf[b] == 1 {
|
||||
v.SharedPixmaps = true
|
||||
} else {
|
||||
v.SharedPixmaps = false
|
||||
}
|
||||
b += 1
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.MajorVersion = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.MinorVersion = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Uid = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Gid = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.PixmapFormat = buf[b]
|
||||
b += 1
|
||||
|
||||
b += 15 // padding
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook ShmQueryVersionCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ShmQueryVersion
|
||||
func (c *Conn) shmQueryVersionRequest() []byte {
|
||||
size := 4
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["MIT-SHM"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 0 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ShmAttach
|
||||
// size: 16
|
||||
type ShmAttachCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for ShmAttach
|
||||
func (c *Conn) ShmAttach(Shmseg ShmSeg, Shmid uint32, ReadOnly bool) ShmAttachCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.shmAttachRequest(Shmseg, Shmid, ReadOnly), cookie)
|
||||
return ShmAttachCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ShmAttachChecked(Shmseg ShmSeg, Shmid uint32, ReadOnly bool) ShmAttachCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.shmAttachRequest(Shmseg, Shmid, ReadOnly), cookie)
|
||||
return ShmAttachCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook ShmAttachCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ShmAttach
|
||||
func (c *Conn) shmAttachRequest(Shmseg ShmSeg, Shmid uint32, ReadOnly bool) []byte {
|
||||
size := 16
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["MIT-SHM"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 1 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Shmseg))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], Shmid)
|
||||
b += 4
|
||||
|
||||
if ReadOnly {
|
||||
buf[b] = 1
|
||||
} else {
|
||||
buf[b] = 0
|
||||
}
|
||||
b += 1
|
||||
|
||||
b += 3 // padding
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ShmDetach
|
||||
// size: 8
|
||||
type ShmDetachCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for ShmDetach
|
||||
func (c *Conn) ShmDetach(Shmseg ShmSeg) ShmDetachCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.shmDetachRequest(Shmseg), cookie)
|
||||
return ShmDetachCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ShmDetachChecked(Shmseg ShmSeg) ShmDetachCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.shmDetachRequest(Shmseg), cookie)
|
||||
return ShmDetachCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook ShmDetachCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ShmDetach
|
||||
func (c *Conn) shmDetachRequest(Shmseg ShmSeg) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["MIT-SHM"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 2 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Shmseg))
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ShmPutImage
|
||||
// size: 40
|
||||
type ShmPutImageCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for ShmPutImage
|
||||
func (c *Conn) ShmPutImage(Drawable Drawable, Gc Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg ShmSeg, Offset uint32) ShmPutImageCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.shmPutImageRequest(Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie)
|
||||
return ShmPutImageCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ShmPutImageChecked(Drawable Drawable, Gc Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg ShmSeg, Offset uint32) ShmPutImageCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.shmPutImageRequest(Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie)
|
||||
return ShmPutImageCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook ShmPutImageCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ShmPutImage
|
||||
func (c *Conn) shmPutImageRequest(Drawable Drawable, Gc Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg ShmSeg, Offset uint32) []byte {
|
||||
size := 40
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["MIT-SHM"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 3 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Drawable))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], uint32(Gc))
|
||||
b += 4
|
||||
|
||||
Put16(buf[b:], TotalWidth)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], TotalHeight)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], SrcX)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], SrcY)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], SrcWidth)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], SrcHeight)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], uint16(DstX))
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], uint16(DstY))
|
||||
b += 2
|
||||
|
||||
buf[b] = Depth
|
||||
b += 1
|
||||
|
||||
buf[b] = Format
|
||||
b += 1
|
||||
|
||||
buf[b] = SendEvent
|
||||
b += 1
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
Put32(buf[b:], uint32(Shmseg))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], Offset)
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ShmGetImage
|
||||
// size: 32
|
||||
type ShmGetImageCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) ShmGetImage(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg ShmSeg, Offset uint32) ShmGetImageCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.shmGetImageRequest(Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie)
|
||||
return ShmGetImageCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ShmGetImageUnchecked(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg ShmSeg, Offset uint32) ShmGetImageCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.shmGetImageRequest(Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie)
|
||||
return ShmGetImageCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for ShmGetImage
|
||||
// size: 16
|
||||
type ShmGetImageReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
Depth byte
|
||||
Visual Visualid
|
||||
Size uint32
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request ShmGetImage
|
||||
func (cook ShmGetImageCookie) Reply() (*ShmGetImageReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return shmGetImageReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for ShmGetImage
|
||||
func shmGetImageReply(buf []byte) *ShmGetImageReply {
|
||||
v := new(ShmGetImageReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
v.Depth = buf[b]
|
||||
b += 1
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.Visual = Visualid(Get32(buf[b:]))
|
||||
b += 4
|
||||
|
||||
v.Size = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook ShmGetImageCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ShmGetImage
|
||||
func (c *Conn) shmGetImageRequest(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg ShmSeg, Offset uint32) []byte {
|
||||
size := 32
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["MIT-SHM"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 4 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Drawable))
|
||||
b += 4
|
||||
|
||||
Put16(buf[b:], uint16(X))
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], uint16(Y))
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], Width)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], Height)
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], PlaneMask)
|
||||
b += 4
|
||||
|
||||
buf[b] = Format
|
||||
b += 1
|
||||
|
||||
b += 3 // padding
|
||||
|
||||
Put32(buf[b:], uint32(Shmseg))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], Offset)
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request ShmCreatePixmap
|
||||
// size: 28
|
||||
type ShmCreatePixmapCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for ShmCreatePixmap
|
||||
func (c *Conn) ShmCreatePixmap(Pid Pixmap, Drawable Drawable, Width uint16, Height uint16, Depth byte, Shmseg ShmSeg, Offset uint32) ShmCreatePixmapCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.shmCreatePixmapRequest(Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie)
|
||||
return ShmCreatePixmapCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) ShmCreatePixmapChecked(Pid Pixmap, Drawable Drawable, Width uint16, Height uint16, Depth byte, Shmseg ShmSeg, Offset uint32) ShmCreatePixmapCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.shmCreatePixmapRequest(Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie)
|
||||
return ShmCreatePixmapCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook ShmCreatePixmapCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for ShmCreatePixmap
|
||||
func (c *Conn) shmCreatePixmapRequest(Pid Pixmap, Drawable Drawable, Width uint16, Height uint16, Depth byte, Shmseg ShmSeg, Offset uint32) []byte {
|
||||
size := 28
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["MIT-SHM"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 5 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Pid))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], uint32(Drawable))
|
||||
b += 4
|
||||
|
||||
Put16(buf[b:], Width)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], Height)
|
||||
b += 2
|
||||
|
||||
buf[b] = Depth
|
||||
b += 1
|
||||
|
||||
b += 3 // padding
|
||||
|
||||
Put32(buf[b:], uint32(Shmseg))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], Offset)
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
-1949
File diff suppressed because it is too large
Load Diff
@@ -1,326 +0,0 @@
|
||||
package xgb
|
||||
|
||||
/*
|
||||
This file was generated by xc_misc.xml on May 10 2012 12:39:34pm EDT.
|
||||
This file is automatically generated. Edit at your peril!
|
||||
*/
|
||||
|
||||
// Xc_miscInit must be called before using the XC-MISC extension.
|
||||
func (c *Conn) Xc_miscInit() error {
|
||||
reply, err := c.QueryExtension(7, "XC-MISC").Reply()
|
||||
switch {
|
||||
case err != nil:
|
||||
return err
|
||||
case !reply.Present:
|
||||
return errorf("No extension named XC-MISC could be found on on the server.")
|
||||
}
|
||||
|
||||
c.extLock.Lock()
|
||||
c.extensions["XC-MISC"] = reply.MajorOpcode
|
||||
for evNum, fun := range newExtEventFuncs["XC-MISC"] {
|
||||
newEventFuncs[int(reply.FirstEvent)+evNum] = fun
|
||||
}
|
||||
for errNum, fun := range newExtErrorFuncs["XC-MISC"] {
|
||||
newErrorFuncs[int(reply.FirstError)+errNum] = fun
|
||||
}
|
||||
c.extLock.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtEventFuncs["XC-MISC"] = make(map[int]newEventFun)
|
||||
newExtErrorFuncs["XC-MISC"] = make(map[int]newErrorFun)
|
||||
}
|
||||
|
||||
// Skipping definition for base type 'Float'
|
||||
|
||||
// Skipping definition for base type 'Card8'
|
||||
|
||||
// Skipping definition for base type 'Int16'
|
||||
|
||||
// Skipping definition for base type 'Int32'
|
||||
|
||||
// Skipping definition for base type 'Void'
|
||||
|
||||
// Skipping definition for base type 'Byte'
|
||||
|
||||
// Skipping definition for base type 'Int8'
|
||||
|
||||
// Skipping definition for base type 'Card16'
|
||||
|
||||
// Skipping definition for base type 'Char'
|
||||
|
||||
// Skipping definition for base type 'Card32'
|
||||
|
||||
// Skipping definition for base type 'Double'
|
||||
|
||||
// Skipping definition for base type 'Bool'
|
||||
|
||||
// Request Xc_miscGetVersion
|
||||
// size: 8
|
||||
type Xc_miscGetVersionCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) Xc_miscGetVersion(ClientMajorVersion uint16, ClientMinorVersion uint16) Xc_miscGetVersionCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xc_miscGetVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie)
|
||||
return Xc_miscGetVersionCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) Xc_miscGetVersionUnchecked(ClientMajorVersion uint16, ClientMinorVersion uint16) Xc_miscGetVersionCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xc_miscGetVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie)
|
||||
return Xc_miscGetVersionCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for Xc_miscGetVersion
|
||||
// size: 12
|
||||
type Xc_miscGetVersionReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
ServerMajorVersion uint16
|
||||
ServerMinorVersion uint16
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request Xc_miscGetVersion
|
||||
func (cook Xc_miscGetVersionCookie) Reply() (*Xc_miscGetVersionReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return xc_miscGetVersionReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for Xc_miscGetVersion
|
||||
func xc_miscGetVersionReply(buf []byte) *Xc_miscGetVersionReply {
|
||||
v := new(Xc_miscGetVersionReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.ServerMajorVersion = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.ServerMinorVersion = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook Xc_miscGetVersionCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for Xc_miscGetVersion
|
||||
func (c *Conn) xc_miscGetVersionRequest(ClientMajorVersion uint16, ClientMinorVersion uint16) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XC-MISC"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 0 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], ClientMajorVersion)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], ClientMinorVersion)
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request Xc_miscGetXIDRange
|
||||
// size: 4
|
||||
type Xc_miscGetXIDRangeCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) Xc_miscGetXIDRange() Xc_miscGetXIDRangeCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xc_miscGetXIDRangeRequest(), cookie)
|
||||
return Xc_miscGetXIDRangeCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) Xc_miscGetXIDRangeUnchecked() Xc_miscGetXIDRangeCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xc_miscGetXIDRangeRequest(), cookie)
|
||||
return Xc_miscGetXIDRangeCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for Xc_miscGetXIDRange
|
||||
// size: 16
|
||||
type Xc_miscGetXIDRangeReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
StartId uint32
|
||||
Count uint32
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request Xc_miscGetXIDRange
|
||||
func (cook Xc_miscGetXIDRangeCookie) Reply() (*Xc_miscGetXIDRangeReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return xc_miscGetXIDRangeReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for Xc_miscGetXIDRange
|
||||
func xc_miscGetXIDRangeReply(buf []byte) *Xc_miscGetXIDRangeReply {
|
||||
v := new(Xc_miscGetXIDRangeReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.StartId = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
v.Count = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook Xc_miscGetXIDRangeCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for Xc_miscGetXIDRange
|
||||
func (c *Conn) xc_miscGetXIDRangeRequest() []byte {
|
||||
size := 4
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XC-MISC"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 1 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request Xc_miscGetXIDList
|
||||
// size: 8
|
||||
type Xc_miscGetXIDListCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) Xc_miscGetXIDList(Count uint32) Xc_miscGetXIDListCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xc_miscGetXIDListRequest(Count), cookie)
|
||||
return Xc_miscGetXIDListCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) Xc_miscGetXIDListUnchecked(Count uint32) Xc_miscGetXIDListCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xc_miscGetXIDListRequest(Count), cookie)
|
||||
return Xc_miscGetXIDListCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for Xc_miscGetXIDList
|
||||
// size: (32 + pad((int(IdsLen) * 4)))
|
||||
type Xc_miscGetXIDListReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
IdsLen uint32
|
||||
// padding: 20 bytes
|
||||
Ids []uint32 // size: pad((int(IdsLen) * 4))
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request Xc_miscGetXIDList
|
||||
func (cook Xc_miscGetXIDListCookie) Reply() (*Xc_miscGetXIDListReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return xc_miscGetXIDListReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for Xc_miscGetXIDList
|
||||
func xc_miscGetXIDListReply(buf []byte) *Xc_miscGetXIDListReply {
|
||||
v := new(Xc_miscGetXIDListReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.IdsLen = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
b += 20 // padding
|
||||
|
||||
v.Ids = make([]uint32, v.IdsLen)
|
||||
for i := 0; i < int(v.IdsLen); i++ {
|
||||
v.Ids[i] = Get32(buf[b:])
|
||||
b += 4
|
||||
}
|
||||
b = pad(b)
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook Xc_miscGetXIDListCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for Xc_miscGetXIDList
|
||||
func (c *Conn) xc_miscGetXIDListRequest(Count uint32) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XC-MISC"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 2 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], Count)
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
@@ -1,539 +0,0 @@
|
||||
package xgb
|
||||
|
||||
/*
|
||||
This file was generated by xevie.xml on May 10 2012 12:39:34pm EDT.
|
||||
This file is automatically generated. Edit at your peril!
|
||||
*/
|
||||
|
||||
// XevieInit must be called before using the XEVIE extension.
|
||||
func (c *Conn) XevieInit() error {
|
||||
reply, err := c.QueryExtension(5, "XEVIE").Reply()
|
||||
switch {
|
||||
case err != nil:
|
||||
return err
|
||||
case !reply.Present:
|
||||
return errorf("No extension named XEVIE could be found on on the server.")
|
||||
}
|
||||
|
||||
c.extLock.Lock()
|
||||
c.extensions["XEVIE"] = reply.MajorOpcode
|
||||
for evNum, fun := range newExtEventFuncs["XEVIE"] {
|
||||
newEventFuncs[int(reply.FirstEvent)+evNum] = fun
|
||||
}
|
||||
for errNum, fun := range newExtErrorFuncs["XEVIE"] {
|
||||
newErrorFuncs[int(reply.FirstError)+errNum] = fun
|
||||
}
|
||||
c.extLock.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtEventFuncs["XEVIE"] = make(map[int]newEventFun)
|
||||
newExtErrorFuncs["XEVIE"] = make(map[int]newErrorFun)
|
||||
}
|
||||
|
||||
// Skipping definition for base type 'Int8'
|
||||
|
||||
// Skipping definition for base type 'Card16'
|
||||
|
||||
// Skipping definition for base type 'Char'
|
||||
|
||||
// Skipping definition for base type 'Card32'
|
||||
|
||||
// Skipping definition for base type 'Double'
|
||||
|
||||
// Skipping definition for base type 'Bool'
|
||||
|
||||
// Skipping definition for base type 'Float'
|
||||
|
||||
// Skipping definition for base type 'Card8'
|
||||
|
||||
// Skipping definition for base type 'Int16'
|
||||
|
||||
// Skipping definition for base type 'Int32'
|
||||
|
||||
// Skipping definition for base type 'Void'
|
||||
|
||||
// Skipping definition for base type 'Byte'
|
||||
|
||||
const (
|
||||
XevieDatatypeUnmodified = 0
|
||||
XevieDatatypeModified = 1
|
||||
)
|
||||
|
||||
// 'XevieEvent' struct definition
|
||||
// Size: 32
|
||||
type XevieEvent struct {
|
||||
// padding: 32 bytes
|
||||
}
|
||||
|
||||
// Struct read XevieEvent
|
||||
func ReadXevieEvent(buf []byte, v *XevieEvent) int {
|
||||
b := 0
|
||||
|
||||
b += 32 // padding
|
||||
|
||||
return b
|
||||
}
|
||||
|
||||
// Struct list read XevieEvent
|
||||
func ReadXevieEventList(buf []byte, dest []XevieEvent) int {
|
||||
b := 0
|
||||
for i := 0; i < len(dest); i++ {
|
||||
dest[i] = XevieEvent{}
|
||||
b += ReadXevieEvent(buf[b:], &dest[i])
|
||||
}
|
||||
return pad(b)
|
||||
}
|
||||
|
||||
// Struct write XevieEvent
|
||||
func (v XevieEvent) Bytes() []byte {
|
||||
buf := make([]byte, 32)
|
||||
b := 0
|
||||
|
||||
b += 32 // padding
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Write struct list XevieEvent
|
||||
func XevieEventListBytes(buf []byte, list []XevieEvent) int {
|
||||
b := 0
|
||||
var structBytes []byte
|
||||
for _, item := range list {
|
||||
structBytes = item.Bytes()
|
||||
copy(buf[b:], structBytes)
|
||||
b += pad(len(structBytes))
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// Request XevieQueryVersion
|
||||
// size: 8
|
||||
type XevieQueryVersionCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) XevieQueryVersion(ClientMajorVersion uint16, ClientMinorVersion uint16) XevieQueryVersionCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xevieQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie)
|
||||
return XevieQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) XevieQueryVersionUnchecked(ClientMajorVersion uint16, ClientMinorVersion uint16) XevieQueryVersionCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xevieQueryVersionRequest(ClientMajorVersion, ClientMinorVersion), cookie)
|
||||
return XevieQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for XevieQueryVersion
|
||||
// size: 32
|
||||
type XevieQueryVersionReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
ServerMajorVersion uint16
|
||||
ServerMinorVersion uint16
|
||||
// padding: 20 bytes
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request XevieQueryVersion
|
||||
func (cook XevieQueryVersionCookie) Reply() (*XevieQueryVersionReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return xevieQueryVersionReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for XevieQueryVersion
|
||||
func xevieQueryVersionReply(buf []byte) *XevieQueryVersionReply {
|
||||
v := new(XevieQueryVersionReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.ServerMajorVersion = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.ServerMinorVersion = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
b += 20 // padding
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook XevieQueryVersionCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for XevieQueryVersion
|
||||
func (c *Conn) xevieQueryVersionRequest(ClientMajorVersion uint16, ClientMinorVersion uint16) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XEVIE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 0 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], ClientMajorVersion)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], ClientMinorVersion)
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request XevieStart
|
||||
// size: 8
|
||||
type XevieStartCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) XevieStart(Screen uint32) XevieStartCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xevieStartRequest(Screen), cookie)
|
||||
return XevieStartCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) XevieStartUnchecked(Screen uint32) XevieStartCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xevieStartRequest(Screen), cookie)
|
||||
return XevieStartCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for XevieStart
|
||||
// size: 32
|
||||
type XevieStartReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
// padding: 24 bytes
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request XevieStart
|
||||
func (cook XevieStartCookie) Reply() (*XevieStartReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return xevieStartReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for XevieStart
|
||||
func xevieStartReply(buf []byte) *XevieStartReply {
|
||||
v := new(XevieStartReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
b += 24 // padding
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook XevieStartCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for XevieStart
|
||||
func (c *Conn) xevieStartRequest(Screen uint32) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XEVIE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 1 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], Screen)
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request XevieEnd
|
||||
// size: 8
|
||||
type XevieEndCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) XevieEnd(Cmap uint32) XevieEndCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xevieEndRequest(Cmap), cookie)
|
||||
return XevieEndCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) XevieEndUnchecked(Cmap uint32) XevieEndCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xevieEndRequest(Cmap), cookie)
|
||||
return XevieEndCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for XevieEnd
|
||||
// size: 32
|
||||
type XevieEndReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
// padding: 24 bytes
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request XevieEnd
|
||||
func (cook XevieEndCookie) Reply() (*XevieEndReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return xevieEndReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for XevieEnd
|
||||
func xevieEndReply(buf []byte) *XevieEndReply {
|
||||
v := new(XevieEndReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
b += 24 // padding
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook XevieEndCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for XevieEnd
|
||||
func (c *Conn) xevieEndRequest(Cmap uint32) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XEVIE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 2 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], Cmap)
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request XevieSend
|
||||
// size: 104
|
||||
type XevieSendCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) XevieSend(Event XevieEvent, DataType uint32) XevieSendCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xevieSendRequest(Event, DataType), cookie)
|
||||
return XevieSendCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) XevieSendUnchecked(Event XevieEvent, DataType uint32) XevieSendCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xevieSendRequest(Event, DataType), cookie)
|
||||
return XevieSendCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for XevieSend
|
||||
// size: 32
|
||||
type XevieSendReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
// padding: 24 bytes
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request XevieSend
|
||||
func (cook XevieSendCookie) Reply() (*XevieSendReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return xevieSendReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for XevieSend
|
||||
func xevieSendReply(buf []byte) *XevieSendReply {
|
||||
v := new(XevieSendReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
b += 24 // padding
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook XevieSendCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for XevieSend
|
||||
func (c *Conn) xevieSendRequest(Event XevieEvent, DataType uint32) []byte {
|
||||
size := 104
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XEVIE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 3 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
{
|
||||
structBytes := Event.Bytes()
|
||||
copy(buf[b:], structBytes)
|
||||
b += pad(len(structBytes))
|
||||
}
|
||||
|
||||
Put32(buf[b:], DataType)
|
||||
b += 4
|
||||
|
||||
b += 64 // padding
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request XevieSelectInput
|
||||
// size: 8
|
||||
type XevieSelectInputCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) XevieSelectInput(EventMask uint32) XevieSelectInputCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xevieSelectInputRequest(EventMask), cookie)
|
||||
return XevieSelectInputCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) XevieSelectInputUnchecked(EventMask uint32) XevieSelectInputCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xevieSelectInputRequest(EventMask), cookie)
|
||||
return XevieSelectInputCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for XevieSelectInput
|
||||
// size: 32
|
||||
type XevieSelectInputReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
// padding: 24 bytes
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request XevieSelectInput
|
||||
func (cook XevieSelectInputCookie) Reply() (*XevieSelectInputReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return xevieSelectInputReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for XevieSelectInput
|
||||
func xevieSelectInputReply(buf []byte) *XevieSelectInputReply {
|
||||
v := new(XevieSelectInputReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
b += 24 // padding
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook XevieSelectInputCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for XevieSelectInput
|
||||
func (c *Conn) xevieSelectInputRequest(EventMask uint32) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XEVIE"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 4 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], EventMask)
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,655 +0,0 @@
|
||||
package xgb
|
||||
|
||||
/*
|
||||
This file was generated by xinerama.xml on May 10 2012 12:39:34pm EDT.
|
||||
This file is automatically generated. Edit at your peril!
|
||||
*/
|
||||
|
||||
// Imports are not necessary for XGB because everything is
|
||||
// in one package. They are still listed here for reference.
|
||||
// import "xproto"
|
||||
|
||||
// XineramaInit must be called before using the XINERAMA extension.
|
||||
func (c *Conn) XineramaInit() error {
|
||||
reply, err := c.QueryExtension(8, "XINERAMA").Reply()
|
||||
switch {
|
||||
case err != nil:
|
||||
return err
|
||||
case !reply.Present:
|
||||
return errorf("No extension named XINERAMA could be found on on the server.")
|
||||
}
|
||||
|
||||
c.extLock.Lock()
|
||||
c.extensions["XINERAMA"] = reply.MajorOpcode
|
||||
for evNum, fun := range newExtEventFuncs["XINERAMA"] {
|
||||
newEventFuncs[int(reply.FirstEvent)+evNum] = fun
|
||||
}
|
||||
for errNum, fun := range newExtErrorFuncs["XINERAMA"] {
|
||||
newErrorFuncs[int(reply.FirstError)+errNum] = fun
|
||||
}
|
||||
c.extLock.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtEventFuncs["XINERAMA"] = make(map[int]newEventFun)
|
||||
newExtErrorFuncs["XINERAMA"] = make(map[int]newErrorFun)
|
||||
}
|
||||
|
||||
// Skipping definition for base type 'Int8'
|
||||
|
||||
// Skipping definition for base type 'Card16'
|
||||
|
||||
// Skipping definition for base type 'Char'
|
||||
|
||||
// Skipping definition for base type 'Card32'
|
||||
|
||||
// Skipping definition for base type 'Double'
|
||||
|
||||
// Skipping definition for base type 'Bool'
|
||||
|
||||
// Skipping definition for base type 'Float'
|
||||
|
||||
// Skipping definition for base type 'Card8'
|
||||
|
||||
// Skipping definition for base type 'Int16'
|
||||
|
||||
// Skipping definition for base type 'Int32'
|
||||
|
||||
// Skipping definition for base type 'Void'
|
||||
|
||||
// Skipping definition for base type 'Byte'
|
||||
|
||||
// 'XineramaScreenInfo' struct definition
|
||||
// Size: 8
|
||||
type XineramaScreenInfo struct {
|
||||
XOrg int16
|
||||
YOrg int16
|
||||
Width uint16
|
||||
Height uint16
|
||||
}
|
||||
|
||||
// Struct read XineramaScreenInfo
|
||||
func ReadXineramaScreenInfo(buf []byte, v *XineramaScreenInfo) int {
|
||||
b := 0
|
||||
|
||||
v.XOrg = int16(Get16(buf[b:]))
|
||||
b += 2
|
||||
|
||||
v.YOrg = int16(Get16(buf[b:]))
|
||||
b += 2
|
||||
|
||||
v.Width = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Height = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
return b
|
||||
}
|
||||
|
||||
// Struct list read XineramaScreenInfo
|
||||
func ReadXineramaScreenInfoList(buf []byte, dest []XineramaScreenInfo) int {
|
||||
b := 0
|
||||
for i := 0; i < len(dest); i++ {
|
||||
dest[i] = XineramaScreenInfo{}
|
||||
b += ReadXineramaScreenInfo(buf[b:], &dest[i])
|
||||
}
|
||||
return pad(b)
|
||||
}
|
||||
|
||||
// Struct write XineramaScreenInfo
|
||||
func (v XineramaScreenInfo) Bytes() []byte {
|
||||
buf := make([]byte, 8)
|
||||
b := 0
|
||||
|
||||
Put16(buf[b:], uint16(v.XOrg))
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], uint16(v.YOrg))
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], v.Width)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], v.Height)
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Write struct list XineramaScreenInfo
|
||||
func XineramaScreenInfoListBytes(buf []byte, list []XineramaScreenInfo) int {
|
||||
b := 0
|
||||
var structBytes []byte
|
||||
for _, item := range list {
|
||||
structBytes = item.Bytes()
|
||||
copy(buf[b:], structBytes)
|
||||
b += pad(len(structBytes))
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// Request XineramaQueryVersion
|
||||
// size: 8
|
||||
type XineramaQueryVersionCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) XineramaQueryVersion(Major byte, Minor byte) XineramaQueryVersionCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xineramaQueryVersionRequest(Major, Minor), cookie)
|
||||
return XineramaQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) XineramaQueryVersionUnchecked(Major byte, Minor byte) XineramaQueryVersionCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xineramaQueryVersionRequest(Major, Minor), cookie)
|
||||
return XineramaQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for XineramaQueryVersion
|
||||
// size: 12
|
||||
type XineramaQueryVersionReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
Major uint16
|
||||
Minor uint16
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request XineramaQueryVersion
|
||||
func (cook XineramaQueryVersionCookie) Reply() (*XineramaQueryVersionReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return xineramaQueryVersionReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for XineramaQueryVersion
|
||||
func xineramaQueryVersionReply(buf []byte) *XineramaQueryVersionReply {
|
||||
v := new(XineramaQueryVersionReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.Major = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Minor = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook XineramaQueryVersionCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for XineramaQueryVersion
|
||||
func (c *Conn) xineramaQueryVersionRequest(Major byte, Minor byte) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XINERAMA"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 0 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
buf[b] = Major
|
||||
b += 1
|
||||
|
||||
buf[b] = Minor
|
||||
b += 1
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request XineramaGetState
|
||||
// size: 8
|
||||
type XineramaGetStateCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) XineramaGetState(Window Window) XineramaGetStateCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xineramaGetStateRequest(Window), cookie)
|
||||
return XineramaGetStateCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) XineramaGetStateUnchecked(Window Window) XineramaGetStateCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xineramaGetStateRequest(Window), cookie)
|
||||
return XineramaGetStateCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for XineramaGetState
|
||||
// size: 12
|
||||
type XineramaGetStateReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
State byte
|
||||
Window Window
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request XineramaGetState
|
||||
func (cook XineramaGetStateCookie) Reply() (*XineramaGetStateReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return xineramaGetStateReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for XineramaGetState
|
||||
func xineramaGetStateReply(buf []byte) *XineramaGetStateReply {
|
||||
v := new(XineramaGetStateReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
v.State = buf[b]
|
||||
b += 1
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.Window = Window(Get32(buf[b:]))
|
||||
b += 4
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook XineramaGetStateCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for XineramaGetState
|
||||
func (c *Conn) xineramaGetStateRequest(Window Window) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XINERAMA"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 1 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Window))
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request XineramaGetScreenCount
|
||||
// size: 8
|
||||
type XineramaGetScreenCountCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) XineramaGetScreenCount(Window Window) XineramaGetScreenCountCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xineramaGetScreenCountRequest(Window), cookie)
|
||||
return XineramaGetScreenCountCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) XineramaGetScreenCountUnchecked(Window Window) XineramaGetScreenCountCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xineramaGetScreenCountRequest(Window), cookie)
|
||||
return XineramaGetScreenCountCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for XineramaGetScreenCount
|
||||
// size: 12
|
||||
type XineramaGetScreenCountReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
ScreenCount byte
|
||||
Window Window
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request XineramaGetScreenCount
|
||||
func (cook XineramaGetScreenCountCookie) Reply() (*XineramaGetScreenCountReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return xineramaGetScreenCountReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for XineramaGetScreenCount
|
||||
func xineramaGetScreenCountReply(buf []byte) *XineramaGetScreenCountReply {
|
||||
v := new(XineramaGetScreenCountReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
v.ScreenCount = buf[b]
|
||||
b += 1
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.Window = Window(Get32(buf[b:]))
|
||||
b += 4
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook XineramaGetScreenCountCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for XineramaGetScreenCount
|
||||
func (c *Conn) xineramaGetScreenCountRequest(Window Window) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XINERAMA"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 2 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Window))
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request XineramaGetScreenSize
|
||||
// size: 12
|
||||
type XineramaGetScreenSizeCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) XineramaGetScreenSize(Window Window, Screen uint32) XineramaGetScreenSizeCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xineramaGetScreenSizeRequest(Window, Screen), cookie)
|
||||
return XineramaGetScreenSizeCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) XineramaGetScreenSizeUnchecked(Window Window, Screen uint32) XineramaGetScreenSizeCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xineramaGetScreenSizeRequest(Window, Screen), cookie)
|
||||
return XineramaGetScreenSizeCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for XineramaGetScreenSize
|
||||
// size: 24
|
||||
type XineramaGetScreenSizeReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
Width uint32
|
||||
Height uint32
|
||||
Window Window
|
||||
Screen uint32
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request XineramaGetScreenSize
|
||||
func (cook XineramaGetScreenSizeCookie) Reply() (*XineramaGetScreenSizeReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return xineramaGetScreenSizeReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for XineramaGetScreenSize
|
||||
func xineramaGetScreenSizeReply(buf []byte) *XineramaGetScreenSizeReply {
|
||||
v := new(XineramaGetScreenSizeReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.Width = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
v.Height = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
v.Window = Window(Get32(buf[b:]))
|
||||
b += 4
|
||||
|
||||
v.Screen = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook XineramaGetScreenSizeCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for XineramaGetScreenSize
|
||||
func (c *Conn) xineramaGetScreenSizeRequest(Window Window, Screen uint32) []byte {
|
||||
size := 12
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XINERAMA"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 3 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Window))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], Screen)
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request XineramaIsActive
|
||||
// size: 4
|
||||
type XineramaIsActiveCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) XineramaIsActive() XineramaIsActiveCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xineramaIsActiveRequest(), cookie)
|
||||
return XineramaIsActiveCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) XineramaIsActiveUnchecked() XineramaIsActiveCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xineramaIsActiveRequest(), cookie)
|
||||
return XineramaIsActiveCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for XineramaIsActive
|
||||
// size: 12
|
||||
type XineramaIsActiveReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
State uint32
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request XineramaIsActive
|
||||
func (cook XineramaIsActiveCookie) Reply() (*XineramaIsActiveReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return xineramaIsActiveReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for XineramaIsActive
|
||||
func xineramaIsActiveReply(buf []byte) *XineramaIsActiveReply {
|
||||
v := new(XineramaIsActiveReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.State = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook XineramaIsActiveCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for XineramaIsActive
|
||||
func (c *Conn) xineramaIsActiveRequest() []byte {
|
||||
size := 4
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XINERAMA"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 4 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request XineramaQueryScreens
|
||||
// size: 4
|
||||
type XineramaQueryScreensCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) XineramaQueryScreens() XineramaQueryScreensCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xineramaQueryScreensRequest(), cookie)
|
||||
return XineramaQueryScreensCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) XineramaQueryScreensUnchecked() XineramaQueryScreensCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xineramaQueryScreensRequest(), cookie)
|
||||
return XineramaQueryScreensCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for XineramaQueryScreens
|
||||
// size: (32 + pad((int(Number) * 8)))
|
||||
type XineramaQueryScreensReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
Number uint32
|
||||
// padding: 20 bytes
|
||||
ScreenInfo []XineramaScreenInfo // size: pad((int(Number) * 8))
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request XineramaQueryScreens
|
||||
func (cook XineramaQueryScreensCookie) Reply() (*XineramaQueryScreensReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return xineramaQueryScreensReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for XineramaQueryScreens
|
||||
func xineramaQueryScreensReply(buf []byte) *XineramaQueryScreensReply {
|
||||
v := new(XineramaQueryScreensReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.Number = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
b += 20 // padding
|
||||
|
||||
v.ScreenInfo = make([]XineramaScreenInfo, v.Number)
|
||||
b += ReadXineramaScreenInfoList(buf[b:], v.ScreenInfo)
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook XineramaQueryScreensCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for XineramaQueryScreens
|
||||
func (c *Conn) xineramaQueryScreensRequest() []byte {
|
||||
size := 4
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XINERAMA"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 5 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,361 +0,0 @@
|
||||
package xgb
|
||||
|
||||
/*
|
||||
This file was generated by xtest.xml on May 10 2012 12:39:34pm EDT.
|
||||
This file is automatically generated. Edit at your peril!
|
||||
*/
|
||||
|
||||
// Imports are not necessary for XGB because everything is
|
||||
// in one package. They are still listed here for reference.
|
||||
// import "xproto"
|
||||
|
||||
// XtestInit must be called before using the XTEST extension.
|
||||
func (c *Conn) XtestInit() error {
|
||||
reply, err := c.QueryExtension(5, "XTEST").Reply()
|
||||
switch {
|
||||
case err != nil:
|
||||
return err
|
||||
case !reply.Present:
|
||||
return errorf("No extension named XTEST could be found on on the server.")
|
||||
}
|
||||
|
||||
c.extLock.Lock()
|
||||
c.extensions["XTEST"] = reply.MajorOpcode
|
||||
for evNum, fun := range newExtEventFuncs["XTEST"] {
|
||||
newEventFuncs[int(reply.FirstEvent)+evNum] = fun
|
||||
}
|
||||
for errNum, fun := range newExtErrorFuncs["XTEST"] {
|
||||
newErrorFuncs[int(reply.FirstError)+errNum] = fun
|
||||
}
|
||||
c.extLock.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtEventFuncs["XTEST"] = make(map[int]newEventFun)
|
||||
newExtErrorFuncs["XTEST"] = make(map[int]newErrorFun)
|
||||
}
|
||||
|
||||
// Skipping definition for base type 'Int16'
|
||||
|
||||
// Skipping definition for base type 'Int32'
|
||||
|
||||
// Skipping definition for base type 'Void'
|
||||
|
||||
// Skipping definition for base type 'Byte'
|
||||
|
||||
// Skipping definition for base type 'Int8'
|
||||
|
||||
// Skipping definition for base type 'Card16'
|
||||
|
||||
// Skipping definition for base type 'Char'
|
||||
|
||||
// Skipping definition for base type 'Card32'
|
||||
|
||||
// Skipping definition for base type 'Double'
|
||||
|
||||
// Skipping definition for base type 'Bool'
|
||||
|
||||
// Skipping definition for base type 'Float'
|
||||
|
||||
// Skipping definition for base type 'Card8'
|
||||
|
||||
const (
|
||||
XtestCursorNone = 0
|
||||
XtestCursorCurrent = 1
|
||||
)
|
||||
|
||||
// Request XtestGetVersion
|
||||
// size: 8
|
||||
type XtestGetVersionCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) XtestGetVersion(MajorVersion byte, MinorVersion uint16) XtestGetVersionCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xtestGetVersionRequest(MajorVersion, MinorVersion), cookie)
|
||||
return XtestGetVersionCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) XtestGetVersionUnchecked(MajorVersion byte, MinorVersion uint16) XtestGetVersionCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xtestGetVersionRequest(MajorVersion, MinorVersion), cookie)
|
||||
return XtestGetVersionCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for XtestGetVersion
|
||||
// size: 10
|
||||
type XtestGetVersionReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
MajorVersion byte
|
||||
MinorVersion uint16
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request XtestGetVersion
|
||||
func (cook XtestGetVersionCookie) Reply() (*XtestGetVersionReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return xtestGetVersionReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for XtestGetVersion
|
||||
func xtestGetVersionReply(buf []byte) *XtestGetVersionReply {
|
||||
v := new(XtestGetVersionReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
v.MajorVersion = buf[b]
|
||||
b += 1
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.MinorVersion = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook XtestGetVersionCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for XtestGetVersion
|
||||
func (c *Conn) xtestGetVersionRequest(MajorVersion byte, MinorVersion uint16) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XTEST"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 0 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
buf[b] = MajorVersion
|
||||
b += 1
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
Put16(buf[b:], MinorVersion)
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request XtestCompareCursor
|
||||
// size: 12
|
||||
type XtestCompareCursorCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) XtestCompareCursor(Window Window, Cursor Cursor) XtestCompareCursorCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xtestCompareCursorRequest(Window, Cursor), cookie)
|
||||
return XtestCompareCursorCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) XtestCompareCursorUnchecked(Window Window, Cursor Cursor) XtestCompareCursorCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xtestCompareCursorRequest(Window, Cursor), cookie)
|
||||
return XtestCompareCursorCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for XtestCompareCursor
|
||||
// size: 8
|
||||
type XtestCompareCursorReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
Same bool
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request XtestCompareCursor
|
||||
func (cook XtestCompareCursorCookie) Reply() (*XtestCompareCursorReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return xtestCompareCursorReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for XtestCompareCursor
|
||||
func xtestCompareCursorReply(buf []byte) *XtestCompareCursorReply {
|
||||
v := new(XtestCompareCursorReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
if buf[b] == 1 {
|
||||
v.Same = true
|
||||
} else {
|
||||
v.Same = false
|
||||
}
|
||||
b += 1
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook XtestCompareCursorCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for XtestCompareCursor
|
||||
func (c *Conn) xtestCompareCursorRequest(Window Window, Cursor Cursor) []byte {
|
||||
size := 12
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XTEST"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 1 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(Window))
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], uint32(Cursor))
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request XtestFakeInput
|
||||
// size: 36
|
||||
type XtestFakeInputCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for XtestFakeInput
|
||||
func (c *Conn) XtestFakeInput(Type byte, Detail byte, Time uint32, Root Window, RootX int16, RootY int16, Deviceid byte) XtestFakeInputCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.xtestFakeInputRequest(Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie)
|
||||
return XtestFakeInputCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) XtestFakeInputChecked(Type byte, Detail byte, Time uint32, Root Window, RootX int16, RootY int16, Deviceid byte) XtestFakeInputCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.xtestFakeInputRequest(Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie)
|
||||
return XtestFakeInputCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook XtestFakeInputCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for XtestFakeInput
|
||||
func (c *Conn) xtestFakeInputRequest(Type byte, Detail byte, Time uint32, Root Window, RootX int16, RootY int16, Deviceid byte) []byte {
|
||||
size := 36
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XTEST"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 2 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
buf[b] = Type
|
||||
b += 1
|
||||
|
||||
buf[b] = Detail
|
||||
b += 1
|
||||
|
||||
b += 2 // padding
|
||||
|
||||
Put32(buf[b:], Time)
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], uint32(Root))
|
||||
b += 4
|
||||
|
||||
b += 8 // padding
|
||||
|
||||
Put16(buf[b:], uint16(RootX))
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], uint16(RootY))
|
||||
b += 2
|
||||
|
||||
b += 7 // padding
|
||||
|
||||
buf[b] = Deviceid
|
||||
b += 1
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request XtestGrabControl
|
||||
// size: 8
|
||||
type XtestGrabControlCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
// Write request to wire for XtestGrabControl
|
||||
func (c *Conn) XtestGrabControl(Impervious bool) XtestGrabControlCookie {
|
||||
cookie := c.newCookie(false, false)
|
||||
c.newRequest(c.xtestGrabControlRequest(Impervious), cookie)
|
||||
return XtestGrabControlCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) XtestGrabControlChecked(Impervious bool) XtestGrabControlCookie {
|
||||
cookie := c.newCookie(true, false)
|
||||
c.newRequest(c.xtestGrabControlRequest(Impervious), cookie)
|
||||
return XtestGrabControlCookie{cookie}
|
||||
}
|
||||
|
||||
func (cook XtestGrabControlCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for XtestGrabControl
|
||||
func (c *Conn) xtestGrabControlRequest(Impervious bool) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XTEST"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 3 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
if Impervious {
|
||||
buf[b] = 1
|
||||
} else {
|
||||
buf[b] = 0
|
||||
}
|
||||
b += 1
|
||||
|
||||
b += 3 // padding
|
||||
|
||||
return buf
|
||||
}
|
||||
-2780
File diff suppressed because it is too large
Load Diff
@@ -1,929 +0,0 @@
|
||||
package xgb
|
||||
|
||||
/*
|
||||
This file was generated by xvmc.xml on May 10 2012 12:39:35pm EDT.
|
||||
This file is automatically generated. Edit at your peril!
|
||||
*/
|
||||
|
||||
// Imports are not necessary for XGB because everything is
|
||||
// in one package. They are still listed here for reference.
|
||||
// import "xv"
|
||||
|
||||
// XvmcInit must be called before using the XVideo-MotionCompensation extension.
|
||||
func (c *Conn) XvmcInit() error {
|
||||
reply, err := c.QueryExtension(25, "XVideo-MotionCompensation").Reply()
|
||||
switch {
|
||||
case err != nil:
|
||||
return err
|
||||
case !reply.Present:
|
||||
return errorf("No extension named XVideo-MotionCompensation could be found on on the server.")
|
||||
}
|
||||
|
||||
c.extLock.Lock()
|
||||
c.extensions["XVideo-MotionCompensation"] = reply.MajorOpcode
|
||||
for evNum, fun := range newExtEventFuncs["XVideo-MotionCompensation"] {
|
||||
newEventFuncs[int(reply.FirstEvent)+evNum] = fun
|
||||
}
|
||||
for errNum, fun := range newExtErrorFuncs["XVideo-MotionCompensation"] {
|
||||
newErrorFuncs[int(reply.FirstError)+errNum] = fun
|
||||
}
|
||||
c.extLock.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
newExtEventFuncs["XVideo-MotionCompensation"] = make(map[int]newEventFun)
|
||||
newExtErrorFuncs["XVideo-MotionCompensation"] = make(map[int]newErrorFun)
|
||||
}
|
||||
|
||||
// Skipping definition for base type 'Int8'
|
||||
|
||||
// Skipping definition for base type 'Card16'
|
||||
|
||||
// Skipping definition for base type 'Char'
|
||||
|
||||
// Skipping definition for base type 'Card32'
|
||||
|
||||
// Skipping definition for base type 'Double'
|
||||
|
||||
// Skipping definition for base type 'Bool'
|
||||
|
||||
// Skipping definition for base type 'Float'
|
||||
|
||||
// Skipping definition for base type 'Card8'
|
||||
|
||||
// Skipping definition for base type 'Int16'
|
||||
|
||||
// Skipping definition for base type 'Int32'
|
||||
|
||||
// Skipping definition for base type 'Void'
|
||||
|
||||
// Skipping definition for base type 'Byte'
|
||||
|
||||
type XvmcContext uint32
|
||||
|
||||
func (c *Conn) NewXvmcContextId() (XvmcContext, error) {
|
||||
id, err := c.NewId()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return XvmcContext(id), nil
|
||||
}
|
||||
|
||||
type XvmcSurface uint32
|
||||
|
||||
func (c *Conn) NewXvmcSurfaceId() (XvmcSurface, error) {
|
||||
id, err := c.NewId()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return XvmcSurface(id), nil
|
||||
}
|
||||
|
||||
type XvmcSubpicture uint32
|
||||
|
||||
func (c *Conn) NewXvmcSubpictureId() (XvmcSubpicture, error) {
|
||||
id, err := c.NewId()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return XvmcSubpicture(id), nil
|
||||
}
|
||||
|
||||
// 'XvmcSurfaceInfo' struct definition
|
||||
// Size: 24
|
||||
type XvmcSurfaceInfo struct {
|
||||
Id XvmcSurface
|
||||
ChromaFormat uint16
|
||||
Pad0 uint16
|
||||
MaxWidth uint16
|
||||
MaxHeight uint16
|
||||
SubpictureMaxWidth uint16
|
||||
SubpictureMaxHeight uint16
|
||||
McType uint32
|
||||
Flags uint32
|
||||
}
|
||||
|
||||
// Struct read XvmcSurfaceInfo
|
||||
func ReadXvmcSurfaceInfo(buf []byte, v *XvmcSurfaceInfo) int {
|
||||
b := 0
|
||||
|
||||
v.Id = XvmcSurface(Get32(buf[b:]))
|
||||
b += 4
|
||||
|
||||
v.ChromaFormat = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Pad0 = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.MaxWidth = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.MaxHeight = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.SubpictureMaxWidth = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.SubpictureMaxHeight = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.McType = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
v.Flags = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
return b
|
||||
}
|
||||
|
||||
// Struct list read XvmcSurfaceInfo
|
||||
func ReadXvmcSurfaceInfoList(buf []byte, dest []XvmcSurfaceInfo) int {
|
||||
b := 0
|
||||
for i := 0; i < len(dest); i++ {
|
||||
dest[i] = XvmcSurfaceInfo{}
|
||||
b += ReadXvmcSurfaceInfo(buf[b:], &dest[i])
|
||||
}
|
||||
return pad(b)
|
||||
}
|
||||
|
||||
// Struct write XvmcSurfaceInfo
|
||||
func (v XvmcSurfaceInfo) Bytes() []byte {
|
||||
buf := make([]byte, 24)
|
||||
b := 0
|
||||
|
||||
Put32(buf[b:], uint32(v.Id))
|
||||
b += 4
|
||||
|
||||
Put16(buf[b:], v.ChromaFormat)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], v.Pad0)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], v.MaxWidth)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], v.MaxHeight)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], v.SubpictureMaxWidth)
|
||||
b += 2
|
||||
|
||||
Put16(buf[b:], v.SubpictureMaxHeight)
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], v.McType)
|
||||
b += 4
|
||||
|
||||
Put32(buf[b:], v.Flags)
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Write struct list XvmcSurfaceInfo
|
||||
func XvmcSurfaceInfoListBytes(buf []byte, list []XvmcSurfaceInfo) int {
|
||||
b := 0
|
||||
var structBytes []byte
|
||||
for _, item := range list {
|
||||
structBytes = item.Bytes()
|
||||
copy(buf[b:], structBytes)
|
||||
b += pad(len(structBytes))
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// Request XvmcQueryVersion
|
||||
// size: 4
|
||||
type XvmcQueryVersionCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) XvmcQueryVersion() XvmcQueryVersionCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xvmcQueryVersionRequest(), cookie)
|
||||
return XvmcQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) XvmcQueryVersionUnchecked() XvmcQueryVersionCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xvmcQueryVersionRequest(), cookie)
|
||||
return XvmcQueryVersionCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for XvmcQueryVersion
|
||||
// size: 16
|
||||
type XvmcQueryVersionReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
Major uint32
|
||||
Minor uint32
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request XvmcQueryVersion
|
||||
func (cook XvmcQueryVersionCookie) Reply() (*XvmcQueryVersionReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return xvmcQueryVersionReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for XvmcQueryVersion
|
||||
func xvmcQueryVersionReply(buf []byte) *XvmcQueryVersionReply {
|
||||
v := new(XvmcQueryVersionReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.Major = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
v.Minor = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook XvmcQueryVersionCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for XvmcQueryVersion
|
||||
func (c *Conn) xvmcQueryVersionRequest() []byte {
|
||||
size := 4
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 0 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request XvmcListSurfaceTypes
|
||||
// size: 8
|
||||
type XvmcListSurfaceTypesCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) XvmcListSurfaceTypes(PortId XvPort) XvmcListSurfaceTypesCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xvmcListSurfaceTypesRequest(PortId), cookie)
|
||||
return XvmcListSurfaceTypesCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) XvmcListSurfaceTypesUnchecked(PortId XvPort) XvmcListSurfaceTypesCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xvmcListSurfaceTypesRequest(PortId), cookie)
|
||||
return XvmcListSurfaceTypesCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for XvmcListSurfaceTypes
|
||||
// size: (32 + pad((int(Num) * 24)))
|
||||
type XvmcListSurfaceTypesReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
Num uint32
|
||||
// padding: 20 bytes
|
||||
Surfaces []XvmcSurfaceInfo // size: pad((int(Num) * 24))
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request XvmcListSurfaceTypes
|
||||
func (cook XvmcListSurfaceTypesCookie) Reply() (*XvmcListSurfaceTypesReply, error) {
|
||||
buf, err := cook.reply()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return xvmcListSurfaceTypesReply(buf), nil
|
||||
}
|
||||
|
||||
// Read reply into structure from buffer for XvmcListSurfaceTypes
|
||||
func xvmcListSurfaceTypesReply(buf []byte) *XvmcListSurfaceTypesReply {
|
||||
v := new(XvmcListSurfaceTypesReply)
|
||||
b := 1 // skip reply determinant
|
||||
|
||||
b += 1 // padding
|
||||
|
||||
v.Sequence = Get16(buf[b:])
|
||||
b += 2
|
||||
|
||||
v.Length = Get32(buf[b:]) // 4-byte units
|
||||
b += 4
|
||||
|
||||
v.Num = Get32(buf[b:])
|
||||
b += 4
|
||||
|
||||
b += 20 // padding
|
||||
|
||||
v.Surfaces = make([]XvmcSurfaceInfo, v.Num)
|
||||
b += ReadXvmcSurfaceInfoList(buf[b:], v.Surfaces)
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
func (cook XvmcListSurfaceTypesCookie) Check() error {
|
||||
return cook.check()
|
||||
}
|
||||
|
||||
// Write request to wire for XvmcListSurfaceTypes
|
||||
func (c *Conn) xvmcListSurfaceTypesRequest(PortId XvPort) []byte {
|
||||
size := 8
|
||||
b := 0
|
||||
buf := make([]byte, size)
|
||||
|
||||
buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"]
|
||||
b += 1
|
||||
|
||||
buf[b] = 1 // request opcode
|
||||
b += 1
|
||||
|
||||
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
|
||||
b += 2
|
||||
|
||||
Put32(buf[b:], uint32(PortId))
|
||||
b += 4
|
||||
|
||||
return buf
|
||||
}
|
||||
|
||||
// Request XvmcCreateContext
|
||||
// size: 24
|
||||
type XvmcCreateContextCookie struct {
|
||||
*cookie
|
||||
}
|
||||
|
||||
func (c *Conn) XvmcCreateContext(ContextId XvmcContext, PortId XvPort, SurfaceId XvmcSurface, Width uint16, Height uint16, Flags uint32) XvmcCreateContextCookie {
|
||||
cookie := c.newCookie(true, true)
|
||||
c.newRequest(c.xvmcCreateContextRequest(ContextId, PortId, SurfaceId, Width, Height, Flags), cookie)
|
||||
return XvmcCreateContextCookie{cookie}
|
||||
}
|
||||
|
||||
func (c *Conn) XvmcCreateContextUnchecked(ContextId XvmcContext, PortId XvPort, SurfaceId XvmcSurface, Width uint16, Height uint16, Flags uint32) XvmcCreateContextCookie {
|
||||
cookie := c.newCookie(false, true)
|
||||
c.newRequest(c.xvmcCreateContextRequest(ContextId, PortId, SurfaceId, Width, Height, Flags), cookie)
|
||||
return XvmcCreateContextCookie{cookie}
|
||||
}
|
||||
|
||||
// Request reply for XvmcCreateContext
|
||||
// size: (36 + pad((int(Length) * 4)))
|
||||
type XvmcCreateContextReply struct {
|
||||
Sequence uint16
|
||||
Length uint32
|
||||
// padding: 1 bytes
|
||||
WidthActual uint16
|
||||
HeightActual uint16
|
||||
FlagsReturn uint32
|
||||
// padding: 20 bytes
|
||||
PrivData []uint32 // size: pad((int(Length) * 4))
|
||||
}
|
||||
|
||||
// Waits and reads reply data from request XvmcCreateContext
|
||||