auto-generated Go code ftw. ~65,000 lines. woooheee

This commit is contained in:
Andrew Gallant (Ocelot) 2012-05-06 03:06:48 -04:00
parent 70ebcf5178
commit 135cee5761
28 changed files with 40161 additions and 61 deletions

112
nexgb/auto_bigreq.go Normal file
View File

@ -0,0 +1,112 @@
package xgb
/*
This file was generated by bigreq.xml on May 6 2012 3:00:43am EDT.
This file is automatically generated. Edit at your peril!
*/
// Skipping definition for base type 'Float'
// Skipping definition for base type 'Id'
// 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 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
}

555
nexgb/auto_composite.go Normal file
View File

@ -0,0 +1,555 @@
package xgb
/*
This file was generated by composite.xml on May 6 2012 3:00:43am 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"
// Skipping definition for base type 'Float'
// Skipping definition for base type 'Id'
// 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 (
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 Id, Update byte) CompositeRedirectWindowCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.compositeRedirectWindowRequest(Window, Update), cookie)
return CompositeRedirectWindowCookie{cookie}
}
func (c *Conn) CompositeRedirectWindowChecked(Window Id, 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 Id, 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 Id, Update byte) CompositeRedirectSubwindowsCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.compositeRedirectSubwindowsRequest(Window, Update), cookie)
return CompositeRedirectSubwindowsCookie{cookie}
}
func (c *Conn) CompositeRedirectSubwindowsChecked(Window Id, 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 Id, 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 Id, Update byte) CompositeUnredirectWindowCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.compositeUnredirectWindowRequest(Window, Update), cookie)
return CompositeUnredirectWindowCookie{cookie}
}
func (c *Conn) CompositeUnredirectWindowChecked(Window Id, 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 Id, 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 Id, Update byte) CompositeUnredirectSubwindowsCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.compositeUnredirectSubwindowsRequest(Window, Update), cookie)
return CompositeUnredirectSubwindowsCookie{cookie}
}
func (c *Conn) CompositeUnredirectSubwindowsChecked(Window Id, 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 Id, 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 Id, Window Id) CompositeCreateRegionFromBorderClipCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.compositeCreateRegionFromBorderClipRequest(Region, Window), cookie)
return CompositeCreateRegionFromBorderClipCookie{cookie}
}
func (c *Conn) CompositeCreateRegionFromBorderClipChecked(Region Id, Window Id) 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 Id, Window Id) []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 Id, Pixmap Id) CompositeNameWindowPixmapCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.compositeNameWindowPixmapRequest(Window, Pixmap), cookie)
return CompositeNameWindowPixmapCookie{cookie}
}
func (c *Conn) CompositeNameWindowPixmapChecked(Window Id, Pixmap Id) 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 Id, Pixmap Id) []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 Id) CompositeGetOverlayWindowCookie {
cookie := c.newCookie(true, true)
c.newRequest(c.compositeGetOverlayWindowRequest(Window), cookie)
return CompositeGetOverlayWindowCookie{cookie}
}
func (c *Conn) CompositeGetOverlayWindowUnchecked(Window Id) 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 Id
// 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 = Id(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 Id) []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 Id) CompositeReleaseOverlayWindowCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.compositeReleaseOverlayWindowRequest(Window), cookie)
return CompositeReleaseOverlayWindowCookie{cookie}
}
func (c *Conn) CompositeReleaseOverlayWindowChecked(Window Id) 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 Id) []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
}

479
nexgb/auto_damage.go Normal file
View File

@ -0,0 +1,479 @@
package xgb
/*
This file was generated by damage.xml on May 6 2012 3:00:43am 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"
// 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 'Id'
// 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'
const (
DamageReportLevelRawRectangles = 0
DamageReportLevelDeltaRectangles = 1
DamageReportLevelBoundingBox = 2
DamageReportLevelNonEmpty = 3
)
// Skipping resource definition of 'Damage'
// Event definition DamageNotify (0)
// Size: 32
const DamageNotify = 0
type DamageNotifyEvent struct {
Sequence uint16
Level byte
Drawable Id
Damage Id
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 = Id(Get32(buf[b:]))
b += 4
v.Damage = Id(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() {
newEventFuncs[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() Id {
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() {
newErrorFuncs[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 Id, Drawable Id, Level byte) DamageCreateCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.damageCreateRequest(Damage, Drawable, Level), cookie)
return DamageCreateCookie{cookie}
}
func (c *Conn) DamageCreateChecked(Damage Id, Drawable Id, 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 Id, Drawable Id, 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 Id) DamageDestroyCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.damageDestroyRequest(Damage), cookie)
return DamageDestroyCookie{cookie}
}
func (c *Conn) DamageDestroyChecked(Damage Id) 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 Id) []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 Id, Repair Id, Parts Id) DamageSubtractCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.damageSubtractRequest(Damage, Repair, Parts), cookie)
return DamageSubtractCookie{cookie}
}
func (c *Conn) DamageSubtractChecked(Damage Id, Repair Id, Parts Id) 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 Id, Repair Id, Parts Id) []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 Id, Region Id) DamageAddCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.damageAddRequest(Drawable, Region), cookie)
return DamageAddCookie{cookie}
}
func (c *Conn) DamageAddChecked(Drawable Id, Region Id) 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 Id, Region Id) []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
}

574
nexgb/auto_dpms.go Normal file
View File

@ -0,0 +1,574 @@
package xgb
/*
This file was generated by dpms.xml on May 6 2012 3:00:44am EDT.
This file is automatically generated. Edit at your peril!
*/
// 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 'Id'
// Skipping definition for base type 'Card8'
// Skipping definition for base type 'Int16'
// Skipping definition for base type 'Int32'
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
}

