better docs

This commit is contained in:
Andrew Gallant (Ocelot) 2012-05-10 23:57:34 -04:00
parent a3363755cd
commit c00652934e
34 changed files with 6734 additions and 4688 deletions

View File

@ -2,7 +2,7 @@
package bigreq
/*
This file was generated by bigreq.xml on May 10 2012 8:04:31pm EDT.
This file was generated by bigreq.xml on May 10 2012 11:56:18pm EDT.
This file is automatically generated. Edit at your peril!
*/
@ -40,6 +40,8 @@ func init() {
xgb.NewExtErrorFuncs["BIG-REQUESTS"] = make(map[int]xgb.NewErrorFun)
}
// Skipping definition for base type 'Float'
// Skipping definition for base type 'Card8'
// Skipping definition for base type 'Int16'
@ -62,36 +64,36 @@ func init() {
// Skipping definition for base type 'Bool'
// Skipping definition for base type 'Float'
// Request Enable
// size: 4
// EnableCookie is a cookie used only for Enable requests.
type EnableCookie struct {
*xgb.Cookie
}
// Enable sends a checked request.
// If an error occurs, it will be returned with the reply by calling EnableCookie.Reply()
func Enable(c *xgb.Conn) EnableCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(enableRequest(c), cookie)
return EnableCookie{cookie}
}
// EnableUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func EnableUnchecked(c *xgb.Conn) EnableCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(enableRequest(c), cookie)
return EnableCookie{cookie}
}
// Request reply for Enable
// size: 12
// EnableReply represents the data returned from a Enable request.
type EnableReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
MaximumRequestLength uint32
}
// Waits and reads reply data from request Enable
// Reply blocks and returns the reply data for a Enable request.
func (cook EnableCookie) Reply() (*EnableReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -103,7 +105,7 @@ func (cook EnableCookie) Reply() (*EnableReply, error) {
return enableReply(buf), nil
}
// Read reply into structure from buffer for Enable
// enableReply reads a byte slice into a EnableReply value.
func enableReply(buf []byte) *EnableReply {
v := new(EnableReply)
b := 1 // skip reply determinant
@ -123,6 +125,7 @@ func enableReply(buf []byte) *EnableReply {
}
// Write request to wire for Enable
// enableRequest writes a Enable request to a byte slice.
func enableRequest(c *xgb.Conn) []byte {
size := 4
b := 0

View File

@ -2,7 +2,7 @@
package composite
/*
This file was generated by composite.xml on May 10 2012 8:04:31pm EDT.
This file was generated by composite.xml on May 10 2012 11:56:18pm EDT.
This file is automatically generated. Edit at your peril!
*/
@ -41,16 +41,6 @@ func init() {
xgb.NewExtErrorFuncs["Composite"] = make(map[int]xgb.NewErrorFun)
}
// Skipping definition for base type 'Card8'
// Skipping definition for base type 'Int16'
// Skipping definition for base type 'Int32'
// Skipping definition for base type 'Void'
// Skipping definition for base type 'Byte'
// Skipping definition for base type 'Int8'
// Skipping definition for base type 'Card16'
@ -65,41 +55,53 @@ func init() {
// Skipping definition for base type 'Float'
// Skipping definition for base type 'Card8'
// Skipping definition for base type 'Int16'
// Skipping definition for base type 'Int32'
// Skipping definition for base type 'Void'
// Skipping definition for base type 'Byte'
const (
RedirectAutomatic = 0
RedirectManual = 1
)
// Request QueryVersion
// size: 12
// QueryVersionCookie is a cookie used only for QueryVersion requests.
type QueryVersionCookie struct {
*xgb.Cookie
}
// QueryVersion sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()
func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
return QueryVersionCookie{cookie}
}
// QueryVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
return QueryVersionCookie{cookie}
}
// Request reply for QueryVersion
// size: 32
// QueryVersionReply represents the data returned from a QueryVersion request.
type QueryVersionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
MajorVersion uint32
MinorVersion uint32
// padding: 16 bytes
}
// Waits and reads reply data from request QueryVersion
// Reply blocks and returns the reply data for a QueryVersion request.
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -111,7 +113,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
return queryVersionReply(buf), nil
}
// Read reply into structure from buffer for QueryVersion
// queryVersionReply reads a byte slice into a QueryVersionReply value.
func queryVersionReply(buf []byte) *QueryVersionReply {
v := new(QueryVersionReply)
b := 1 // skip reply determinant
@ -136,6 +138,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
}
// Write request to wire for QueryVersion
// queryVersionRequest writes a QueryVersion request to a byte slice.
func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) []byte {
size := 12
b := 0
@ -159,30 +162,35 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVers
return buf
}
// Request RedirectWindow
// size: 12
// RedirectWindowCookie is a cookie used only for RedirectWindow requests.
type RedirectWindowCookie struct {
*xgb.Cookie
}
// Write request to wire for RedirectWindow
// RedirectWindow sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func RedirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) RedirectWindowCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(redirectWindowRequest(c, Window, Update), cookie)
return RedirectWindowCookie{cookie}
}
// RedirectWindowChecked sends a checked request.
// If an error occurs, it can be retrieved using RedirectWindowCookie.Check()
func RedirectWindowChecked(c *xgb.Conn, Window xproto.Window, Update byte) RedirectWindowCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(redirectWindowRequest(c, Window, Update), cookie)
return RedirectWindowCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook RedirectWindowCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for RedirectWindow
// redirectWindowRequest writes a RedirectWindow request to a byte slice.
func redirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte {
size := 12
b := 0
@ -208,30 +216,35 @@ func redirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byt
return buf
}
// Request RedirectSubwindows
// size: 12
// RedirectSubwindowsCookie is a cookie used only for RedirectSubwindows requests.
type RedirectSubwindowsCookie struct {
*xgb.Cookie
}
// Write request to wire for RedirectSubwindows
// RedirectSubwindows sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func RedirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) RedirectSubwindowsCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(redirectSubwindowsRequest(c, Window, Update), cookie)
return RedirectSubwindowsCookie{cookie}
}
// RedirectSubwindowsChecked sends a checked request.
// If an error occurs, it can be retrieved using RedirectSubwindowsCookie.Check()
func RedirectSubwindowsChecked(c *xgb.Conn, Window xproto.Window, Update byte) RedirectSubwindowsCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(redirectSubwindowsRequest(c, Window, Update), cookie)
return RedirectSubwindowsCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook RedirectSubwindowsCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for RedirectSubwindows
// redirectSubwindowsRequest writes a RedirectSubwindows request to a byte slice.
func redirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte {
size := 12
b := 0
@ -257,30 +270,35 @@ func redirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) [
return buf
}
// Request UnredirectWindow
// size: 12
// UnredirectWindowCookie is a cookie used only for UnredirectWindow requests.
type UnredirectWindowCookie struct {
*xgb.Cookie
}
// Write request to wire for UnredirectWindow
// UnredirectWindow sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func UnredirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectWindowCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(unredirectWindowRequest(c, Window, Update), cookie)
return UnredirectWindowCookie{cookie}
}
// UnredirectWindowChecked sends a checked request.
// If an error occurs, it can be retrieved using UnredirectWindowCookie.Check()
func UnredirectWindowChecked(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectWindowCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(unredirectWindowRequest(c, Window, Update), cookie)
return UnredirectWindowCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook UnredirectWindowCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for UnredirectWindow
// unredirectWindowRequest writes a UnredirectWindow request to a byte slice.
func unredirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte {
size := 12
b := 0
@ -306,30 +324,35 @@ func unredirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []b
return buf
}
// Request UnredirectSubwindows
// size: 12
// UnredirectSubwindowsCookie is a cookie used only for UnredirectSubwindows requests.
type UnredirectSubwindowsCookie struct {
*xgb.Cookie
}
// Write request to wire for UnredirectSubwindows
// UnredirectSubwindows sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func UnredirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectSubwindowsCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(unredirectSubwindowsRequest(c, Window, Update), cookie)
return UnredirectSubwindowsCookie{cookie}
}
// UnredirectSubwindowsChecked sends a checked request.
// If an error occurs, it can be retrieved using UnredirectSubwindowsCookie.Check()
func UnredirectSubwindowsChecked(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectSubwindowsCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(unredirectSubwindowsRequest(c, Window, Update), cookie)
return UnredirectSubwindowsCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook UnredirectSubwindowsCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for UnredirectSubwindows
// unredirectSubwindowsRequest writes a UnredirectSubwindows request to a byte slice.
func unredirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte {
size := 12
b := 0
@ -355,30 +378,35 @@ func unredirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte)
return buf
}
// Request CreateRegionFromBorderClip
// size: 12
// CreateRegionFromBorderClipCookie is a cookie used only for CreateRegionFromBorderClip requests.
type CreateRegionFromBorderClipCookie struct {
*xgb.Cookie
}
// Write request to wire for CreateRegionFromBorderClip
// CreateRegionFromBorderClip sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func CreateRegionFromBorderClip(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) CreateRegionFromBorderClipCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(createRegionFromBorderClipRequest(c, Region, Window), cookie)
return CreateRegionFromBorderClipCookie{cookie}
}
// CreateRegionFromBorderClipChecked sends a checked request.
// If an error occurs, it can be retrieved using CreateRegionFromBorderClipCookie.Check()
func CreateRegionFromBorderClipChecked(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) CreateRegionFromBorderClipCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(createRegionFromBorderClipRequest(c, Region, Window), cookie)
return CreateRegionFromBorderClipCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook CreateRegionFromBorderClipCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for CreateRegionFromBorderClip
// createRegionFromBorderClipRequest writes a CreateRegionFromBorderClip request to a byte slice.
func createRegionFromBorderClipRequest(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) []byte {
size := 12
b := 0
@ -402,30 +430,35 @@ func createRegionFromBorderClipRequest(c *xgb.Conn, Region xfixes.Region, Window
return buf
}
// Request NameWindowPixmap
// size: 12
// NameWindowPixmapCookie is a cookie used only for NameWindowPixmap requests.
type NameWindowPixmapCookie struct {
*xgb.Cookie
}
// Write request to wire for NameWindowPixmap
// NameWindowPixmap sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func NameWindowPixmap(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) NameWindowPixmapCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(nameWindowPixmapRequest(c, Window, Pixmap), cookie)
return NameWindowPixmapCookie{cookie}
}
// NameWindowPixmapChecked sends a checked request.
// If an error occurs, it can be retrieved using NameWindowPixmapCookie.Check()
func NameWindowPixmapChecked(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) NameWindowPixmapCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(nameWindowPixmapRequest(c, Window, Pixmap), cookie)
return NameWindowPixmapCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook NameWindowPixmapCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for NameWindowPixmap
// nameWindowPixmapRequest writes a NameWindowPixmap request to a byte slice.
func nameWindowPixmapRequest(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) []byte {
size := 12
b := 0
@ -449,35 +482,37 @@ func nameWindowPixmapRequest(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pi
return buf
}
// Request GetOverlayWindow
// size: 8
// GetOverlayWindowCookie is a cookie used only for GetOverlayWindow requests.
type GetOverlayWindowCookie struct {
*xgb.Cookie
}
// GetOverlayWindow sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetOverlayWindowCookie.Reply()
func GetOverlayWindow(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getOverlayWindowRequest(c, Window), cookie)
return GetOverlayWindowCookie{cookie}
}
// GetOverlayWindowUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetOverlayWindowUnchecked(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getOverlayWindowRequest(c, Window), cookie)
return GetOverlayWindowCookie{cookie}
}
// Request reply for GetOverlayWindow
// size: 32
// GetOverlayWindowReply represents the data returned from a GetOverlayWindow request.
type GetOverlayWindowReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
OverlayWin xproto.Window
// padding: 20 bytes
}
// Waits and reads reply data from request GetOverlayWindow
// Reply blocks and returns the reply data for a GetOverlayWindow request.
func (cook GetOverlayWindowCookie) Reply() (*GetOverlayWindowReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -489,7 +524,7 @@ func (cook GetOverlayWindowCookie) Reply() (*GetOverlayWindowReply, error) {
return getOverlayWindowReply(buf), nil
}
// Read reply into structure from buffer for GetOverlayWindow
// getOverlayWindowReply reads a byte slice into a GetOverlayWindowReply value.
func getOverlayWindowReply(buf []byte) *GetOverlayWindowReply {
v := new(GetOverlayWindowReply)
b := 1 // skip reply determinant
@ -511,6 +546,7 @@ func getOverlayWindowReply(buf []byte) *GetOverlayWindowReply {
}
// Write request to wire for GetOverlayWindow
// getOverlayWindowRequest writes a GetOverlayWindow request to a byte slice.
func getOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte {
size := 8
b := 0
@ -531,30 +567,35 @@ func getOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte {
return buf
}
// Request ReleaseOverlayWindow
// size: 8
// ReleaseOverlayWindowCookie is a cookie used only for ReleaseOverlayWindow requests.
type ReleaseOverlayWindowCookie struct {
*xgb.Cookie
}
// Write request to wire for ReleaseOverlayWindow
// ReleaseOverlayWindow sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func ReleaseOverlayWindow(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindowCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(releaseOverlayWindowRequest(c, Window), cookie)
return ReleaseOverlayWindowCookie{cookie}
}
// ReleaseOverlayWindowChecked sends a checked request.
// If an error occurs, it can be retrieved using ReleaseOverlayWindowCookie.Check()
func ReleaseOverlayWindowChecked(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindowCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(releaseOverlayWindowRequest(c, Window), cookie)
return ReleaseOverlayWindowCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook ReleaseOverlayWindowCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for ReleaseOverlayWindow
// releaseOverlayWindowRequest writes a ReleaseOverlayWindow request to a byte slice.
func releaseOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte {
size := 8
b := 0

View File

@ -2,7 +2,7 @@
package damage
/*
This file was generated by damage.xml on May 10 2012 8:04:31pm EDT.
This file was generated by damage.xml on May 10 2012 11:56:18pm EDT.
This file is automatically generated. Edit at your peril!
*/
@ -82,9 +82,7 @@ func NewDamageId(c *xgb.Conn) (Damage, error) {
return Damage(id), nil
}
// Event definition Notify (0)
// Size: 32
// Notify is the event number for a NotifyEvent.
const Notify = 0
type NotifyEvent struct {
@ -97,7 +95,7 @@ type NotifyEvent struct {
Geometry xproto.Rectangle
}
// Event read Notify
// NotifyEventNew constructs a NotifyEvent value that implements xgb.Event from a byte slice.
func NotifyEventNew(buf []byte) xgb.Event {
v := NotifyEvent{}
b := 1 // don't read event number
@ -126,7 +124,7 @@ func NotifyEventNew(buf []byte) xgb.Event {
return v
}
// Event write Notify
// Bytes writes a NotifyEvent value to a byte slice.
func (v NotifyEvent) Bytes() []byte {
buf := make([]byte, 32)
b := 0
@ -164,12 +162,14 @@ func (v NotifyEvent) Bytes() []byte {
return buf
}
func (v NotifyEvent) ImplementsEvent() {}
// SequenceId returns the sequence id attached to the Notify event.
// Events without a sequence number (KeymapNotify) return 0.
// This is mostly used internally.
func (v NotifyEvent) SequenceId() uint16 {
return v.Sequence
}
// String is a rudimentary string representation of NotifyEvent.
func (v NotifyEvent) String() string {
fieldVals := make([]string, 0, 6)
fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence))
@ -184,9 +184,7 @@ func init() {
xgb.NewExtEventFuncs["DAMAGE"][0] = NotifyEventNew
}
// Error definition BadDamage (0)
// Size: 32
// BadBadDamage is the error number for a BadBadDamage.
const BadBadDamage = 0
type BadDamageError struct {
@ -194,7 +192,7 @@ type BadDamageError struct {
NiceName string
}
// Error read BadDamage
// BadDamageErrorNew constructs a BadDamageError value that implements xgb.Error from a byte slice.
func BadDamageErrorNew(buf []byte) xgb.Error {
v := BadDamageError{}
v.NiceName = "BadDamage"
@ -208,8 +206,8 @@ func BadDamageErrorNew(buf []byte) xgb.Error {
return v
}
func (err BadDamageError) ImplementsError() {}
// SequenceId returns the sequence id attached to the BadBadDamage error.
// This is mostly used internally.
func (err BadDamageError) SequenceId() uint16 {
return err.Sequence
}
@ -229,36 +227,38 @@ func init() {
xgb.NewExtErrorFuncs["DAMAGE"][0] = BadDamageErrorNew
}
// Request QueryVersion
// size: 12
// QueryVersionCookie is a cookie used only for QueryVersion requests.
type QueryVersionCookie struct {
*xgb.Cookie
}
// QueryVersion sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()
func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
return QueryVersionCookie{cookie}
}
// QueryVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
return QueryVersionCookie{cookie}
}
// Request reply for QueryVersion
// size: 32
// QueryVersionReply represents the data returned from a QueryVersion request.
type QueryVersionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
MajorVersion uint32
MinorVersion uint32
// padding: 16 bytes
}
// Waits and reads reply data from request QueryVersion
// Reply blocks and returns the reply data for a QueryVersion request.
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -270,7 +270,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
return queryVersionReply(buf), nil
}
// Read reply into structure from buffer for QueryVersion
// queryVersionReply reads a byte slice into a QueryVersionReply value.
func queryVersionReply(buf []byte) *QueryVersionReply {
v := new(QueryVersionReply)
b := 1 // skip reply determinant
@ -295,6 +295,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
}
// Write request to wire for QueryVersion
// queryVersionRequest writes a QueryVersion request to a byte slice.
func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) []byte {
size := 12
b := 0
@ -318,30 +319,35 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVers
return buf
}
// Request Create
// size: 16
// CreateCookie is a cookie used only for Create requests.
type CreateCookie struct {
*xgb.Cookie
}
// Write request to wire for Create
// Create sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func Create(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) CreateCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(createRequest(c, Damage, Drawable, Level), cookie)
return CreateCookie{cookie}
}
// CreateChecked sends a checked request.
// If an error occurs, it can be retrieved using CreateCookie.Check()
func CreateChecked(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) CreateCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(createRequest(c, Damage, Drawable, Level), cookie)
return CreateCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook CreateCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for Create
// createRequest writes a Create request to a byte slice.
func createRequest(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) []byte {
size := 16
b := 0
@ -370,30 +376,35 @@ func createRequest(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level b
return buf
}
// Request Destroy
// size: 8
// DestroyCookie is a cookie used only for Destroy requests.
type DestroyCookie struct {
*xgb.Cookie
}
// Write request to wire for Destroy
// Destroy sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func Destroy(c *xgb.Conn, Damage Damage) DestroyCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(destroyRequest(c, Damage), cookie)
return DestroyCookie{cookie}
}
// DestroyChecked sends a checked request.
// If an error occurs, it can be retrieved using DestroyCookie.Check()
func DestroyChecked(c *xgb.Conn, Damage Damage) DestroyCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(destroyRequest(c, Damage), cookie)
return DestroyCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook DestroyCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for Destroy
// destroyRequest writes a Destroy request to a byte slice.
func destroyRequest(c *xgb.Conn, Damage Damage) []byte {
size := 8
b := 0
@ -414,30 +425,35 @@ func destroyRequest(c *xgb.Conn, Damage Damage) []byte {
return buf
}
// Request Subtract
// size: 16
// SubtractCookie is a cookie used only for Subtract requests.
type SubtractCookie struct {
*xgb.Cookie
}
// Write request to wire for Subtract
// Subtract sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func Subtract(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Region) SubtractCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(subtractRequest(c, Damage, Repair, Parts), cookie)
return SubtractCookie{cookie}
}
// SubtractChecked sends a checked request.
// If an error occurs, it can be retrieved using SubtractCookie.Check()
func SubtractChecked(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Region) SubtractCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(subtractRequest(c, Damage, Repair, Parts), cookie)
return SubtractCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook SubtractCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for Subtract
// subtractRequest writes a Subtract request to a byte slice.
func subtractRequest(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Region) []byte {
size := 16
b := 0
@ -464,30 +480,35 @@ func subtractRequest(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfi
return buf
}
// Request Add
// size: 12
// AddCookie is a cookie used only for Add requests.
type AddCookie struct {
*xgb.Cookie
}
// Write request to wire for Add
// Add sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func Add(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(addRequest(c, Drawable, Region), cookie)
return AddCookie{cookie}
}
// AddChecked sends a checked request.
// If an error occurs, it can be retrieved using AddCookie.Check()
func AddChecked(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(addRequest(c, Drawable, Region), cookie)
return AddCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook AddCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for Add
// addRequest writes a Add request to a byte slice.
func addRequest(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) []byte {
size := 12
b := 0

View File

@ -2,7 +2,7 @@
package dpms
/*
This file was generated by dpms.xml on May 10 2012 8:04:31pm EDT.
This file was generated by dpms.xml on May 10 2012 11:56:18pm EDT.
This file is automatically generated. Edit at your peril!
*/
@ -40,6 +40,14 @@ func init() {
xgb.NewExtErrorFuncs["DPMS"] = make(map[int]xgb.NewErrorFun)
}
// Skipping definition for base type 'Card8'
// Skipping definition for base type 'Int16'
// Skipping definition for base type 'Int32'
// Skipping definition for base type 'Void'
// Skipping definition for base type 'Byte'
// Skipping definition for base type 'Int8'
@ -56,14 +64,6 @@ func init() {
// Skipping definition for base type 'Float'
// Skipping definition for base type 'Card8'
// Skipping definition for base type 'Int16'
// Skipping definition for base type 'Int32'
// Skipping definition for base type 'Void'
const (
DPMSModeOn = 0
DPMSModeStandby = 1
@ -71,35 +71,37 @@ const (
DPMSModeOff = 3
)
// Request GetVersion
// size: 8
// GetVersionCookie is a cookie used only for GetVersion requests.
type GetVersionCookie struct {
*xgb.Cookie
}
// GetVersion sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetVersionCookie.Reply()
func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
return GetVersionCookie{cookie}
}
// GetVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
return GetVersionCookie{cookie}
}
// Request reply for GetVersion
// size: 12
// GetVersionReply represents the data returned from a GetVersion request.
type GetVersionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
ServerMajorVersion uint16
ServerMinorVersion uint16
}
// Waits and reads reply data from request GetVersion
// Reply blocks and returns the reply data for a GetVersion request.
func (cook GetVersionCookie) Reply() (*GetVersionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -111,7 +113,7 @@ func (cook GetVersionCookie) Reply() (*GetVersionReply, error) {
return getVersionReply(buf), nil
}
// Read reply into structure from buffer for GetVersion
// getVersionReply reads a byte slice into a GetVersionReply value.
func getVersionReply(buf []byte) *GetVersionReply {
v := new(GetVersionReply)
b := 1 // skip reply determinant
@ -134,6 +136,7 @@ func getVersionReply(buf []byte) *GetVersionReply {
}
// Write request to wire for GetVersion
// getVersionRequest writes a GetVersion request to a byte slice.
func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte {
size := 8
b := 0
@ -157,35 +160,37 @@ func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersio
return buf
}
// Request Capable
// size: 4
// CapableCookie is a cookie used only for Capable requests.
type CapableCookie struct {
*xgb.Cookie
}
// Capable sends a checked request.
// If an error occurs, it will be returned with the reply by calling CapableCookie.Reply()
func Capable(c *xgb.Conn) CapableCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(capableRequest(c), cookie)
return CapableCookie{cookie}
}
// CapableUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func CapableUnchecked(c *xgb.Conn) CapableCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(capableRequest(c), cookie)
return CapableCookie{cookie}
}
// Request reply for Capable
// size: 32
// CapableReply represents the data returned from a Capable request.
type CapableReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
Capable bool
// padding: 23 bytes
}
// Waits and reads reply data from request Capable
// Reply blocks and returns the reply data for a Capable request.
func (cook CapableCookie) Reply() (*CapableReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -197,7 +202,7 @@ func (cook CapableCookie) Reply() (*CapableReply, error) {
return capableReply(buf), nil
}
// Read reply into structure from buffer for Capable
// capableReply reads a byte slice into a CapableReply value.
func capableReply(buf []byte) *CapableReply {
v := new(CapableReply)
b := 1 // skip reply determinant
@ -223,6 +228,7 @@ func capableReply(buf []byte) *CapableReply {
}
// Write request to wire for Capable
// capableRequest writes a Capable request to a byte slice.
func capableRequest(c *xgb.Conn) []byte {
size := 4
b := 0
@ -240,29 +246,31 @@ func capableRequest(c *xgb.Conn) []byte {
return buf
}
// Request GetTimeouts
// size: 4
// GetTimeoutsCookie is a cookie used only for GetTimeouts requests.
type GetTimeoutsCookie struct {
*xgb.Cookie
}
// GetTimeouts sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetTimeoutsCookie.Reply()
func GetTimeouts(c *xgb.Conn) GetTimeoutsCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getTimeoutsRequest(c), cookie)
return GetTimeoutsCookie{cookie}
}
// GetTimeoutsUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetTimeoutsUnchecked(c *xgb.Conn) GetTimeoutsCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getTimeoutsRequest(c), cookie)
return GetTimeoutsCookie{cookie}
}
// Request reply for GetTimeouts
// size: 32
// GetTimeoutsReply represents the data returned from a GetTimeouts request.
type GetTimeoutsReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
StandbyTimeout uint16
SuspendTimeout uint16
@ -270,7 +278,7 @@ type GetTimeoutsReply struct {
// padding: 18 bytes
}
// Waits and reads reply data from request GetTimeouts
// Reply blocks and returns the reply data for a GetTimeouts request.
func (cook GetTimeoutsCookie) Reply() (*GetTimeoutsReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -282,7 +290,7 @@ func (cook GetTimeoutsCookie) Reply() (*GetTimeoutsReply, error) {
return getTimeoutsReply(buf), nil
}
// Read reply into structure from buffer for GetTimeouts
// getTimeoutsReply reads a byte slice into a GetTimeoutsReply value.
func getTimeoutsReply(buf []byte) *GetTimeoutsReply {
v := new(GetTimeoutsReply)
b := 1 // skip reply determinant
@ -310,6 +318,7 @@ func getTimeoutsReply(buf []byte) *GetTimeoutsReply {
}
// Write request to wire for GetTimeouts
// getTimeoutsRequest writes a GetTimeouts request to a byte slice.
func getTimeoutsRequest(c *xgb.Conn) []byte {
size := 4
b := 0
@ -327,30 +336,35 @@ func getTimeoutsRequest(c *xgb.Conn) []byte {
return buf
}
// Request SetTimeouts
// size: 12
// SetTimeoutsCookie is a cookie used only for SetTimeouts requests.
type SetTimeoutsCookie struct {
*xgb.Cookie
}
// Write request to wire for SetTimeouts
// SetTimeouts sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func SetTimeouts(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) SetTimeoutsCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(setTimeoutsRequest(c, StandbyTimeout, SuspendTimeout, OffTimeout), cookie)
return SetTimeoutsCookie{cookie}
}
// SetTimeoutsChecked sends a checked request.
// If an error occurs, it can be retrieved using SetTimeoutsCookie.Check()
func SetTimeoutsChecked(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) SetTimeoutsCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(setTimeoutsRequest(c, StandbyTimeout, SuspendTimeout, OffTimeout), cookie)
return SetTimeoutsCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook SetTimeoutsCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for SetTimeouts
// setTimeoutsRequest writes a SetTimeouts request to a byte slice.
func setTimeoutsRequest(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) []byte {
size := 12
b := 0
@ -377,30 +391,35 @@ func setTimeoutsRequest(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint1
return buf
}
// Request Enable
// size: 4
// EnableCookie is a cookie used only for Enable requests.
type EnableCookie struct {
*xgb.Cookie
}
// Write request to wire for Enable
// Enable sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func Enable(c *xgb.Conn) EnableCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(enableRequest(c), cookie)
return EnableCookie{cookie}
}
// EnableChecked sends a checked request.
// If an error occurs, it can be retrieved using EnableCookie.Check()
func EnableChecked(c *xgb.Conn) EnableCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(enableRequest(c), cookie)
return EnableCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook EnableCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for Enable
// enableRequest writes a Enable request to a byte slice.
func enableRequest(c *xgb.Conn) []byte {
size := 4
b := 0
@ -418,30 +437,35 @@ func enableRequest(c *xgb.Conn) []byte {
return buf
}
// Request Disable
// size: 4
// DisableCookie is a cookie used only for Disable requests.
type DisableCookie struct {
*xgb.Cookie
}
// Write request to wire for Disable
// Disable sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func Disable(c *xgb.Conn) DisableCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(disableRequest(c), cookie)
return DisableCookie{cookie}
}
// DisableChecked sends a checked request.
// If an error occurs, it can be retrieved using DisableCookie.Check()
func DisableChecked(c *xgb.Conn) DisableCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(disableRequest(c), cookie)
return DisableCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook DisableCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for Disable
// disableRequest writes a Disable request to a byte slice.
func disableRequest(c *xgb.Conn) []byte {
size := 4
b := 0
@ -459,30 +483,35 @@ func disableRequest(c *xgb.Conn) []byte {
return buf
}
// Request ForceLevel
// size: 8
// ForceLevelCookie is a cookie used only for ForceLevel requests.
type ForceLevelCookie struct {
*xgb.Cookie
}
// Write request to wire for ForceLevel
// ForceLevel sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func ForceLevel(c *xgb.Conn, PowerLevel uint16) ForceLevelCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(forceLevelRequest(c, PowerLevel), cookie)
return ForceLevelCookie{cookie}
}
// ForceLevelChecked sends a checked request.
// If an error occurs, it can be retrieved using ForceLevelCookie.Check()
func ForceLevelChecked(c *xgb.Conn, PowerLevel uint16) ForceLevelCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(forceLevelRequest(c, PowerLevel), cookie)
return ForceLevelCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook ForceLevelCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for ForceLevel
// forceLevelRequest writes a ForceLevel request to a byte slice.
func forceLevelRequest(c *xgb.Conn, PowerLevel uint16) []byte {
size := 8
b := 0
@ -503,36 +532,38 @@ func forceLevelRequest(c *xgb.Conn, PowerLevel uint16) []byte {
return buf
}
// Request Info
// size: 4
// InfoCookie is a cookie used only for Info requests.
type InfoCookie struct {
*xgb.Cookie
}
// Info sends a checked request.
// If an error occurs, it will be returned with the reply by calling InfoCookie.Reply()
func Info(c *xgb.Conn) InfoCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(infoRequest(c), cookie)
return InfoCookie{cookie}
}
// InfoUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func InfoUnchecked(c *xgb.Conn) InfoCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(infoRequest(c), cookie)
return InfoCookie{cookie}
}
// Request reply for Info
// size: 32
// InfoReply represents the data returned from a Info request.
type InfoReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
PowerLevel uint16
State bool
// padding: 21 bytes
}
// Waits and reads reply data from request Info
// Reply blocks and returns the reply data for a Info request.
func (cook InfoCookie) Reply() (*InfoReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -544,7 +575,7 @@ func (cook InfoCookie) Reply() (*InfoReply, error) {
return infoReply(buf), nil
}
// Read reply into structure from buffer for Info
// infoReply reads a byte slice into a InfoReply value.
func infoReply(buf []byte) *InfoReply {
v := new(InfoReply)
b := 1 // skip reply determinant
@ -573,6 +604,7 @@ func infoReply(buf []byte) *InfoReply {
}
// Write request to wire for Info
// infoRequest writes a Info request to a byte slice.
func infoRequest(c *xgb.Conn) []byte {
size := 4
b := 0

View File

@ -2,7 +2,7 @@
package dri2
/*
This file was generated by dri2.xml on May 10 2012 8:04:31pm EDT.
This file was generated by dri2.xml on May 10 2012 11:56:18pm EDT.
This file is automatically generated. Edit at your peril!
*/
@ -40,14 +40,6 @@ func init() {
xgb.NewExtErrorFuncs["DRI2"] = make(map[int]xgb.NewErrorFun)
}
// Skipping definition for base type 'Char'
// Skipping definition for base type 'Card32'
// Skipping definition for base type 'Double'
// Skipping definition for base type 'Bool'
// Skipping definition for base type 'Float'
// Skipping definition for base type 'Card8'
@ -64,6 +56,14 @@ func init() {
// 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 (
AttachmentBufferFrontLeft = 0
AttachmentBufferBackLeft = 1
@ -89,8 +89,6 @@ const (
EventTypeFlipComplete = 3
)
// 'DRI2Buffer' struct definition
// Size: 20
type DRI2Buffer struct {
Attachment uint32
Name uint32
@ -99,7 +97,7 @@ type DRI2Buffer struct {
Flags uint32
}
// Struct read DRI2Buffer
// DRI2BufferRead reads a byte slice into a DRI2Buffer value.
func DRI2BufferRead(buf []byte, v *DRI2Buffer) int {
b := 0
@ -121,7 +119,7 @@ func DRI2BufferRead(buf []byte, v *DRI2Buffer) int {
return b
}
// Struct list read DRI2Buffer
// DRI2BufferReadList reads a byte slice into a list of DRI2Buffer values.
func DRI2BufferReadList(buf []byte, dest []DRI2Buffer) int {
b := 0
for i := 0; i < len(dest); i++ {
@ -131,7 +129,7 @@ func DRI2BufferReadList(buf []byte, dest []DRI2Buffer) int {
return xgb.Pad(b)
}
// Struct write DRI2Buffer
// Bytes writes a DRI2Buffer value to a byte slice.
func (v DRI2Buffer) Bytes() []byte {
buf := make([]byte, 20)
b := 0
@ -154,7 +152,7 @@ func (v DRI2Buffer) Bytes() []byte {
return buf
}
// Write struct list DRI2Buffer
// DRI2BufferListBytes writes a list of %s(MISSING) values to a byte slice.
func DRI2BufferListBytes(buf []byte, list []DRI2Buffer) int {
b := 0
var structBytes []byte
@ -166,14 +164,12 @@ func DRI2BufferListBytes(buf []byte, list []DRI2Buffer) int {
return b
}
// 'AttachFormat' struct definition
// Size: 8
type AttachFormat struct {
Attachment uint32
Format uint32
}
// Struct read AttachFormat
// AttachFormatRead reads a byte slice into a AttachFormat value.
func AttachFormatRead(buf []byte, v *AttachFormat) int {
b := 0
@ -186,7 +182,7 @@ func AttachFormatRead(buf []byte, v *AttachFormat) int {
return b
}
// Struct list read AttachFormat
// AttachFormatReadList reads a byte slice into a list of AttachFormat values.
func AttachFormatReadList(buf []byte, dest []AttachFormat) int {
b := 0
for i := 0; i < len(dest); i++ {
@ -196,7 +192,7 @@ func AttachFormatReadList(buf []byte, dest []AttachFormat) int {
return xgb.Pad(b)
}
// Struct write AttachFormat
// Bytes writes a AttachFormat value to a byte slice.
func (v AttachFormat) Bytes() []byte {
buf := make([]byte, 8)
b := 0
@ -210,7 +206,7 @@ func (v AttachFormat) Bytes() []byte {
return buf
}
// Write struct list AttachFormat
// AttachFormatListBytes writes a list of %s(MISSING) values to a byte slice.
func AttachFormatListBytes(buf []byte, list []AttachFormat) int {
b := 0
var structBytes []byte
@ -222,9 +218,7 @@ func AttachFormatListBytes(buf []byte, list []AttachFormat) int {
return b
}
// Event definition BufferSwapComplete (0)
// Size: 32
// BufferSwapComplete is the event number for a BufferSwapCompleteEvent.
const BufferSwapComplete = 0
type BufferSwapCompleteEvent struct {
@ -240,7 +234,7 @@ type BufferSwapCompleteEvent struct {
Sbc uint32
}
// Event read BufferSwapComplete
// BufferSwapCompleteEventNew constructs a BufferSwapCompleteEvent value that implements xgb.Event from a byte slice.
func BufferSwapCompleteEventNew(buf []byte) xgb.Event {
v := BufferSwapCompleteEvent{}
b := 1 // don't read event number
@ -276,7 +270,7 @@ func BufferSwapCompleteEventNew(buf []byte) xgb.Event {
return v
}
// Event write BufferSwapComplete
// Bytes writes a BufferSwapCompleteEvent value to a byte slice.
func (v BufferSwapCompleteEvent) Bytes() []byte {
buf := make([]byte, 32)
b := 0
@ -315,12 +309,14 @@ func (v BufferSwapCompleteEvent) Bytes() []byte {
return buf
}
func (v BufferSwapCompleteEvent) ImplementsEvent() {}
// SequenceId returns the sequence id attached to the BufferSwapComplete event.
// Events without a sequence number (KeymapNotify) return 0.
// This is mostly used internally.
func (v BufferSwapCompleteEvent) SequenceId() uint16 {
return v.Sequence
}
// String is a rudimentary string representation of BufferSwapCompleteEvent.
func (v BufferSwapCompleteEvent) String() string {
fieldVals := make([]string, 0, 9)
fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence))
@ -338,9 +334,7 @@ func init() {
xgb.NewExtEventFuncs["DRI2"][0] = BufferSwapCompleteEventNew
}
// Event definition InvalidateBuffers (1)
// Size: 32
// InvalidateBuffers is the event number for a InvalidateBuffersEvent.
const InvalidateBuffers = 1
type InvalidateBuffersEvent struct {
@ -349,7 +343,7 @@ type InvalidateBuffersEvent struct {
Drawable xproto.Drawable
}
// Event read InvalidateBuffers
// InvalidateBuffersEventNew constructs a InvalidateBuffersEvent value that implements xgb.Event from a byte slice.
func InvalidateBuffersEventNew(buf []byte) xgb.Event {
v := InvalidateBuffersEvent{}
b := 1 // don't read event number
@ -365,7 +359,7 @@ func InvalidateBuffersEventNew(buf []byte) xgb.Event {
return v
}
// Event write InvalidateBuffers
// Bytes writes a InvalidateBuffersEvent value to a byte slice.
func (v InvalidateBuffersEvent) Bytes() []byte {
buf := make([]byte, 32)
b := 0
@ -384,12 +378,14 @@ func (v InvalidateBuffersEvent) Bytes() []byte {
return buf
}
func (v InvalidateBuffersEvent) ImplementsEvent() {}
// SequenceId returns the sequence id attached to the InvalidateBuffers event.
// Events without a sequence number (KeymapNotify) return 0.
// This is mostly used internally.
func (v InvalidateBuffersEvent) SequenceId() uint16 {
return v.Sequence
}
// String is a rudimentary string representation of InvalidateBuffersEvent.
func (v InvalidateBuffersEvent) String() string {
fieldVals := make([]string, 0, 2)
fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence))
@ -401,35 +397,37 @@ func init() {
xgb.NewExtEventFuncs["DRI2"][1] = InvalidateBuffersEventNew
}
// Request QueryVersion
// size: 12
// QueryVersionCookie is a cookie used only for QueryVersion requests.
type QueryVersionCookie struct {
*xgb.Cookie
}
// QueryVersion sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()
func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie)
return QueryVersionCookie{cookie}
}
// QueryVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie)
return QueryVersionCookie{cookie}
}
// Request reply for QueryVersion
// size: 16
// QueryVersionReply represents the data returned from a QueryVersion request.
type QueryVersionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
MajorVersion uint32
MinorVersion uint32
}
// Waits and reads reply data from request QueryVersion
// Reply blocks and returns the reply data for a QueryVersion request.
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -441,7 +439,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
return queryVersionReply(buf), nil
}
// Read reply into structure from buffer for QueryVersion
// queryVersionReply reads a byte slice into a QueryVersionReply value.
func queryVersionReply(buf []byte) *QueryVersionReply {
v := new(QueryVersionReply)
b := 1 // skip reply determinant
@ -464,6 +462,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
}
// Write request to wire for QueryVersion
// queryVersionRequest writes a QueryVersion request to a byte slice.
func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) []byte {
size := 12
b := 0
@ -487,29 +486,31 @@ func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32)
return buf
}
// Request Connect
// size: 12
// ConnectCookie is a cookie used only for Connect requests.
type ConnectCookie struct {
*xgb.Cookie
}
// Connect sends a checked request.
// If an error occurs, it will be returned with the reply by calling ConnectCookie.Reply()
func Connect(c *xgb.Conn, Window xproto.Window, DriverType uint32) ConnectCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(connectRequest(c, Window, DriverType), cookie)
return ConnectCookie{cookie}
}
// ConnectUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func ConnectUnchecked(c *xgb.Conn, Window xproto.Window, DriverType uint32) ConnectCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(connectRequest(c, Window, DriverType), cookie)
return ConnectCookie{cookie}
}
// Request reply for Connect
// size: (((32 + xgb.Pad((int(DriverNameLength) * 1))) + xgb.Pad(((((int(DriverNameLength) + 3) & -4) - int(DriverNameLength)) * 1))) + xgb.Pad((int(DeviceNameLength) * 1)))
// ConnectReply represents the data returned from a Connect request.
type ConnectReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
DriverNameLength uint32
DeviceNameLength uint32
@ -519,7 +520,7 @@ type ConnectReply struct {
DeviceName string // size: xgb.Pad((int(DeviceNameLength) * 1))
}
// Waits and reads reply data from request Connect
// Reply blocks and returns the reply data for a Connect request.
func (cook ConnectCookie) Reply() (*ConnectReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -531,7 +532,7 @@ func (cook ConnectCookie) Reply() (*ConnectReply, error) {
return connectReply(buf), nil
}
// Read reply into structure from buffer for Connect
// connectReply reads a byte slice into a ConnectReply value.
func connectReply(buf []byte) *ConnectReply {
v := new(ConnectReply)
b := 1 // skip reply determinant
@ -574,6 +575,7 @@ func connectReply(buf []byte) *ConnectReply {
}
// Write request to wire for Connect
// connectRequest writes a Connect request to a byte slice.
func connectRequest(c *xgb.Conn, Window xproto.Window, DriverType uint32) []byte {
size := 12
b := 0
@ -597,34 +599,36 @@ func connectRequest(c *xgb.Conn, Window xproto.Window, DriverType uint32) []byte
return buf
}
// Request Authenticate
// size: 12
// AuthenticateCookie is a cookie used only for Authenticate requests.
type AuthenticateCookie struct {
*xgb.Cookie
}
// Authenticate sends a checked request.
// If an error occurs, it will be returned with the reply by calling AuthenticateCookie.Reply()
func Authenticate(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(authenticateRequest(c, Window, Magic), cookie)
return AuthenticateCookie{cookie}
}
// AuthenticateUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func AuthenticateUnchecked(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(authenticateRequest(c, Window, Magic), cookie)
return AuthenticateCookie{cookie}
}
// Request reply for Authenticate
// size: 12
// AuthenticateReply represents the data returned from a Authenticate request.
type AuthenticateReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
Authenticated uint32
}
// Waits and reads reply data from request Authenticate
// Reply blocks and returns the reply data for a Authenticate request.
func (cook AuthenticateCookie) Reply() (*AuthenticateReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -636,7 +640,7 @@ func (cook AuthenticateCookie) Reply() (*AuthenticateReply, error) {
return authenticateReply(buf), nil
}
// Read reply into structure from buffer for Authenticate
// authenticateReply reads a byte slice into a AuthenticateReply value.
func authenticateReply(buf []byte) *AuthenticateReply {
v := new(AuthenticateReply)
b := 1 // skip reply determinant
@ -656,6 +660,7 @@ func authenticateReply(buf []byte) *AuthenticateReply {
}
// Write request to wire for Authenticate
// authenticateRequest writes a Authenticate request to a byte slice.
func authenticateRequest(c *xgb.Conn, Window xproto.Window, Magic uint32) []byte {
size := 12
b := 0
@ -679,30 +684,35 @@ func authenticateRequest(c *xgb.Conn, Window xproto.Window, Magic uint32) []byte
return buf
}
// Request CreateDrawable
// size: 8
// CreateDrawableCookie is a cookie used only for CreateDrawable requests.
type CreateDrawableCookie struct {
*xgb.Cookie
}
// Write request to wire for CreateDrawable
// CreateDrawable sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func CreateDrawable(c *xgb.Conn, Drawable xproto.Drawable) CreateDrawableCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(createDrawableRequest(c, Drawable), cookie)
return CreateDrawableCookie{cookie}
}
// CreateDrawableChecked sends a checked request.
// If an error occurs, it can be retrieved using CreateDrawableCookie.Check()
func CreateDrawableChecked(c *xgb.Conn, Drawable xproto.Drawable) CreateDrawableCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(createDrawableRequest(c, Drawable), cookie)
return CreateDrawableCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook CreateDrawableCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for CreateDrawable
// createDrawableRequest writes a CreateDrawable request to a byte slice.
func createDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
size := 8
b := 0
@ -723,30 +733,35 @@ func createDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
return buf
}
// Request DestroyDrawable
// size: 8
// DestroyDrawableCookie is a cookie used only for DestroyDrawable requests.
type DestroyDrawableCookie struct {
*xgb.Cookie
}
// Write request to wire for DestroyDrawable
// DestroyDrawable sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func DestroyDrawable(c *xgb.Conn, Drawable xproto.Drawable) DestroyDrawableCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(destroyDrawableRequest(c, Drawable), cookie)
return DestroyDrawableCookie{cookie}
}
// DestroyDrawableChecked sends a checked request.
// If an error occurs, it can be retrieved using DestroyDrawableCookie.Check()
func DestroyDrawableChecked(c *xgb.Conn, Drawable xproto.Drawable) DestroyDrawableCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(destroyDrawableRequest(c, Drawable), cookie)
return DestroyDrawableCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook DestroyDrawableCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for DestroyDrawable
// destroyDrawableRequest writes a DestroyDrawable request to a byte slice.
func destroyDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
size := 8
b := 0
@ -767,29 +782,31 @@ func destroyDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
return buf
}
// Request GetBuffers
// size: xgb.Pad((12 + xgb.Pad((len(Attachments) * 4))))
// GetBuffersCookie is a cookie used only for GetBuffers requests.
type GetBuffersCookie struct {
*xgb.Cookie
}
// GetBuffers sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetBuffersCookie.Reply()
func GetBuffers(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) GetBuffersCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getBuffersRequest(c, Drawable, Count, Attachments), cookie)
return GetBuffersCookie{cookie}
}
// GetBuffersUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetBuffersUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) GetBuffersCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getBuffersRequest(c, Drawable, Count, Attachments), cookie)
return GetBuffersCookie{cookie}
}
// Request reply for GetBuffers
// size: (32 + xgb.Pad((int(Count) * 20)))
// GetBuffersReply represents the data returned from a GetBuffers request.
type GetBuffersReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
Width uint32
Height uint32
@ -798,7 +815,7 @@ type GetBuffersReply struct {
Buffers []DRI2Buffer // size: xgb.Pad((int(Count) * 20))
}
// Waits and reads reply data from request GetBuffers
// Reply blocks and returns the reply data for a GetBuffers request.
func (cook GetBuffersCookie) Reply() (*GetBuffersReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -810,7 +827,7 @@ func (cook GetBuffersCookie) Reply() (*GetBuffersReply, error) {
return getBuffersReply(buf), nil
}
// Read reply into structure from buffer for GetBuffers
// getBuffersReply reads a byte slice into a GetBuffersReply value.
func getBuffersReply(buf []byte) *GetBuffersReply {
v := new(GetBuffersReply)
b := 1 // skip reply determinant
@ -841,6 +858,7 @@ func getBuffersReply(buf []byte) *GetBuffersReply {
}
// Write request to wire for GetBuffers
// getBuffersRequest writes a GetBuffers request to a byte slice.
func getBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) []byte {
size := xgb.Pad((12 + xgb.Pad((len(Attachments) * 4))))
b := 0
@ -870,33 +888,35 @@ func getBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Atta
return buf
}
// Request CopyRegion
// size: 20
// CopyRegionCookie is a cookie used only for CopyRegion requests.
type CopyRegionCookie struct {
*xgb.Cookie
}
// CopyRegion sends a checked request.
// If an error occurs, it will be returned with the reply by calling CopyRegionCookie.Reply()
func CopyRegion(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(copyRegionRequest(c, Drawable, Region, Dest, Src), cookie)
return CopyRegionCookie{cookie}
}
// CopyRegionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func CopyRegionUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(copyRegionRequest(c, Drawable, Region, Dest, Src), cookie)
return CopyRegionCookie{cookie}
}
// Request reply for CopyRegion
// size: 8
// CopyRegionReply represents the data returned from a CopyRegion request.
type CopyRegionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
}
// Waits and reads reply data from request CopyRegion
// Reply blocks and returns the reply data for a CopyRegion request.
func (cook CopyRegionCookie) Reply() (*CopyRegionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -908,7 +928,7 @@ func (cook CopyRegionCookie) Reply() (*CopyRegionReply, error) {
return copyRegionReply(buf), nil
}
// Read reply into structure from buffer for CopyRegion
// copyRegionReply reads a byte slice into a CopyRegionReply value.
func copyRegionReply(buf []byte) *CopyRegionReply {
v := new(CopyRegionReply)
b := 1 // skip reply determinant
@ -925,6 +945,7 @@ func copyRegionReply(buf []byte) *CopyRegionReply {
}
// Write request to wire for CopyRegion
// copyRegionRequest writes a CopyRegion request to a byte slice.
func copyRegionRequest(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) []byte {
size := 20
b := 0
@ -954,29 +975,31 @@ func copyRegionRequest(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Des
return buf
}
// Request GetBuffersWithFormat
// size: xgb.Pad((12 + xgb.Pad((len(Attachments) * 8))))
// GetBuffersWithFormatCookie is a cookie used only for GetBuffersWithFormat requests.
type GetBuffersWithFormatCookie struct {
*xgb.Cookie
}
// GetBuffersWithFormat sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetBuffersWithFormatCookie.Reply()
func GetBuffersWithFormat(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) GetBuffersWithFormatCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getBuffersWithFormatRequest(c, Drawable, Count, Attachments), cookie)
return GetBuffersWithFormatCookie{cookie}
}
// GetBuffersWithFormatUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetBuffersWithFormatUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) GetBuffersWithFormatCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getBuffersWithFormatRequest(c, Drawable, Count, Attachments), cookie)
return GetBuffersWithFormatCookie{cookie}
}
// Request reply for GetBuffersWithFormat
// size: (32 + xgb.Pad((int(Count) * 20)))
// GetBuffersWithFormatReply represents the data returned from a GetBuffersWithFormat request.
type GetBuffersWithFormatReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
Width uint32
Height uint32
@ -985,7 +1008,7 @@ type GetBuffersWithFormatReply struct {
Buffers []DRI2Buffer // size: xgb.Pad((int(Count) * 20))
}
// Waits and reads reply data from request GetBuffersWithFormat
// Reply blocks and returns the reply data for a GetBuffersWithFormat request.
func (cook GetBuffersWithFormatCookie) Reply() (*GetBuffersWithFormatReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -997,7 +1020,7 @@ func (cook GetBuffersWithFormatCookie) Reply() (*GetBuffersWithFormatReply, erro
return getBuffersWithFormatReply(buf), nil
}
// Read reply into structure from buffer for GetBuffersWithFormat
// getBuffersWithFormatReply reads a byte slice into a GetBuffersWithFormatReply value.
func getBuffersWithFormatReply(buf []byte) *GetBuffersWithFormatReply {
v := new(GetBuffersWithFormatReply)
b := 1 // skip reply determinant
@ -1028,6 +1051,7 @@ func getBuffersWithFormatReply(buf []byte) *GetBuffersWithFormatReply {
}
// Write request to wire for GetBuffersWithFormat
// getBuffersWithFormatRequest writes a GetBuffersWithFormat request to a byte slice.
func getBuffersWithFormatRequest(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) []byte {
size := xgb.Pad((12 + xgb.Pad((len(Attachments) * 8))))
b := 0
@ -1053,35 +1077,37 @@ func getBuffersWithFormatRequest(c *xgb.Conn, Drawable xproto.Drawable, Count ui
return buf
}
// Request SwapBuffers
// size: 32
// SwapBuffersCookie is a cookie used only for SwapBuffers requests.
type SwapBuffersCookie struct {
*xgb.Cookie
}
// SwapBuffers sends a checked request.
// If an error occurs, it will be returned with the reply by calling SwapBuffersCookie.Reply()
func SwapBuffers(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) SwapBuffersCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(swapBuffersRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie)
return SwapBuffersCookie{cookie}
}
// SwapBuffersUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func SwapBuffersUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) SwapBuffersCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(swapBuffersRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie)
return SwapBuffersCookie{cookie}
}
// Request reply for SwapBuffers
// size: 16
// SwapBuffersReply represents the data returned from a SwapBuffers request.
type SwapBuffersReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
SwapHi uint32
SwapLo uint32
}
// Waits and reads reply data from request SwapBuffers
// Reply blocks and returns the reply data for a SwapBuffers request.
func (cook SwapBuffersCookie) Reply() (*SwapBuffersReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -1093,7 +1119,7 @@ func (cook SwapBuffersCookie) Reply() (*SwapBuffersReply, error) {
return swapBuffersReply(buf), nil
}
// Read reply into structure from buffer for SwapBuffers
// swapBuffersReply reads a byte slice into a SwapBuffersReply value.
func swapBuffersReply(buf []byte) *SwapBuffersReply {
v := new(SwapBuffersReply)
b := 1 // skip reply determinant
@ -1116,6 +1142,7 @@ func swapBuffersReply(buf []byte) *SwapBuffersReply {
}
// Write request to wire for SwapBuffers
// swapBuffersRequest writes a SwapBuffers request to a byte slice.
func swapBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) []byte {
size := 32
b := 0
@ -1154,29 +1181,31 @@ func swapBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint3
return buf
}
// Request GetMSC
// size: 8
// GetMSCCookie is a cookie used only for GetMSC requests.
type GetMSCCookie struct {
*xgb.Cookie
}
// GetMSC sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetMSCCookie.Reply()
func GetMSC(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getMSCRequest(c, Drawable), cookie)
return GetMSCCookie{cookie}
}
// GetMSCUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetMSCUnchecked(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getMSCRequest(c, Drawable), cookie)
return GetMSCCookie{cookie}
}
// Request reply for GetMSC
// size: 32
// GetMSCReply represents the data returned from a GetMSC request.
type GetMSCReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
UstHi uint32
UstLo uint32
@ -1186,7 +1215,7 @@ type GetMSCReply struct {
SbcLo uint32
}
// Waits and reads reply data from request GetMSC
// Reply blocks and returns the reply data for a GetMSC request.
func (cook GetMSCCookie) Reply() (*GetMSCReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -1198,7 +1227,7 @@ func (cook GetMSCCookie) Reply() (*GetMSCReply, error) {
return getMSCReply(buf), nil
}
// Read reply into structure from buffer for GetMSC
// getMSCReply reads a byte slice into a GetMSCReply value.
func getMSCReply(buf []byte) *GetMSCReply {
v := new(GetMSCReply)
b := 1 // skip reply determinant
@ -1233,6 +1262,7 @@ func getMSCReply(buf []byte) *GetMSCReply {
}
// Write request to wire for GetMSC
// getMSCRequest writes a GetMSC request to a byte slice.
func getMSCRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
size := 8
b := 0
@ -1253,29 +1283,31 @@ func getMSCRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
return buf
}
// Request WaitMSC
// size: 32
// WaitMSCCookie is a cookie used only for WaitMSC requests.
type WaitMSCCookie struct {
*xgb.Cookie
}
// WaitMSC sends a checked request.
// If an error occurs, it will be returned with the reply by calling WaitMSCCookie.Reply()
func WaitMSC(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) WaitMSCCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(waitMSCRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie)
return WaitMSCCookie{cookie}
}
// WaitMSCUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func WaitMSCUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) WaitMSCCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(waitMSCRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie)
return WaitMSCCookie{cookie}
}
// Request reply for WaitMSC
// size: 32
// WaitMSCReply represents the data returned from a WaitMSC request.
type WaitMSCReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
UstHi uint32
UstLo uint32
@ -1285,7 +1317,7 @@ type WaitMSCReply struct {
SbcLo uint32
}
// Waits and reads reply data from request WaitMSC
// Reply blocks and returns the reply data for a WaitMSC request.
func (cook WaitMSCCookie) Reply() (*WaitMSCReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -1297,7 +1329,7 @@ func (cook WaitMSCCookie) Reply() (*WaitMSCReply, error) {
return waitMSCReply(buf), nil
}
// Read reply into structure from buffer for WaitMSC
// waitMSCReply reads a byte slice into a WaitMSCReply value.
func waitMSCReply(buf []byte) *WaitMSCReply {
v := new(WaitMSCReply)
b := 1 // skip reply determinant
@ -1332,6 +1364,7 @@ func waitMSCReply(buf []byte) *WaitMSCReply {
}
// Write request to wire for WaitMSC
// waitMSCRequest writes a WaitMSC request to a byte slice.
func waitMSCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) []byte {
size := 32
b := 0
@ -1370,29 +1403,31 @@ func waitMSCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, T
return buf
}
// Request WaitSBC
// size: 16
// WaitSBCCookie is a cookie used only for WaitSBC requests.
type WaitSBCCookie struct {
*xgb.Cookie
}
// WaitSBC sends a checked request.
// If an error occurs, it will be returned with the reply by calling WaitSBCCookie.Reply()
func WaitSBC(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) WaitSBCCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(waitSBCRequest(c, Drawable, TargetSbcHi, TargetSbcLo), cookie)
return WaitSBCCookie{cookie}
}
// WaitSBCUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func WaitSBCUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) WaitSBCCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(waitSBCRequest(c, Drawable, TargetSbcHi, TargetSbcLo), cookie)
return WaitSBCCookie{cookie}
}
// Request reply for WaitSBC
// size: 32
// WaitSBCReply represents the data returned from a WaitSBC request.
type WaitSBCReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
UstHi uint32
UstLo uint32
@ -1402,7 +1437,7 @@ type WaitSBCReply struct {
SbcLo uint32
}
// Waits and reads reply data from request WaitSBC
// Reply blocks and returns the reply data for a WaitSBC request.
func (cook WaitSBCCookie) Reply() (*WaitSBCReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -1414,7 +1449,7 @@ func (cook WaitSBCCookie) Reply() (*WaitSBCReply, error) {
return waitSBCReply(buf), nil
}
// Read reply into structure from buffer for WaitSBC
// waitSBCReply reads a byte slice into a WaitSBCReply value.
func waitSBCReply(buf []byte) *WaitSBCReply {
v := new(WaitSBCReply)
b := 1 // skip reply determinant
@ -1449,6 +1484,7 @@ func waitSBCReply(buf []byte) *WaitSBCReply {
}
// Write request to wire for WaitSBC
// waitSBCRequest writes a WaitSBC request to a byte slice.
func waitSBCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) []byte {
size := 16
b := 0
@ -1475,30 +1511,35 @@ func waitSBCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, T
return buf
}
// Request SwapInterval
// size: 12
// SwapIntervalCookie is a cookie used only for SwapInterval requests.
type SwapIntervalCookie struct {
*xgb.Cookie
}
// Write request to wire for SwapInterval
// SwapInterval sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func SwapInterval(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(swapIntervalRequest(c, Drawable, Interval), cookie)
return SwapIntervalCookie{cookie}
}
// SwapIntervalChecked sends a checked request.
// If an error occurs, it can be retrieved using SwapIntervalCookie.Check()
func SwapIntervalChecked(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(swapIntervalRequest(c, Drawable, Interval), cookie)
return SwapIntervalCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook SwapIntervalCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for SwapInterval
// swapIntervalRequest writes a SwapInterval request to a byte slice.
func swapIntervalRequest(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) []byte {
size := 12
b := 0

View File

@ -2,7 +2,7 @@
package ge
/*
This file was generated by ge.xml on May 10 2012 8:04:31pm EDT.
This file was generated by ge.xml on May 10 2012 11:56:18pm EDT.
This file is automatically generated. Edit at your peril!
*/
@ -40,10 +40,6 @@ func init() {
xgb.NewExtErrorFuncs["Generic Event Extension"] = make(map[int]xgb.NewErrorFun)
}
// Skipping definition for base type 'Card8'
// Skipping definition for base type 'Int16'
// Skipping definition for base type 'Int32'
// Skipping definition for base type 'Void'
@ -64,36 +60,42 @@ func init() {
// Skipping definition for base type 'Float'
// Request QueryVersion
// size: 8
// Skipping definition for base type 'Card8'
// Skipping definition for base type 'Int16'
// QueryVersionCookie is a cookie used only for QueryVersion requests.
type QueryVersionCookie struct {
*xgb.Cookie
}
// QueryVersion sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()
func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
return QueryVersionCookie{cookie}
}
// QueryVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
return QueryVersionCookie{cookie}
}
// Request reply for QueryVersion
// size: 32
// QueryVersionReply represents the data returned from a QueryVersion request.
type QueryVersionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
MajorVersion uint16
MinorVersion uint16
// padding: 20 bytes
}
// Waits and reads reply data from request QueryVersion
// Reply blocks and returns the reply data for a QueryVersion request.
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -105,7 +107,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
return queryVersionReply(buf), nil
}
// Read reply into structure from buffer for QueryVersion
// queryVersionReply reads a byte slice into a QueryVersionReply value.
func queryVersionReply(buf []byte) *QueryVersionReply {
v := new(QueryVersionReply)
b := 1 // skip reply determinant
@ -130,6 +132,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
}
// Write request to wire for QueryVersion
// queryVersionRequest writes a QueryVersion request to a byte slice.
func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte {
size := 8
b := 0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
package record
/*
This file was generated by record.xml on May 10 2012 8:04:32pm EDT.
This file was generated by record.xml on May 10 2012 11:56:19pm EDT.
This file is automatically generated. Edit at your peril!
*/
@ -90,14 +90,12 @@ type ElementHeader byte
type ClientSpec uint32
// 'Range8' struct definition
// Size: 2
type Range8 struct {
First byte
Last byte
}
// Struct read Range8
// Range8Read reads a byte slice into a Range8 value.
func Range8Read(buf []byte, v *Range8) int {
b := 0
@ -110,7 +108,7 @@ func Range8Read(buf []byte, v *Range8) int {
return b
}
// Struct list read Range8
// Range8ReadList reads a byte slice into a list of Range8 values.
func Range8ReadList(buf []byte, dest []Range8) int {
b := 0
for i := 0; i < len(dest); i++ {
@ -120,7 +118,7 @@ func Range8ReadList(buf []byte, dest []Range8) int {
return xgb.Pad(b)
}
// Struct write Range8
// Bytes writes a Range8 value to a byte slice.
func (v Range8) Bytes() []byte {
buf := make([]byte, 2)
b := 0
@ -134,7 +132,7 @@ func (v Range8) Bytes() []byte {
return buf
}
// Write struct list Range8
// Range8ListBytes writes a list of %s(MISSING) values to a byte slice.
func Range8ListBytes(buf []byte, list []Range8) int {
b := 0
var structBytes []byte
@ -146,14 +144,12 @@ func Range8ListBytes(buf []byte, list []Range8) int {
return b
}
// 'Range16' struct definition
// Size: 4
type Range16 struct {
First uint16
Last uint16
}
// Struct read Range16
// Range16Read reads a byte slice into a Range16 value.
func Range16Read(buf []byte, v *Range16) int {
b := 0
@ -166,7 +162,7 @@ func Range16Read(buf []byte, v *Range16) int {
return b
}
// Struct list read Range16
// Range16ReadList reads a byte slice into a list of Range16 values.
func Range16ReadList(buf []byte, dest []Range16) int {
b := 0
for i := 0; i < len(dest); i++ {
@ -176,7 +172,7 @@ func Range16ReadList(buf []byte, dest []Range16) int {
return xgb.Pad(b)
}
// Struct write Range16
// Bytes writes a Range16 value to a byte slice.
func (v Range16) Bytes() []byte {
buf := make([]byte, 4)
b := 0
@ -190,7 +186,7 @@ func (v Range16) Bytes() []byte {
return buf
}
// Write struct list Range16
// Range16ListBytes writes a list of %s(MISSING) values to a byte slice.
func Range16ListBytes(buf []byte, list []Range16) int {
b := 0
var structBytes []byte
@ -202,14 +198,12 @@ func Range16ListBytes(buf []byte, list []Range16) int {
return b
}
// 'ExtRange' struct definition
// Size: 6
type ExtRange struct {
Major Range8
Minor Range16
}
// Struct read ExtRange
// ExtRangeRead reads a byte slice into a ExtRange value.
func ExtRangeRead(buf []byte, v *ExtRange) int {
b := 0
@ -222,7 +216,7 @@ func ExtRangeRead(buf []byte, v *ExtRange) int {
return b
}
// Struct list read ExtRange
// ExtRangeReadList reads a byte slice into a list of ExtRange values.
func ExtRangeReadList(buf []byte, dest []ExtRange) int {
b := 0
for i := 0; i < len(dest); i++ {
@ -232,7 +226,7 @@ func ExtRangeReadList(buf []byte, dest []ExtRange) int {
return xgb.Pad(b)
}
// Struct write ExtRange
// Bytes writes a ExtRange value to a byte slice.
func (v ExtRange) Bytes() []byte {
buf := make([]byte, 6)
b := 0
@ -252,7 +246,7 @@ func (v ExtRange) Bytes() []byte {
return buf
}
// Write struct list ExtRange
// ExtRangeListBytes writes a list of %s(MISSING) values to a byte slice.
func ExtRangeListBytes(buf []byte, list []ExtRange) int {
b := 0
var structBytes []byte
@ -264,8 +258,6 @@ func ExtRangeListBytes(buf []byte, list []ExtRange) int {
return b
}
// 'Range' struct definition
// Size: 24
type Range struct {
CoreRequests Range8
CoreReplies Range8
@ -278,7 +270,7 @@ type Range struct {
ClientDied bool
}
// Struct read Range
// RangeRead reads a byte slice into a Range value.
func RangeRead(buf []byte, v *Range) int {
b := 0
@ -320,7 +312,7 @@ func RangeRead(buf []byte, v *Range) int {
return b
}
// Struct list read Range
// RangeReadList reads a byte slice into a list of Range values.
func RangeReadList(buf []byte, dest []Range) int {
b := 0
for i := 0; i < len(dest); i++ {
@ -330,7 +322,7 @@ func RangeReadList(buf []byte, dest []Range) int {
return xgb.Pad(b)
}
// Struct write Range
// Bytes writes a Range value to a byte slice.
func (v Range) Bytes() []byte {
buf := make([]byte, 24)
b := 0
@ -394,7 +386,7 @@ func (v Range) Bytes() []byte {
return buf
}
// Write struct list Range
// RangeListBytes writes a list of %s(MISSING) values to a byte slice.
func RangeListBytes(buf []byte, list []Range) int {
b := 0
var structBytes []byte
@ -406,15 +398,13 @@ func RangeListBytes(buf []byte, list []Range) int {
return b
}
// 'ClientInfo' struct definition
// Size: (8 + xgb.Pad((int(NumRanges) * 24)))
type ClientInfo struct {
ClientResource ClientSpec
NumRanges uint32
Ranges []Range // size: xgb.Pad((int(NumRanges) * 24))
}
// Struct read ClientInfo
// ClientInfoRead reads a byte slice into a ClientInfo value.
func ClientInfoRead(buf []byte, v *ClientInfo) int {
b := 0
@ -430,7 +420,7 @@ func ClientInfoRead(buf []byte, v *ClientInfo) int {
return b
}
// Struct list read ClientInfo
// ClientInfoReadList reads a byte slice into a list of ClientInfo values.
func ClientInfoReadList(buf []byte, dest []ClientInfo) int {
b := 0
for i := 0; i < len(dest); i++ {
@ -440,7 +430,7 @@ func ClientInfoReadList(buf []byte, dest []ClientInfo) int {
return xgb.Pad(b)
}
// Struct write ClientInfo
// Bytes writes a ClientInfo value to a byte slice.
func (v ClientInfo) Bytes() []byte {
buf := make([]byte, (8 + xgb.Pad((int(v.NumRanges) * 24))))
b := 0
@ -456,7 +446,7 @@ func (v ClientInfo) Bytes() []byte {
return buf
}
// Write struct list ClientInfo
// ClientInfoListBytes writes a list of %s(MISSING) values to a byte slice.
func ClientInfoListBytes(buf []byte, list []ClientInfo) int {
b := 0
var structBytes []byte
@ -468,7 +458,7 @@ func ClientInfoListBytes(buf []byte, list []ClientInfo) int {
return b
}
// Struct list size ClientInfo
// ClientInfoListSize computes the size (bytes) of a list of ClientInfo values.
func ClientInfoListSize(list []ClientInfo) int {
size := 0
for _, item := range list {
@ -477,9 +467,7 @@ func ClientInfoListSize(list []ClientInfo) int {
return size
}
// Error definition BadContext (0)
// Size: 32
// BadBadContext is the error number for a BadBadContext.
const BadBadContext = 0
type BadContextError struct {
@ -488,7 +476,7 @@ type BadContextError struct {
InvalidRecord uint32
}
// Error read BadContext
// BadContextErrorNew constructs a BadContextError value that implements xgb.Error from a byte slice.
func BadContextErrorNew(buf []byte) xgb.Error {
v := BadContextError{}
v.NiceName = "BadContext"
@ -505,8 +493,8 @@ func BadContextErrorNew(buf []byte) xgb.Error {
return v
}
func (err BadContextError) ImplementsError() {}
// SequenceId returns the sequence id attached to the BadBadContext error.
// This is mostly used internally.
func (err BadContextError) SequenceId() uint16 {
return err.Sequence
}
@ -527,35 +515,37 @@ func init() {
xgb.NewExtErrorFuncs["RECORD"][0] = BadContextErrorNew
}
// Request QueryVersion
// size: 8
// QueryVersionCookie is a cookie used only for QueryVersion requests.
type QueryVersionCookie struct {
*xgb.Cookie
}
// QueryVersion sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()
func QueryVersion(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) QueryVersionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie)
return QueryVersionCookie{cookie}
}
// QueryVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) QueryVersionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie)
return QueryVersionCookie{cookie}
}
// Request reply for QueryVersion
// size: 12
// QueryVersionReply represents the data returned from a QueryVersion request.
type QueryVersionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
MajorVersion uint16
MinorVersion uint16
}
// Waits and reads reply data from request QueryVersion
// Reply blocks and returns the reply data for a QueryVersion request.
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -567,7 +557,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
return queryVersionReply(buf), nil
}
// Read reply into structure from buffer for QueryVersion
// queryVersionReply reads a byte slice into a QueryVersionReply value.
func queryVersionReply(buf []byte) *QueryVersionReply {
v := new(QueryVersionReply)
b := 1 // skip reply determinant
@ -590,6 +580,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
}
// Write request to wire for QueryVersion
// queryVersionRequest writes a QueryVersion request to a byte slice.
func queryVersionRequest(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) []byte {
size := 8
b := 0
@ -613,30 +604,35 @@ func queryVersionRequest(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16)
return buf
}
// Request CreateContext
// size: xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24))))
// CreateContextCookie is a cookie used only for CreateContext requests.
type CreateContextCookie struct {
*xgb.Cookie
}
// Write request to wire for CreateContext
// CreateContext sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func CreateContext(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(createContextRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie)
return CreateContextCookie{cookie}
}
// CreateContextChecked sends a checked request.
// If an error occurs, it can be retrieved using CreateContextCookie.Check()
func CreateContextChecked(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(createContextRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie)
return CreateContextCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook CreateContextCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for CreateContext
// createContextRequest writes a CreateContext request to a byte slice.
func createContextRequest(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) []byte {
size := xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24))))
b := 0
@ -676,30 +672,35 @@ func createContextRequest(c *xgb.Conn, Context Context, ElementHeader ElementHea
return buf
}
// Request RegisterClients
// size: xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24))))
// RegisterClientsCookie is a cookie used only for RegisterClients requests.
type RegisterClientsCookie struct {
*xgb.Cookie
}
// Write request to wire for RegisterClients
// RegisterClients sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func RegisterClients(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) RegisterClientsCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(registerClientsRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie)
return RegisterClientsCookie{cookie}
}
// RegisterClientsChecked sends a checked request.
// If an error occurs, it can be retrieved using RegisterClientsCookie.Check()
func RegisterClientsChecked(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) RegisterClientsCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(registerClientsRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie)
return RegisterClientsCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook RegisterClientsCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for RegisterClients
// registerClientsRequest writes a RegisterClients request to a byte slice.
func registerClientsRequest(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) []byte {
size := xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24))))
b := 0
@ -739,30 +740,35 @@ func registerClientsRequest(c *xgb.Conn, Context Context, ElementHeader ElementH
return buf
}
// Request UnregisterClients
// size: xgb.Pad((12 + xgb.Pad((int(NumClientSpecs) * 4))))
// UnregisterClientsCookie is a cookie used only for UnregisterClients requests.
type UnregisterClientsCookie struct {
*xgb.Cookie
}
// Write request to wire for UnregisterClients
// UnregisterClients sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func UnregisterClients(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) UnregisterClientsCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(unregisterClientsRequest(c, Context, NumClientSpecs, ClientSpecs), cookie)
return UnregisterClientsCookie{cookie}
}
// UnregisterClientsChecked sends a checked request.
// If an error occurs, it can be retrieved using UnregisterClientsCookie.Check()
func UnregisterClientsChecked(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) UnregisterClientsCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(unregisterClientsRequest(c, Context, NumClientSpecs, ClientSpecs), cookie)
return UnregisterClientsCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook UnregisterClientsCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for UnregisterClients
// unregisterClientsRequest writes a UnregisterClients request to a byte slice.
func unregisterClientsRequest(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) []byte {
size := xgb.Pad((12 + xgb.Pad((int(NumClientSpecs) * 4))))
b := 0
@ -792,29 +798,31 @@ func unregisterClientsRequest(c *xgb.Conn, Context Context, NumClientSpecs uint3
return buf
}
// Request GetContext
// size: 8
// GetContextCookie is a cookie used only for GetContext requests.
type GetContextCookie struct {
*xgb.Cookie
}
// GetContext sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetContextCookie.Reply()
func GetContext(c *xgb.Conn, Context Context) GetContextCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getContextRequest(c, Context), cookie)
return GetContextCookie{cookie}
}
// GetContextUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetContextUnchecked(c *xgb.Conn, Context Context) GetContextCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getContextRequest(c, Context), cookie)
return GetContextCookie{cookie}
}
// Request reply for GetContext
// size: (32 + ClientInfoListSize(InterceptedClients))
// GetContextReply represents the data returned from a GetContext request.
type GetContextReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
Enabled bool
ElementHeader ElementHeader
// padding: 3 bytes
@ -823,7 +831,7 @@ type GetContextReply struct {
InterceptedClients []ClientInfo // size: ClientInfoListSize(InterceptedClients)
}
// Waits and reads reply data from request GetContext
// Reply blocks and returns the reply data for a GetContext request.
func (cook GetContextCookie) Reply() (*GetContextReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -835,7 +843,7 @@ func (cook GetContextCookie) Reply() (*GetContextReply, error) {
return getContextReply(buf), nil
}
// Read reply into structure from buffer for GetContext
// getContextReply reads a byte slice into a GetContextReply value.
func getContextReply(buf []byte) *GetContextReply {
v := new(GetContextReply)
b := 1 // skip reply determinant
@ -870,6 +878,7 @@ func getContextReply(buf []byte) *GetContextReply {
}
// Write request to wire for GetContext
// getContextRequest writes a GetContext request to a byte slice.
func getContextRequest(c *xgb.Conn, Context Context) []byte {
size := 8
b := 0
@ -890,29 +899,31 @@ func getContextRequest(c *xgb.Conn, Context Context) []byte {
return buf
}
// Request EnableContext
// size: 8
// EnableContextCookie is a cookie used only for EnableContext requests.
type EnableContextCookie struct {
*xgb.Cookie
}
// EnableContext sends a checked request.
// If an error occurs, it will be returned with the reply by calling EnableContextCookie.Reply()
func EnableContext(c *xgb.Conn, Context Context) EnableContextCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(enableContextRequest(c, Context), cookie)
return EnableContextCookie{cookie}
}
// EnableContextUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func EnableContextUnchecked(c *xgb.Conn, Context Context) EnableContextCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(enableContextRequest(c, Context), cookie)
return EnableContextCookie{cookie}
}
// Request reply for EnableContext
// size: (32 + xgb.Pad(((int(Length) * 4) * 1)))
// EnableContextReply represents the data returned from a EnableContext request.
type EnableContextReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
Category byte
ElementHeader ElementHeader
ClientSwapped bool
@ -924,7 +935,7 @@ type EnableContextReply struct {
Data []byte // size: xgb.Pad(((int(Length) * 4) * 1))
}
// Waits and reads reply data from request EnableContext
// Reply blocks and returns the reply data for a EnableContext request.
func (cook EnableContextCookie) Reply() (*EnableContextReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -936,7 +947,7 @@ func (cook EnableContextCookie) Reply() (*EnableContextReply, error) {
return enableContextReply(buf), nil
}
// Read reply into structure from buffer for EnableContext
// enableContextReply reads a byte slice into a EnableContextReply value.
func enableContextReply(buf []byte) *EnableContextReply {
v := new(EnableContextReply)
b := 1 // skip reply determinant
@ -981,6 +992,7 @@ func enableContextReply(buf []byte) *EnableContextReply {
}
// Write request to wire for EnableContext
// enableContextRequest writes a EnableContext request to a byte slice.
func enableContextRequest(c *xgb.Conn, Context Context) []byte {
size := 8
b := 0
@ -1001,30 +1013,35 @@ func enableContextRequest(c *xgb.Conn, Context Context) []byte {
return buf
}
// Request DisableContext
// size: 8
// DisableContextCookie is a cookie used only for DisableContext requests.
type DisableContextCookie struct {
*xgb.Cookie
}
// Write request to wire for DisableContext
// DisableContext sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func DisableContext(c *xgb.Conn, Context Context) DisableContextCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(disableContextRequest(c, Context), cookie)
return DisableContextCookie{cookie}
}
// DisableContextChecked sends a checked request.
// If an error occurs, it can be retrieved using DisableContextCookie.Check()
func DisableContextChecked(c *xgb.Conn, Context Context) DisableContextCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(disableContextRequest(c, Context), cookie)
return DisableContextCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook DisableContextCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for DisableContext
// disableContextRequest writes a DisableContext request to a byte slice.
func disableContextRequest(c *xgb.Conn, Context Context) []byte {
size := 8
b := 0
@ -1045,30 +1062,35 @@ func disableContextRequest(c *xgb.Conn, Context Context) []byte {
return buf
}
// Request FreeContext
// size: 8
// FreeContextCookie is a cookie used only for FreeContext requests.
type FreeContextCookie struct {
*xgb.Cookie
}
// Write request to wire for FreeContext
// FreeContext sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func FreeContext(c *xgb.Conn, Context Context) FreeContextCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(freeContextRequest(c, Context), cookie)
return FreeContextCookie{cookie}
}
// FreeContextChecked sends a checked request.
// If an error occurs, it can be retrieved using FreeContextCookie.Check()
func FreeContextChecked(c *xgb.Conn, Context Context) FreeContextCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(freeContextRequest(c, Context), cookie)
return FreeContextCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook FreeContextCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for FreeContext
// freeContextRequest writes a FreeContext request to a byte slice.
func freeContextRequest(c *xgb.Conn, Context Context) []byte {
size := 8
b := 0

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
package res
/*
This file was generated by res.xml on May 10 2012 8:04:32pm EDT.
This file was generated by res.xml on May 10 2012 11:56:19pm EDT.
This file is automatically generated. Edit at your peril!
*/
@ -64,14 +64,12 @@ func init() {
// Skipping definition for base type 'Char'
// 'Client' struct definition
// Size: 8
type Client struct {
ResourceBase uint32
ResourceMask uint32
}
// Struct read Client
// ClientRead reads a byte slice into a Client value.
func ClientRead(buf []byte, v *Client) int {
b := 0
@ -84,7 +82,7 @@ func ClientRead(buf []byte, v *Client) int {
return b
}
// Struct list read Client
// ClientReadList reads a byte slice into a list of Client values.
func ClientReadList(buf []byte, dest []Client) int {
b := 0
for i := 0; i < len(dest); i++ {
@ -94,7 +92,7 @@ func ClientReadList(buf []byte, dest []Client) int {
return xgb.Pad(b)
}
// Struct write Client
// Bytes writes a Client value to a byte slice.
func (v Client) Bytes() []byte {
buf := make([]byte, 8)
b := 0
@ -108,7 +106,7 @@ func (v Client) Bytes() []byte {
return buf
}
// Write struct list Client
// ClientListBytes writes a list of %s(MISSING) values to a byte slice.
func ClientListBytes(buf []byte, list []Client) int {
b := 0
var structBytes []byte
@ -120,14 +118,12 @@ func ClientListBytes(buf []byte, list []Client) int {
return b
}
// 'Type' struct definition
// Size: 8
type Type struct {
ResourceType xproto.Atom
Count uint32
}
// Struct read Type
// TypeRead reads a byte slice into a Type value.
func TypeRead(buf []byte, v *Type) int {
b := 0
@ -140,7 +136,7 @@ func TypeRead(buf []byte, v *Type) int {
return b
}
// Struct list read Type
// TypeReadList reads a byte slice into a list of Type values.
func TypeReadList(buf []byte, dest []Type) int {
b := 0
for i := 0; i < len(dest); i++ {
@ -150,7 +146,7 @@ func TypeReadList(buf []byte, dest []Type) int {
return xgb.Pad(b)
}
// Struct write Type
// Bytes writes a Type value to a byte slice.
func (v Type) Bytes() []byte {
buf := make([]byte, 8)
b := 0
@ -164,7 +160,7 @@ func (v Type) Bytes() []byte {
return buf
}
// Write struct list Type
// TypeListBytes writes a list of %s(MISSING) values to a byte slice.
func TypeListBytes(buf []byte, list []Type) int {
b := 0
var structBytes []byte
@ -176,35 +172,37 @@ func TypeListBytes(buf []byte, list []Type) int {
return b
}
// Request QueryVersion
// size: 8
// QueryVersionCookie is a cookie used only for QueryVersion requests.
type QueryVersionCookie struct {
*xgb.Cookie
}
// QueryVersion sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()
func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie)
return QueryVersionCookie{cookie}
}
// QueryVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryVersionUnchecked(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie)
return QueryVersionCookie{cookie}
}
// Request reply for QueryVersion
// size: 12
// QueryVersionReply represents the data returned from a QueryVersion request.
type QueryVersionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
ServerMajor uint16
ServerMinor uint16
}
// Waits and reads reply data from request QueryVersion
// Reply blocks and returns the reply data for a QueryVersion request.
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -216,7 +214,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
return queryVersionReply(buf), nil
}
// Read reply into structure from buffer for QueryVersion
// queryVersionReply reads a byte slice into a QueryVersionReply value.
func queryVersionReply(buf []byte) *QueryVersionReply {
v := new(QueryVersionReply)
b := 1 // skip reply determinant
@ -239,6 +237,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
}
// Write request to wire for QueryVersion
// queryVersionRequest writes a QueryVersion request to a byte slice.
func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte {
size := 8
b := 0
@ -262,36 +261,38 @@ func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte
return buf
}
// Request QueryClients
// size: 4
// QueryClientsCookie is a cookie used only for QueryClients requests.
type QueryClientsCookie struct {
*xgb.Cookie
}
// QueryClients sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryClientsCookie.Reply()
func QueryClients(c *xgb.Conn) QueryClientsCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryClientsRequest(c), cookie)
return QueryClientsCookie{cookie}
}
// QueryClientsUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryClientsUnchecked(c *xgb.Conn) QueryClientsCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryClientsRequest(c), cookie)
return QueryClientsCookie{cookie}
}
// Request reply for QueryClients
// size: (32 + xgb.Pad((int(NumClients) * 8)))
// QueryClientsReply represents the data returned from a QueryClients request.
type QueryClientsReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
NumClients uint32
// padding: 20 bytes
Clients []Client // size: xgb.Pad((int(NumClients) * 8))
}
// Waits and reads reply data from request QueryClients
// Reply blocks and returns the reply data for a QueryClients request.
func (cook QueryClientsCookie) Reply() (*QueryClientsReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -303,7 +304,7 @@ func (cook QueryClientsCookie) Reply() (*QueryClientsReply, error) {
return queryClientsReply(buf), nil
}
// Read reply into structure from buffer for QueryClients
// queryClientsReply reads a byte slice into a QueryClientsReply value.
func queryClientsReply(buf []byte) *QueryClientsReply {
v := new(QueryClientsReply)
b := 1 // skip reply determinant
@ -328,6 +329,7 @@ func queryClientsReply(buf []byte) *QueryClientsReply {
}
// Write request to wire for QueryClients
// queryClientsRequest writes a QueryClients request to a byte slice.
func queryClientsRequest(c *xgb.Conn) []byte {
size := 4
b := 0
@ -345,36 +347,38 @@ func queryClientsRequest(c *xgb.Conn) []byte {
return buf
}
// Request QueryClientResources
// size: 8
// QueryClientResourcesCookie is a cookie used only for QueryClientResources requests.
type QueryClientResourcesCookie struct {
*xgb.Cookie
}
// QueryClientResources sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryClientResourcesCookie.Reply()
func QueryClientResources(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryClientResourcesRequest(c, Xid), cookie)
return QueryClientResourcesCookie{cookie}
}
// QueryClientResourcesUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryClientResourcesUnchecked(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryClientResourcesRequest(c, Xid), cookie)
return QueryClientResourcesCookie{cookie}
}
// Request reply for QueryClientResources
// size: (32 + xgb.Pad((int(NumTypes) * 8)))
// QueryClientResourcesReply represents the data returned from a QueryClientResources request.
type QueryClientResourcesReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
NumTypes uint32
// padding: 20 bytes
Types []Type // size: xgb.Pad((int(NumTypes) * 8))
}
// Waits and reads reply data from request QueryClientResources
// Reply blocks and returns the reply data for a QueryClientResources request.
func (cook QueryClientResourcesCookie) Reply() (*QueryClientResourcesReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -386,7 +390,7 @@ func (cook QueryClientResourcesCookie) Reply() (*QueryClientResourcesReply, erro
return queryClientResourcesReply(buf), nil
}
// Read reply into structure from buffer for QueryClientResources
// queryClientResourcesReply reads a byte slice into a QueryClientResourcesReply value.
func queryClientResourcesReply(buf []byte) *QueryClientResourcesReply {
v := new(QueryClientResourcesReply)
b := 1 // skip reply determinant
@ -411,6 +415,7 @@ func queryClientResourcesReply(buf []byte) *QueryClientResourcesReply {
}
// Write request to wire for QueryClientResources
// queryClientResourcesRequest writes a QueryClientResources request to a byte slice.
func queryClientResourcesRequest(c *xgb.Conn, Xid uint32) []byte {
size := 8
b := 0
@ -431,35 +436,37 @@ func queryClientResourcesRequest(c *xgb.Conn, Xid uint32) []byte {
return buf
}
// Request QueryClientPixmapBytes
// size: 8
// QueryClientPixmapBytesCookie is a cookie used only for QueryClientPixmapBytes requests.
type QueryClientPixmapBytesCookie struct {
*xgb.Cookie
}
// QueryClientPixmapBytes sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryClientPixmapBytesCookie.Reply()
func QueryClientPixmapBytes(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryClientPixmapBytesRequest(c, Xid), cookie)
return QueryClientPixmapBytesCookie{cookie}
}
// QueryClientPixmapBytesUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryClientPixmapBytesUnchecked(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryClientPixmapBytesRequest(c, Xid), cookie)
return QueryClientPixmapBytesCookie{cookie}
}
// Request reply for QueryClientPixmapBytes
// size: 16
// QueryClientPixmapBytesReply represents the data returned from a QueryClientPixmapBytes request.
type QueryClientPixmapBytesReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
Bytes uint32
BytesOverflow uint32
}
// Waits and reads reply data from request QueryClientPixmapBytes
// Reply blocks and returns the reply data for a QueryClientPixmapBytes request.
func (cook QueryClientPixmapBytesCookie) Reply() (*QueryClientPixmapBytesReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -471,7 +478,7 @@ func (cook QueryClientPixmapBytesCookie) Reply() (*QueryClientPixmapBytesReply,
return queryClientPixmapBytesReply(buf), nil
}
// Read reply into structure from buffer for QueryClientPixmapBytes
// queryClientPixmapBytesReply reads a byte slice into a QueryClientPixmapBytesReply value.
func queryClientPixmapBytesReply(buf []byte) *QueryClientPixmapBytesReply {
v := new(QueryClientPixmapBytesReply)
b := 1 // skip reply determinant
@ -494,6 +501,7 @@ func queryClientPixmapBytesReply(buf []byte) *QueryClientPixmapBytesReply {
}
// Write request to wire for QueryClientPixmapBytes
// queryClientPixmapBytesRequest writes a QueryClientPixmapBytes request to a byte slice.
func queryClientPixmapBytesRequest(c *xgb.Conn, Xid uint32) []byte {
size := 8
b := 0

View File

@ -2,7 +2,7 @@
package screensaver
/*
This file was generated by screensaver.xml on May 10 2012 8:04:32pm EDT.
This file was generated by screensaver.xml on May 10 2012 11:56:19pm EDT.
This file is automatically generated. Edit at your peril!
*/
@ -40,6 +40,10 @@ func init() {
xgb.NewExtErrorFuncs["MIT-SCREEN-SAVER"] = make(map[int]xgb.NewErrorFun)
}
// Skipping definition for base type 'Card32'
// Skipping definition for base type 'Double'
// Skipping definition for base type 'Bool'
// Skipping definition for base type 'Float'
@ -60,10 +64,6 @@ func init() {
// Skipping definition for base type 'Char'
// Skipping definition for base type 'Card32'
// Skipping definition for base type 'Double'
const (
KindBlanked = 0
KindInternal = 1
@ -82,9 +82,7 @@ const (
StateDisabled = 3
)
// Event definition Notify (0)
// Size: 32
// Notify is the event number for a NotifyEvent.
const Notify = 0
type NotifyEvent struct {
@ -101,7 +99,7 @@ type NotifyEvent struct {
// padding: 14 bytes
}
// Event read Notify
// NotifyEventNew constructs a NotifyEvent value that implements xgb.Event from a byte slice.
func NotifyEventNew(buf []byte) xgb.Event {
v := NotifyEvent{}
b := 1 // don't read event number
@ -144,7 +142,7 @@ func NotifyEventNew(buf []byte) xgb.Event {
return v
}
// Event write Notify
// Bytes writes a NotifyEvent value to a byte slice.
func (v NotifyEvent) Bytes() []byte {
buf := make([]byte, 32)
b := 0
@ -190,12 +188,14 @@ func (v NotifyEvent) Bytes() []byte {
return buf
}
func (v NotifyEvent) ImplementsEvent() {}
// SequenceId returns the sequence id attached to the Notify event.
// Events without a sequence number (KeymapNotify) return 0.
// This is mostly used internally.
func (v NotifyEvent) SequenceId() uint16 {
return v.Sequence
}
// String is a rudimentary string representation of NotifyEvent.
func (v NotifyEvent) String() string {
fieldVals := make([]string, 0, 10)
fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence))
@ -214,36 +214,38 @@ func init() {
xgb.NewExtEventFuncs["MIT-SCREEN-SAVER"][0] = NotifyEventNew
}
// Request QueryVersion
// size: 8
// QueryVersionCookie is a cookie used only for QueryVersion requests.
type QueryVersionCookie struct {
*xgb.Cookie
}
// QueryVersion sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()
func QueryVersion(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
return QueryVersionCookie{cookie}
}
// QueryVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
return QueryVersionCookie{cookie}
}
// Request reply for QueryVersion
// size: 32
// QueryVersionReply represents the data returned from a QueryVersion request.
type QueryVersionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
ServerMajorVersion uint16
ServerMinorVersion uint16
// padding: 20 bytes
}
// Waits and reads reply data from request QueryVersion
// Reply blocks and returns the reply data for a QueryVersion request.
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -255,7 +257,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
return queryVersionReply(buf), nil
}
// Read reply into structure from buffer for QueryVersion
// queryVersionReply reads a byte slice into a QueryVersionReply value.
func queryVersionReply(buf []byte) *QueryVersionReply {
v := new(QueryVersionReply)
b := 1 // skip reply determinant
@ -280,6 +282,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
}
// Write request to wire for QueryVersion
// queryVersionRequest writes a QueryVersion request to a byte slice.
func queryVersionRequest(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) []byte {
size := 8
b := 0
@ -305,29 +308,31 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersio
return buf
}
// Request QueryInfo
// size: 8
// QueryInfoCookie is a cookie used only for QueryInfo requests.
type QueryInfoCookie struct {
*xgb.Cookie
}
// QueryInfo sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryInfoCookie.Reply()
func QueryInfo(c *xgb.Conn, Drawable xproto.Drawable) QueryInfoCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryInfoRequest(c, Drawable), cookie)
return QueryInfoCookie{cookie}
}
// QueryInfoUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryInfoUnchecked(c *xgb.Conn, Drawable xproto.Drawable) QueryInfoCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryInfoRequest(c, Drawable), cookie)
return QueryInfoCookie{cookie}
}
// Request reply for QueryInfo
// size: 32
// QueryInfoReply represents the data returned from a QueryInfo request.
type QueryInfoReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
State byte
SaverWindow xproto.Window
MsUntilServer uint32
@ -337,7 +342,7 @@ type QueryInfoReply struct {
// padding: 7 bytes
}
// Waits and reads reply data from request QueryInfo
// Reply blocks and returns the reply data for a QueryInfo request.
func (cook QueryInfoCookie) Reply() (*QueryInfoReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -349,7 +354,7 @@ func (cook QueryInfoCookie) Reply() (*QueryInfoReply, error) {
return queryInfoReply(buf), nil
}
// Read reply into structure from buffer for QueryInfo
// queryInfoReply reads a byte slice into a QueryInfoReply value.
func queryInfoReply(buf []byte) *QueryInfoReply {
v := new(QueryInfoReply)
b := 1 // skip reply determinant
@ -384,6 +389,7 @@ func queryInfoReply(buf []byte) *QueryInfoReply {
}
// Write request to wire for QueryInfo
// queryInfoRequest writes a QueryInfo request to a byte slice.
func queryInfoRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
size := 8
b := 0
@ -404,30 +410,35 @@ func queryInfoRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
return buf
}
// Request SelectInput
// size: 12
// SelectInputCookie is a cookie used only for SelectInput requests.
type SelectInputCookie struct {
*xgb.Cookie
}
// Write request to wire for SelectInput
// SelectInput sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func SelectInput(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) SelectInputCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(selectInputRequest(c, Drawable, EventMask), cookie)
return SelectInputCookie{cookie}
}
// SelectInputChecked sends a checked request.
// If an error occurs, it can be retrieved using SelectInputCookie.Check()
func SelectInputChecked(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) SelectInputCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(selectInputRequest(c, Drawable, EventMask), cookie)
return SelectInputCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook SelectInputCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for SelectInput
// selectInputRequest writes a SelectInput request to a byte slice.
func selectInputRequest(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) []byte {
size := 12
b := 0
@ -451,30 +462,35 @@ func selectInputRequest(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32)
return buf
}
// Request SetAttributes
// size: xgb.Pad((24 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))))
// SetAttributesCookie is a cookie used only for SetAttributes requests.
type SetAttributesCookie struct {
*xgb.Cookie
}
// Write request to wire for SetAttributes
// SetAttributes sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func SetAttributes(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual xproto.Visualid, ValueMask uint32, ValueList []uint32) SetAttributesCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(setAttributesRequest(c, Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie)
return SetAttributesCookie{cookie}
}
// SetAttributesChecked sends a checked request.
// If an error occurs, it can be retrieved using SetAttributesCookie.Check()
func SetAttributesChecked(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual xproto.Visualid, ValueMask uint32, ValueList []uint32) SetAttributesCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(setAttributesRequest(c, Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie)
return SetAttributesCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook SetAttributesCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for SetAttributes
// setAttributesRequest writes a SetAttributes request to a byte slice.
func setAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class byte, Depth byte, Visual xproto.Visualid, ValueMask uint32, ValueList []uint32) []byte {
size := xgb.Pad((24 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))))
b := 0
@ -527,30 +543,35 @@ func setAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int1
return buf
}
// Request UnsetAttributes
// size: 8
// UnsetAttributesCookie is a cookie used only for UnsetAttributes requests.
type UnsetAttributesCookie struct {
*xgb.Cookie
}
// Write request to wire for UnsetAttributes
// UnsetAttributes sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func UnsetAttributes(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(unsetAttributesRequest(c, Drawable), cookie)
return UnsetAttributesCookie{cookie}
}
// UnsetAttributesChecked sends a checked request.
// If an error occurs, it can be retrieved using UnsetAttributesCookie.Check()
func UnsetAttributesChecked(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(unsetAttributesRequest(c, Drawable), cookie)
return UnsetAttributesCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook UnsetAttributesCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for UnsetAttributes
// unsetAttributesRequest writes a UnsetAttributes request to a byte slice.
func unsetAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
size := 8
b := 0
@ -571,30 +592,35 @@ func unsetAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
return buf
}
// Request Suspend
// size: 8
// SuspendCookie is a cookie used only for Suspend requests.
type SuspendCookie struct {
*xgb.Cookie
}
// Write request to wire for Suspend
// Suspend sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func Suspend(c *xgb.Conn, Suspend bool) SuspendCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(suspendRequest(c, Suspend), cookie)
return SuspendCookie{cookie}
}
// SuspendChecked sends a checked request.
// If an error occurs, it can be retrieved using SuspendCookie.Check()
func SuspendChecked(c *xgb.Conn, Suspend bool) SuspendCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(suspendRequest(c, Suspend), cookie)
return SuspendCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook SuspendCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for Suspend
// suspendRequest writes a Suspend request to a byte slice.
func suspendRequest(c *xgb.Conn, Suspend bool) []byte {
size := 8
b := 0

View File

@ -2,7 +2,7 @@
package shape
/*
This file was generated by shape.xml on May 10 2012 8:04:32pm EDT.
This file was generated by shape.xml on May 10 2012 11:56:19pm EDT.
This file is automatically generated. Edit at your peril!
*/
@ -82,9 +82,7 @@ type Op byte
type Kind byte
// Event definition Notify (0)
// Size: 32
// Notify is the event number for a NotifyEvent.
const Notify = 0
type NotifyEvent struct {
@ -100,7 +98,7 @@ type NotifyEvent struct {
// padding: 11 bytes
}
// Event read Notify
// NotifyEventNew constructs a NotifyEvent value that implements xgb.Event from a byte slice.
func NotifyEventNew(buf []byte) xgb.Event {
v := NotifyEvent{}
b := 1 // don't read event number
@ -141,7 +139,7 @@ func NotifyEventNew(buf []byte) xgb.Event {
return v
}
// Event write Notify
// Bytes writes a NotifyEvent value to a byte slice.
func (v NotifyEvent) Bytes() []byte {
buf := make([]byte, 32)
b := 0
@ -185,12 +183,14 @@ func (v NotifyEvent) Bytes() []byte {
return buf
}
func (v NotifyEvent) ImplementsEvent() {}
// SequenceId returns the sequence id attached to the Notify event.
// Events without a sequence number (KeymapNotify) return 0.
// This is mostly used internally.
func (v NotifyEvent) SequenceId() uint16 {
return v.Sequence
}
// String is a rudimentary string representation of NotifyEvent.
func (v NotifyEvent) String() string {
fieldVals := make([]string, 0, 9)
fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence))
@ -209,35 +209,37 @@ func init() {
xgb.NewExtEventFuncs["SHAPE"][0] = NotifyEventNew
}
// Request QueryVersion
// size: 4
// QueryVersionCookie is a cookie used only for QueryVersion requests.
type QueryVersionCookie struct {
*xgb.Cookie
}
// QueryVersion sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()
func QueryVersion(c *xgb.Conn) QueryVersionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryVersionRequest(c), cookie)
return QueryVersionCookie{cookie}
}
// QueryVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryVersionRequest(c), cookie)
return QueryVersionCookie{cookie}
}
// Request reply for QueryVersion
// size: 12
// QueryVersionReply represents the data returned from a QueryVersion request.
type QueryVersionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
MajorVersion uint16
MinorVersion uint16
}
// Waits and reads reply data from request QueryVersion
// Reply blocks and returns the reply data for a QueryVersion request.
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -249,7 +251,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
return queryVersionReply(buf), nil
}
// Read reply into structure from buffer for QueryVersion
// queryVersionReply reads a byte slice into a QueryVersionReply value.
func queryVersionReply(buf []byte) *QueryVersionReply {
v := new(QueryVersionReply)
b := 1 // skip reply determinant
@ -272,6 +274,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
}
// Write request to wire for QueryVersion
// queryVersionRequest writes a QueryVersion request to a byte slice.
func queryVersionRequest(c *xgb.Conn) []byte {
size := 4
b := 0
@ -289,30 +292,35 @@ func queryVersionRequest(c *xgb.Conn) []byte {
return buf
}
// Request Rectangles
// size: xgb.Pad((16 + xgb.Pad((len(Rectangles) * 8))))
// RectanglesCookie is a cookie used only for Rectangles requests.
type RectanglesCookie struct {
*xgb.Cookie
}
// Write request to wire for Rectangles
// Rectangles sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func Rectangles(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) RectanglesCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(rectanglesRequest(c, Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie)
return RectanglesCookie{cookie}
}
// RectanglesChecked sends a checked request.
// If an error occurs, it can be retrieved using RectanglesCookie.Check()
func RectanglesChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) RectanglesCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(rectanglesRequest(c, Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie)
return RectanglesCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook RectanglesCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for Rectangles
// rectanglesRequest writes a Rectangles request to a byte slice.
func rectanglesRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) []byte {
size := xgb.Pad((16 + xgb.Pad((len(Rectangles) * 8))))
b := 0
@ -352,30 +360,35 @@ func rectanglesRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering
return buf
}
// Request Mask
// size: 20
// MaskCookie is a cookie used only for Mask requests.
type MaskCookie struct {
*xgb.Cookie
}
// Write request to wire for Mask
// Mask sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func Mask(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) MaskCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(maskRequest(c, Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie)
return MaskCookie{cookie}
}
// MaskChecked sends a checked request.
// If an error occurs, it can be retrieved using MaskCookie.Check()
func MaskChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) MaskCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(maskRequest(c, Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie)
return MaskCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook MaskCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for Mask
// maskRequest writes a Mask request to a byte slice.
func maskRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) []byte {
size := 20
b := 0
@ -413,30 +426,35 @@ func maskRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWin
return buf
}
// Request Combine
// size: 20
// CombineCookie is a cookie used only for Combine requests.
type CombineCookie struct {
*xgb.Cookie
}
// Write request to wire for Combine
// Combine sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func Combine(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) CombineCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(combineRequest(c, Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie)
return CombineCookie{cookie}
}
// CombineChecked sends a checked request.
// If an error occurs, it can be retrieved using CombineCookie.Check()
func CombineChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) CombineCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(combineRequest(c, Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie)
return CombineCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook CombineCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for Combine
// combineRequest writes a Combine request to a byte slice.
func combineRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) []byte {
size := 20
b := 0
@ -477,30 +495,35 @@ func combineRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind
return buf
}
// Request Offset
// size: 16
// OffsetCookie is a cookie used only for Offset requests.
type OffsetCookie struct {
*xgb.Cookie
}
// Write request to wire for Offset
// Offset sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func Offset(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) OffsetCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(offsetRequest(c, DestinationKind, DestinationWindow, XOffset, YOffset), cookie)
return OffsetCookie{cookie}
}
// OffsetChecked sends a checked request.
// If an error occurs, it can be retrieved using OffsetCookie.Check()
func OffsetChecked(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) OffsetCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(offsetRequest(c, DestinationKind, DestinationWindow, XOffset, YOffset), cookie)
return OffsetCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook OffsetCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for Offset
// offsetRequest writes a Offset request to a byte slice.
func offsetRequest(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) []byte {
size := 16
b := 0
@ -532,29 +555,31 @@ func offsetRequest(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.W
return buf
}
// Request QueryExtents
// size: 8
// QueryExtentsCookie is a cookie used only for QueryExtents requests.
type QueryExtentsCookie struct {
*xgb.Cookie
}
// QueryExtents sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryExtentsCookie.Reply()
func QueryExtents(c *xgb.Conn, DestinationWindow xproto.Window) QueryExtentsCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryExtentsRequest(c, DestinationWindow), cookie)
return QueryExtentsCookie{cookie}
}
// QueryExtentsUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryExtentsUnchecked(c *xgb.Conn, DestinationWindow xproto.Window) QueryExtentsCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryExtentsRequest(c, DestinationWindow), cookie)
return QueryExtentsCookie{cookie}
}
// Request reply for QueryExtents
// size: 28
// QueryExtentsReply represents the data returned from a QueryExtents request.
type QueryExtentsReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
BoundingShaped bool
ClipShaped bool
@ -569,7 +594,7 @@ type QueryExtentsReply struct {
ClipShapeExtentsHeight uint16
}
// Waits and reads reply data from request QueryExtents
// Reply blocks and returns the reply data for a QueryExtents request.
func (cook QueryExtentsCookie) Reply() (*QueryExtentsReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -581,7 +606,7 @@ func (cook QueryExtentsCookie) Reply() (*QueryExtentsReply, error) {
return queryExtentsReply(buf), nil
}
// Read reply into structure from buffer for QueryExtents
// queryExtentsReply reads a byte slice into a QueryExtentsReply value.
func queryExtentsReply(buf []byte) *QueryExtentsReply {
v := new(QueryExtentsReply)
b := 1 // skip reply determinant
@ -638,6 +663,7 @@ func queryExtentsReply(buf []byte) *QueryExtentsReply {
}
// Write request to wire for QueryExtents
// queryExtentsRequest writes a QueryExtents request to a byte slice.
func queryExtentsRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte {
size := 8
b := 0
@ -658,30 +684,35 @@ func queryExtentsRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte {
return buf
}
// Request SelectInput
// size: 12
// SelectInputCookie is a cookie used only for SelectInput requests.
type SelectInputCookie struct {
*xgb.Cookie
}
// Write request to wire for SelectInput
// SelectInput sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func SelectInput(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) SelectInputCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(selectInputRequest(c, DestinationWindow, Enable), cookie)
return SelectInputCookie{cookie}
}
// SelectInputChecked sends a checked request.
// If an error occurs, it can be retrieved using SelectInputCookie.Check()
func SelectInputChecked(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) SelectInputCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(selectInputRequest(c, DestinationWindow, Enable), cookie)
return SelectInputCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook SelectInputCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for SelectInput
// selectInputRequest writes a SelectInput request to a byte slice.
func selectInputRequest(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) []byte {
size := 12
b := 0
@ -711,33 +742,35 @@ func selectInputRequest(c *xgb.Conn, DestinationWindow xproto.Window, Enable boo
return buf
}
// Request InputSelected
// size: 8
// InputSelectedCookie is a cookie used only for InputSelected requests.
type InputSelectedCookie struct {
*xgb.Cookie
}
// InputSelected sends a checked request.
// If an error occurs, it will be returned with the reply by calling InputSelectedCookie.Reply()
func InputSelected(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(inputSelectedRequest(c, DestinationWindow), cookie)
return InputSelectedCookie{cookie}
}
// InputSelectedUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func InputSelectedUnchecked(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(inputSelectedRequest(c, DestinationWindow), cookie)
return InputSelectedCookie{cookie}
}
// Request reply for InputSelected
// size: 8
// InputSelectedReply represents the data returned from a InputSelected request.
type InputSelectedReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
Enabled bool
}
// Waits and reads reply data from request InputSelected
// Reply blocks and returns the reply data for a InputSelected request.
func (cook InputSelectedCookie) Reply() (*InputSelectedReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -749,7 +782,7 @@ func (cook InputSelectedCookie) Reply() (*InputSelectedReply, error) {
return inputSelectedReply(buf), nil
}
// Read reply into structure from buffer for InputSelected
// inputSelectedReply reads a byte slice into a InputSelectedReply value.
func inputSelectedReply(buf []byte) *InputSelectedReply {
v := new(InputSelectedReply)
b := 1 // skip reply determinant
@ -771,6 +804,7 @@ func inputSelectedReply(buf []byte) *InputSelectedReply {
}
// Write request to wire for InputSelected
// inputSelectedRequest writes a InputSelected request to a byte slice.
func inputSelectedRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte {
size := 8
b := 0
@ -791,36 +825,38 @@ func inputSelectedRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte {
return buf
}
// Request GetRectangles
// size: 12
// GetRectanglesCookie is a cookie used only for GetRectangles requests.
type GetRectanglesCookie struct {
*xgb.Cookie
}
// GetRectangles sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetRectanglesCookie.Reply()
func GetRectangles(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getRectanglesRequest(c, Window, SourceKind), cookie)
return GetRectanglesCookie{cookie}
}
// GetRectanglesUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetRectanglesUnchecked(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getRectanglesRequest(c, Window, SourceKind), cookie)
return GetRectanglesCookie{cookie}
}
// Request reply for GetRectangles
// size: (32 + xgb.Pad((int(RectanglesLen) * 8)))
// GetRectanglesReply represents the data returned from a GetRectangles request.
type GetRectanglesReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
Ordering byte
RectanglesLen uint32
// padding: 20 bytes
Rectangles []xproto.Rectangle // size: xgb.Pad((int(RectanglesLen) * 8))
}
// Waits and reads reply data from request GetRectangles
// Reply blocks and returns the reply data for a GetRectangles request.
func (cook GetRectanglesCookie) Reply() (*GetRectanglesReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -832,7 +868,7 @@ func (cook GetRectanglesCookie) Reply() (*GetRectanglesReply, error) {
return getRectanglesReply(buf), nil
}
// Read reply into structure from buffer for GetRectangles
// getRectanglesReply reads a byte slice into a GetRectanglesReply value.
func getRectanglesReply(buf []byte) *GetRectanglesReply {
v := new(GetRectanglesReply)
b := 1 // skip reply determinant
@ -858,6 +894,7 @@ func getRectanglesReply(buf []byte) *GetRectanglesReply {
}
// Write request to wire for GetRectangles
// getRectanglesRequest writes a GetRectangles request to a byte slice.
func getRectanglesRequest(c *xgb.Conn, Window xproto.Window, SourceKind Kind) []byte {
size := 12
b := 0

View File

@ -2,7 +2,7 @@
package shm
/*
This file was generated by shm.xml on May 10 2012 8:04:32pm EDT.
This file was generated by shm.xml on May 10 2012 11:56:19pm EDT.
This file is automatically generated. Edit at your peril!
*/
@ -40,6 +40,8 @@ func init() {
xgb.NewExtErrorFuncs["MIT-SHM"] = make(map[int]xgb.NewErrorFun)
}
// Skipping definition for base type 'Int32'
// Skipping definition for base type 'Void'
// Skipping definition for base type 'Byte'
@ -62,8 +64,6 @@ func init() {
// Skipping definition for base type 'Int16'
// Skipping definition for base type 'Int32'
type Seg uint32
func NewSegId(c *xgb.Conn) (Seg, error) {
@ -74,9 +74,7 @@ func NewSegId(c *xgb.Conn) (Seg, error) {
return Seg(id), nil
}
// Event definition Completion (0)
// Size: 32
// Completion is the event number for a CompletionEvent.
const Completion = 0
type CompletionEvent struct {
@ -90,7 +88,7 @@ type CompletionEvent struct {
Offset uint32
}
// Event read Completion
// CompletionEventNew constructs a CompletionEvent value that implements xgb.Event from a byte slice.
func CompletionEventNew(buf []byte) xgb.Event {
v := CompletionEvent{}
b := 1 // don't read event number
@ -120,7 +118,7 @@ func CompletionEventNew(buf []byte) xgb.Event {
return v
}
// Event write Completion
// Bytes writes a CompletionEvent value to a byte slice.
func (v CompletionEvent) Bytes() []byte {
buf := make([]byte, 32)
b := 0
@ -153,12 +151,14 @@ func (v CompletionEvent) Bytes() []byte {
return buf
}
func (v CompletionEvent) ImplementsEvent() {}
// SequenceId returns the sequence id attached to the Completion event.
// Events without a sequence number (KeymapNotify) return 0.
// This is mostly used internally.
func (v CompletionEvent) SequenceId() uint16 {
return v.Sequence
}
// String is a rudimentary string representation of CompletionEvent.
func (v CompletionEvent) String() string {
fieldVals := make([]string, 0, 7)
fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence))
@ -174,20 +174,20 @@ func init() {
xgb.NewExtEventFuncs["MIT-SHM"][0] = CompletionEventNew
}
// ErrorCopy definition BadSeg (0)
// BadBadSeg is the error number for a BadBadSeg.
const BadBadSeg = 0
type BadSegError xproto.ValueError
// BadSegErrorNew constructs a BadSegError value that implements xgb.Error from a byte slice.
func BadSegErrorNew(buf []byte) xgb.Error {
v := BadSegError(xproto.ValueErrorNew(buf).(xproto.ValueError))
v.NiceName = "BadSeg"
return v
}
func (err BadSegError) ImplementsError() {}
// SequenceId returns the sequence id attached to the BadBadSeg error.
// This is mostly used internally.
func (err BadSegError) SequenceId() uint16 {
return err.Sequence
}
@ -210,29 +210,31 @@ func init() {
xgb.NewExtErrorFuncs["MIT-SHM"][0] = BadSegErrorNew
}
// Request QueryVersion
// size: 4
// QueryVersionCookie is a cookie used only for QueryVersion requests.
type QueryVersionCookie struct {
*xgb.Cookie
}
// QueryVersion sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()
func QueryVersion(c *xgb.Conn) QueryVersionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryVersionRequest(c), cookie)
return QueryVersionCookie{cookie}
}
// QueryVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryVersionRequest(c), cookie)
return QueryVersionCookie{cookie}
}
// Request reply for QueryVersion
// size: 32
// QueryVersionReply represents the data returned from a QueryVersion request.
type QueryVersionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
SharedPixmaps bool
MajorVersion uint16
MinorVersion uint16
@ -242,7 +244,7 @@ type QueryVersionReply struct {
// padding: 15 bytes
}
// Waits and reads reply data from request QueryVersion
// Reply blocks and returns the reply data for a QueryVersion request.
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -254,7 +256,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
return queryVersionReply(buf), nil
}
// Read reply into structure from buffer for QueryVersion
// queryVersionReply reads a byte slice into a QueryVersionReply value.
func queryVersionReply(buf []byte) *QueryVersionReply {
v := new(QueryVersionReply)
b := 1 // skip reply determinant
@ -293,6 +295,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
}
// Write request to wire for QueryVersion
// queryVersionRequest writes a QueryVersion request to a byte slice.
func queryVersionRequest(c *xgb.Conn) []byte {
size := 4
b := 0
@ -310,30 +313,35 @@ func queryVersionRequest(c *xgb.Conn) []byte {
return buf
}
// Request Attach
// size: 16
// AttachCookie is a cookie used only for Attach requests.
type AttachCookie struct {
*xgb.Cookie
}
// Write request to wire for Attach
// Attach sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func Attach(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(attachRequest(c, Shmseg, Shmid, ReadOnly), cookie)
return AttachCookie{cookie}
}
// AttachChecked sends a checked request.
// If an error occurs, it can be retrieved using AttachCookie.Check()
func AttachChecked(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(attachRequest(c, Shmseg, Shmid, ReadOnly), cookie)
return AttachCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook AttachCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for Attach
// attachRequest writes a Attach request to a byte slice.
func attachRequest(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) []byte {
size := 16
b := 0
@ -366,30 +374,35 @@ func attachRequest(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) []byte
return buf
}
// Request Detach
// size: 8
// DetachCookie is a cookie used only for Detach requests.
type DetachCookie struct {
*xgb.Cookie
}
// Write request to wire for Detach
// Detach sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func Detach(c *xgb.Conn, Shmseg Seg) DetachCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(detachRequest(c, Shmseg), cookie)
return DetachCookie{cookie}
}
// DetachChecked sends a checked request.
// If an error occurs, it can be retrieved using DetachCookie.Check()
func DetachChecked(c *xgb.Conn, Shmseg Seg) DetachCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(detachRequest(c, Shmseg), cookie)
return DetachCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook DetachCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for Detach
// detachRequest writes a Detach request to a byte slice.
func detachRequest(c *xgb.Conn, Shmseg Seg) []byte {
size := 8
b := 0
@ -410,30 +423,35 @@ func detachRequest(c *xgb.Conn, Shmseg Seg) []byte {
return buf
}
// Request PutImage
// size: 40
// PutImageCookie is a cookie used only for PutImage requests.
type PutImageCookie struct {
*xgb.Cookie
}
// Write request to wire for PutImage
// PutImage sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func PutImage(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) PutImageCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(putImageRequest(c, Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie)
return PutImageCookie{cookie}
}
// PutImageChecked sends a checked request.
// If an error occurs, it can be retrieved using PutImageCookie.Check()
func PutImageChecked(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) PutImageCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(putImageRequest(c, Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie)
return PutImageCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook PutImageCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for PutImage
// putImageRequest writes a PutImage request to a byte slice.
func putImageRequest(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) []byte {
size := 40
b := 0
@ -498,35 +516,37 @@ func putImageRequest(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext,
return buf
}
// Request GetImage
// size: 32
// GetImageCookie is a cookie used only for GetImage requests.
type GetImageCookie struct {
*xgb.Cookie
}
// GetImage sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetImageCookie.Reply()
func GetImage(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) GetImageCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getImageRequest(c, Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie)
return GetImageCookie{cookie}
}
// GetImageUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetImageUnchecked(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) GetImageCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getImageRequest(c, Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie)
return GetImageCookie{cookie}
}
// Request reply for GetImage
// size: 16
// GetImageReply represents the data returned from a GetImage request.
type GetImageReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
Depth byte
Visual xproto.Visualid
Size uint32
}
// Waits and reads reply data from request GetImage
// Reply blocks and returns the reply data for a GetImage request.
func (cook GetImageCookie) Reply() (*GetImageReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -538,7 +558,7 @@ func (cook GetImageCookie) Reply() (*GetImageReply, error) {
return getImageReply(buf), nil
}
// Read reply into structure from buffer for GetImage
// getImageReply reads a byte slice into a GetImageReply value.
func getImageReply(buf []byte) *GetImageReply {
v := new(GetImageReply)
b := 1 // skip reply determinant
@ -562,6 +582,7 @@ func getImageReply(buf []byte) *GetImageReply {
}
// Write request to wire for GetImage
// getImageRequest writes a GetImage request to a byte slice.
func getImageRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) []byte {
size := 32
b := 0
@ -608,30 +629,35 @@ func getImageRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Wi
return buf
}
// Request CreatePixmap
// size: 28
// CreatePixmapCookie is a cookie used only for CreatePixmap requests.
type CreatePixmapCookie struct {
*xgb.Cookie
}
// Write request to wire for CreatePixmap
// CreatePixmap sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func CreatePixmap(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(createPixmapRequest(c, Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie)
return CreatePixmapCookie{cookie}
}
// CreatePixmapChecked sends a checked request.
// If an error occurs, it can be retrieved using CreatePixmapCookie.Check()
func CreatePixmapChecked(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(createPixmapRequest(c, Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie)
return CreatePixmapCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook CreatePixmapCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for CreatePixmap
// createPixmapRequest writes a CreatePixmap request to a byte slice.
func createPixmapRequest(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) []byte {
size := 28
b := 0

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
package xcmisc
/*
This file was generated by xc_misc.xml on May 10 2012 8:04:32pm EDT.
This file was generated by xc_misc.xml on May 10 2012 11:56:19pm EDT.
This file is automatically generated. Edit at your peril!
*/
@ -64,35 +64,37 @@ func init() {
// Skipping definition for base type 'Bool'
// Request GetVersion
// size: 8
// GetVersionCookie is a cookie used only for GetVersion requests.
type GetVersionCookie struct {
*xgb.Cookie
}
// GetVersion sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetVersionCookie.Reply()
func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
return GetVersionCookie{cookie}
}
// GetVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
return GetVersionCookie{cookie}
}
// Request reply for GetVersion
// size: 12
// GetVersionReply represents the data returned from a GetVersion request.
type GetVersionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
ServerMajorVersion uint16
ServerMinorVersion uint16
}
// Waits and reads reply data from request GetVersion
// Reply blocks and returns the reply data for a GetVersion request.
func (cook GetVersionCookie) Reply() (*GetVersionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -104,7 +106,7 @@ func (cook GetVersionCookie) Reply() (*GetVersionReply, error) {
return getVersionReply(buf), nil
}
// Read reply into structure from buffer for GetVersion
// getVersionReply reads a byte slice into a GetVersionReply value.
func getVersionReply(buf []byte) *GetVersionReply {
v := new(GetVersionReply)
b := 1 // skip reply determinant
@ -127,6 +129,7 @@ func getVersionReply(buf []byte) *GetVersionReply {
}
// Write request to wire for GetVersion
// getVersionRequest writes a GetVersion request to a byte slice.
func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte {
size := 8
b := 0
@ -150,35 +153,37 @@ func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersio
return buf
}
// Request GetXIDRange
// size: 4
// GetXIDRangeCookie is a cookie used only for GetXIDRange requests.
type GetXIDRangeCookie struct {
*xgb.Cookie
}
// GetXIDRange sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetXIDRangeCookie.Reply()
func GetXIDRange(c *xgb.Conn) GetXIDRangeCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getXIDRangeRequest(c), cookie)
return GetXIDRangeCookie{cookie}
}
// GetXIDRangeUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetXIDRangeUnchecked(c *xgb.Conn) GetXIDRangeCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getXIDRangeRequest(c), cookie)
return GetXIDRangeCookie{cookie}
}
// Request reply for GetXIDRange
// size: 16
// GetXIDRangeReply represents the data returned from a GetXIDRange request.
type GetXIDRangeReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
StartId uint32
Count uint32
}
// Waits and reads reply data from request GetXIDRange
// Reply blocks and returns the reply data for a GetXIDRange request.
func (cook GetXIDRangeCookie) Reply() (*GetXIDRangeReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -190,7 +195,7 @@ func (cook GetXIDRangeCookie) Reply() (*GetXIDRangeReply, error) {
return getXIDRangeReply(buf), nil
}
// Read reply into structure from buffer for GetXIDRange
// getXIDRangeReply reads a byte slice into a GetXIDRangeReply value.
func getXIDRangeReply(buf []byte) *GetXIDRangeReply {
v := new(GetXIDRangeReply)
b := 1 // skip reply determinant
@ -213,6 +218,7 @@ func getXIDRangeReply(buf []byte) *GetXIDRangeReply {
}
// Write request to wire for GetXIDRange
// getXIDRangeRequest writes a GetXIDRange request to a byte slice.
func getXIDRangeRequest(c *xgb.Conn) []byte {
size := 4
b := 0
@ -230,36 +236,38 @@ func getXIDRangeRequest(c *xgb.Conn) []byte {
return buf
}
// Request GetXIDList
// size: 8
// GetXIDListCookie is a cookie used only for GetXIDList requests.
type GetXIDListCookie struct {
*xgb.Cookie
}
// GetXIDList sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetXIDListCookie.Reply()
func GetXIDList(c *xgb.Conn, Count uint32) GetXIDListCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getXIDListRequest(c, Count), cookie)
return GetXIDListCookie{cookie}
}
// GetXIDListUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetXIDListUnchecked(c *xgb.Conn, Count uint32) GetXIDListCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getXIDListRequest(c, Count), cookie)
return GetXIDListCookie{cookie}
}
// Request reply for GetXIDList
// size: (32 + xgb.Pad((int(IdsLen) * 4)))
// GetXIDListReply represents the data returned from a GetXIDList request.
type GetXIDListReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
IdsLen uint32
// padding: 20 bytes
Ids []uint32 // size: xgb.Pad((int(IdsLen) * 4))
}
// Waits and reads reply data from request GetXIDList
// Reply blocks and returns the reply data for a GetXIDList request.
func (cook GetXIDListCookie) Reply() (*GetXIDListReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -271,7 +279,7 @@ func (cook GetXIDListCookie) Reply() (*GetXIDListReply, error) {
return getXIDListReply(buf), nil
}
// Read reply into structure from buffer for GetXIDList
// getXIDListReply reads a byte slice into a GetXIDListReply value.
func getXIDListReply(buf []byte) *GetXIDListReply {
v := new(GetXIDListReply)
b := 1 // skip reply determinant
@ -300,6 +308,7 @@ func getXIDListReply(buf []byte) *GetXIDListReply {
}
// Write request to wire for GetXIDList
// getXIDListRequest writes a GetXIDList request to a byte slice.
func getXIDListRequest(c *xgb.Conn, Count uint32) []byte {
size := 8
b := 0

View File

@ -2,7 +2,7 @@
package xevie
/*
This file was generated by xevie.xml on May 10 2012 8:04:32pm EDT.
This file was generated by xevie.xml on May 10 2012 11:56:19pm EDT.
This file is automatically generated. Edit at your peril!
*/
@ -40,16 +40,6 @@ func init() {
xgb.NewExtErrorFuncs["XEVIE"] = make(map[int]xgb.NewErrorFun)
}
// Skipping definition for base type 'Card8'
// Skipping definition for base type 'Int16'
// Skipping definition for base type 'Int32'
// Skipping definition for base type 'Void'
// Skipping definition for base type 'Byte'
// Skipping definition for base type 'Int8'
// Skipping definition for base type 'Card16'
@ -64,18 +54,26 @@ func init() {
// Skipping definition for base type 'Float'
// Skipping definition for base type 'Card8'
// Skipping definition for base type 'Int16'
// Skipping definition for base type 'Int32'
// Skipping definition for base type 'Void'
// Skipping definition for base type 'Byte'
const (
DatatypeUnmodified = 0
DatatypeModified = 1
)
// 'Event' struct definition
// Size: 32
type Event struct {
// padding: 32 bytes
}
// Struct read Event
// EventRead reads a byte slice into a Event value.
func EventRead(buf []byte, v *Event) int {
b := 0
@ -84,7 +82,7 @@ func EventRead(buf []byte, v *Event) int {
return b
}
// Struct list read Event
// EventReadList reads a byte slice into a list of Event values.
func EventReadList(buf []byte, dest []Event) int {
b := 0
for i := 0; i < len(dest); i++ {
@ -94,7 +92,7 @@ func EventReadList(buf []byte, dest []Event) int {
return xgb.Pad(b)
}
// Struct write Event
// Bytes writes a Event value to a byte slice.
func (v Event) Bytes() []byte {
buf := make([]byte, 32)
b := 0
@ -104,7 +102,7 @@ func (v Event) Bytes() []byte {
return buf
}
// Write struct list Event
// EventListBytes writes a list of %s(MISSING) values to a byte slice.
func EventListBytes(buf []byte, list []Event) int {
b := 0
var structBytes []byte
@ -116,36 +114,38 @@ func EventListBytes(buf []byte, list []Event) int {
return b
}
// Request QueryVersion
// size: 8
// QueryVersionCookie is a cookie used only for QueryVersion requests.
type QueryVersionCookie struct {
*xgb.Cookie
}
// QueryVersion sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()
func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
return QueryVersionCookie{cookie}
}
// QueryVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
return QueryVersionCookie{cookie}
}
// Request reply for QueryVersion
// size: 32
// QueryVersionReply represents the data returned from a QueryVersion request.
type QueryVersionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
ServerMajorVersion uint16
ServerMinorVersion uint16
// padding: 20 bytes
}
// Waits and reads reply data from request QueryVersion
// Reply blocks and returns the reply data for a QueryVersion request.
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -157,7 +157,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
return queryVersionReply(buf), nil
}
// Read reply into structure from buffer for QueryVersion
// queryVersionReply reads a byte slice into a QueryVersionReply value.
func queryVersionReply(buf []byte) *QueryVersionReply {
v := new(QueryVersionReply)
b := 1 // skip reply determinant
@ -182,6 +182,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
}
// Write request to wire for QueryVersion
// queryVersionRequest writes a QueryVersion request to a byte slice.
func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte {
size := 8
b := 0
@ -205,34 +206,36 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVers
return buf
}
// Request Start
// size: 8
// StartCookie is a cookie used only for Start requests.
type StartCookie struct {
*xgb.Cookie
}
// Start sends a checked request.
// If an error occurs, it will be returned with the reply by calling StartCookie.Reply()
func Start(c *xgb.Conn, Screen uint32) StartCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(startRequest(c, Screen), cookie)
return StartCookie{cookie}
}
// StartUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func StartUnchecked(c *xgb.Conn, Screen uint32) StartCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(startRequest(c, Screen), cookie)
return StartCookie{cookie}
}
// Request reply for Start
// size: 32
// StartReply represents the data returned from a Start request.
type StartReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
// padding: 24 bytes
}
// Waits and reads reply data from request Start
// Reply blocks and returns the reply data for a Start request.
func (cook StartCookie) Reply() (*StartReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -244,7 +247,7 @@ func (cook StartCookie) Reply() (*StartReply, error) {
return startReply(buf), nil
}
// Read reply into structure from buffer for Start
// startReply reads a byte slice into a StartReply value.
func startReply(buf []byte) *StartReply {
v := new(StartReply)
b := 1 // skip reply determinant
@ -263,6 +266,7 @@ func startReply(buf []byte) *StartReply {
}
// Write request to wire for Start
// startRequest writes a Start request to a byte slice.
func startRequest(c *xgb.Conn, Screen uint32) []byte {
size := 8
b := 0
@ -283,34 +287,36 @@ func startRequest(c *xgb.Conn, Screen uint32) []byte {
return buf
}
// Request End
// size: 8
// EndCookie is a cookie used only for End requests.
type EndCookie struct {
*xgb.Cookie
}
// End sends a checked request.
// If an error occurs, it will be returned with the reply by calling EndCookie.Reply()
func End(c *xgb.Conn, Cmap uint32) EndCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(endRequest(c, Cmap), cookie)
return EndCookie{cookie}
}
// EndUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func EndUnchecked(c *xgb.Conn, Cmap uint32) EndCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(endRequest(c, Cmap), cookie)
return EndCookie{cookie}
}
// Request reply for End
// size: 32
// EndReply represents the data returned from a End request.
type EndReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
// padding: 24 bytes
}
// Waits and reads reply data from request End
// Reply blocks and returns the reply data for a End request.
func (cook EndCookie) Reply() (*EndReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -322,7 +328,7 @@ func (cook EndCookie) Reply() (*EndReply, error) {
return endReply(buf), nil
}
// Read reply into structure from buffer for End
// endReply reads a byte slice into a EndReply value.
func endReply(buf []byte) *EndReply {
v := new(EndReply)
b := 1 // skip reply determinant
@ -341,6 +347,7 @@ func endReply(buf []byte) *EndReply {
}
// Write request to wire for End
// endRequest writes a End request to a byte slice.
func endRequest(c *xgb.Conn, Cmap uint32) []byte {
size := 8
b := 0
@ -361,34 +368,36 @@ func endRequest(c *xgb.Conn, Cmap uint32) []byte {
return buf
}
// Request Send
// size: 104
// SendCookie is a cookie used only for Send requests.
type SendCookie struct {
*xgb.Cookie
}
// Send sends a checked request.
// If an error occurs, it will be returned with the reply by calling SendCookie.Reply()
func Send(c *xgb.Conn, Event Event, DataType uint32) SendCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(sendRequest(c, Event, DataType), cookie)
return SendCookie{cookie}
}
// SendUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func SendUnchecked(c *xgb.Conn, Event Event, DataType uint32) SendCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(sendRequest(c, Event, DataType), cookie)
return SendCookie{cookie}
}
// Request reply for Send
// size: 32
// SendReply represents the data returned from a Send request.
type SendReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
// padding: 24 bytes
}
// Waits and reads reply data from request Send
// Reply blocks and returns the reply data for a Send request.
func (cook SendCookie) Reply() (*SendReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -400,7 +409,7 @@ func (cook SendCookie) Reply() (*SendReply, error) {
return sendReply(buf), nil
}
// Read reply into structure from buffer for Send
// sendReply reads a byte slice into a SendReply value.
func sendReply(buf []byte) *SendReply {
v := new(SendReply)
b := 1 // skip reply determinant
@ -419,6 +428,7 @@ func sendReply(buf []byte) *SendReply {
}
// Write request to wire for Send
// sendRequest writes a Send request to a byte slice.
func sendRequest(c *xgb.Conn, Event Event, DataType uint32) []byte {
size := 104
b := 0
@ -447,34 +457,36 @@ func sendRequest(c *xgb.Conn, Event Event, DataType uint32) []byte {
return buf
}
// Request SelectInput
// size: 8
// SelectInputCookie is a cookie used only for SelectInput requests.
type SelectInputCookie struct {
*xgb.Cookie
}
// SelectInput sends a checked request.
// If an error occurs, it will be returned with the reply by calling SelectInputCookie.Reply()
func SelectInput(c *xgb.Conn, EventMask uint32) SelectInputCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(selectInputRequest(c, EventMask), cookie)
return SelectInputCookie{cookie}
}
// SelectInputUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func SelectInputUnchecked(c *xgb.Conn, EventMask uint32) SelectInputCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(selectInputRequest(c, EventMask), cookie)
return SelectInputCookie{cookie}
}
// Request reply for SelectInput
// size: 32
// SelectInputReply represents the data returned from a SelectInput request.
type SelectInputReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
// padding: 24 bytes
}
// Waits and reads reply data from request SelectInput
// Reply blocks and returns the reply data for a SelectInput request.
func (cook SelectInputCookie) Reply() (*SelectInputReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -486,7 +498,7 @@ func (cook SelectInputCookie) Reply() (*SelectInputReply, error) {
return selectInputReply(buf), nil
}
// Read reply into structure from buffer for SelectInput
// selectInputReply reads a byte slice into a SelectInputReply value.
func selectInputReply(buf []byte) *SelectInputReply {
v := new(SelectInputReply)
b := 1 // skip reply determinant
@ -505,6 +517,7 @@ func selectInputReply(buf []byte) *SelectInputReply {
}
// Write request to wire for SelectInput
// selectInputRequest writes a SelectInput request to a byte slice.
func selectInputRequest(c *xgb.Conn, EventMask uint32) []byte {
size := 8
b := 0

View File

@ -2,7 +2,7 @@
package xf86dri
/*
This file was generated by xf86dri.xml on May 10 2012 8:04:32pm EDT.
This file was generated by xf86dri.xml on May 10 2012 11:56:19pm EDT.
This file is automatically generated. Edit at your peril!
*/
@ -40,18 +40,6 @@ func init() {
xgb.NewExtErrorFuncs["XFree86-DRI"] = make(map[int]xgb.NewErrorFun)
}
// Skipping definition for base type 'Int8'
// Skipping definition for base type 'Card16'
// Skipping definition for base type 'Char'
// Skipping definition for base type 'Card32'
// Skipping definition for base type 'Double'
// Skipping definition for base type 'Bool'
// Skipping definition for base type 'Float'
// Skipping definition for base type 'Card8'
@ -64,8 +52,18 @@ func init() {
// Skipping definition for base type 'Byte'
// 'DrmClipRect' struct definition
// Size: 8
// 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'
type DrmClipRect struct {
X1 int16
Y1 int16
@ -73,7 +71,7 @@ type DrmClipRect struct {
X3 int16
}
// Struct read DrmClipRect
// DrmClipRectRead reads a byte slice into a DrmClipRect value.
func DrmClipRectRead(buf []byte, v *DrmClipRect) int {
b := 0
@ -92,7 +90,7 @@ func DrmClipRectRead(buf []byte, v *DrmClipRect) int {
return b
}
// Struct list read DrmClipRect
// DrmClipRectReadList reads a byte slice into a list of DrmClipRect values.
func DrmClipRectReadList(buf []byte, dest []DrmClipRect) int {
b := 0
for i := 0; i < len(dest); i++ {
@ -102,7 +100,7 @@ func DrmClipRectReadList(buf []byte, dest []DrmClipRect) int {
return xgb.Pad(b)
}
// Struct write DrmClipRect
// Bytes writes a DrmClipRect value to a byte slice.
func (v DrmClipRect) Bytes() []byte {
buf := make([]byte, 8)
b := 0
@ -122,7 +120,7 @@ func (v DrmClipRect) Bytes() []byte {
return buf
}
// Write struct list DrmClipRect
// DrmClipRectListBytes writes a list of %s(MISSING) values to a byte slice.
func DrmClipRectListBytes(buf []byte, list []DrmClipRect) int {
b := 0
var structBytes []byte
@ -134,36 +132,38 @@ func DrmClipRectListBytes(buf []byte, list []DrmClipRect) int {
return b
}
// Request QueryVersion
// size: 4
// QueryVersionCookie is a cookie used only for QueryVersion requests.
type QueryVersionCookie struct {
*xgb.Cookie
}
// QueryVersion sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()
func QueryVersion(c *xgb.Conn) QueryVersionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryVersionRequest(c), cookie)
return QueryVersionCookie{cookie}
}
// QueryVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryVersionRequest(c), cookie)
return QueryVersionCookie{cookie}
}
// Request reply for QueryVersion
// size: 16
// QueryVersionReply represents the data returned from a QueryVersion request.
type QueryVersionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
DriMajorVersion uint16
DriMinorVersion uint16
DriMinorPatch uint32
}
// Waits and reads reply data from request QueryVersion
// Reply blocks and returns the reply data for a QueryVersion request.
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -175,7 +175,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
return queryVersionReply(buf), nil
}
// Read reply into structure from buffer for QueryVersion
// queryVersionReply reads a byte slice into a QueryVersionReply value.
func queryVersionReply(buf []byte) *QueryVersionReply {
v := new(QueryVersionReply)
b := 1 // skip reply determinant
@ -201,6 +201,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
}
// Write request to wire for QueryVersion
// queryVersionRequest writes a QueryVersion request to a byte slice.
func queryVersionRequest(c *xgb.Conn) []byte {
size := 4
b := 0
@ -218,34 +219,36 @@ func queryVersionRequest(c *xgb.Conn) []byte {
return buf
}
// Request QueryDirectRenderingCapable
// size: 8
// QueryDirectRenderingCapableCookie is a cookie used only for QueryDirectRenderingCapable requests.
type QueryDirectRenderingCapableCookie struct {
*xgb.Cookie
}
// QueryDirectRenderingCapable sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryDirectRenderingCapableCookie.Reply()
func QueryDirectRenderingCapable(c *xgb.Conn, Screen uint32) QueryDirectRenderingCapableCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryDirectRenderingCapableRequest(c, Screen), cookie)
return QueryDirectRenderingCapableCookie{cookie}
}
// QueryDirectRenderingCapableUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryDirectRenderingCapableUnchecked(c *xgb.Conn, Screen uint32) QueryDirectRenderingCapableCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryDirectRenderingCapableRequest(c, Screen), cookie)
return QueryDirectRenderingCapableCookie{cookie}
}
// Request reply for QueryDirectRenderingCapable
// size: 9
// QueryDirectRenderingCapableReply represents the data returned from a QueryDirectRenderingCapable request.
type QueryDirectRenderingCapableReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
IsCapable bool
}
// Waits and reads reply data from request QueryDirectRenderingCapable
// Reply blocks and returns the reply data for a QueryDirectRenderingCapable request.
func (cook QueryDirectRenderingCapableCookie) Reply() (*QueryDirectRenderingCapableReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -257,7 +260,7 @@ func (cook QueryDirectRenderingCapableCookie) Reply() (*QueryDirectRenderingCapa
return queryDirectRenderingCapableReply(buf), nil
}
// Read reply into structure from buffer for QueryDirectRenderingCapable
// queryDirectRenderingCapableReply reads a byte slice into a QueryDirectRenderingCapableReply value.
func queryDirectRenderingCapableReply(buf []byte) *QueryDirectRenderingCapableReply {
v := new(QueryDirectRenderingCapableReply)
b := 1 // skip reply determinant
@ -281,6 +284,7 @@ func queryDirectRenderingCapableReply(buf []byte) *QueryDirectRenderingCapableRe
}
// Write request to wire for QueryDirectRenderingCapable
// queryDirectRenderingCapableRequest writes a QueryDirectRenderingCapable request to a byte slice.
func queryDirectRenderingCapableRequest(c *xgb.Conn, Screen uint32) []byte {
size := 8
b := 0
@ -301,29 +305,31 @@ func queryDirectRenderingCapableRequest(c *xgb.Conn, Screen uint32) []byte {
return buf
}
// Request OpenConnection
// size: 8
// OpenConnectionCookie is a cookie used only for OpenConnection requests.
type OpenConnectionCookie struct {
*xgb.Cookie
}
// OpenConnection sends a checked request.
// If an error occurs, it will be returned with the reply by calling OpenConnectionCookie.Reply()
func OpenConnection(c *xgb.Conn, Screen uint32) OpenConnectionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(openConnectionRequest(c, Screen), cookie)
return OpenConnectionCookie{cookie}
}
// OpenConnectionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func OpenConnectionUnchecked(c *xgb.Conn, Screen uint32) OpenConnectionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(openConnectionRequest(c, Screen), cookie)
return OpenConnectionCookie{cookie}
}
// Request reply for OpenConnection
// size: (32 + xgb.Pad((int(BusIdLen) * 1)))
// OpenConnectionReply represents the data returned from a OpenConnection request.
type OpenConnectionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
SareaHandleLow uint32
SareaHandleHigh uint32
@ -332,7 +338,7 @@ type OpenConnectionReply struct {
BusId string // size: xgb.Pad((int(BusIdLen) * 1))
}
// Waits and reads reply data from request OpenConnection
// Reply blocks and returns the reply data for a OpenConnection request.
func (cook OpenConnectionCookie) Reply() (*OpenConnectionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -344,7 +350,7 @@ func (cook OpenConnectionCookie) Reply() (*OpenConnectionReply, error) {
return openConnectionReply(buf), nil
}
// Read reply into structure from buffer for OpenConnection
// openConnectionReply reads a byte slice into a OpenConnectionReply value.
func openConnectionReply(buf []byte) *OpenConnectionReply {
v := new(OpenConnectionReply)
b := 1 // skip reply determinant
@ -379,6 +385,7 @@ func openConnectionReply(buf []byte) *OpenConnectionReply {
}
// Write request to wire for OpenConnection
// openConnectionRequest writes a OpenConnection request to a byte slice.
func openConnectionRequest(c *xgb.Conn, Screen uint32) []byte {
size := 8
b := 0
@ -399,30 +406,35 @@ func openConnectionRequest(c *xgb.Conn, Screen uint32) []byte {
return buf
}
// Request CloseConnection
// size: 8
// CloseConnectionCookie is a cookie used only for CloseConnection requests.
type CloseConnectionCookie struct {
*xgb.Cookie
}
// Write request to wire for CloseConnection
// CloseConnection sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func CloseConnection(c *xgb.Conn, Screen uint32) CloseConnectionCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(closeConnectionRequest(c, Screen), cookie)
return CloseConnectionCookie{cookie}
}
// CloseConnectionChecked sends a checked request.
// If an error occurs, it can be retrieved using CloseConnectionCookie.Check()
func CloseConnectionChecked(c *xgb.Conn, Screen uint32) CloseConnectionCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(closeConnectionRequest(c, Screen), cookie)
return CloseConnectionCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook CloseConnectionCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for CloseConnection
// closeConnectionRequest writes a CloseConnection request to a byte slice.
func closeConnectionRequest(c *xgb.Conn, Screen uint32) []byte {
size := 8
b := 0
@ -443,29 +455,31 @@ func closeConnectionRequest(c *xgb.Conn, Screen uint32) []byte {
return buf
}
// Request GetClientDriverName
// size: 8
// GetClientDriverNameCookie is a cookie used only for GetClientDriverName requests.
type GetClientDriverNameCookie struct {
*xgb.Cookie
}
// GetClientDriverName sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetClientDriverNameCookie.Reply()
func GetClientDriverName(c *xgb.Conn, Screen uint32) GetClientDriverNameCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getClientDriverNameRequest(c, Screen), cookie)
return GetClientDriverNameCookie{cookie}
}
// GetClientDriverNameUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetClientDriverNameUnchecked(c *xgb.Conn, Screen uint32) GetClientDriverNameCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getClientDriverNameRequest(c, Screen), cookie)
return GetClientDriverNameCookie{cookie}
}
// Request reply for GetClientDriverName
// size: (32 + xgb.Pad((int(ClientDriverNameLen) * 1)))
// GetClientDriverNameReply represents the data returned from a GetClientDriverName request.
type GetClientDriverNameReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
ClientDriverMajorVersion uint32
ClientDriverMinorVersion uint32
@ -475,7 +489,7 @@ type GetClientDriverNameReply struct {
ClientDriverName string // size: xgb.Pad((int(ClientDriverNameLen) * 1))
}
// Waits and reads reply data from request GetClientDriverName
// Reply blocks and returns the reply data for a GetClientDriverName request.
func (cook GetClientDriverNameCookie) Reply() (*GetClientDriverNameReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -487,7 +501,7 @@ func (cook GetClientDriverNameCookie) Reply() (*GetClientDriverNameReply, error)
return getClientDriverNameReply(buf), nil
}
// Read reply into structure from buffer for GetClientDriverName
// getClientDriverNameReply reads a byte slice into a GetClientDriverNameReply value.
func getClientDriverNameReply(buf []byte) *GetClientDriverNameReply {
v := new(GetClientDriverNameReply)
b := 1 // skip reply determinant
@ -525,6 +539,7 @@ func getClientDriverNameReply(buf []byte) *GetClientDriverNameReply {
}
// Write request to wire for GetClientDriverName
// getClientDriverNameRequest writes a GetClientDriverName request to a byte slice.
func getClientDriverNameRequest(c *xgb.Conn, Screen uint32) []byte {
size := 8
b := 0
@ -545,34 +560,36 @@ func getClientDriverNameRequest(c *xgb.Conn, Screen uint32) []byte {
return buf
}
// Request CreateContext
// size: 16
// CreateContextCookie is a cookie used only for CreateContext requests.
type CreateContextCookie struct {
*xgb.Cookie
}
// CreateContext sends a checked request.
// If an error occurs, it will be returned with the reply by calling CreateContextCookie.Reply()
func CreateContext(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) CreateContextCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(createContextRequest(c, Screen, Visual, Context), cookie)
return CreateContextCookie{cookie}
}
// CreateContextUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func CreateContextUnchecked(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) CreateContextCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(createContextRequest(c, Screen, Visual, Context), cookie)
return CreateContextCookie{cookie}
}
// Request reply for CreateContext
// size: 12
// CreateContextReply represents the data returned from a CreateContext request.
type CreateContextReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
HwContext uint32
}
// Waits and reads reply data from request CreateContext
// Reply blocks and returns the reply data for a CreateContext request.
func (cook CreateContextCookie) Reply() (*CreateContextReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -584,7 +601,7 @@ func (cook CreateContextCookie) Reply() (*CreateContextReply, error) {
return createContextReply(buf), nil
}
// Read reply into structure from buffer for CreateContext
// createContextReply reads a byte slice into a CreateContextReply value.
func createContextReply(buf []byte) *CreateContextReply {
v := new(CreateContextReply)
b := 1 // skip reply determinant
@ -604,6 +621,7 @@ func createContextReply(buf []byte) *CreateContextReply {
}
// Write request to wire for CreateContext
// createContextRequest writes a CreateContext request to a byte slice.
func createContextRequest(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) []byte {
size := 16
b := 0
@ -630,30 +648,35 @@ func createContextRequest(c *xgb.Conn, Screen uint32, Visual uint32, Context uin
return buf
}
// Request DestroyContext
// size: 12
// DestroyContextCookie is a cookie used only for DestroyContext requests.
type DestroyContextCookie struct {
*xgb.Cookie
}
// Write request to wire for DestroyContext
// DestroyContext sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func DestroyContext(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(destroyContextRequest(c, Screen, Context), cookie)
return DestroyContextCookie{cookie}
}
// DestroyContextChecked sends a checked request.
// If an error occurs, it can be retrieved using DestroyContextCookie.Check()
func DestroyContextChecked(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(destroyContextRequest(c, Screen, Context), cookie)
return DestroyContextCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook DestroyContextCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for DestroyContext
// destroyContextRequest writes a DestroyContext request to a byte slice.
func destroyContextRequest(c *xgb.Conn, Screen uint32, Context uint32) []byte {
size := 12
b := 0
@ -677,34 +700,36 @@ func destroyContextRequest(c *xgb.Conn, Screen uint32, Context uint32) []byte {
return buf
}
// Request CreateDrawable
// size: 12
// CreateDrawableCookie is a cookie used only for CreateDrawable requests.
type CreateDrawableCookie struct {
*xgb.Cookie
}
// CreateDrawable sends a checked request.
// If an error occurs, it will be returned with the reply by calling CreateDrawableCookie.Reply()
func CreateDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(createDrawableRequest(c, Screen, Drawable), cookie)
return CreateDrawableCookie{cookie}
}
// CreateDrawableUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func CreateDrawableUnchecked(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(createDrawableRequest(c, Screen, Drawable), cookie)
return CreateDrawableCookie{cookie}
}
// Request reply for CreateDrawable
// size: 12
// CreateDrawableReply represents the data returned from a CreateDrawable request.
type CreateDrawableReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
HwDrawableHandle uint32
}
// Waits and reads reply data from request CreateDrawable
// Reply blocks and returns the reply data for a CreateDrawable request.
func (cook CreateDrawableCookie) Reply() (*CreateDrawableReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -716,7 +741,7 @@ func (cook CreateDrawableCookie) Reply() (*CreateDrawableReply, error) {
return createDrawableReply(buf), nil
}
// Read reply into structure from buffer for CreateDrawable
// createDrawableReply reads a byte slice into a CreateDrawableReply value.
func createDrawableReply(buf []byte) *CreateDrawableReply {
v := new(CreateDrawableReply)
b := 1 // skip reply determinant
@ -736,6 +761,7 @@ func createDrawableReply(buf []byte) *CreateDrawableReply {
}
// Write request to wire for CreateDrawable
// createDrawableRequest writes a CreateDrawable request to a byte slice.
func createDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte {
size := 12
b := 0
@ -759,30 +785,35 @@ func createDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte {
return buf
}
// Request DestroyDrawable
// size: 12
// DestroyDrawableCookie is a cookie used only for DestroyDrawable requests.
type DestroyDrawableCookie struct {
*xgb.Cookie
}
// Write request to wire for DestroyDrawable
// DestroyDrawable sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func DestroyDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawableCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(destroyDrawableRequest(c, Screen, Drawable), cookie)
return DestroyDrawableCookie{cookie}
}
// DestroyDrawableChecked sends a checked request.
// If an error occurs, it can be retrieved using DestroyDrawableCookie.Check()
func DestroyDrawableChecked(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawableCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(destroyDrawableRequest(c, Screen, Drawable), cookie)
return DestroyDrawableCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook DestroyDrawableCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for DestroyDrawable
// destroyDrawableRequest writes a DestroyDrawable request to a byte slice.
func destroyDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte {
size := 12
b := 0
@ -806,29 +837,31 @@ func destroyDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte
return buf
}
// Request GetDrawableInfo
// size: 12
// GetDrawableInfoCookie is a cookie used only for GetDrawableInfo requests.
type GetDrawableInfoCookie struct {
*xgb.Cookie
}
// GetDrawableInfo sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetDrawableInfoCookie.Reply()
func GetDrawableInfo(c *xgb.Conn, Screen uint32, Drawable uint32) GetDrawableInfoCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getDrawableInfoRequest(c, Screen, Drawable), cookie)
return GetDrawableInfoCookie{cookie}
}
// GetDrawableInfoUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetDrawableInfoUnchecked(c *xgb.Conn, Screen uint32, Drawable uint32) GetDrawableInfoCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getDrawableInfoRequest(c, Screen, Drawable), cookie)
return GetDrawableInfoCookie{cookie}
}
// Request reply for GetDrawableInfo
// size: ((36 + xgb.Pad((int(NumClipRects) * 8))) + xgb.Pad((int(NumBackClipRects) * 8)))
// GetDrawableInfoReply represents the data returned from a GetDrawableInfo request.
type GetDrawableInfoReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
DrawableTableIndex uint32
DrawableTableStamp uint32
@ -844,7 +877,7 @@ type GetDrawableInfoReply struct {
BackClipRects []DrmClipRect // size: xgb.Pad((int(NumBackClipRects) * 8))
}
// Waits and reads reply data from request GetDrawableInfo
// Reply blocks and returns the reply data for a GetDrawableInfo request.
func (cook GetDrawableInfoCookie) Reply() (*GetDrawableInfoReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -856,7 +889,7 @@ func (cook GetDrawableInfoCookie) Reply() (*GetDrawableInfoReply, error) {
return getDrawableInfoReply(buf), nil
}
// Read reply into structure from buffer for GetDrawableInfo
// getDrawableInfoReply reads a byte slice into a GetDrawableInfoReply value.
func getDrawableInfoReply(buf []byte) *GetDrawableInfoReply {
v := new(GetDrawableInfoReply)
b := 1 // skip reply determinant
@ -909,6 +942,7 @@ func getDrawableInfoReply(buf []byte) *GetDrawableInfoReply {
}
// Write request to wire for GetDrawableInfo
// getDrawableInfoRequest writes a GetDrawableInfo request to a byte slice.
func getDrawableInfoRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte {
size := 12
b := 0
@ -932,29 +966,31 @@ func getDrawableInfoRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte
return buf
}
// Request GetDeviceInfo
// size: 8
// GetDeviceInfoCookie is a cookie used only for GetDeviceInfo requests.
type GetDeviceInfoCookie struct {
*xgb.Cookie
}
// GetDeviceInfo sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetDeviceInfoCookie.Reply()
func GetDeviceInfo(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getDeviceInfoRequest(c, Screen), cookie)
return GetDeviceInfoCookie{cookie}
}
// GetDeviceInfoUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetDeviceInfoUnchecked(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getDeviceInfoRequest(c, Screen), cookie)
return GetDeviceInfoCookie{cookie}
}
// Request reply for GetDeviceInfo
// size: (32 + xgb.Pad((int(DevicePrivateSize) * 4)))
// GetDeviceInfoReply represents the data returned from a GetDeviceInfo request.
type GetDeviceInfoReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
FramebufferHandleLow uint32
FramebufferHandleHigh uint32
@ -965,7 +1001,7 @@ type GetDeviceInfoReply struct {
DevicePrivate []uint32 // size: xgb.Pad((int(DevicePrivateSize) * 4))
}
// Waits and reads reply data from request GetDeviceInfo
// Reply blocks and returns the reply data for a GetDeviceInfo request.
func (cook GetDeviceInfoCookie) Reply() (*GetDeviceInfoReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -977,7 +1013,7 @@ func (cook GetDeviceInfoCookie) Reply() (*GetDeviceInfoReply, error) {
return getDeviceInfoReply(buf), nil
}
// Read reply into structure from buffer for GetDeviceInfo
// getDeviceInfoReply reads a byte slice into a GetDeviceInfoReply value.
func getDeviceInfoReply(buf []byte) *GetDeviceInfoReply {
v := new(GetDeviceInfoReply)
b := 1 // skip reply determinant
@ -1019,6 +1055,7 @@ func getDeviceInfoReply(buf []byte) *GetDeviceInfoReply {
}
// Write request to wire for GetDeviceInfo
// getDeviceInfoRequest writes a GetDeviceInfo request to a byte slice.
func getDeviceInfoRequest(c *xgb.Conn, Screen uint32) []byte {
size := 8
b := 0
@ -1039,34 +1076,36 @@ func getDeviceInfoRequest(c *xgb.Conn, Screen uint32) []byte {
return buf
}
// Request AuthConnection
// size: 12
// AuthConnectionCookie is a cookie used only for AuthConnection requests.
type AuthConnectionCookie struct {
*xgb.Cookie
}
// AuthConnection sends a checked request.
// If an error occurs, it will be returned with the reply by calling AuthConnectionCookie.Reply()
func AuthConnection(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(authConnectionRequest(c, Screen, Magic), cookie)
return AuthConnectionCookie{cookie}
}
// AuthConnectionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func AuthConnectionUnchecked(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(authConnectionRequest(c, Screen, Magic), cookie)
return AuthConnectionCookie{cookie}
}
// Request reply for AuthConnection
// size: 12
// AuthConnectionReply represents the data returned from a AuthConnection request.
type AuthConnectionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
Authenticated uint32
}
// Waits and reads reply data from request AuthConnection
// Reply blocks and returns the reply data for a AuthConnection request.
func (cook AuthConnectionCookie) Reply() (*AuthConnectionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -1078,7 +1117,7 @@ func (cook AuthConnectionCookie) Reply() (*AuthConnectionReply, error) {
return authConnectionReply(buf), nil
}
// Read reply into structure from buffer for AuthConnection
// authConnectionReply reads a byte slice into a AuthConnectionReply value.
func authConnectionReply(buf []byte) *AuthConnectionReply {
v := new(AuthConnectionReply)
b := 1 // skip reply determinant
@ -1098,6 +1137,7 @@ func authConnectionReply(buf []byte) *AuthConnectionReply {
}
// Write request to wire for AuthConnection
// authConnectionRequest writes a AuthConnection request to a byte slice.
func authConnectionRequest(c *xgb.Conn, Screen uint32, Magic uint32) []byte {
size := 12
b := 0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -118,7 +118,6 @@ func (c *Conn) Close() {
// Event is an interface that can contain any of the events returned by the
// server. Use a type assertion switch to extract the Event structs.
type Event interface {
ImplementsEvent()
Bytes() []byte
String() string
}
@ -141,7 +140,6 @@ var NewExtEventFuncs = make(map[string]map[int]NewEventFun)
// Error is an interface that can contain any of the errors returned by
// the server. Use a type assertion switch to extract the Error structs.
type Error interface {
ImplementsError()
SequenceId() uint16
BadId() uint32
Error() string

View File

@ -6,9 +6,7 @@ import (
// Error types
func (e *Error) Define(c *Context) {
c.Putln("// Error definition %s (%d)", e.SrcName(), e.Number)
c.Putln("// Size: %s", e.Size())
c.Putln("")
c.Putln("// %s is the error number for a %s.", e.ErrConst(), e.ErrConst())
c.Putln("const %s = %d", e.ErrConst(), e.Number)
c.Putln("")
c.Putln("type %s struct {", e.ErrType())
@ -40,7 +38,8 @@ func (e *Error) Define(c *Context) {
}
func (e *Error) Read(c *Context) {
c.Putln("// Error read %s", e.SrcName())
c.Putln("// %sNew constructs a %s value that implements xgb.Error from "+
"a byte slice.", e.ErrType(), e.ErrType())
c.Putln("func %sNew(buf []byte) xgb.Error {", e.ErrType())
c.Putln("v := %s{}", e.ErrType())
c.Putln("v.NiceName = \"%s\"", e.SrcName())
@ -62,8 +61,9 @@ func (e *Error) Read(c *Context) {
// ImplementsError writes functions to implement the XGB Error interface.
func (e *Error) ImplementsError(c *Context) {
c.Putln("func (err %s) ImplementsError() { }", e.ErrType())
c.Putln("")
c.Putln("// SequenceId returns the sequence id attached to the %s error.",
e.ErrConst())
c.Putln("// This is mostly used internally.")
c.Putln("func (err %s) SequenceId() uint16 {", e.ErrType())
c.Putln("return err.Sequence")
c.Putln("}")
@ -84,8 +84,7 @@ func (e *Error) ImplementsError(c *Context) {
// ErrorCopy types
func (e *ErrorCopy) Define(c *Context) {
c.Putln("// ErrorCopy definition %s (%d)", e.SrcName(), e.Number)
c.Putln("")
c.Putln("// %s is the error number for a %s.", e.ErrConst(), e.ErrConst())
c.Putln("const %s = %d", e.ErrConst(), e.Number)
c.Putln("")
c.Putln("type %s %s", e.ErrType(), e.Old.(*Error).ErrType())
@ -111,6 +110,8 @@ func (e *ErrorCopy) Define(c *Context) {
}
func (e *ErrorCopy) Read(c *Context) {
c.Putln("// %sNew constructs a %s value that implements xgb.Error from "+
"a byte slice.", e.ErrType(), e.ErrType())
c.Putln("func %sNew(buf []byte) xgb.Error {", e.ErrType())
c.Putln("v := %s(%sNew(buf).(%s))",
e.ErrType(), e.Old.(*Error).ErrType(), e.Old.(*Error).ErrType())
@ -122,8 +123,9 @@ func (e *ErrorCopy) Read(c *Context) {
// ImplementsError writes functions to implement the XGB Error interface.
func (e *ErrorCopy) ImplementsError(c *Context) {
c.Putln("func (err %s) ImplementsError() { }", e.ErrType())
c.Putln("")
c.Putln("// SequenceId returns the sequence id attached to the %s error.",
e.ErrConst())
c.Putln("// This is mostly used internally.")
c.Putln("func (err %s) SequenceId() uint16 {", e.ErrType())
c.Putln("return err.Sequence")
c.Putln("}")

View File

@ -6,9 +6,7 @@ import (
// Event types
func (e *Event) Define(c *Context) {
c.Putln("// Event definition %s (%d)", e.SrcName(), e.Number)
c.Putln("// Size: %s", e.Size())
c.Putln("")
c.Putln("// %s is the event number for a %s.", e.SrcName(), e.EvType())
c.Putln("const %s = %d", e.SrcName(), e.Number)
c.Putln("")
c.Putln("type %s struct {", e.EvType())
@ -30,8 +28,10 @@ func (e *Event) Define(c *Context) {
e.Write(c)
// Makes sure that this event type is an Event interface.
c.Putln("func (v %s) ImplementsEvent() { }", e.EvType())
c.Putln("")
c.Putln("// SequenceId returns the sequence id attached to the %s event.",
e.SrcName())
c.Putln("// Events without a sequence number (KeymapNotify) return 0.")
c.Putln("// This is mostly used internally.")
c.Putln("func (v %s) SequenceId() uint16 {", e.EvType())
if e.NoSequence {
c.Putln("return uint16(0)")
@ -40,6 +40,8 @@ func (e *Event) Define(c *Context) {
}
c.Putln("}")
c.Putln("")
c.Putln("// String is a rudimentary string representation of %s.",
e.EvType())
c.Putln("func (v %s) String() string {", e.EvType())
EventFieldString(c, e.Fields, e.SrcName())
c.Putln("}")
@ -58,7 +60,8 @@ func (e *Event) Define(c *Context) {
}
func (e *Event) Read(c *Context) {
c.Putln("// Event read %s", e.SrcName())
c.Putln("// %sNew constructs a %s value that implements xgb.Event from "+
"a byte slice.", e.EvType(), e.EvType())
c.Putln("func %sNew(buf []byte) xgb.Event {", e.EvType())
c.Putln("v := %s{}", e.EvType())
c.Putln("b := 1 // don't read event number")
@ -78,7 +81,7 @@ func (e *Event) Read(c *Context) {
}
func (e *Event) Write(c *Context) {
c.Putln("// Event write %s", e.SrcName())
c.Putln("// Bytes writes a %s value to a byte slice.", e.EvType())
c.Putln("func (v %s) Bytes() []byte {", e.EvType())
c.Putln("buf := make([]byte, %s)", e.Size())
c.Putln("b := 0")
@ -102,8 +105,7 @@ func (e *Event) Write(c *Context) {
// EventCopy types
func (e *EventCopy) Define(c *Context) {
c.Putln("// EventCopy definition %s (%d)", e.SrcName(), e.Number)
c.Putln("")
c.Putln("// %s is the event number for a %s.", e.SrcName(), e.EvType())
c.Putln("const %s = %d", e.SrcName(), e.Number)
c.Putln("")
c.Putln("type %s %s", e.EvType(), e.Old.(*Event).EvType())
@ -118,8 +120,10 @@ func (e *EventCopy) Define(c *Context) {
e.Write(c)
// Makes sure that this event type is an Event interface.
c.Putln("func (v %s) ImplementsEvent() { }", e.EvType())
c.Putln("")
c.Putln("// SequenceId returns the sequence id attached to the %s event.",
e.SrcName())
c.Putln("// Events without a sequence number (KeymapNotify) return 0.")
c.Putln("// This is mostly used internally.")
c.Putln("func (v %s) SequenceId() uint16 {", e.EvType())
if e.Old.(*Event).NoSequence {
c.Putln("return uint16(0)")
@ -146,6 +150,8 @@ func (e *EventCopy) Define(c *Context) {
}
func (e *EventCopy) Read(c *Context) {
c.Putln("// %sNew constructs a %s value that implements xgb.Event from "+
"a byte slice.", e.EvType(), e.EvType())
c.Putln("func %sNew(buf []byte) xgb.Event {", e.EvType())
c.Putln("return %s(%sNew(buf).(%s))",
e.EvType(), e.Old.(*Event).EvType(), e.Old.(*Event).EvType())
@ -154,6 +160,7 @@ func (e *EventCopy) Read(c *Context) {
}
func (e *EventCopy) Write(c *Context) {
c.Putln("// Bytes writes a %s value to a byte slice.", e.EvType())
c.Putln("func (v %s) Bytes() []byte {", e.EvType())
c.Putln("return %s(v).Bytes()", e.Old.(*Event).EvType())
c.Putln("}")

View File

@ -6,13 +6,16 @@ import (
)
func (r *Request) Define(c *Context) {
c.Putln("// Request %s", r.SrcName())
c.Putln("// size: %s", r.Size(c))
c.Putln("// %s is a cookie used only for %s requests.",
r.CookieName(), r.SrcName())
c.Putln("type %s struct {", r.CookieName())
c.Putln("*xgb.Cookie")
c.Putln("}")
c.Putln("")
if r.Reply != nil {
c.Putln("// %s sends a checked request.", r.SrcName())
c.Putln("// If an error occurs, it will be returned with the reply "+
"by calling %s.Reply()", r.CookieName())
c.Putln("func %s(c *xgb.Conn, %s) %s {",
r.SrcName(), r.ParamNameTypes(), r.CookieName())
c.Putln("cookie := c.NewCookie(true, true)")
@ -21,6 +24,9 @@ func (r *Request) Define(c *Context) {
c.Putln("}")
c.Putln("")
c.Putln("// %sUnchecked sends an unchecked request.", r.SrcName())
c.Putln("// If an error occurs, it can only be retrieved using " +
"xgb.WaitForEvent or xgb.PollForEvent.")
c.Putln("func %sUnchecked(c *xgb.Conn, %s) %s {",
r.SrcName(), r.ParamNameTypes(), r.CookieName())
c.Putln("cookie := c.NewCookie(false, true)")
@ -31,7 +37,9 @@ func (r *Request) Define(c *Context) {
r.ReadReply(c)
} else {
c.Putln("// Write request to wire for %s", r.SrcName())
c.Putln("// %s sends an unchecked request.", r.SrcName())
c.Putln("// If an error occurs, it can only be retrieved using " +
"xgb.WaitForEvent or xgb.PollForEvent.")
c.Putln("func %s(c *xgb.Conn, %s) %s {",
r.SrcName(), r.ParamNameTypes(), r.CookieName())
c.Putln("cookie := c.NewCookie(false, false)")
@ -40,6 +48,9 @@ func (r *Request) Define(c *Context) {
c.Putln("}")
c.Putln("")
c.Putln("// %sChecked sends a checked request.", r.SrcName())
c.Putln("// If an error occurs, it can be retrieved using "+
"%s.Check()", r.CookieName())
c.Putln("func %sChecked(c *xgb.Conn, %s) %s {",
r.SrcName(), r.ParamNameTypes(), r.CookieName())
c.Putln("cookie := c.NewCookie(true, false)")
@ -48,6 +59,10 @@ func (r *Request) Define(c *Context) {
c.Putln("}")
c.Putln("")
c.Putln("// Check returns an error if one occurred for checked " +
"requests that are not expecting a reply.")
c.Putln("// This cannot be called for requests expecting a reply, " +
"nor for unchecked requests.")
c.Putln("func (cook %s) Check() error {", r.CookieName())
c.Putln("return cook.Cookie.Check()")
c.Putln("}")
@ -57,18 +72,19 @@ func (r *Request) Define(c *Context) {
}
func (r *Request) ReadReply(c *Context) {
c.Putln("// Request reply for %s", r.SrcName())
c.Putln("// size: %s", r.Reply.Size())
c.Putln("// %s represents the data returned from a %s request.",
r.ReplyTypeName(), r.SrcName())
c.Putln("type %s struct {", r.ReplyTypeName())
c.Putln("Sequence uint16")
c.Putln("Length uint32")
c.Putln("Sequence uint16 // sequence number of the request for this reply")
c.Putln("Length uint32 // number of bytes in this reply")
for _, field := range r.Reply.Fields {
field.Define(c)
}
c.Putln("}")
c.Putln("")
c.Putln("// Waits and reads reply data from request %s", r.SrcName())
c.Putln("// Reply blocks and returns the reply data for a %s request.",
r.SrcName())
c.Putln("func (cook %s) Reply() (*%s, error) {",
r.CookieName(), r.ReplyTypeName())
c.Putln("buf, err := cook.Cookie.Reply()")
@ -82,7 +98,8 @@ func (r *Request) ReadReply(c *Context) {
c.Putln("}")
c.Putln("")
c.Putln("// Read reply into structure from buffer for %s", r.SrcName())
c.Putln("// %s reads a byte slice into a %s value.",
r.ReplyName(), r.ReplyTypeName())
c.Putln("func %s(buf []byte) *%s {",
r.ReplyName(), r.ReplyTypeName())
c.Putln("v := new(%s)", r.ReplyTypeName())
@ -113,6 +130,8 @@ func (r *Request) WriteRequest(c *Context) {
c.Putln("")
}
c.Putln("// Write request to wire for %s", r.SrcName())
c.Putln("// %s writes a %s request to a byte slice.",
r.ReqName(), r.SrcName())
c.Putln("func %s(c *xgb.Conn, %s) []byte {",
r.ReqName(), r.ParamNameTypes())
c.Putln("size := %s", r.Size(c))

View File

@ -1,8 +1,6 @@
package main
func (s *Struct) Define(c *Context) {
c.Putln("// '%s' struct definition", s.SrcName())
c.Putln("// Size: %s", s.Size())
c.Putln("type %s struct {", s.SrcName())
for _, field := range s.Fields {
field.Define(c)
@ -34,7 +32,8 @@ func (s *Struct) Define(c *Context) {
// the number of bytes read off the buffer.
// 'ReadStructName' should only be used to read raw reply data from the wire.
func (s *Struct) Read(c *Context) {
c.Putln("// Struct read %s", s.SrcName())
c.Putln("// %sRead reads a byte slice into a %s value.",
s.SrcName(), s.SrcName())
c.Putln("func %sRead(buf []byte, v *%s) int {", s.SrcName(), s.SrcName())
c.Putln("b := 0")
@ -53,10 +52,10 @@ func (s *Struct) Read(c *Context) {
// a source (i.e., the buffer) byte slice, and a destination slice and returns
// the number of bytes read from the byte slice.
func (s *Struct) ReadList(c *Context) {
c.Putln("// Struct list read %s", s.SrcName())
c.Putln("// %sReadList reads a byte slice into a list of %s values.",
s.SrcName(), s.SrcName())
c.Putln("func %sReadList(buf []byte, dest []%s) int {",
s.SrcName(), s.SrcName())
c.Putln("b := 0")
c.Putln("for i := 0; i < len(dest); i++ {")
c.Putln("dest[i] = %s{}", s.SrcName())
@ -70,7 +69,7 @@ func (s *Struct) ReadList(c *Context) {
}
func (s *Struct) Write(c *Context) {
c.Putln("// Struct write %s", s.SrcName())
c.Putln("// Bytes writes a %s value to a byte slice.", s.SrcName())
c.Putln("func (v %s) Bytes() []byte {", s.SrcName())
c.Putln("buf := make([]byte, %s)", s.Size().Reduce("v."))
c.Putln("b := 0")
@ -85,7 +84,8 @@ func (s *Struct) Write(c *Context) {
}
func (s *Struct) WriteList(c *Context) {
c.Putln("// Write struct list %s", s.SrcName())
c.Putln("// %sListBytes writes a list of %s values to a byte slice.",
s.SrcName())
c.Putln("func %sListBytes(buf []byte, list []%s) int {",
s.SrcName(), s.SrcName())
c.Putln("b := 0")
@ -101,7 +101,8 @@ func (s *Struct) WriteList(c *Context) {
}
func (s *Struct) WriteListSize(c *Context) {
c.Putln("// Struct list size %s", s.SrcName())
c.Putln("// %sListSize computes the size (bytes) of a list of %s values.",
s.SrcName(), s.SrcName())
c.Putln("func %sListSize(list []%s) int {", s.SrcName(), s.SrcName())
c.Putln("size := 0")
if s.Size().Expression.Concrete() {

View File

@ -2,7 +2,8 @@ package main
// Union types
func (u *Union) Define(c *Context) {
c.Putln("// Union definition %s", u.SrcName())
c.Putln("// %s is a represention of the %s union type.",
u.SrcName(), u.SrcName())
c.Putln("// Note that to *create* a Union, you should *never* create")
c.Putln("// this struct directly (unless you know what you're doing).")
c.Putln("// Instead use one of the following constructors for '%s':",
@ -38,8 +39,8 @@ func (u *Union) Define(c *Context) {
func (u *Union) New(c *Context) {
for _, field := range u.Fields {
c.Putln("// Union constructor for %s for field %s.",
u.SrcName(), field.SrcName())
c.Putln("// %s%sNew constructs a new %s union type with the %s field.",
u.SrcName(), field.SrcName(), u.SrcName(), field.SrcName())
c.Putln("func %s%sNew(%s %s) %s {",
u.SrcName(), field.SrcName(), field.SrcName(),
field.SrcType(), u.SrcName())
@ -65,7 +66,8 @@ func (u *Union) New(c *Context) {
}
func (u *Union) Read(c *Context) {
c.Putln("// Union read %s", u.SrcName())
c.Putln("// %sRead reads a byte slice into a %s value.",
u.SrcName(), u.SrcName())
c.Putln("func %sRead(buf []byte, v *%s) int {", u.SrcName(), u.SrcName())
c.Putln("var b int")
c.Putln("")
@ -80,7 +82,8 @@ func (u *Union) Read(c *Context) {
}
func (u *Union) ReadList(c *Context) {
c.Putln("// Union list read %s", u.SrcName())
c.Putln("// %sReadList reads a byte slice into a list of %s values.",
u.SrcName(), u.SrcName())
c.Putln("func %sReadList(buf []byte, dest []%s) int {",
u.SrcName(), u.SrcName())
c.Putln("b := 0")
@ -99,7 +102,7 @@ func (u *Union) ReadList(c *Context) {
// *same* *fixed* size. Thus, we make sure to always read bytes into
// every field which allows us to simply pick the first field and write it.
func (u *Union) Write(c *Context) {
c.Putln("// Union write %s", u.SrcName())
c.Putln("// Bytes writes a %s value to a byte slice.", u.SrcName())
c.Putln("// Each field in a union must contain the same data.")
c.Putln("// So simply pick the first field and write that to the wire.")
c.Putln("func (v %s) Bytes() []byte {", u.SrcName())
@ -113,7 +116,8 @@ func (u *Union) Write(c *Context) {
}
func (u *Union) WriteList(c *Context) {
c.Putln("// Union list write %s", u.SrcName())
c.Putln("// %sListBytes writes a list of %s values to a byte slice.",
u.SrcName())
c.Putln("func %sListBytes(buf []byte, list []%s) int {",
u.SrcName(), u.SrcName())
c.Putln("b := 0")
@ -130,6 +134,8 @@ func (u *Union) WriteList(c *Context) {
func (u *Union) WriteListSize(c *Context) {
c.Putln("// Union list size %s", u.SrcName())
c.Putln("// %sListSize computes the size (bytes) of a list of %s values.",
u.SrcName())
c.Putln("func %sListSize(list []%s) int {", u.SrcName(), u.SrcName())
c.Putln("size := 0")
c.Putln("for _, item := range list {")

View File

@ -2,7 +2,7 @@
package xinerama
/*
This file was generated by xinerama.xml on May 10 2012 8:04:32pm EDT.
This file was generated by xinerama.xml on May 10 2012 11:56:19pm EDT.
This file is automatically generated. Edit at your peril!
*/
@ -64,8 +64,6 @@ func init() {
// Skipping definition for base type 'Card8'
// 'ScreenInfo' struct definition
// Size: 8
type ScreenInfo struct {
XOrg int16
YOrg int16
@ -73,7 +71,7 @@ type ScreenInfo struct {
Height uint16
}
// Struct read ScreenInfo
// ScreenInfoRead reads a byte slice into a ScreenInfo value.
func ScreenInfoRead(buf []byte, v *ScreenInfo) int {
b := 0
@ -92,7 +90,7 @@ func ScreenInfoRead(buf []byte, v *ScreenInfo) int {
return b
}
// Struct list read ScreenInfo
// ScreenInfoReadList reads a byte slice into a list of ScreenInfo values.
func ScreenInfoReadList(buf []byte, dest []ScreenInfo) int {
b := 0
for i := 0; i < len(dest); i++ {
@ -102,7 +100,7 @@ func ScreenInfoReadList(buf []byte, dest []ScreenInfo) int {
return xgb.Pad(b)
}
// Struct write ScreenInfo
// Bytes writes a ScreenInfo value to a byte slice.
func (v ScreenInfo) Bytes() []byte {
buf := make([]byte, 8)
b := 0
@ -122,7 +120,7 @@ func (v ScreenInfo) Bytes() []byte {
return buf
}
// Write struct list ScreenInfo
// ScreenInfoListBytes writes a list of %s(MISSING) values to a byte slice.
func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int {
b := 0
var structBytes []byte
@ -134,35 +132,37 @@ func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int {
return b
}
// Request QueryVersion
// size: 8
// QueryVersionCookie is a cookie used only for QueryVersion requests.
type QueryVersionCookie struct {
*xgb.Cookie
}
// QueryVersion sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()
func QueryVersion(c *xgb.Conn, Major byte, Minor byte) QueryVersionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryVersionRequest(c, Major, Minor), cookie)
return QueryVersionCookie{cookie}
}
// QueryVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryVersionUnchecked(c *xgb.Conn, Major byte, Minor byte) QueryVersionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryVersionRequest(c, Major, Minor), cookie)
return QueryVersionCookie{cookie}
}
// Request reply for QueryVersion
// size: 12
// QueryVersionReply represents the data returned from a QueryVersion request.
type QueryVersionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
Major uint16
Minor uint16
}
// Waits and reads reply data from request QueryVersion
// Reply blocks and returns the reply data for a QueryVersion request.
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -174,7 +174,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
return queryVersionReply(buf), nil
}
// Read reply into structure from buffer for QueryVersion
// queryVersionReply reads a byte slice into a QueryVersionReply value.
func queryVersionReply(buf []byte) *QueryVersionReply {
v := new(QueryVersionReply)
b := 1 // skip reply determinant
@ -197,6 +197,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
}
// Write request to wire for QueryVersion
// queryVersionRequest writes a QueryVersion request to a byte slice.
func queryVersionRequest(c *xgb.Conn, Major byte, Minor byte) []byte {
size := 8
b := 0
@ -220,34 +221,36 @@ func queryVersionRequest(c *xgb.Conn, Major byte, Minor byte) []byte {
return buf
}
// Request GetState
// size: 8
// GetStateCookie is a cookie used only for GetState requests.
type GetStateCookie struct {
*xgb.Cookie
}
// GetState sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetStateCookie.Reply()
func GetState(c *xgb.Conn, Window xproto.Window) GetStateCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getStateRequest(c, Window), cookie)
return GetStateCookie{cookie}
}
// GetStateUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetStateUnchecked(c *xgb.Conn, Window xproto.Window) GetStateCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getStateRequest(c, Window), cookie)
return GetStateCookie{cookie}
}
// Request reply for GetState
// size: 12
// GetStateReply represents the data returned from a GetState request.
type GetStateReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
State byte
Window xproto.Window
}
// Waits and reads reply data from request GetState
// Reply blocks and returns the reply data for a GetState request.
func (cook GetStateCookie) Reply() (*GetStateReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -259,7 +262,7 @@ func (cook GetStateCookie) Reply() (*GetStateReply, error) {
return getStateReply(buf), nil
}
// Read reply into structure from buffer for GetState
// getStateReply reads a byte slice into a GetStateReply value.
func getStateReply(buf []byte) *GetStateReply {
v := new(GetStateReply)
b := 1 // skip reply determinant
@ -280,6 +283,7 @@ func getStateReply(buf []byte) *GetStateReply {
}
// Write request to wire for GetState
// getStateRequest writes a GetState request to a byte slice.
func getStateRequest(c *xgb.Conn, Window xproto.Window) []byte {
size := 8
b := 0
@ -300,34 +304,36 @@ func getStateRequest(c *xgb.Conn, Window xproto.Window) []byte {
return buf
}
// Request GetScreenCount
// size: 8
// GetScreenCountCookie is a cookie used only for GetScreenCount requests.
type GetScreenCountCookie struct {
*xgb.Cookie
}
// GetScreenCount sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetScreenCountCookie.Reply()
func GetScreenCount(c *xgb.Conn, Window xproto.Window) GetScreenCountCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getScreenCountRequest(c, Window), cookie)
return GetScreenCountCookie{cookie}
}
// GetScreenCountUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetScreenCountUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenCountCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getScreenCountRequest(c, Window), cookie)
return GetScreenCountCookie{cookie}
}
// Request reply for GetScreenCount
// size: 12
// GetScreenCountReply represents the data returned from a GetScreenCount request.
type GetScreenCountReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
ScreenCount byte
Window xproto.Window
}
// Waits and reads reply data from request GetScreenCount
// Reply blocks and returns the reply data for a GetScreenCount request.
func (cook GetScreenCountCookie) Reply() (*GetScreenCountReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -339,7 +345,7 @@ func (cook GetScreenCountCookie) Reply() (*GetScreenCountReply, error) {
return getScreenCountReply(buf), nil
}
// Read reply into structure from buffer for GetScreenCount
// getScreenCountReply reads a byte slice into a GetScreenCountReply value.
func getScreenCountReply(buf []byte) *GetScreenCountReply {
v := new(GetScreenCountReply)
b := 1 // skip reply determinant
@ -360,6 +366,7 @@ func getScreenCountReply(buf []byte) *GetScreenCountReply {
}
// Write request to wire for GetScreenCount
// getScreenCountRequest writes a GetScreenCount request to a byte slice.
func getScreenCountRequest(c *xgb.Conn, Window xproto.Window) []byte {
size := 8
b := 0
@ -380,29 +387,31 @@ func getScreenCountRequest(c *xgb.Conn, Window xproto.Window) []byte {
return buf
}
// Request GetScreenSize
// size: 12
// GetScreenSizeCookie is a cookie used only for GetScreenSize requests.
type GetScreenSizeCookie struct {
*xgb.Cookie
}
// GetScreenSize sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetScreenSizeCookie.Reply()
func GetScreenSize(c *xgb.Conn, Window xproto.Window, Screen uint32) GetScreenSizeCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getScreenSizeRequest(c, Window, Screen), cookie)
return GetScreenSizeCookie{cookie}
}
// GetScreenSizeUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetScreenSizeUnchecked(c *xgb.Conn, Window xproto.Window, Screen uint32) GetScreenSizeCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getScreenSizeRequest(c, Window, Screen), cookie)
return GetScreenSizeCookie{cookie}
}
// Request reply for GetScreenSize
// size: 24
// GetScreenSizeReply represents the data returned from a GetScreenSize request.
type GetScreenSizeReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
Width uint32
Height uint32
@ -410,7 +419,7 @@ type GetScreenSizeReply struct {
Screen uint32
}
// Waits and reads reply data from request GetScreenSize
// Reply blocks and returns the reply data for a GetScreenSize request.
func (cook GetScreenSizeCookie) Reply() (*GetScreenSizeReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -422,7 +431,7 @@ func (cook GetScreenSizeCookie) Reply() (*GetScreenSizeReply, error) {
return getScreenSizeReply(buf), nil
}
// Read reply into structure from buffer for GetScreenSize
// getScreenSizeReply reads a byte slice into a GetScreenSizeReply value.
func getScreenSizeReply(buf []byte) *GetScreenSizeReply {
v := new(GetScreenSizeReply)
b := 1 // skip reply determinant
@ -451,6 +460,7 @@ func getScreenSizeReply(buf []byte) *GetScreenSizeReply {
}
// Write request to wire for GetScreenSize
// getScreenSizeRequest writes a GetScreenSize request to a byte slice.
func getScreenSizeRequest(c *xgb.Conn, Window xproto.Window, Screen uint32) []byte {
size := 12
b := 0
@ -474,34 +484,36 @@ func getScreenSizeRequest(c *xgb.Conn, Window xproto.Window, Screen uint32) []by
return buf
}
// Request IsActive
// size: 4
// IsActiveCookie is a cookie used only for IsActive requests.
type IsActiveCookie struct {
*xgb.Cookie
}
// IsActive sends a checked request.
// If an error occurs, it will be returned with the reply by calling IsActiveCookie.Reply()
func IsActive(c *xgb.Conn) IsActiveCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(isActiveRequest(c), cookie)
return IsActiveCookie{cookie}
}
// IsActiveUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func IsActiveUnchecked(c *xgb.Conn) IsActiveCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(isActiveRequest(c), cookie)
return IsActiveCookie{cookie}
}
// Request reply for IsActive
// size: 12
// IsActiveReply represents the data returned from a IsActive request.
type IsActiveReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
State uint32
}
// Waits and reads reply data from request IsActive
// Reply blocks and returns the reply data for a IsActive request.
func (cook IsActiveCookie) Reply() (*IsActiveReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -513,7 +525,7 @@ func (cook IsActiveCookie) Reply() (*IsActiveReply, error) {
return isActiveReply(buf), nil
}
// Read reply into structure from buffer for IsActive
// isActiveReply reads a byte slice into a IsActiveReply value.
func isActiveReply(buf []byte) *IsActiveReply {
v := new(IsActiveReply)
b := 1 // skip reply determinant
@ -533,6 +545,7 @@ func isActiveReply(buf []byte) *IsActiveReply {
}
// Write request to wire for IsActive
// isActiveRequest writes a IsActive request to a byte slice.
func isActiveRequest(c *xgb.Conn) []byte {
size := 4
b := 0
@ -550,36 +563,38 @@ func isActiveRequest(c *xgb.Conn) []byte {
return buf
}
// Request QueryScreens
// size: 4
// QueryScreensCookie is a cookie used only for QueryScreens requests.
type QueryScreensCookie struct {
*xgb.Cookie
}
// QueryScreens sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryScreensCookie.Reply()
func QueryScreens(c *xgb.Conn) QueryScreensCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryScreensRequest(c), cookie)
return QueryScreensCookie{cookie}
}
// QueryScreensUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryScreensUnchecked(c *xgb.Conn) QueryScreensCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryScreensRequest(c), cookie)
return QueryScreensCookie{cookie}
}
// Request reply for QueryScreens
// size: (32 + xgb.Pad((int(Number) * 8)))
// QueryScreensReply represents the data returned from a QueryScreens request.
type QueryScreensReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
Number uint32
// padding: 20 bytes
ScreenInfo []ScreenInfo // size: xgb.Pad((int(Number) * 8))
}
// Waits and reads reply data from request QueryScreens
// Reply blocks and returns the reply data for a QueryScreens request.
func (cook QueryScreensCookie) Reply() (*QueryScreensReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -591,7 +606,7 @@ func (cook QueryScreensCookie) Reply() (*QueryScreensReply, error) {
return queryScreensReply(buf), nil
}
// Read reply into structure from buffer for QueryScreens
// queryScreensReply reads a byte slice into a QueryScreensReply value.
func queryScreensReply(buf []byte) *QueryScreensReply {
v := new(QueryScreensReply)
b := 1 // skip reply determinant
@ -616,6 +631,7 @@ func queryScreensReply(buf []byte) *QueryScreensReply {
}
// Write request to wire for QueryScreens
// queryScreensRequest writes a QueryScreens request to a byte slice.
func queryScreensRequest(c *xgb.Conn) []byte {
size := 4
b := 0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
package xtest
/*
This file was generated by xtest.xml on May 10 2012 8:04:33pm EDT.
This file was generated by xtest.xml on May 10 2012 11:56:20pm EDT.
This file is automatically generated. Edit at your peril!
*/
@ -69,34 +69,36 @@ const (
CursorCurrent = 1
)
// Request GetVersion
// size: 8
// GetVersionCookie is a cookie used only for GetVersion requests.
type GetVersionCookie struct {
*xgb.Cookie
}
// GetVersion sends a checked request.
// If an error occurs, it will be returned with the reply by calling GetVersionCookie.Reply()
func GetVersion(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) GetVersionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(getVersionRequest(c, MajorVersion, MinorVersion), cookie)
return GetVersionCookie{cookie}
}
// GetVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetVersionUnchecked(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) GetVersionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(getVersionRequest(c, MajorVersion, MinorVersion), cookie)
return GetVersionCookie{cookie}
}
// Request reply for GetVersion
// size: 10
// GetVersionReply represents the data returned from a GetVersion request.
type GetVersionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
MajorVersion byte
MinorVersion uint16
}
// Waits and reads reply data from request GetVersion
// Reply blocks and returns the reply data for a GetVersion request.
func (cook GetVersionCookie) Reply() (*GetVersionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -108,7 +110,7 @@ func (cook GetVersionCookie) Reply() (*GetVersionReply, error) {
return getVersionReply(buf), nil
}
// Read reply into structure from buffer for GetVersion
// getVersionReply reads a byte slice into a GetVersionReply value.
func getVersionReply(buf []byte) *GetVersionReply {
v := new(GetVersionReply)
b := 1 // skip reply determinant
@ -129,6 +131,7 @@ func getVersionReply(buf []byte) *GetVersionReply {
}
// Write request to wire for GetVersion
// getVersionRequest writes a GetVersion request to a byte slice.
func getVersionRequest(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) []byte {
size := 8
b := 0
@ -154,33 +157,35 @@ func getVersionRequest(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) []by
return buf
}
// Request CompareCursor
// size: 12
// CompareCursorCookie is a cookie used only for CompareCursor requests.
type CompareCursorCookie struct {
*xgb.Cookie
}
// CompareCursor sends a checked request.
// If an error occurs, it will be returned with the reply by calling CompareCursorCookie.Reply()
func CompareCursor(c *xgb.Conn, Window xproto.Window, Cursor xproto.Cursor) CompareCursorCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(compareCursorRequest(c, Window, Cursor), cookie)
return CompareCursorCookie{cookie}
}
// CompareCursorUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func CompareCursorUnchecked(c *xgb.Conn, Window xproto.Window, Cursor xproto.Cursor) CompareCursorCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(compareCursorRequest(c, Window, Cursor), cookie)
return CompareCursorCookie{cookie}
}
// Request reply for CompareCursor
// size: 8
// CompareCursorReply represents the data returned from a CompareCursor request.
type CompareCursorReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
Same bool
}
// Waits and reads reply data from request CompareCursor
// Reply blocks and returns the reply data for a CompareCursor request.
func (cook CompareCursorCookie) Reply() (*CompareCursorReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -192,7 +197,7 @@ func (cook CompareCursorCookie) Reply() (*CompareCursorReply, error) {
return compareCursorReply(buf), nil
}
// Read reply into structure from buffer for CompareCursor
// compareCursorReply reads a byte slice into a CompareCursorReply value.
func compareCursorReply(buf []byte) *CompareCursorReply {
v := new(CompareCursorReply)
b := 1 // skip reply determinant
@ -214,6 +219,7 @@ func compareCursorReply(buf []byte) *CompareCursorReply {
}
// Write request to wire for CompareCursor
// compareCursorRequest writes a CompareCursor request to a byte slice.
func compareCursorRequest(c *xgb.Conn, Window xproto.Window, Cursor xproto.Cursor) []byte {
size := 12
b := 0
@ -237,30 +243,35 @@ func compareCursorRequest(c *xgb.Conn, Window xproto.Window, Cursor xproto.Curso
return buf
}
// Request FakeInput
// size: 36
// FakeInputCookie is a cookie used only for FakeInput requests.
type FakeInputCookie struct {
*xgb.Cookie
}
// Write request to wire for FakeInput
// FakeInput sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func FakeInput(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xproto.Window, RootX int16, RootY int16, Deviceid byte) FakeInputCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(fakeInputRequest(c, Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie)
return FakeInputCookie{cookie}
}
// FakeInputChecked sends a checked request.
// If an error occurs, it can be retrieved using FakeInputCookie.Check()
func FakeInputChecked(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xproto.Window, RootX int16, RootY int16, Deviceid byte) FakeInputCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(fakeInputRequest(c, Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie)
return FakeInputCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook FakeInputCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for FakeInput
// fakeInputRequest writes a FakeInput request to a byte slice.
func fakeInputRequest(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xproto.Window, RootX int16, RootY int16, Deviceid byte) []byte {
size := 36
b := 0
@ -305,30 +316,35 @@ func fakeInputRequest(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xpr
return buf
}
// Request GrabControl
// size: 8
// GrabControlCookie is a cookie used only for GrabControl requests.
type GrabControlCookie struct {
*xgb.Cookie
}
// Write request to wire for GrabControl
// GrabControl sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GrabControl(c *xgb.Conn, Impervious bool) GrabControlCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(grabControlRequest(c, Impervious), cookie)
return GrabControlCookie{cookie}
}
// GrabControlChecked sends a checked request.
// If an error occurs, it can be retrieved using GrabControlCookie.Check()
func GrabControlChecked(c *xgb.Conn, Impervious bool) GrabControlCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(grabControlRequest(c, Impervious), cookie)
return GrabControlCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook GrabControlCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for GrabControl
// grabControlRequest writes a GrabControl request to a byte slice.
func grabControlRequest(c *xgb.Conn, Impervious bool) []byte {
size := 8
b := 0

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
package xvmc
/*
This file was generated by xvmc.xml on May 10 2012 8:04:33pm EDT.
This file was generated by xvmc.xml on May 10 2012 11:56:20pm EDT.
This file is automatically generated. Edit at your peril!
*/
@ -41,6 +41,16 @@ func init() {
xgb.NewExtErrorFuncs["XVideo-MotionCompensation"] = make(map[int]xgb.NewErrorFun)
}
// Skipping definition for base type 'Card16'
// Skipping definition for base type 'Char'
// Skipping definition for base type 'Card32'
// Skipping definition for base type 'Double'
// Skipping definition for base type 'Bool'
// Skipping definition for base type 'Float'
// Skipping definition for base type 'Card8'
@ -55,16 +65,6 @@ func init() {
// 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'
type Context uint32
func NewContextId(c *xgb.Conn) (Context, error) {
@ -95,8 +95,6 @@ func NewSubpictureId(c *xgb.Conn) (Subpicture, error) {
return Subpicture(id), nil
}
// 'SurfaceInfo' struct definition
// Size: 24
type SurfaceInfo struct {
Id Surface
ChromaFormat uint16
@ -109,7 +107,7 @@ type SurfaceInfo struct {
Flags uint32
}
// Struct read SurfaceInfo
// SurfaceInfoRead reads a byte slice into a SurfaceInfo value.
func SurfaceInfoRead(buf []byte, v *SurfaceInfo) int {
b := 0
@ -143,7 +141,7 @@ func SurfaceInfoRead(buf []byte, v *SurfaceInfo) int {
return b
}
// Struct list read SurfaceInfo
// SurfaceInfoReadList reads a byte slice into a list of SurfaceInfo values.
func SurfaceInfoReadList(buf []byte, dest []SurfaceInfo) int {
b := 0
for i := 0; i < len(dest); i++ {
@ -153,7 +151,7 @@ func SurfaceInfoReadList(buf []byte, dest []SurfaceInfo) int {
return xgb.Pad(b)
}
// Struct write SurfaceInfo
// Bytes writes a SurfaceInfo value to a byte slice.
func (v SurfaceInfo) Bytes() []byte {
buf := make([]byte, 24)
b := 0
@ -188,7 +186,7 @@ func (v SurfaceInfo) Bytes() []byte {
return buf
}
// Write struct list SurfaceInfo
// SurfaceInfoListBytes writes a list of %s(MISSING) values to a byte slice.
func SurfaceInfoListBytes(buf []byte, list []SurfaceInfo) int {
b := 0
var structBytes []byte
@ -200,35 +198,37 @@ func SurfaceInfoListBytes(buf []byte, list []SurfaceInfo) int {
return b
}
// Request QueryVersion
// size: 4
// QueryVersionCookie is a cookie used only for QueryVersion requests.
type QueryVersionCookie struct {
*xgb.Cookie
}
// QueryVersion sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()
func QueryVersion(c *xgb.Conn) QueryVersionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryVersionRequest(c), cookie)
return QueryVersionCookie{cookie}
}
// QueryVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryVersionRequest(c), cookie)
return QueryVersionCookie{cookie}
}
// Request reply for QueryVersion
// size: 16
// QueryVersionReply represents the data returned from a QueryVersion request.
type QueryVersionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
Major uint32
Minor uint32
}
// Waits and reads reply data from request QueryVersion
// Reply blocks and returns the reply data for a QueryVersion request.
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -240,7 +240,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
return queryVersionReply(buf), nil
}
// Read reply into structure from buffer for QueryVersion
// queryVersionReply reads a byte slice into a QueryVersionReply value.
func queryVersionReply(buf []byte) *QueryVersionReply {
v := new(QueryVersionReply)
b := 1 // skip reply determinant
@ -263,6 +263,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
}
// Write request to wire for QueryVersion
// queryVersionRequest writes a QueryVersion request to a byte slice.
func queryVersionRequest(c *xgb.Conn) []byte {
size := 4
b := 0
@ -280,36 +281,38 @@ func queryVersionRequest(c *xgb.Conn) []byte {
return buf
}
// Request ListSurfaceTypes
// size: 8
// ListSurfaceTypesCookie is a cookie used only for ListSurfaceTypes requests.
type ListSurfaceTypesCookie struct {
*xgb.Cookie
}
// ListSurfaceTypes sends a checked request.
// If an error occurs, it will be returned with the reply by calling ListSurfaceTypesCookie.Reply()
func ListSurfaceTypes(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(listSurfaceTypesRequest(c, PortId), cookie)
return ListSurfaceTypesCookie{cookie}
}
// ListSurfaceTypesUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func ListSurfaceTypesUnchecked(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(listSurfaceTypesRequest(c, PortId), cookie)
return ListSurfaceTypesCookie{cookie}
}
// Request reply for ListSurfaceTypes
// size: (32 + xgb.Pad((int(Num) * 24)))
// ListSurfaceTypesReply represents the data returned from a ListSurfaceTypes request.
type ListSurfaceTypesReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
Num uint32
// padding: 20 bytes
Surfaces []SurfaceInfo // size: xgb.Pad((int(Num) * 24))
}
// Waits and reads reply data from request ListSurfaceTypes
// Reply blocks and returns the reply data for a ListSurfaceTypes request.
func (cook ListSurfaceTypesCookie) Reply() (*ListSurfaceTypesReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -321,7 +324,7 @@ func (cook ListSurfaceTypesCookie) Reply() (*ListSurfaceTypesReply, error) {
return listSurfaceTypesReply(buf), nil
}
// Read reply into structure from buffer for ListSurfaceTypes
// listSurfaceTypesReply reads a byte slice into a ListSurfaceTypesReply value.
func listSurfaceTypesReply(buf []byte) *ListSurfaceTypesReply {
v := new(ListSurfaceTypesReply)
b := 1 // skip reply determinant
@ -346,6 +349,7 @@ func listSurfaceTypesReply(buf []byte) *ListSurfaceTypesReply {
}
// Write request to wire for ListSurfaceTypes
// listSurfaceTypesRequest writes a ListSurfaceTypes request to a byte slice.
func listSurfaceTypesRequest(c *xgb.Conn, PortId xv.Port) []byte {
size := 8
b := 0
@ -366,29 +370,31 @@ func listSurfaceTypesRequest(c *xgb.Conn, PortId xv.Port) []byte {
return buf
}
// Request CreateContext
// size: 24
// CreateContextCookie is a cookie used only for CreateContext requests.
type CreateContextCookie struct {
*xgb.Cookie
}
// CreateContext sends a checked request.
// If an error occurs, it will be returned with the reply by calling CreateContextCookie.Reply()
func CreateContext(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) CreateContextCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(createContextRequest(c, ContextId, PortId, SurfaceId, Width, Height, Flags), cookie)
return CreateContextCookie{cookie}
}
// CreateContextUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func CreateContextUnchecked(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) CreateContextCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(createContextRequest(c, ContextId, PortId, SurfaceId, Width, Height, Flags), cookie)
return CreateContextCookie{cookie}
}
// Request reply for CreateContext
// size: (36 + xgb.Pad((int(Length) * 4)))
// CreateContextReply represents the data returned from a CreateContext request.
type CreateContextReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
WidthActual uint16
HeightActual uint16
@ -397,7 +403,7 @@ type CreateContextReply struct {
PrivData []uint32 // size: xgb.Pad((int(Length) * 4))
}
// Waits and reads reply data from request CreateContext
// Reply blocks and returns the reply data for a CreateContext request.
func (cook CreateContextCookie) Reply() (*CreateContextReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -409,7 +415,7 @@ func (cook CreateContextCookie) Reply() (*CreateContextReply, error) {
return createContextReply(buf), nil
}
// Read reply into structure from buffer for CreateContext
// createContextReply reads a byte slice into a CreateContextReply value.
func createContextReply(buf []byte) *CreateContextReply {
v := new(CreateContextReply)
b := 1 // skip reply determinant
@ -444,6 +450,7 @@ func createContextReply(buf []byte) *CreateContextReply {
}
// Write request to wire for CreateContext
// createContextRequest writes a CreateContext request to a byte slice.
func createContextRequest(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) []byte {
size := 24
b := 0
@ -479,30 +486,35 @@ func createContextRequest(c *xgb.Conn, ContextId Context, PortId xv.Port, Surfac
return buf
}
// Request DestroyContext
// size: 8
// DestroyContextCookie is a cookie used only for DestroyContext requests.
type DestroyContextCookie struct {
*xgb.Cookie
}
// Write request to wire for DestroyContext
// DestroyContext sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func DestroyContext(c *xgb.Conn, ContextId Context) DestroyContextCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(destroyContextRequest(c, ContextId), cookie)
return DestroyContextCookie{cookie}
}
// DestroyContextChecked sends a checked request.
// If an error occurs, it can be retrieved using DestroyContextCookie.Check()
func DestroyContextChecked(c *xgb.Conn, ContextId Context) DestroyContextCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(destroyContextRequest(c, ContextId), cookie)
return DestroyContextCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook DestroyContextCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for DestroyContext
// destroyContextRequest writes a DestroyContext request to a byte slice.
func destroyContextRequest(c *xgb.Conn, ContextId Context) []byte {
size := 8
b := 0
@ -523,35 +535,37 @@ func destroyContextRequest(c *xgb.Conn, ContextId Context) []byte {
return buf
}
// Request CreateSurface
// size: 12
// CreateSurfaceCookie is a cookie used only for CreateSurface requests.
type CreateSurfaceCookie struct {
*xgb.Cookie
}
// CreateSurface sends a checked request.
// If an error occurs, it will be returned with the reply by calling CreateSurfaceCookie.Reply()
func CreateSurface(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(createSurfaceRequest(c, SurfaceId, ContextId), cookie)
return CreateSurfaceCookie{cookie}
}
// CreateSurfaceUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func CreateSurfaceUnchecked(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(createSurfaceRequest(c, SurfaceId, ContextId), cookie)
return CreateSurfaceCookie{cookie}
}
// Request reply for CreateSurface
// size: (32 + xgb.Pad((int(Length) * 4)))
// CreateSurfaceReply represents the data returned from a CreateSurface request.
type CreateSurfaceReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
// padding: 24 bytes
PrivData []uint32 // size: xgb.Pad((int(Length) * 4))
}
// Waits and reads reply data from request CreateSurface
// Reply blocks and returns the reply data for a CreateSurface request.
func (cook CreateSurfaceCookie) Reply() (*CreateSurfaceReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -563,7 +577,7 @@ func (cook CreateSurfaceCookie) Reply() (*CreateSurfaceReply, error) {
return createSurfaceReply(buf), nil
}
// Read reply into structure from buffer for CreateSurface
// createSurfaceReply reads a byte slice into a CreateSurfaceReply value.
func createSurfaceReply(buf []byte) *CreateSurfaceReply {
v := new(CreateSurfaceReply)
b := 1 // skip reply determinant
@ -589,6 +603,7 @@ func createSurfaceReply(buf []byte) *CreateSurfaceReply {
}
// Write request to wire for CreateSurface
// createSurfaceRequest writes a CreateSurface request to a byte slice.
func createSurfaceRequest(c *xgb.Conn, SurfaceId Surface, ContextId Context) []byte {
size := 12
b := 0
@ -612,30 +627,35 @@ func createSurfaceRequest(c *xgb.Conn, SurfaceId Surface, ContextId Context) []b
return buf
}
// Request DestroySurface
// size: 8
// DestroySurfaceCookie is a cookie used only for DestroySurface requests.
type DestroySurfaceCookie struct {
*xgb.Cookie
}
// Write request to wire for DestroySurface
// DestroySurface sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func DestroySurface(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(destroySurfaceRequest(c, SurfaceId), cookie)
return DestroySurfaceCookie{cookie}
}
// DestroySurfaceChecked sends a checked request.
// If an error occurs, it can be retrieved using DestroySurfaceCookie.Check()
func DestroySurfaceChecked(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(destroySurfaceRequest(c, SurfaceId), cookie)
return DestroySurfaceCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook DestroySurfaceCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for DestroySurface
// destroySurfaceRequest writes a DestroySurface request to a byte slice.
func destroySurfaceRequest(c *xgb.Conn, SurfaceId Surface) []byte {
size := 8
b := 0
@ -656,29 +676,31 @@ func destroySurfaceRequest(c *xgb.Conn, SurfaceId Surface) []byte {
return buf
}
// Request CreateSubpicture
// size: 20
// CreateSubpictureCookie is a cookie used only for CreateSubpicture requests.
type CreateSubpictureCookie struct {
*xgb.Cookie
}
// CreateSubpicture sends a checked request.
// If an error occurs, it will be returned with the reply by calling CreateSubpictureCookie.Reply()
func CreateSubpicture(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) CreateSubpictureCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(createSubpictureRequest(c, SubpictureId, Context, XvimageId, Width, Height), cookie)
return CreateSubpictureCookie{cookie}
}
// CreateSubpictureUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func CreateSubpictureUnchecked(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) CreateSubpictureCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(createSubpictureRequest(c, SubpictureId, Context, XvimageId, Width, Height), cookie)
return CreateSubpictureCookie{cookie}
}
// Request reply for CreateSubpicture
// size: (32 + xgb.Pad((int(Length) * 4)))
// CreateSubpictureReply represents the data returned from a CreateSubpicture request.
type CreateSubpictureReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
WidthActual uint16
HeightActual uint16
@ -689,7 +711,7 @@ type CreateSubpictureReply struct {
PrivData []uint32 // size: xgb.Pad((int(Length) * 4))
}
// Waits and reads reply data from request CreateSubpicture
// Reply blocks and returns the reply data for a CreateSubpicture request.
func (cook CreateSubpictureCookie) Reply() (*CreateSubpictureReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -701,7 +723,7 @@ func (cook CreateSubpictureCookie) Reply() (*CreateSubpictureReply, error) {
return createSubpictureReply(buf), nil
}
// Read reply into structure from buffer for CreateSubpicture
// createSubpictureReply reads a byte slice into a CreateSubpictureReply value.
func createSubpictureReply(buf []byte) *CreateSubpictureReply {
v := new(CreateSubpictureReply)
b := 1 // skip reply determinant
@ -743,6 +765,7 @@ func createSubpictureReply(buf []byte) *CreateSubpictureReply {
}
// Write request to wire for CreateSubpicture
// createSubpictureRequest writes a CreateSubpicture request to a byte slice.
func createSubpictureRequest(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) []byte {
size := 20
b := 0
@ -775,30 +798,35 @@ func createSubpictureRequest(c *xgb.Conn, SubpictureId Subpicture, Context Conte
return buf
}
// Request DestroySubpicture
// size: 8
// DestroySubpictureCookie is a cookie used only for DestroySubpicture requests.
type DestroySubpictureCookie struct {
*xgb.Cookie
}
// Write request to wire for DestroySubpicture
// DestroySubpicture sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func DestroySubpicture(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(destroySubpictureRequest(c, SubpictureId), cookie)
return DestroySubpictureCookie{cookie}
}
// DestroySubpictureChecked sends a checked request.
// If an error occurs, it can be retrieved using DestroySubpictureCookie.Check()
func DestroySubpictureChecked(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(destroySubpictureRequest(c, SubpictureId), cookie)
return DestroySubpictureCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook DestroySubpictureCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for DestroySubpicture
// destroySubpictureRequest writes a DestroySubpicture request to a byte slice.
func destroySubpictureRequest(c *xgb.Conn, SubpictureId Subpicture) []byte {
size := 8
b := 0
@ -819,36 +847,38 @@ func destroySubpictureRequest(c *xgb.Conn, SubpictureId Subpicture) []byte {
return buf
}
// Request ListSubpictureTypes
// size: 12
// ListSubpictureTypesCookie is a cookie used only for ListSubpictureTypes requests.
type ListSubpictureTypesCookie struct {
*xgb.Cookie
}
// ListSubpictureTypes sends a checked request.
// If an error occurs, it will be returned with the reply by calling ListSubpictureTypesCookie.Reply()
func ListSubpictureTypes(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSubpictureTypesCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(listSubpictureTypesRequest(c, PortId, SurfaceId), cookie)
return ListSubpictureTypesCookie{cookie}
}
// ListSubpictureTypesUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func ListSubpictureTypesUnchecked(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSubpictureTypesCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(listSubpictureTypesRequest(c, PortId, SurfaceId), cookie)
return ListSubpictureTypesCookie{cookie}
}
// Request reply for ListSubpictureTypes
// size: (32 + xv.ImageFormatInfoListSize(Types))
// ListSubpictureTypesReply represents the data returned from a ListSubpictureTypes request.
type ListSubpictureTypesReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
Num uint32
// padding: 20 bytes
Types []xv.ImageFormatInfo // size: xv.ImageFormatInfoListSize(Types)
}
// Waits and reads reply data from request ListSubpictureTypes
// Reply blocks and returns the reply data for a ListSubpictureTypes request.
func (cook ListSubpictureTypesCookie) Reply() (*ListSubpictureTypesReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@ -860,7 +890,7 @@ func (cook ListSubpictureTypesCookie) Reply() (*ListSubpictureTypesReply, error)
return listSubpictureTypesReply(buf), nil
}
// Read reply into structure from buffer for ListSubpictureTypes
// listSubpictureTypesReply reads a byte slice into a ListSubpictureTypesReply value.
func listSubpictureTypesReply(buf []byte) *ListSubpictureTypesReply {
v := new(ListSubpictureTypesReply)
b := 1 // skip reply determinant
@ -885,6 +915,7 @@ func listSubpictureTypesReply(buf []byte) *ListSubpictureTypesReply {
}
// Write request to wire for ListSubpictureTypes
// listSubpictureTypesRequest writes a ListSubpictureTypes request to a byte slice.
func listSubpictureTypesRequest(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) []byte {
size := 12
b := 0