1534
nexgb/auto_dri2.go Normal file

File diff suppressed because it is too large Load Diff

125
nexgb/auto_ge.go Normal file
View File

@ -0,0 +1,125 @@
package xgb
/*
This file was generated by ge.xml on May 6 2012 3:00:44am EDT.
This file is automatically generated. Edit at your peril!
*/
// Skipping definition for base type 'Id'
// 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'
// 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
}

9356
nexgb/auto_glx.go Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
package xgb
/*
This file was generated by randr.xml on May 5 2012 6:06:50pm EDT.
This file was generated by randr.xml on May 6 2012 3:00:44am EDT.
This file is automatically generated. Edit at your peril!
*/
@ -10,12 +10,6 @@ package xgb
// import "xproto"
// import "render"
// Skipping definition for base type 'Id'
// Skipping definition for base type 'Card8'
// Skipping definition for base type 'Int16'
// Skipping definition for base type 'Int32'
// Skipping definition for base type 'Void'
@ -36,6 +30,12 @@ package xgb
// Skipping definition for base type 'Float'
// Skipping definition for base type 'Id'
// Skipping definition for base type 'Card8'
// Skipping definition for base type 'Int16'
const (
RandrRotationRotate0 = 1
RandrRotationRotate90 = 2

1061
nexgb/auto_record.go Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
package xgb
/*
This file was generated by render.xml on May 5 2012 6:07:02pm EDT.
This file was generated by render.xml on May 6 2012 3:00:44am EDT.
This file is automatically generated. Edit at your peril!
*/
@ -9,18 +9,6 @@ package xgb
// in one package. They are still listed here for reference.
// import "xproto"
// Skipping definition for base type 'Id'
// 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'
@ -35,6 +23,18 @@ package xgb
// Skipping definition for base type 'Float'
// Skipping definition for base type 'Id'
// 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 (
RenderPictTypeIndexed = 0
RenderPictTypeDirect = 1

502
nexgb/auto_res.go Normal file
View File

@ -0,0 +1,502 @@
package xgb
/*
This file was generated by res.xml on May 6 2012 3:00:44am 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"
// 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 'Id'
// 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'
// '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 Id
Count uint32
}
// Struct read ResType
func ReadResType(buf []byte, v *ResType) int {
b := 0
v.ResourceType = Id(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
}

601
nexgb/auto_screensaver.go Normal file
View File

@ -0,0 +1,601 @@
package xgb
/*
This file was generated by screensaver.xml on May 6 2012 3:00:44am 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"
// 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 'Id'
// 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'
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 Id
Window Id
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 = Id(Get32(buf[b:]))
b += 4
v.Window = Id(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() {
newEventFuncs[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 Id) ScreensaverQueryInfoCookie {
cookie := c.newCookie(true, true)
c.newRequest(c.screensaverQueryInfoRequest(Drawable), cookie)
return ScreensaverQueryInfoCookie{cookie}
}
func (c *Conn) ScreensaverQueryInfoUnchecked(Drawable Id) 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 Id
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 = Id(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 Id) []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 Id, EventMask uint32) ScreensaverSelectInputCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.screensaverSelectInputRequest(Drawable, EventMask), cookie)
return ScreensaverSelectInputCookie{cookie}
}
func (c *Conn) ScreensaverSelectInputChecked(Drawable Id, 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 Id, 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 Id, 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 Id, 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 Id, 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 Id) ScreensaverUnsetAttributesCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.screensaverUnsetAttributesRequest(Drawable), cookie)
return ScreensaverUnsetAttributesCookie{cookie}
}
func (c *Conn) ScreensaverUnsetAttributesChecked(Drawable Id) 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 Id) []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
}

871
nexgb/auto_shape.go Normal file
View File

@ -0,0 +1,871 @@
package xgb
/*
This file was generated by shape.xml on May 6 2012 3:00:44am 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"
// 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 'Id'
// 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'
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 Id
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 = Id(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() {
newEventFuncs[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 Id, 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 Id, 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 Id, 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 Id, XOffset int16, YOffset int16, SourceBitmap Id) 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 Id, XOffset int16, YOffset int16, SourceBitmap Id) 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 Id, XOffset int16, YOffset int16, SourceBitmap Id) []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 Id, XOffset int16, YOffset int16, SourceWindow Id) 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 Id, XOffset int16, YOffset int16, SourceWindow Id) 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 Id, XOffset int16, YOffset int16, SourceWindow Id) []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 Id, 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 Id, 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 Id, 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 Id) ShapeQueryExtentsCookie {
cookie := c.newCookie(true, true)
c.newRequest(c.shapeQueryExtentsRequest(DestinationWindow), cookie)
return ShapeQueryExtentsCookie{cookie}
}
func (c *Conn) ShapeQueryExtentsUnchecked(DestinationWindow Id) 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 Id) []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 Id, Enable bool) ShapeSelectInputCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.shapeSelectInputRequest(DestinationWindow, Enable), cookie)
return ShapeSelectInputCookie{cookie}
}
func (c *Conn) ShapeSelectInputChecked(DestinationWindow Id, 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 Id, 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 Id) ShapeInputSelectedCookie {
cookie := c.newCookie(true, true)
c.newRequest(c.shapeInputSelectedRequest(DestinationWindow), cookie)
return ShapeInputSelectedCookie{cookie}
}
func (c *Conn) ShapeInputSelectedUnchecked(DestinationWindow Id) 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 Id) []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 Id, SourceKind ShapeKind) ShapeGetRectanglesCookie {
cookie := c.newCookie(true, true)
c.newRequest(c.shapeGetRectanglesRequest(Window, SourceKind), cookie)
return ShapeGetRectanglesCookie{cookie}
}
func (c *Conn) ShapeGetRectanglesUnchecked(Window Id, 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 Id, 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
}

644
nexgb/auto_shm.go Normal file
View File

@ -0,0 +1,644 @@
package xgb
/*
This file was generated by shm.xml on May 6 2012 3:00:44am 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"
// 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'
// Skipping definition for base type 'Id'
// Skipping resource definition of 'Seg'
// Event definition ShmCompletion (0)
// Size: 32
const ShmCompletion = 0
type ShmCompletionEvent struct {
Sequence uint16
// padding: 1 bytes
Drawable Id
MinorEvent uint16
MajorEvent byte
// padding: 1 bytes
Shmseg Id
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 = Id(Get32(buf[b:]))
b += 4
v.MinorEvent = Get16(buf[b:])
b += 2
v.MajorEvent = buf[b]
b += 1
b += 1 // padding
v.Shmseg = Id(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() {
newEventFuncs[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() Id {
return Id(err.BadValue)
}
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() {
newErrorFuncs[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 Id, 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 Id, 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 Id, 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 Id) ShmDetachCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.shmDetachRequest(Shmseg), cookie)
return ShmDetachCookie{cookie}
}
func (c *Conn) ShmDetachChecked(Shmseg Id) 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 Id) []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 Id, Gc Id, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Id, 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 Id, Gc Id, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Id, 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 Id, Gc Id, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Id, 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 Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Id, 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 Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Id, 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 Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Id, 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 Id, Drawable Id, Width uint16, Height uint16, Depth byte, Shmseg Id, 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 Id, Drawable Id, Width uint16, Height uint16, Depth byte, Shmseg Id, 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 Id, Drawable Id, Width uint16, Height uint16, Depth byte, Shmseg Id, 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
}

1899
nexgb/auto_sync.go Normal file

File diff suppressed because it is too large Load Diff

300
nexgb/auto_xc_misc.go Normal file
View File

@ -0,0 +1,300 @@
package xgb
/*
This file was generated by xc_misc.xml on May 6 2012 3:00:44am EDT.
This file is automatically generated. Edit at your peril!
*/
// Skipping definition for base type 'Float'
// Skipping definition for base type 'Id'
// 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
}

513
nexgb/auto_xevie.go Normal file
View File

@ -0,0 +1,513 @@
package xgb
/*
This file was generated by xevie.xml on May 6 2012 3:00:44am EDT.
This file is automatically generated. Edit at your peril!
*/
// Skipping definition for base type 'Id'
// 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 (
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
}

1125
nexgb/auto_xf86dri.go Normal file

File diff suppressed because it is too large Load Diff

2372
nexgb/auto_xf86vidmode.go Normal file

File diff suppressed because it is too large Load Diff

2139
nexgb/auto_xfixes.go Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
package xgb
/*
This file was generated by xinerama.xml on May 5 2012 5:56:52pm EDT.
This file was generated by xinerama.xml on May 6 2012 3:00:45am EDT.
This file is automatically generated. Edit at your peril!
*/
@ -9,6 +9,16 @@ package xgb
// in one package. They are still listed here for reference.
// import "xproto"
// Skipping definition for base type 'Float'
// Skipping definition for base type 'Id'
// 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'
@ -25,16 +35,6 @@ package xgb
// Skipping definition for base type 'Bool'
// Skipping definition for base type 'Float'
// Skipping definition for base type 'Id'
// Skipping definition for base type 'Card8'
// Skipping definition for base type 'Int16'
// Skipping definition for base type 'Int32'
// 'XineramaScreenInfo' struct definition
// Size: 8
type XineramaScreenInfo struct {
@ -183,12 +183,12 @@ func (c *Conn) xineramaQueryVersionRequest(Major byte, Minor byte) []byte {
buf[b] = 0 // request opcode
b += 1
buf[b] = Major
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
@ -270,12 +270,12 @@ func (c *Conn) xineramaGetStateRequest(Window Id) []byte {
buf[b] = 1 // request opcode
b += 1
Put32(buf[b:], uint32(Window))
b += 4
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
b += 2
Put32(buf[b:], uint32(Window))
b += 4
return buf
}
@ -354,12 +354,12 @@ func (c *Conn) xineramaGetScreenCountRequest(Window Id) []byte {
buf[b] = 2 // request opcode
b += 1
Put32(buf[b:], uint32(Window))
b += 4
Put16(buf[b:], uint16(size/4)) // write request size in 4-byte units
b += 2
Put32(buf[b:], uint32(Window))
b += 4
return buf
}
@ -449,12 +449,12 @@ func (c *Conn) xineramaGetScreenSizeRequest(Window Id, Screen uint32) []byte {
buf[b] = 3 // request opcode
b += 1
Put32(buf[b:], uint32(Window))
b += 4
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

7271
nexgb/auto_xinput.go Normal file

File diff suppressed because it is too large Load Diff

2176
nexgb/auto_xprint.go Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,12 @@
package xgb
/*
This file was generated by xproto.xml on May 5 2012 5:43:45pm EDT.
This file was generated by xproto.xml on May 6 2012 3:00:45am EDT.
This file is automatically generated. Edit at your peril!
*/
// Skipping definition for base type 'Int16'
// Skipping definition for base type 'Int32'
// Skipping definition for base type 'Void'
@ -29,8 +31,6 @@ package xgb
// Skipping definition for base type 'Card8'
// Skipping definition for base type 'Int16'
const (
VisualClassStaticGray = 0
VisualClassGrayScale = 1
@ -2417,15 +2417,15 @@ func HostListSize(list []Host) int {
// NewClientMessageDataUnionData16(Data16 []uint16) ClientMessageDataUnion
// NewClientMessageDataUnionData32(Data32 []uint32) ClientMessageDataUnion
type ClientMessageDataUnion struct {
Data8 []byte // size: pad(20)
Data16 []uint16 // size: pad(20)
Data32 []uint32 // size: pad(20)
Data8 []byte // size: 20
Data16 []uint16 // size: 20
Data32 []uint32 // size: 20
}
// Union constructor for ClientMessageDataUnion for field Data8.
func NewClientMessageDataUnionData8(Data8 []byte) ClientMessageDataUnion {
var b int
buf := make([]byte, pad(20))
buf := make([]byte, 20)
copy(buf[b:], Data8[:20])
b += pad(int(20))
@ -2462,7 +2462,7 @@ func NewClientMessageDataUnionData8(Data8 []byte) ClientMessageDataUnion {
// Union constructor for ClientMessageDataUnion for field Data16.
func NewClientMessageDataUnionData16(Data16 []uint16) ClientMessageDataUnion {
var b int
buf := make([]byte, pad(20))
buf := make([]byte, 20)
for i := 0; i < int(10); i++ {
Put16(buf[b:], Data16[i])
@ -2502,7 +2502,7 @@ func NewClientMessageDataUnionData16(Data16 []uint16) ClientMessageDataUnion {
// Union constructor for ClientMessageDataUnion for field Data32.
func NewClientMessageDataUnionData32(Data32 []uint32) ClientMessageDataUnion {
var b int
buf := make([]byte, pad(20))
buf := make([]byte, 20)
for i := 0; i < int(5); i++ {
Put32(buf[b:], Data32[i])
@ -2564,7 +2564,7 @@ func ReadClientMessageDataUnion(buf []byte, v *ClientMessageDataUnion) int {
}
b = pad(b)
return pad(20)
return 20
}
// Union list read ClientMessageDataUnion
@ -2581,7 +2581,7 @@ func ReadClientMessageDataUnionList(buf []byte, dest []ClientMessageDataUnion) i
// Each field in a union must contain the same data.
// So simply pick the first field and write that to the wire.
func (v ClientMessageDataUnion) Bytes() []byte {
buf := make([]byte, pad(20))
buf := make([]byte, 20)
b := 0
copy(buf[b:], v.Data8[:20])
@ -3285,7 +3285,7 @@ func init() {
const KeymapNotify = 11
type KeymapNotifyEvent struct {
Keys []byte // size: pad(31)
Keys []byte // size: 32
}
// Event read KeymapNotify
@ -7938,7 +7938,7 @@ func (c *Conn) convertSelectionRequest(Requestor Id, Selection Id, Target Id, Pr
}
// Request SendEvent
// size: pad((12 + pad(32)))
// size: 44
type SendEventCookie struct {
*cookie
}
@ -7962,7 +7962,7 @@ func (cook SendEventCookie) Check() error {
// Write request to wire for SendEvent
func (c *Conn) sendEventRequest(Propagate bool, Destination Id, EventMask uint32, Event string) []byte {
size := pad((12 + pad(32)))
size := 44
b := 0
buf := make([]byte, size)
@ -9200,12 +9200,12 @@ func (c *Conn) QueryKeymapUnchecked() QueryKeymapCookie {
}
// Request reply for QueryKeymap
// size: (8 + pad(32))
// size: 40
type QueryKeymapReply struct {
Sequence uint16
Length uint32
// padding: 1 bytes
Keys []byte // size: pad(32)
Keys []byte // size: 32
}
// Waits and reads reply data from request QueryKeymap
@ -13267,7 +13267,7 @@ func (c *Conn) GetKeyboardControlUnchecked() GetKeyboardControlCookie {
}
// Request reply for GetKeyboardControl
// size: (20 + pad(32))
// size: 52
type GetKeyboardControlReply struct {
Sequence uint16
Length uint32
@ -13278,7 +13278,7 @@ type GetKeyboardControlReply struct {
BellPitch uint16
BellDuration uint16
// padding: 2 bytes
AutoRepeats []byte // size: pad(32)
AutoRepeats []byte // size: 32
}
// Waits and reads reply data from request GetKeyboardControl

1939
nexgb/auto_xselinux.go Normal file

File diff suppressed because it is too large Load Diff

335
nexgb/auto_xtest.go Normal file
View File

@ -0,0 +1,335 @@
package xgb
/*
This file was generated by xtest.xml on May 6 2012 3:00:45am 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"
// 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 'Id'
// Skipping definition for base type 'Card8'
// Skipping definition for base type 'Int16'
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 Id, Cursor Id) XtestCompareCursorCookie {
cookie := c.newCookie(true, true)
c.newRequest(c.xtestCompareCursorRequest(Window, Cursor), cookie)
return XtestCompareCursorCookie{cookie}
}
func (c *Conn) XtestCompareCursorUnchecked(Window Id, Cursor Id) 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 Id, Cursor Id) []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 Id, 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 Id, 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 Id, 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
}

2738
nexgb/auto_xv.go Normal file

File diff suppressed because it is too large Load Diff

879
nexgb/auto_xvmc.go Normal file
View File

@ -0,0 +1,879 @@
package xgb
/*
This file was generated by xvmc.xml on May 6 2012 3:00:45am 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"
// 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 'Id'
// 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 resource definition of 'Context'
// Skipping resource definition of 'Surface'
// Skipping resource definition of 'Subpicture'
// 'XvmcSurfaceInfo' struct definition
// Size: 24
type XvmcSurfaceInfo struct {
Id Id
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 = Id(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 Id) XvmcListSurfaceTypesCookie {
cookie := c.newCookie(true, true)
c.newRequest(c.xvmcListSurfaceTypesRequest(PortId), cookie)
return XvmcListSurfaceTypesCookie{cookie}
}
func (c *Conn) XvmcListSurfaceTypesUnchecked(PortId Id) 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 Id) []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 Id, PortId Id, SurfaceId Id, 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 Id, PortId Id, SurfaceId Id, 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
func (cook XvmcCreateContextCookie) Reply() (*XvmcCreateContextReply, error) {
buf, err := cook.reply()
if err != nil {
return nil, err
}
if buf == nil {
return nil, nil
}
return xvmcCreateContextReply(buf), nil
}
// Read reply into structure from buffer for XvmcCreateContext
func xvmcCreateContextReply(buf []byte) *XvmcCreateContextReply {
v := new(XvmcCreateContextReply)
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.WidthActual = Get16(buf[b:])
b += 2
v.HeightActual = Get16(buf[b:])
b += 2
v.FlagsReturn = Get32(buf[b:])
b += 4
b += 20 // padding
v.PrivData = make([]uint32, v.Length)
for i := 0; i < int(v.Length); i++ {
v.PrivData[i] = Get32(buf[b:])
b += 4
}
b = pad(b)
return v
}
func (cook XvmcCreateContextCookie) Check() error {
return cook.check()
}
// Write request to wire for XvmcCreateContext
func (c *Conn) xvmcCreateContextRequest(ContextId Id, PortId Id, SurfaceId Id, Width uint16, Height uint16, Flags uint32) []byte {
size := 24
b := 0
buf := make([]byte, size)
buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"]
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(ContextId))
b += 4
Put32(buf[b:], uint32(PortId))
b += 4
Put32(buf[b:], uint32(SurfaceId))
b += 4
Put16(buf[b:], Width)
b += 2
Put16(buf[b:], Height)
b += 2
Put32(buf[b:], Flags)
b += 4
return buf
}
// Request XvmcDestroyContext
// size: 8
type XvmcDestroyContextCookie struct {
*cookie
}
// Write request to wire for XvmcDestroyContext
func (c *Conn) XvmcDestroyContext(ContextId Id) XvmcDestroyContextCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.xvmcDestroyContextRequest(ContextId), cookie)
return XvmcDestroyContextCookie{cookie}
}
func (c *Conn) XvmcDestroyContextChecked(ContextId Id) XvmcDestroyContextCookie {
cookie := c.newCookie(true, false)
c.newRequest(c.xvmcDestroyContextRequest(ContextId), cookie)
return XvmcDestroyContextCookie{cookie}
}
func (cook XvmcDestroyContextCookie) Check() error {
return cook.check()
}
// Write request to wire for XvmcDestroyContext
func (c *Conn) xvmcDestroyContextRequest(ContextId Id) []byte {
size := 8
b := 0
buf := make([]byte, size)
buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"]
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(ContextId))
b += 4
return buf
}
// Request XvmcCreateSurface
// size: 12
type XvmcCreateSurfaceCookie struct {
*cookie
}
func (c *Conn) XvmcCreateSurface(SurfaceId Id, ContextId Id) XvmcCreateSurfaceCookie {
cookie := c.newCookie(true, true)
c.newRequest(c.xvmcCreateSurfaceRequest(SurfaceId, ContextId), cookie)
return XvmcCreateSurfaceCookie{cookie}
}
func (c *Conn) XvmcCreateSurfaceUnchecked(SurfaceId Id, ContextId Id) XvmcCreateSurfaceCookie {
cookie := c.newCookie(false, true)
c.newRequest(c.xvmcCreateSurfaceRequest(SurfaceId, ContextId), cookie)
return XvmcCreateSurfaceCookie{cookie}
}
// Request reply for XvmcCreateSurface
// size: (32 + pad((int(Length) * 4)))
type XvmcCreateSurfaceReply struct {
Sequence uint16
Length uint32
// padding: 1 bytes
// padding: 24 bytes
PrivData []uint32 // size: pad((int(Length) * 4))
}
// Waits and reads reply data from request XvmcCreateSurface
func (cook XvmcCreateSurfaceCookie) Reply() (*XvmcCreateSurfaceReply, error) {
buf, err := cook.reply()
if err != nil {
return nil, err
}
if buf == nil {
return nil, nil
}
return xvmcCreateSurfaceReply(buf), nil
}
// Read reply into structure from buffer for XvmcCreateSurface
func xvmcCreateSurfaceReply(buf []byte) *XvmcCreateSurfaceReply {
v := new(XvmcCreateSurfaceReply)
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
v.PrivData = make([]uint32, v.Length)
for i := 0; i < int(v.Length); i++ {
v.PrivData[i] = Get32(buf[b:])
b += 4
}
b = pad(b)
return v
}
func (cook XvmcCreateSurfaceCookie) Check() error {
return cook.check()
}
// Write request to wire for XvmcCreateSurface
func (c *Conn) xvmcCreateSurfaceRequest(SurfaceId Id, ContextId Id) []byte {
size := 12
b := 0
buf := make([]byte, size)
buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"]
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(SurfaceId))
b += 4
Put32(buf[b:], uint32(ContextId))
b += 4
return buf
}
// Request XvmcDestroySurface
// size: 8
type XvmcDestroySurfaceCookie struct {
*cookie
}
// Write request to wire for XvmcDestroySurface
func (c *Conn) XvmcDestroySurface(SurfaceId Id) XvmcDestroySurfaceCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.xvmcDestroySurfaceRequest(SurfaceId), cookie)
return XvmcDestroySurfaceCookie{cookie}
}
func (c *Conn) XvmcDestroySurfaceChecked(SurfaceId Id) XvmcDestroySurfaceCookie {
cookie := c.newCookie(true, false)
c.newRequest(c.xvmcDestroySurfaceRequest(SurfaceId), cookie)
return XvmcDestroySurfaceCookie{cookie}
}
func (cook XvmcDestroySurfaceCookie) Check() error {
return cook.check()
}
// Write request to wire for XvmcDestroySurface
func (c *Conn) xvmcDestroySurfaceRequest(SurfaceId Id) []byte {
size := 8
b := 0
buf := make([]byte, size)
buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"]
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(SurfaceId))
b += 4
return buf
}
// Request XvmcCreateSubpicture
// size: 20
type XvmcCreateSubpictureCookie struct {
*cookie
}
func (c *Conn) XvmcCreateSubpicture(SubpictureId Id, Context Id, XvimageId uint32, Width uint16, Height uint16) XvmcCreateSubpictureCookie {
cookie := c.newCookie(true, true)
c.newRequest(c.xvmcCreateSubpictureRequest(SubpictureId, Context, XvimageId, Width, Height), cookie)
return XvmcCreateSubpictureCookie{cookie}
}
func (c *Conn) XvmcCreateSubpictureUnchecked(SubpictureId Id, Context Id, XvimageId uint32, Width uint16, Height uint16) XvmcCreateSubpictureCookie {
cookie := c.newCookie(false, true)
c.newRequest(c.xvmcCreateSubpictureRequest(SubpictureId, Context, XvimageId, Width, Height), cookie)
return XvmcCreateSubpictureCookie{cookie}
}
// Request reply for XvmcCreateSubpicture
// size: (32 + pad((int(Length) * 4)))
type XvmcCreateSubpictureReply struct {
Sequence uint16
Length uint32
// padding: 1 bytes
WidthActual uint16
HeightActual uint16
NumPaletteEntries uint16
EntryBytes uint16
ComponentOrder []byte // size: 4
// padding: 12 bytes
PrivData []uint32 // size: pad((int(Length) * 4))
}
// Waits and reads reply data from request XvmcCreateSubpicture
func (cook XvmcCreateSubpictureCookie) Reply() (*XvmcCreateSubpictureReply, error) {
buf, err := cook.reply()
if err != nil {
return nil, err
}
if buf == nil {
return nil, nil
}
return xvmcCreateSubpictureReply(buf), nil
}
// Read reply into structure from buffer for XvmcCreateSubpicture
func xvmcCreateSubpictureReply(buf []byte) *XvmcCreateSubpictureReply {
v := new(XvmcCreateSubpictureReply)
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.WidthActual = Get16(buf[b:])
b += 2
v.HeightActual = Get16(buf[b:])
b += 2
v.NumPaletteEntries = Get16(buf[b:])
b += 2
v.EntryBytes = Get16(buf[b:])
b += 2
v.ComponentOrder = make([]byte, 4)
copy(v.ComponentOrder[:4], buf[b:])
b += pad(int(4))
b += 12 // padding
v.PrivData = make([]uint32, v.Length)
for i := 0; i < int(v.Length); i++ {
v.PrivData[i] = Get32(buf[b:])
b += 4
}
b = pad(b)
return v
}
func (cook XvmcCreateSubpictureCookie) Check() error {
return cook.check()
}
// Write request to wire for XvmcCreateSubpicture
func (c *Conn) xvmcCreateSubpictureRequest(SubpictureId Id, Context Id, XvimageId uint32, Width uint16, Height uint16) []byte {
size := 20
b := 0
buf := make([]byte, size)
buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"]
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(SubpictureId))
b += 4
Put32(buf[b:], uint32(Context))
b += 4
Put32(buf[b:], XvimageId)
b += 4
Put16(buf[b:], Width)
b += 2
Put16(buf[b:], Height)
b += 2
return buf
}
// Request XvmcDestroySubpicture
// size: 8
type XvmcDestroySubpictureCookie struct {
*cookie
}
// Write request to wire for XvmcDestroySubpicture
func (c *Conn) XvmcDestroySubpicture(SubpictureId Id) XvmcDestroySubpictureCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.xvmcDestroySubpictureRequest(SubpictureId), cookie)
return XvmcDestroySubpictureCookie{cookie}
}
func (c *Conn) XvmcDestroySubpictureChecked(SubpictureId Id) XvmcDestroySubpictureCookie {
cookie := c.newCookie(true, false)
c.newRequest(c.xvmcDestroySubpictureRequest(SubpictureId), cookie)
return XvmcDestroySubpictureCookie{cookie}
}
func (cook XvmcDestroySubpictureCookie) Check() error {
return cook.check()
}
// Write request to wire for XvmcDestroySubpicture
func (c *Conn) xvmcDestroySubpictureRequest(SubpictureId Id) []byte {
size := 8
b := 0
buf := make([]byte, size)
buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"]
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(SubpictureId))
b += 4
return buf
}
// Request XvmcListSubpictureTypes
// size: 12
type XvmcListSubpictureTypesCookie struct {
*cookie
}
func (c *Conn) XvmcListSubpictureTypes(PortId Id, SurfaceId Id) XvmcListSubpictureTypesCookie {
cookie := c.newCookie(true, true)
c.newRequest(c.xvmcListSubpictureTypesRequest(PortId, SurfaceId), cookie)
return XvmcListSubpictureTypesCookie{cookie}
}
func (c *Conn) XvmcListSubpictureTypesUnchecked(PortId Id, SurfaceId Id) XvmcListSubpictureTypesCookie {
cookie := c.newCookie(false, true)
c.newRequest(c.xvmcListSubpictureTypesRequest(PortId, SurfaceId), cookie)
return XvmcListSubpictureTypesCookie{cookie}
}
// Request reply for XvmcListSubpictureTypes
// size: (32 + XvImageFormatInfoListSize(Types))
type XvmcListSubpictureTypesReply struct {
Sequence uint16
Length uint32
// padding: 1 bytes
Num uint32
// padding: 20 bytes
Types []XvImageFormatInfo // size: XvImageFormatInfoListSize(Types)
}
// Waits and reads reply data from request XvmcListSubpictureTypes
func (cook XvmcListSubpictureTypesCookie) Reply() (*XvmcListSubpictureTypesReply, error) {
buf, err := cook.reply()
if err != nil {
return nil, err
}
if buf == nil {
return nil, nil
}
return xvmcListSubpictureTypesReply(buf), nil
}
// Read reply into structure from buffer for XvmcListSubpictureTypes
func xvmcListSubpictureTypesReply(buf []byte) *XvmcListSubpictureTypesReply {
v := new(XvmcListSubpictureTypesReply)
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.Types = make([]XvImageFormatInfo, v.Num)
b += ReadXvImageFormatInfoList(buf[b:], v.Types)
return v
}
func (cook XvmcListSubpictureTypesCookie) Check() error {
return cook.check()
}
// Write request to wire for XvmcListSubpictureTypes
func (c *Conn) xvmcListSubpictureTypesRequest(PortId Id, SurfaceId Id) []byte {
size := 12
b := 0
buf := make([]byte, size)
buf[b] = c.extensions["XVIDEO-MOTIONCOMPENSATION"]
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(PortId))
b += 4
Put32(buf[b:], uint32(SurfaceId))
b += 4
return buf
}