better docs
This commit is contained in:
parent
a3363755cd
commit
c00652934e
|
@ -2,7 +2,7 @@
|
||||||
package bigreq
|
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!
|
This file is automatically generated. Edit at your peril!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -40,6 +40,8 @@ func init() {
|
||||||
xgb.NewExtErrorFuncs["BIG-REQUESTS"] = make(map[int]xgb.NewErrorFun)
|
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 'Card8'
|
||||||
|
|
||||||
// Skipping definition for base type 'Int16'
|
// Skipping definition for base type 'Int16'
|
||||||
|
@ -62,36 +64,36 @@ func init() {
|
||||||
|
|
||||||
// Skipping definition for base type 'Bool'
|
// Skipping definition for base type 'Bool'
|
||||||
|
|
||||||
// Skipping definition for base type 'Float'
|
// EnableCookie is a cookie used only for Enable requests.
|
||||||
|
|
||||||
// Request Enable
|
|
||||||
// size: 4
|
|
||||||
type EnableCookie struct {
|
type EnableCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func Enable(c *xgb.Conn) EnableCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(enableRequest(c), cookie)
|
c.NewRequest(enableRequest(c), cookie)
|
||||||
return EnableCookie{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 {
|
func EnableUnchecked(c *xgb.Conn) EnableCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(enableRequest(c), cookie)
|
c.NewRequest(enableRequest(c), cookie)
|
||||||
return EnableCookie{cookie}
|
return EnableCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for Enable
|
// EnableReply represents the data returned from a Enable request.
|
||||||
// size: 12
|
|
||||||
type EnableReply struct {
|
type EnableReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
MaximumRequestLength uint32
|
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) {
|
func (cook EnableCookie) Reply() (*EnableReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -103,7 +105,7 @@ func (cook EnableCookie) Reply() (*EnableReply, error) {
|
||||||
return enableReply(buf), nil
|
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 {
|
func enableReply(buf []byte) *EnableReply {
|
||||||
v := new(EnableReply)
|
v := new(EnableReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -123,6 +125,7 @@ func enableReply(buf []byte) *EnableReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Enable
|
// Write request to wire for Enable
|
||||||
|
// enableRequest writes a Enable request to a byte slice.
|
||||||
func enableRequest(c *xgb.Conn) []byte {
|
func enableRequest(c *xgb.Conn) []byte {
|
||||||
size := 4
|
size := 4
|
||||||
b := 0
|
b := 0
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
package composite
|
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!
|
This file is automatically generated. Edit at your peril!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -41,16 +41,6 @@ func init() {
|
||||||
xgb.NewExtErrorFuncs["Composite"] = make(map[int]xgb.NewErrorFun)
|
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 'Int8'
|
||||||
|
|
||||||
// Skipping definition for base type 'Card16'
|
// Skipping definition for base type 'Card16'
|
||||||
|
@ -65,41 +55,53 @@ func init() {
|
||||||
|
|
||||||
// Skipping definition for base type 'Float'
|
// 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 (
|
const (
|
||||||
RedirectAutomatic = 0
|
RedirectAutomatic = 0
|
||||||
RedirectManual = 1
|
RedirectManual = 1
|
||||||
)
|
)
|
||||||
|
|
||||||
// Request QueryVersion
|
// QueryVersionCookie is a cookie used only for QueryVersion requests.
|
||||||
// size: 12
|
|
||||||
type QueryVersionCookie struct {
|
type QueryVersionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
||||||
return QueryVersionCookie{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 {
|
func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
||||||
return QueryVersionCookie{cookie}
|
return QueryVersionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryVersion
|
// QueryVersionReply represents the data returned from a QueryVersion request.
|
||||||
// size: 32
|
|
||||||
type QueryVersionReply struct {
|
type QueryVersionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
MajorVersion uint32
|
MajorVersion uint32
|
||||||
MinorVersion uint32
|
MinorVersion uint32
|
||||||
// padding: 16 bytes
|
// 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) {
|
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -111,7 +113,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
return queryVersionReply(buf), nil
|
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 {
|
func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
v := new(QueryVersionReply)
|
v := new(QueryVersionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -136,6 +138,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryVersion
|
// 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 {
|
func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -159,30 +162,35 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVers
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request RedirectWindow
|
// RedirectWindowCookie is a cookie used only for RedirectWindow requests.
|
||||||
// size: 12
|
|
||||||
type RedirectWindowCookie struct {
|
type RedirectWindowCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func RedirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) RedirectWindowCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(redirectWindowRequest(c, Window, Update), cookie)
|
c.NewRequest(redirectWindowRequest(c, Window, Update), cookie)
|
||||||
return RedirectWindowCookie{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 {
|
func RedirectWindowChecked(c *xgb.Conn, Window xproto.Window, Update byte) RedirectWindowCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(redirectWindowRequest(c, Window, Update), cookie)
|
c.NewRequest(redirectWindowRequest(c, Window, Update), cookie)
|
||||||
return RedirectWindowCookie{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 {
|
func (cook RedirectWindowCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for RedirectWindow
|
// 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 {
|
func redirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -208,30 +216,35 @@ func redirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byt
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request RedirectSubwindows
|
// RedirectSubwindowsCookie is a cookie used only for RedirectSubwindows requests.
|
||||||
// size: 12
|
|
||||||
type RedirectSubwindowsCookie struct {
|
type RedirectSubwindowsCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func RedirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) RedirectSubwindowsCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(redirectSubwindowsRequest(c, Window, Update), cookie)
|
c.NewRequest(redirectSubwindowsRequest(c, Window, Update), cookie)
|
||||||
return RedirectSubwindowsCookie{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 {
|
func RedirectSubwindowsChecked(c *xgb.Conn, Window xproto.Window, Update byte) RedirectSubwindowsCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(redirectSubwindowsRequest(c, Window, Update), cookie)
|
c.NewRequest(redirectSubwindowsRequest(c, Window, Update), cookie)
|
||||||
return RedirectSubwindowsCookie{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 {
|
func (cook RedirectSubwindowsCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for RedirectSubwindows
|
// 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 {
|
func redirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -257,30 +270,35 @@ func redirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) [
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request UnredirectWindow
|
// UnredirectWindowCookie is a cookie used only for UnredirectWindow requests.
|
||||||
// size: 12
|
|
||||||
type UnredirectWindowCookie struct {
|
type UnredirectWindowCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func UnredirectWindow(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectWindowCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(unredirectWindowRequest(c, Window, Update), cookie)
|
c.NewRequest(unredirectWindowRequest(c, Window, Update), cookie)
|
||||||
return UnredirectWindowCookie{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 {
|
func UnredirectWindowChecked(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectWindowCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(unredirectWindowRequest(c, Window, Update), cookie)
|
c.NewRequest(unredirectWindowRequest(c, Window, Update), cookie)
|
||||||
return UnredirectWindowCookie{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 {
|
func (cook UnredirectWindowCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for UnredirectWindow
|
// 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 {
|
func unredirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -306,30 +324,35 @@ func unredirectWindowRequest(c *xgb.Conn, Window xproto.Window, Update byte) []b
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request UnredirectSubwindows
|
// UnredirectSubwindowsCookie is a cookie used only for UnredirectSubwindows requests.
|
||||||
// size: 12
|
|
||||||
type UnredirectSubwindowsCookie struct {
|
type UnredirectSubwindowsCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func UnredirectSubwindows(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectSubwindowsCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(unredirectSubwindowsRequest(c, Window, Update), cookie)
|
c.NewRequest(unredirectSubwindowsRequest(c, Window, Update), cookie)
|
||||||
return UnredirectSubwindowsCookie{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 {
|
func UnredirectSubwindowsChecked(c *xgb.Conn, Window xproto.Window, Update byte) UnredirectSubwindowsCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(unredirectSubwindowsRequest(c, Window, Update), cookie)
|
c.NewRequest(unredirectSubwindowsRequest(c, Window, Update), cookie)
|
||||||
return UnredirectSubwindowsCookie{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 {
|
func (cook UnredirectSubwindowsCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for UnredirectSubwindows
|
// 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 {
|
func unredirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -355,30 +378,35 @@ func unredirectSubwindowsRequest(c *xgb.Conn, Window xproto.Window, Update byte)
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request CreateRegionFromBorderClip
|
// CreateRegionFromBorderClipCookie is a cookie used only for CreateRegionFromBorderClip requests.
|
||||||
// size: 12
|
|
||||||
type CreateRegionFromBorderClipCookie struct {
|
type CreateRegionFromBorderClipCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func CreateRegionFromBorderClip(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) CreateRegionFromBorderClipCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(createRegionFromBorderClipRequest(c, Region, Window), cookie)
|
c.NewRequest(createRegionFromBorderClipRequest(c, Region, Window), cookie)
|
||||||
return CreateRegionFromBorderClipCookie{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 {
|
func CreateRegionFromBorderClipChecked(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) CreateRegionFromBorderClipCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(createRegionFromBorderClipRequest(c, Region, Window), cookie)
|
c.NewRequest(createRegionFromBorderClipRequest(c, Region, Window), cookie)
|
||||||
return CreateRegionFromBorderClipCookie{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 {
|
func (cook CreateRegionFromBorderClipCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for CreateRegionFromBorderClip
|
// 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 {
|
func createRegionFromBorderClipRequest(c *xgb.Conn, Region xfixes.Region, Window xproto.Window) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -402,30 +430,35 @@ func createRegionFromBorderClipRequest(c *xgb.Conn, Region xfixes.Region, Window
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request NameWindowPixmap
|
// NameWindowPixmapCookie is a cookie used only for NameWindowPixmap requests.
|
||||||
// size: 12
|
|
||||||
type NameWindowPixmapCookie struct {
|
type NameWindowPixmapCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func NameWindowPixmap(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) NameWindowPixmapCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(nameWindowPixmapRequest(c, Window, Pixmap), cookie)
|
c.NewRequest(nameWindowPixmapRequest(c, Window, Pixmap), cookie)
|
||||||
return NameWindowPixmapCookie{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 {
|
func NameWindowPixmapChecked(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) NameWindowPixmapCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(nameWindowPixmapRequest(c, Window, Pixmap), cookie)
|
c.NewRequest(nameWindowPixmapRequest(c, Window, Pixmap), cookie)
|
||||||
return NameWindowPixmapCookie{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 {
|
func (cook NameWindowPixmapCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for NameWindowPixmap
|
// 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 {
|
func nameWindowPixmapRequest(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pixmap) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -449,35 +482,37 @@ func nameWindowPixmapRequest(c *xgb.Conn, Window xproto.Window, Pixmap xproto.Pi
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request GetOverlayWindow
|
// GetOverlayWindowCookie is a cookie used only for GetOverlayWindow requests.
|
||||||
// size: 8
|
|
||||||
type GetOverlayWindowCookie struct {
|
type GetOverlayWindowCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GetOverlayWindow(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getOverlayWindowRequest(c, Window), cookie)
|
c.NewRequest(getOverlayWindowRequest(c, Window), cookie)
|
||||||
return GetOverlayWindowCookie{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 {
|
func GetOverlayWindowUnchecked(c *xgb.Conn, Window xproto.Window) GetOverlayWindowCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getOverlayWindowRequest(c, Window), cookie)
|
c.NewRequest(getOverlayWindowRequest(c, Window), cookie)
|
||||||
return GetOverlayWindowCookie{cookie}
|
return GetOverlayWindowCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetOverlayWindow
|
// GetOverlayWindowReply represents the data returned from a GetOverlayWindow request.
|
||||||
// size: 32
|
|
||||||
type GetOverlayWindowReply struct {
|
type GetOverlayWindowReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
OverlayWin xproto.Window
|
OverlayWin xproto.Window
|
||||||
// padding: 20 bytes
|
// 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) {
|
func (cook GetOverlayWindowCookie) Reply() (*GetOverlayWindowReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -489,7 +524,7 @@ func (cook GetOverlayWindowCookie) Reply() (*GetOverlayWindowReply, error) {
|
||||||
return getOverlayWindowReply(buf), nil
|
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 {
|
func getOverlayWindowReply(buf []byte) *GetOverlayWindowReply {
|
||||||
v := new(GetOverlayWindowReply)
|
v := new(GetOverlayWindowReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -511,6 +546,7 @@ func getOverlayWindowReply(buf []byte) *GetOverlayWindowReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetOverlayWindow
|
// Write request to wire for GetOverlayWindow
|
||||||
|
// getOverlayWindowRequest writes a GetOverlayWindow request to a byte slice.
|
||||||
func getOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte {
|
func getOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -531,30 +567,35 @@ func getOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request ReleaseOverlayWindow
|
// ReleaseOverlayWindowCookie is a cookie used only for ReleaseOverlayWindow requests.
|
||||||
// size: 8
|
|
||||||
type ReleaseOverlayWindowCookie struct {
|
type ReleaseOverlayWindowCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func ReleaseOverlayWindow(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindowCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(releaseOverlayWindowRequest(c, Window), cookie)
|
c.NewRequest(releaseOverlayWindowRequest(c, Window), cookie)
|
||||||
return ReleaseOverlayWindowCookie{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 {
|
func ReleaseOverlayWindowChecked(c *xgb.Conn, Window xproto.Window) ReleaseOverlayWindowCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(releaseOverlayWindowRequest(c, Window), cookie)
|
c.NewRequest(releaseOverlayWindowRequest(c, Window), cookie)
|
||||||
return ReleaseOverlayWindowCookie{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 {
|
func (cook ReleaseOverlayWindowCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for ReleaseOverlayWindow
|
// Write request to wire for ReleaseOverlayWindow
|
||||||
|
// releaseOverlayWindowRequest writes a ReleaseOverlayWindow request to a byte slice.
|
||||||
func releaseOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte {
|
func releaseOverlayWindowRequest(c *xgb.Conn, Window xproto.Window) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
package damage
|
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!
|
This file is automatically generated. Edit at your peril!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -82,9 +82,7 @@ func NewDamageId(c *xgb.Conn) (Damage, error) {
|
||||||
return Damage(id), nil
|
return Damage(id), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event definition Notify (0)
|
// Notify is the event number for a NotifyEvent.
|
||||||
// Size: 32
|
|
||||||
|
|
||||||
const Notify = 0
|
const Notify = 0
|
||||||
|
|
||||||
type NotifyEvent struct {
|
type NotifyEvent struct {
|
||||||
|
@ -97,7 +95,7 @@ type NotifyEvent struct {
|
||||||
Geometry xproto.Rectangle
|
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 {
|
func NotifyEventNew(buf []byte) xgb.Event {
|
||||||
v := NotifyEvent{}
|
v := NotifyEvent{}
|
||||||
b := 1 // don't read event number
|
b := 1 // don't read event number
|
||||||
|
@ -126,7 +124,7 @@ func NotifyEventNew(buf []byte) xgb.Event {
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event write Notify
|
// Bytes writes a NotifyEvent value to a byte slice.
|
||||||
func (v NotifyEvent) Bytes() []byte {
|
func (v NotifyEvent) Bytes() []byte {
|
||||||
buf := make([]byte, 32)
|
buf := make([]byte, 32)
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -164,12 +162,14 @@ func (v NotifyEvent) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func (v NotifyEvent) SequenceId() uint16 {
|
||||||
return v.Sequence
|
return v.Sequence
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// String is a rudimentary string representation of NotifyEvent.
|
||||||
func (v NotifyEvent) String() string {
|
func (v NotifyEvent) String() string {
|
||||||
fieldVals := make([]string, 0, 6)
|
fieldVals := make([]string, 0, 6)
|
||||||
fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence))
|
fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence))
|
||||||
|
@ -184,9 +184,7 @@ func init() {
|
||||||
xgb.NewExtEventFuncs["DAMAGE"][0] = NotifyEventNew
|
xgb.NewExtEventFuncs["DAMAGE"][0] = NotifyEventNew
|
||||||
}
|
}
|
||||||
|
|
||||||
// Error definition BadDamage (0)
|
// BadBadDamage is the error number for a BadBadDamage.
|
||||||
// Size: 32
|
|
||||||
|
|
||||||
const BadBadDamage = 0
|
const BadBadDamage = 0
|
||||||
|
|
||||||
type BadDamageError struct {
|
type BadDamageError struct {
|
||||||
|
@ -194,7 +192,7 @@ type BadDamageError struct {
|
||||||
NiceName string
|
NiceName string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Error read BadDamage
|
// BadDamageErrorNew constructs a BadDamageError value that implements xgb.Error from a byte slice.
|
||||||
func BadDamageErrorNew(buf []byte) xgb.Error {
|
func BadDamageErrorNew(buf []byte) xgb.Error {
|
||||||
v := BadDamageError{}
|
v := BadDamageError{}
|
||||||
v.NiceName = "BadDamage"
|
v.NiceName = "BadDamage"
|
||||||
|
@ -208,8 +206,8 @@ func BadDamageErrorNew(buf []byte) xgb.Error {
|
||||||
return v
|
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 {
|
func (err BadDamageError) SequenceId() uint16 {
|
||||||
return err.Sequence
|
return err.Sequence
|
||||||
}
|
}
|
||||||
|
@ -229,36 +227,38 @@ func init() {
|
||||||
xgb.NewExtErrorFuncs["DAMAGE"][0] = BadDamageErrorNew
|
xgb.NewExtErrorFuncs["DAMAGE"][0] = BadDamageErrorNew
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request QueryVersion
|
// QueryVersionCookie is a cookie used only for QueryVersion requests.
|
||||||
// size: 12
|
|
||||||
type QueryVersionCookie struct {
|
type QueryVersionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryVersion(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
||||||
return QueryVersionCookie{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 {
|
func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
||||||
return QueryVersionCookie{cookie}
|
return QueryVersionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryVersion
|
// QueryVersionReply represents the data returned from a QueryVersion request.
|
||||||
// size: 32
|
|
||||||
type QueryVersionReply struct {
|
type QueryVersionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
MajorVersion uint32
|
MajorVersion uint32
|
||||||
MinorVersion uint32
|
MinorVersion uint32
|
||||||
// padding: 16 bytes
|
// 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) {
|
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -270,7 +270,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
return queryVersionReply(buf), nil
|
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 {
|
func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
v := new(QueryVersionReply)
|
v := new(QueryVersionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -295,6 +295,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryVersion
|
// 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 {
|
func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVersion uint32) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -318,30 +319,35 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint32, ClientMinorVers
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Create
|
// CreateCookie is a cookie used only for Create requests.
|
||||||
// size: 16
|
|
||||||
type CreateCookie struct {
|
type CreateCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func Create(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) CreateCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(createRequest(c, Damage, Drawable, Level), cookie)
|
c.NewRequest(createRequest(c, Damage, Drawable, Level), cookie)
|
||||||
return CreateCookie{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 {
|
func CreateChecked(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) CreateCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(createRequest(c, Damage, Drawable, Level), cookie)
|
c.NewRequest(createRequest(c, Damage, Drawable, Level), cookie)
|
||||||
return CreateCookie{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 {
|
func (cook CreateCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Create
|
// 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 {
|
func createRequest(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level byte) []byte {
|
||||||
size := 16
|
size := 16
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -370,30 +376,35 @@ func createRequest(c *xgb.Conn, Damage Damage, Drawable xproto.Drawable, Level b
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Destroy
|
// DestroyCookie is a cookie used only for Destroy requests.
|
||||||
// size: 8
|
|
||||||
type DestroyCookie struct {
|
type DestroyCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func Destroy(c *xgb.Conn, Damage Damage) DestroyCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(destroyRequest(c, Damage), cookie)
|
c.NewRequest(destroyRequest(c, Damage), cookie)
|
||||||
return DestroyCookie{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 {
|
func DestroyChecked(c *xgb.Conn, Damage Damage) DestroyCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(destroyRequest(c, Damage), cookie)
|
c.NewRequest(destroyRequest(c, Damage), cookie)
|
||||||
return DestroyCookie{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 {
|
func (cook DestroyCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Destroy
|
// Write request to wire for Destroy
|
||||||
|
// destroyRequest writes a Destroy request to a byte slice.
|
||||||
func destroyRequest(c *xgb.Conn, Damage Damage) []byte {
|
func destroyRequest(c *xgb.Conn, Damage Damage) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -414,30 +425,35 @@ func destroyRequest(c *xgb.Conn, Damage Damage) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Subtract
|
// SubtractCookie is a cookie used only for Subtract requests.
|
||||||
// size: 16
|
|
||||||
type SubtractCookie struct {
|
type SubtractCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func Subtract(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Region) SubtractCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(subtractRequest(c, Damage, Repair, Parts), cookie)
|
c.NewRequest(subtractRequest(c, Damage, Repair, Parts), cookie)
|
||||||
return SubtractCookie{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 {
|
func SubtractChecked(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Region) SubtractCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(subtractRequest(c, Damage, Repair, Parts), cookie)
|
c.NewRequest(subtractRequest(c, Damage, Repair, Parts), cookie)
|
||||||
return SubtractCookie{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 {
|
func (cook SubtractCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Subtract
|
// 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 {
|
func subtractRequest(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfixes.Region) []byte {
|
||||||
size := 16
|
size := 16
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -464,30 +480,35 @@ func subtractRequest(c *xgb.Conn, Damage Damage, Repair xfixes.Region, Parts xfi
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Add
|
// AddCookie is a cookie used only for Add requests.
|
||||||
// size: 12
|
|
||||||
type AddCookie struct {
|
type AddCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func Add(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(addRequest(c, Drawable, Region), cookie)
|
c.NewRequest(addRequest(c, Drawable, Region), cookie)
|
||||||
return AddCookie{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 {
|
func AddChecked(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) AddCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(addRequest(c, Drawable, Region), cookie)
|
c.NewRequest(addRequest(c, Drawable, Region), cookie)
|
||||||
return AddCookie{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 {
|
func (cook AddCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Add
|
// 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 {
|
func addRequest(c *xgb.Conn, Drawable xproto.Drawable, Region xfixes.Region) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
package dpms
|
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!
|
This file is automatically generated. Edit at your peril!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -40,6 +40,14 @@ func init() {
|
||||||
xgb.NewExtErrorFuncs["DPMS"] = make(map[int]xgb.NewErrorFun)
|
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 'Byte'
|
||||||
|
|
||||||
// Skipping definition for base type 'Int8'
|
// Skipping definition for base type 'Int8'
|
||||||
|
@ -56,14 +64,6 @@ func init() {
|
||||||
|
|
||||||
// Skipping definition for base type 'Float'
|
// 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 (
|
const (
|
||||||
DPMSModeOn = 0
|
DPMSModeOn = 0
|
||||||
DPMSModeStandby = 1
|
DPMSModeStandby = 1
|
||||||
|
@ -71,35 +71,37 @@ const (
|
||||||
DPMSModeOff = 3
|
DPMSModeOff = 3
|
||||||
)
|
)
|
||||||
|
|
||||||
// Request GetVersion
|
// GetVersionCookie is a cookie used only for GetVersion requests.
|
||||||
// size: 8
|
|
||||||
type GetVersionCookie struct {
|
type GetVersionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
||||||
return GetVersionCookie{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 {
|
func GetVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
||||||
return GetVersionCookie{cookie}
|
return GetVersionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetVersion
|
// GetVersionReply represents the data returned from a GetVersion request.
|
||||||
// size: 12
|
|
||||||
type GetVersionReply struct {
|
type GetVersionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
ServerMajorVersion uint16
|
ServerMajorVersion uint16
|
||||||
ServerMinorVersion 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) {
|
func (cook GetVersionCookie) Reply() (*GetVersionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -111,7 +113,7 @@ func (cook GetVersionCookie) Reply() (*GetVersionReply, error) {
|
||||||
return getVersionReply(buf), nil
|
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 {
|
func getVersionReply(buf []byte) *GetVersionReply {
|
||||||
v := new(GetVersionReply)
|
v := new(GetVersionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -134,6 +136,7 @@ func getVersionReply(buf []byte) *GetVersionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetVersion
|
// 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 {
|
func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -157,35 +160,37 @@ func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersio
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Capable
|
// CapableCookie is a cookie used only for Capable requests.
|
||||||
// size: 4
|
|
||||||
type CapableCookie struct {
|
type CapableCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func Capable(c *xgb.Conn) CapableCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(capableRequest(c), cookie)
|
c.NewRequest(capableRequest(c), cookie)
|
||||||
return CapableCookie{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 {
|
func CapableUnchecked(c *xgb.Conn) CapableCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(capableRequest(c), cookie)
|
c.NewRequest(capableRequest(c), cookie)
|
||||||
return CapableCookie{cookie}
|
return CapableCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for Capable
|
// CapableReply represents the data returned from a Capable request.
|
||||||
// size: 32
|
|
||||||
type CapableReply struct {
|
type CapableReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
Capable bool
|
Capable bool
|
||||||
// padding: 23 bytes
|
// 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) {
|
func (cook CapableCookie) Reply() (*CapableReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -197,7 +202,7 @@ func (cook CapableCookie) Reply() (*CapableReply, error) {
|
||||||
return capableReply(buf), nil
|
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 {
|
func capableReply(buf []byte) *CapableReply {
|
||||||
v := new(CapableReply)
|
v := new(CapableReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -223,6 +228,7 @@ func capableReply(buf []byte) *CapableReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Capable
|
// Write request to wire for Capable
|
||||||
|
// capableRequest writes a Capable request to a byte slice.
|
||||||
func capableRequest(c *xgb.Conn) []byte {
|
func capableRequest(c *xgb.Conn) []byte {
|
||||||
size := 4
|
size := 4
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -240,29 +246,31 @@ func capableRequest(c *xgb.Conn) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request GetTimeouts
|
// GetTimeoutsCookie is a cookie used only for GetTimeouts requests.
|
||||||
// size: 4
|
|
||||||
type GetTimeoutsCookie struct {
|
type GetTimeoutsCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GetTimeouts(c *xgb.Conn) GetTimeoutsCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getTimeoutsRequest(c), cookie)
|
c.NewRequest(getTimeoutsRequest(c), cookie)
|
||||||
return GetTimeoutsCookie{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 {
|
func GetTimeoutsUnchecked(c *xgb.Conn) GetTimeoutsCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getTimeoutsRequest(c), cookie)
|
c.NewRequest(getTimeoutsRequest(c), cookie)
|
||||||
return GetTimeoutsCookie{cookie}
|
return GetTimeoutsCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetTimeouts
|
// GetTimeoutsReply represents the data returned from a GetTimeouts request.
|
||||||
// size: 32
|
|
||||||
type GetTimeoutsReply struct {
|
type GetTimeoutsReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
StandbyTimeout uint16
|
StandbyTimeout uint16
|
||||||
SuspendTimeout uint16
|
SuspendTimeout uint16
|
||||||
|
@ -270,7 +278,7 @@ type GetTimeoutsReply struct {
|
||||||
// padding: 18 bytes
|
// 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) {
|
func (cook GetTimeoutsCookie) Reply() (*GetTimeoutsReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -282,7 +290,7 @@ func (cook GetTimeoutsCookie) Reply() (*GetTimeoutsReply, error) {
|
||||||
return getTimeoutsReply(buf), nil
|
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 {
|
func getTimeoutsReply(buf []byte) *GetTimeoutsReply {
|
||||||
v := new(GetTimeoutsReply)
|
v := new(GetTimeoutsReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -310,6 +318,7 @@ func getTimeoutsReply(buf []byte) *GetTimeoutsReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetTimeouts
|
// Write request to wire for GetTimeouts
|
||||||
|
// getTimeoutsRequest writes a GetTimeouts request to a byte slice.
|
||||||
func getTimeoutsRequest(c *xgb.Conn) []byte {
|
func getTimeoutsRequest(c *xgb.Conn) []byte {
|
||||||
size := 4
|
size := 4
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -327,30 +336,35 @@ func getTimeoutsRequest(c *xgb.Conn) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request SetTimeouts
|
// SetTimeoutsCookie is a cookie used only for SetTimeouts requests.
|
||||||
// size: 12
|
|
||||||
type SetTimeoutsCookie struct {
|
type SetTimeoutsCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func SetTimeouts(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) SetTimeoutsCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(setTimeoutsRequest(c, StandbyTimeout, SuspendTimeout, OffTimeout), cookie)
|
c.NewRequest(setTimeoutsRequest(c, StandbyTimeout, SuspendTimeout, OffTimeout), cookie)
|
||||||
return SetTimeoutsCookie{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 {
|
func SetTimeoutsChecked(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) SetTimeoutsCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(setTimeoutsRequest(c, StandbyTimeout, SuspendTimeout, OffTimeout), cookie)
|
c.NewRequest(setTimeoutsRequest(c, StandbyTimeout, SuspendTimeout, OffTimeout), cookie)
|
||||||
return SetTimeoutsCookie{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 {
|
func (cook SetTimeoutsCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for SetTimeouts
|
// 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 {
|
func setTimeoutsRequest(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint16, OffTimeout uint16) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -377,30 +391,35 @@ func setTimeoutsRequest(c *xgb.Conn, StandbyTimeout uint16, SuspendTimeout uint1
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Enable
|
// EnableCookie is a cookie used only for Enable requests.
|
||||||
// size: 4
|
|
||||||
type EnableCookie struct {
|
type EnableCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func Enable(c *xgb.Conn) EnableCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(enableRequest(c), cookie)
|
c.NewRequest(enableRequest(c), cookie)
|
||||||
return EnableCookie{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 {
|
func EnableChecked(c *xgb.Conn) EnableCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(enableRequest(c), cookie)
|
c.NewRequest(enableRequest(c), cookie)
|
||||||
return EnableCookie{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 {
|
func (cook EnableCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Enable
|
// Write request to wire for Enable
|
||||||
|
// enableRequest writes a Enable request to a byte slice.
|
||||||
func enableRequest(c *xgb.Conn) []byte {
|
func enableRequest(c *xgb.Conn) []byte {
|
||||||
size := 4
|
size := 4
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -418,30 +437,35 @@ func enableRequest(c *xgb.Conn) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Disable
|
// DisableCookie is a cookie used only for Disable requests.
|
||||||
// size: 4
|
|
||||||
type DisableCookie struct {
|
type DisableCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func Disable(c *xgb.Conn) DisableCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(disableRequest(c), cookie)
|
c.NewRequest(disableRequest(c), cookie)
|
||||||
return DisableCookie{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 {
|
func DisableChecked(c *xgb.Conn) DisableCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(disableRequest(c), cookie)
|
c.NewRequest(disableRequest(c), cookie)
|
||||||
return DisableCookie{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 {
|
func (cook DisableCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Disable
|
// Write request to wire for Disable
|
||||||
|
// disableRequest writes a Disable request to a byte slice.
|
||||||
func disableRequest(c *xgb.Conn) []byte {
|
func disableRequest(c *xgb.Conn) []byte {
|
||||||
size := 4
|
size := 4
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -459,30 +483,35 @@ func disableRequest(c *xgb.Conn) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request ForceLevel
|
// ForceLevelCookie is a cookie used only for ForceLevel requests.
|
||||||
// size: 8
|
|
||||||
type ForceLevelCookie struct {
|
type ForceLevelCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func ForceLevel(c *xgb.Conn, PowerLevel uint16) ForceLevelCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(forceLevelRequest(c, PowerLevel), cookie)
|
c.NewRequest(forceLevelRequest(c, PowerLevel), cookie)
|
||||||
return ForceLevelCookie{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 {
|
func ForceLevelChecked(c *xgb.Conn, PowerLevel uint16) ForceLevelCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(forceLevelRequest(c, PowerLevel), cookie)
|
c.NewRequest(forceLevelRequest(c, PowerLevel), cookie)
|
||||||
return ForceLevelCookie{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 {
|
func (cook ForceLevelCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for ForceLevel
|
// Write request to wire for ForceLevel
|
||||||
|
// forceLevelRequest writes a ForceLevel request to a byte slice.
|
||||||
func forceLevelRequest(c *xgb.Conn, PowerLevel uint16) []byte {
|
func forceLevelRequest(c *xgb.Conn, PowerLevel uint16) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -503,36 +532,38 @@ func forceLevelRequest(c *xgb.Conn, PowerLevel uint16) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Info
|
// InfoCookie is a cookie used only for Info requests.
|
||||||
// size: 4
|
|
||||||
type InfoCookie struct {
|
type InfoCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func Info(c *xgb.Conn) InfoCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(infoRequest(c), cookie)
|
c.NewRequest(infoRequest(c), cookie)
|
||||||
return InfoCookie{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 {
|
func InfoUnchecked(c *xgb.Conn) InfoCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(infoRequest(c), cookie)
|
c.NewRequest(infoRequest(c), cookie)
|
||||||
return InfoCookie{cookie}
|
return InfoCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for Info
|
// InfoReply represents the data returned from a Info request.
|
||||||
// size: 32
|
|
||||||
type InfoReply struct {
|
type InfoReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
PowerLevel uint16
|
PowerLevel uint16
|
||||||
State bool
|
State bool
|
||||||
// padding: 21 bytes
|
// 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) {
|
func (cook InfoCookie) Reply() (*InfoReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -544,7 +575,7 @@ func (cook InfoCookie) Reply() (*InfoReply, error) {
|
||||||
return infoReply(buf), nil
|
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 {
|
func infoReply(buf []byte) *InfoReply {
|
||||||
v := new(InfoReply)
|
v := new(InfoReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -573,6 +604,7 @@ func infoReply(buf []byte) *InfoReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Info
|
// Write request to wire for Info
|
||||||
|
// infoRequest writes a Info request to a byte slice.
|
||||||
func infoRequest(c *xgb.Conn) []byte {
|
func infoRequest(c *xgb.Conn) []byte {
|
||||||
size := 4
|
size := 4
|
||||||
b := 0
|
b := 0
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
package dri2
|
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!
|
This file is automatically generated. Edit at your peril!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -40,14 +40,6 @@ func init() {
|
||||||
xgb.NewExtErrorFuncs["DRI2"] = make(map[int]xgb.NewErrorFun)
|
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 'Float'
|
||||||
|
|
||||||
// Skipping definition for base type 'Card8'
|
// Skipping definition for base type 'Card8'
|
||||||
|
@ -64,6 +56,14 @@ func init() {
|
||||||
|
|
||||||
// Skipping definition for base type 'Card16'
|
// 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 (
|
const (
|
||||||
AttachmentBufferFrontLeft = 0
|
AttachmentBufferFrontLeft = 0
|
||||||
AttachmentBufferBackLeft = 1
|
AttachmentBufferBackLeft = 1
|
||||||
|
@ -89,8 +89,6 @@ const (
|
||||||
EventTypeFlipComplete = 3
|
EventTypeFlipComplete = 3
|
||||||
)
|
)
|
||||||
|
|
||||||
// 'DRI2Buffer' struct definition
|
|
||||||
// Size: 20
|
|
||||||
type DRI2Buffer struct {
|
type DRI2Buffer struct {
|
||||||
Attachment uint32
|
Attachment uint32
|
||||||
Name uint32
|
Name uint32
|
||||||
|
@ -99,7 +97,7 @@ type DRI2Buffer struct {
|
||||||
Flags uint32
|
Flags uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct read DRI2Buffer
|
// DRI2BufferRead reads a byte slice into a DRI2Buffer value.
|
||||||
func DRI2BufferRead(buf []byte, v *DRI2Buffer) int {
|
func DRI2BufferRead(buf []byte, v *DRI2Buffer) int {
|
||||||
b := 0
|
b := 0
|
||||||
|
|
||||||
|
@ -121,7 +119,7 @@ func DRI2BufferRead(buf []byte, v *DRI2Buffer) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct list read DRI2Buffer
|
// DRI2BufferReadList reads a byte slice into a list of DRI2Buffer values.
|
||||||
func DRI2BufferReadList(buf []byte, dest []DRI2Buffer) int {
|
func DRI2BufferReadList(buf []byte, dest []DRI2Buffer) int {
|
||||||
b := 0
|
b := 0
|
||||||
for i := 0; i < len(dest); i++ {
|
for i := 0; i < len(dest); i++ {
|
||||||
|
@ -131,7 +129,7 @@ func DRI2BufferReadList(buf []byte, dest []DRI2Buffer) int {
|
||||||
return xgb.Pad(b)
|
return xgb.Pad(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct write DRI2Buffer
|
// Bytes writes a DRI2Buffer value to a byte slice.
|
||||||
func (v DRI2Buffer) Bytes() []byte {
|
func (v DRI2Buffer) Bytes() []byte {
|
||||||
buf := make([]byte, 20)
|
buf := make([]byte, 20)
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -154,7 +152,7 @@ func (v DRI2Buffer) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func DRI2BufferListBytes(buf []byte, list []DRI2Buffer) int {
|
||||||
b := 0
|
b := 0
|
||||||
var structBytes []byte
|
var structBytes []byte
|
||||||
|
@ -166,14 +164,12 @@ func DRI2BufferListBytes(buf []byte, list []DRI2Buffer) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'AttachFormat' struct definition
|
|
||||||
// Size: 8
|
|
||||||
type AttachFormat struct {
|
type AttachFormat struct {
|
||||||
Attachment uint32
|
Attachment uint32
|
||||||
Format uint32
|
Format uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct read AttachFormat
|
// AttachFormatRead reads a byte slice into a AttachFormat value.
|
||||||
func AttachFormatRead(buf []byte, v *AttachFormat) int {
|
func AttachFormatRead(buf []byte, v *AttachFormat) int {
|
||||||
b := 0
|
b := 0
|
||||||
|
|
||||||
|
@ -186,7 +182,7 @@ func AttachFormatRead(buf []byte, v *AttachFormat) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct list read AttachFormat
|
// AttachFormatReadList reads a byte slice into a list of AttachFormat values.
|
||||||
func AttachFormatReadList(buf []byte, dest []AttachFormat) int {
|
func AttachFormatReadList(buf []byte, dest []AttachFormat) int {
|
||||||
b := 0
|
b := 0
|
||||||
for i := 0; i < len(dest); i++ {
|
for i := 0; i < len(dest); i++ {
|
||||||
|
@ -196,7 +192,7 @@ func AttachFormatReadList(buf []byte, dest []AttachFormat) int {
|
||||||
return xgb.Pad(b)
|
return xgb.Pad(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct write AttachFormat
|
// Bytes writes a AttachFormat value to a byte slice.
|
||||||
func (v AttachFormat) Bytes() []byte {
|
func (v AttachFormat) Bytes() []byte {
|
||||||
buf := make([]byte, 8)
|
buf := make([]byte, 8)
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -210,7 +206,7 @@ func (v AttachFormat) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func AttachFormatListBytes(buf []byte, list []AttachFormat) int {
|
||||||
b := 0
|
b := 0
|
||||||
var structBytes []byte
|
var structBytes []byte
|
||||||
|
@ -222,9 +218,7 @@ func AttachFormatListBytes(buf []byte, list []AttachFormat) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event definition BufferSwapComplete (0)
|
// BufferSwapComplete is the event number for a BufferSwapCompleteEvent.
|
||||||
// Size: 32
|
|
||||||
|
|
||||||
const BufferSwapComplete = 0
|
const BufferSwapComplete = 0
|
||||||
|
|
||||||
type BufferSwapCompleteEvent struct {
|
type BufferSwapCompleteEvent struct {
|
||||||
|
@ -240,7 +234,7 @@ type BufferSwapCompleteEvent struct {
|
||||||
Sbc uint32
|
Sbc uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event read BufferSwapComplete
|
// BufferSwapCompleteEventNew constructs a BufferSwapCompleteEvent value that implements xgb.Event from a byte slice.
|
||||||
func BufferSwapCompleteEventNew(buf []byte) xgb.Event {
|
func BufferSwapCompleteEventNew(buf []byte) xgb.Event {
|
||||||
v := BufferSwapCompleteEvent{}
|
v := BufferSwapCompleteEvent{}
|
||||||
b := 1 // don't read event number
|
b := 1 // don't read event number
|
||||||
|
@ -276,7 +270,7 @@ func BufferSwapCompleteEventNew(buf []byte) xgb.Event {
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event write BufferSwapComplete
|
// Bytes writes a BufferSwapCompleteEvent value to a byte slice.
|
||||||
func (v BufferSwapCompleteEvent) Bytes() []byte {
|
func (v BufferSwapCompleteEvent) Bytes() []byte {
|
||||||
buf := make([]byte, 32)
|
buf := make([]byte, 32)
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -315,12 +309,14 @@ func (v BufferSwapCompleteEvent) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func (v BufferSwapCompleteEvent) SequenceId() uint16 {
|
||||||
return v.Sequence
|
return v.Sequence
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// String is a rudimentary string representation of BufferSwapCompleteEvent.
|
||||||
func (v BufferSwapCompleteEvent) String() string {
|
func (v BufferSwapCompleteEvent) String() string {
|
||||||
fieldVals := make([]string, 0, 9)
|
fieldVals := make([]string, 0, 9)
|
||||||
fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence))
|
fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence))
|
||||||
|
@ -338,9 +334,7 @@ func init() {
|
||||||
xgb.NewExtEventFuncs["DRI2"][0] = BufferSwapCompleteEventNew
|
xgb.NewExtEventFuncs["DRI2"][0] = BufferSwapCompleteEventNew
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event definition InvalidateBuffers (1)
|
// InvalidateBuffers is the event number for a InvalidateBuffersEvent.
|
||||||
// Size: 32
|
|
||||||
|
|
||||||
const InvalidateBuffers = 1
|
const InvalidateBuffers = 1
|
||||||
|
|
||||||
type InvalidateBuffersEvent struct {
|
type InvalidateBuffersEvent struct {
|
||||||
|
@ -349,7 +343,7 @@ type InvalidateBuffersEvent struct {
|
||||||
Drawable xproto.Drawable
|
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 {
|
func InvalidateBuffersEventNew(buf []byte) xgb.Event {
|
||||||
v := InvalidateBuffersEvent{}
|
v := InvalidateBuffersEvent{}
|
||||||
b := 1 // don't read event number
|
b := 1 // don't read event number
|
||||||
|
@ -365,7 +359,7 @@ func InvalidateBuffersEventNew(buf []byte) xgb.Event {
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event write InvalidateBuffers
|
// Bytes writes a InvalidateBuffersEvent value to a byte slice.
|
||||||
func (v InvalidateBuffersEvent) Bytes() []byte {
|
func (v InvalidateBuffersEvent) Bytes() []byte {
|
||||||
buf := make([]byte, 32)
|
buf := make([]byte, 32)
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -384,12 +378,14 @@ func (v InvalidateBuffersEvent) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func (v InvalidateBuffersEvent) SequenceId() uint16 {
|
||||||
return v.Sequence
|
return v.Sequence
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// String is a rudimentary string representation of InvalidateBuffersEvent.
|
||||||
func (v InvalidateBuffersEvent) String() string {
|
func (v InvalidateBuffersEvent) String() string {
|
||||||
fieldVals := make([]string, 0, 2)
|
fieldVals := make([]string, 0, 2)
|
||||||
fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence))
|
fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence))
|
||||||
|
@ -401,35 +397,37 @@ func init() {
|
||||||
xgb.NewExtEventFuncs["DRI2"][1] = InvalidateBuffersEventNew
|
xgb.NewExtEventFuncs["DRI2"][1] = InvalidateBuffersEventNew
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request QueryVersion
|
// QueryVersionCookie is a cookie used only for QueryVersion requests.
|
||||||
// size: 12
|
|
||||||
type QueryVersionCookie struct {
|
type QueryVersionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie)
|
c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie)
|
||||||
return QueryVersionCookie{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 {
|
func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie)
|
c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie)
|
||||||
return QueryVersionCookie{cookie}
|
return QueryVersionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryVersion
|
// QueryVersionReply represents the data returned from a QueryVersion request.
|
||||||
// size: 16
|
|
||||||
type QueryVersionReply struct {
|
type QueryVersionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
MajorVersion uint32
|
MajorVersion uint32
|
||||||
MinorVersion 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) {
|
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -441,7 +439,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
return queryVersionReply(buf), nil
|
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 {
|
func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
v := new(QueryVersionReply)
|
v := new(QueryVersionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -464,6 +462,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryVersion
|
// 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 {
|
func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -487,29 +486,31 @@ func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32)
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Connect
|
// ConnectCookie is a cookie used only for Connect requests.
|
||||||
// size: 12
|
|
||||||
type ConnectCookie struct {
|
type ConnectCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func Connect(c *xgb.Conn, Window xproto.Window, DriverType uint32) ConnectCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(connectRequest(c, Window, DriverType), cookie)
|
c.NewRequest(connectRequest(c, Window, DriverType), cookie)
|
||||||
return ConnectCookie{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 {
|
func ConnectUnchecked(c *xgb.Conn, Window xproto.Window, DriverType uint32) ConnectCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(connectRequest(c, Window, DriverType), cookie)
|
c.NewRequest(connectRequest(c, Window, DriverType), cookie)
|
||||||
return ConnectCookie{cookie}
|
return ConnectCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for Connect
|
// ConnectReply represents the data returned from a Connect request.
|
||||||
// size: (((32 + xgb.Pad((int(DriverNameLength) * 1))) + xgb.Pad(((((int(DriverNameLength) + 3) & -4) - int(DriverNameLength)) * 1))) + xgb.Pad((int(DeviceNameLength) * 1)))
|
|
||||||
type ConnectReply struct {
|
type ConnectReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
DriverNameLength uint32
|
DriverNameLength uint32
|
||||||
DeviceNameLength uint32
|
DeviceNameLength uint32
|
||||||
|
@ -519,7 +520,7 @@ type ConnectReply struct {
|
||||||
DeviceName string // size: xgb.Pad((int(DeviceNameLength) * 1))
|
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) {
|
func (cook ConnectCookie) Reply() (*ConnectReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -531,7 +532,7 @@ func (cook ConnectCookie) Reply() (*ConnectReply, error) {
|
||||||
return connectReply(buf), nil
|
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 {
|
func connectReply(buf []byte) *ConnectReply {
|
||||||
v := new(ConnectReply)
|
v := new(ConnectReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -574,6 +575,7 @@ func connectReply(buf []byte) *ConnectReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Connect
|
// 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 {
|
func connectRequest(c *xgb.Conn, Window xproto.Window, DriverType uint32) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -597,34 +599,36 @@ func connectRequest(c *xgb.Conn, Window xproto.Window, DriverType uint32) []byte
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Authenticate
|
// AuthenticateCookie is a cookie used only for Authenticate requests.
|
||||||
// size: 12
|
|
||||||
type AuthenticateCookie struct {
|
type AuthenticateCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func Authenticate(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(authenticateRequest(c, Window, Magic), cookie)
|
c.NewRequest(authenticateRequest(c, Window, Magic), cookie)
|
||||||
return AuthenticateCookie{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 {
|
func AuthenticateUnchecked(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(authenticateRequest(c, Window, Magic), cookie)
|
c.NewRequest(authenticateRequest(c, Window, Magic), cookie)
|
||||||
return AuthenticateCookie{cookie}
|
return AuthenticateCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for Authenticate
|
// AuthenticateReply represents the data returned from a Authenticate request.
|
||||||
// size: 12
|
|
||||||
type AuthenticateReply struct {
|
type AuthenticateReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
Authenticated uint32
|
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) {
|
func (cook AuthenticateCookie) Reply() (*AuthenticateReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -636,7 +640,7 @@ func (cook AuthenticateCookie) Reply() (*AuthenticateReply, error) {
|
||||||
return authenticateReply(buf), nil
|
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 {
|
func authenticateReply(buf []byte) *AuthenticateReply {
|
||||||
v := new(AuthenticateReply)
|
v := new(AuthenticateReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -656,6 +660,7 @@ func authenticateReply(buf []byte) *AuthenticateReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Authenticate
|
// 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 {
|
func authenticateRequest(c *xgb.Conn, Window xproto.Window, Magic uint32) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -679,30 +684,35 @@ func authenticateRequest(c *xgb.Conn, Window xproto.Window, Magic uint32) []byte
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request CreateDrawable
|
// CreateDrawableCookie is a cookie used only for CreateDrawable requests.
|
||||||
// size: 8
|
|
||||||
type CreateDrawableCookie struct {
|
type CreateDrawableCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func CreateDrawable(c *xgb.Conn, Drawable xproto.Drawable) CreateDrawableCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(createDrawableRequest(c, Drawable), cookie)
|
c.NewRequest(createDrawableRequest(c, Drawable), cookie)
|
||||||
return CreateDrawableCookie{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 {
|
func CreateDrawableChecked(c *xgb.Conn, Drawable xproto.Drawable) CreateDrawableCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(createDrawableRequest(c, Drawable), cookie)
|
c.NewRequest(createDrawableRequest(c, Drawable), cookie)
|
||||||
return CreateDrawableCookie{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 {
|
func (cook CreateDrawableCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for CreateDrawable
|
// Write request to wire for CreateDrawable
|
||||||
|
// createDrawableRequest writes a CreateDrawable request to a byte slice.
|
||||||
func createDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
|
func createDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -723,30 +733,35 @@ func createDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request DestroyDrawable
|
// DestroyDrawableCookie is a cookie used only for DestroyDrawable requests.
|
||||||
// size: 8
|
|
||||||
type DestroyDrawableCookie struct {
|
type DestroyDrawableCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func DestroyDrawable(c *xgb.Conn, Drawable xproto.Drawable) DestroyDrawableCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(destroyDrawableRequest(c, Drawable), cookie)
|
c.NewRequest(destroyDrawableRequest(c, Drawable), cookie)
|
||||||
return DestroyDrawableCookie{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 {
|
func DestroyDrawableChecked(c *xgb.Conn, Drawable xproto.Drawable) DestroyDrawableCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(destroyDrawableRequest(c, Drawable), cookie)
|
c.NewRequest(destroyDrawableRequest(c, Drawable), cookie)
|
||||||
return DestroyDrawableCookie{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 {
|
func (cook DestroyDrawableCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for DestroyDrawable
|
// Write request to wire for DestroyDrawable
|
||||||
|
// destroyDrawableRequest writes a DestroyDrawable request to a byte slice.
|
||||||
func destroyDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
|
func destroyDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -767,29 +782,31 @@ func destroyDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request GetBuffers
|
// GetBuffersCookie is a cookie used only for GetBuffers requests.
|
||||||
// size: xgb.Pad((12 + xgb.Pad((len(Attachments) * 4))))
|
|
||||||
type GetBuffersCookie struct {
|
type GetBuffersCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GetBuffers(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) GetBuffersCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getBuffersRequest(c, Drawable, Count, Attachments), cookie)
|
c.NewRequest(getBuffersRequest(c, Drawable, Count, Attachments), cookie)
|
||||||
return GetBuffersCookie{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 {
|
func GetBuffersUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) GetBuffersCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getBuffersRequest(c, Drawable, Count, Attachments), cookie)
|
c.NewRequest(getBuffersRequest(c, Drawable, Count, Attachments), cookie)
|
||||||
return GetBuffersCookie{cookie}
|
return GetBuffersCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetBuffers
|
// GetBuffersReply represents the data returned from a GetBuffers request.
|
||||||
// size: (32 + xgb.Pad((int(Count) * 20)))
|
|
||||||
type GetBuffersReply struct {
|
type GetBuffersReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
Width uint32
|
Width uint32
|
||||||
Height uint32
|
Height uint32
|
||||||
|
@ -798,7 +815,7 @@ type GetBuffersReply struct {
|
||||||
Buffers []DRI2Buffer // size: xgb.Pad((int(Count) * 20))
|
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) {
|
func (cook GetBuffersCookie) Reply() (*GetBuffersReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -810,7 +827,7 @@ func (cook GetBuffersCookie) Reply() (*GetBuffersReply, error) {
|
||||||
return getBuffersReply(buf), nil
|
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 {
|
func getBuffersReply(buf []byte) *GetBuffersReply {
|
||||||
v := new(GetBuffersReply)
|
v := new(GetBuffersReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -841,6 +858,7 @@ func getBuffersReply(buf []byte) *GetBuffersReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetBuffers
|
// 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 {
|
func getBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) []byte {
|
||||||
size := xgb.Pad((12 + xgb.Pad((len(Attachments) * 4))))
|
size := xgb.Pad((12 + xgb.Pad((len(Attachments) * 4))))
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -870,33 +888,35 @@ func getBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Atta
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request CopyRegion
|
// CopyRegionCookie is a cookie used only for CopyRegion requests.
|
||||||
// size: 20
|
|
||||||
type CopyRegionCookie struct {
|
type CopyRegionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func CopyRegion(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(copyRegionRequest(c, Drawable, Region, Dest, Src), cookie)
|
c.NewRequest(copyRegionRequest(c, Drawable, Region, Dest, Src), cookie)
|
||||||
return CopyRegionCookie{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 {
|
func CopyRegionUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(copyRegionRequest(c, Drawable, Region, Dest, Src), cookie)
|
c.NewRequest(copyRegionRequest(c, Drawable, Region, Dest, Src), cookie)
|
||||||
return CopyRegionCookie{cookie}
|
return CopyRegionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for CopyRegion
|
// CopyRegionReply represents the data returned from a CopyRegion request.
|
||||||
// size: 8
|
|
||||||
type CopyRegionReply struct {
|
type CopyRegionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// 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) {
|
func (cook CopyRegionCookie) Reply() (*CopyRegionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -908,7 +928,7 @@ func (cook CopyRegionCookie) Reply() (*CopyRegionReply, error) {
|
||||||
return copyRegionReply(buf), nil
|
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 {
|
func copyRegionReply(buf []byte) *CopyRegionReply {
|
||||||
v := new(CopyRegionReply)
|
v := new(CopyRegionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -925,6 +945,7 @@ func copyRegionReply(buf []byte) *CopyRegionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for CopyRegion
|
// 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 {
|
func copyRegionRequest(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) []byte {
|
||||||
size := 20
|
size := 20
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -954,29 +975,31 @@ func copyRegionRequest(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Des
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request GetBuffersWithFormat
|
// GetBuffersWithFormatCookie is a cookie used only for GetBuffersWithFormat requests.
|
||||||
// size: xgb.Pad((12 + xgb.Pad((len(Attachments) * 8))))
|
|
||||||
type GetBuffersWithFormatCookie struct {
|
type GetBuffersWithFormatCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GetBuffersWithFormat(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) GetBuffersWithFormatCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getBuffersWithFormatRequest(c, Drawable, Count, Attachments), cookie)
|
c.NewRequest(getBuffersWithFormatRequest(c, Drawable, Count, Attachments), cookie)
|
||||||
return GetBuffersWithFormatCookie{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 {
|
func GetBuffersWithFormatUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) GetBuffersWithFormatCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getBuffersWithFormatRequest(c, Drawable, Count, Attachments), cookie)
|
c.NewRequest(getBuffersWithFormatRequest(c, Drawable, Count, Attachments), cookie)
|
||||||
return GetBuffersWithFormatCookie{cookie}
|
return GetBuffersWithFormatCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetBuffersWithFormat
|
// GetBuffersWithFormatReply represents the data returned from a GetBuffersWithFormat request.
|
||||||
// size: (32 + xgb.Pad((int(Count) * 20)))
|
|
||||||
type GetBuffersWithFormatReply struct {
|
type GetBuffersWithFormatReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
Width uint32
|
Width uint32
|
||||||
Height uint32
|
Height uint32
|
||||||
|
@ -985,7 +1008,7 @@ type GetBuffersWithFormatReply struct {
|
||||||
Buffers []DRI2Buffer // size: xgb.Pad((int(Count) * 20))
|
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) {
|
func (cook GetBuffersWithFormatCookie) Reply() (*GetBuffersWithFormatReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -997,7 +1020,7 @@ func (cook GetBuffersWithFormatCookie) Reply() (*GetBuffersWithFormatReply, erro
|
||||||
return getBuffersWithFormatReply(buf), nil
|
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 {
|
func getBuffersWithFormatReply(buf []byte) *GetBuffersWithFormatReply {
|
||||||
v := new(GetBuffersWithFormatReply)
|
v := new(GetBuffersWithFormatReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -1028,6 +1051,7 @@ func getBuffersWithFormatReply(buf []byte) *GetBuffersWithFormatReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetBuffersWithFormat
|
// 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 {
|
func getBuffersWithFormatRequest(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) []byte {
|
||||||
size := xgb.Pad((12 + xgb.Pad((len(Attachments) * 8))))
|
size := xgb.Pad((12 + xgb.Pad((len(Attachments) * 8))))
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -1053,35 +1077,37 @@ func getBuffersWithFormatRequest(c *xgb.Conn, Drawable xproto.Drawable, Count ui
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request SwapBuffers
|
// SwapBuffersCookie is a cookie used only for SwapBuffers requests.
|
||||||
// size: 32
|
|
||||||
type SwapBuffersCookie struct {
|
type SwapBuffersCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
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)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(swapBuffersRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie)
|
c.NewRequest(swapBuffersRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie)
|
||||||
return SwapBuffersCookie{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 {
|
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)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(swapBuffersRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie)
|
c.NewRequest(swapBuffersRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie)
|
||||||
return SwapBuffersCookie{cookie}
|
return SwapBuffersCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for SwapBuffers
|
// SwapBuffersReply represents the data returned from a SwapBuffers request.
|
||||||
// size: 16
|
|
||||||
type SwapBuffersReply struct {
|
type SwapBuffersReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
SwapHi uint32
|
SwapHi uint32
|
||||||
SwapLo 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) {
|
func (cook SwapBuffersCookie) Reply() (*SwapBuffersReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1093,7 +1119,7 @@ func (cook SwapBuffersCookie) Reply() (*SwapBuffersReply, error) {
|
||||||
return swapBuffersReply(buf), nil
|
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 {
|
func swapBuffersReply(buf []byte) *SwapBuffersReply {
|
||||||
v := new(SwapBuffersReply)
|
v := new(SwapBuffersReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -1116,6 +1142,7 @@ func swapBuffersReply(buf []byte) *SwapBuffersReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for SwapBuffers
|
// 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 {
|
func swapBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) []byte {
|
||||||
size := 32
|
size := 32
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -1154,29 +1181,31 @@ func swapBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint3
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request GetMSC
|
// GetMSCCookie is a cookie used only for GetMSC requests.
|
||||||
// size: 8
|
|
||||||
type GetMSCCookie struct {
|
type GetMSCCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GetMSC(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getMSCRequest(c, Drawable), cookie)
|
c.NewRequest(getMSCRequest(c, Drawable), cookie)
|
||||||
return GetMSCCookie{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 {
|
func GetMSCUnchecked(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getMSCRequest(c, Drawable), cookie)
|
c.NewRequest(getMSCRequest(c, Drawable), cookie)
|
||||||
return GetMSCCookie{cookie}
|
return GetMSCCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetMSC
|
// GetMSCReply represents the data returned from a GetMSC request.
|
||||||
// size: 32
|
|
||||||
type GetMSCReply struct {
|
type GetMSCReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
UstHi uint32
|
UstHi uint32
|
||||||
UstLo uint32
|
UstLo uint32
|
||||||
|
@ -1186,7 +1215,7 @@ type GetMSCReply struct {
|
||||||
SbcLo uint32
|
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) {
|
func (cook GetMSCCookie) Reply() (*GetMSCReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1198,7 +1227,7 @@ func (cook GetMSCCookie) Reply() (*GetMSCReply, error) {
|
||||||
return getMSCReply(buf), nil
|
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 {
|
func getMSCReply(buf []byte) *GetMSCReply {
|
||||||
v := new(GetMSCReply)
|
v := new(GetMSCReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -1233,6 +1262,7 @@ func getMSCReply(buf []byte) *GetMSCReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetMSC
|
// Write request to wire for GetMSC
|
||||||
|
// getMSCRequest writes a GetMSC request to a byte slice.
|
||||||
func getMSCRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
|
func getMSCRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -1253,29 +1283,31 @@ func getMSCRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request WaitMSC
|
// WaitMSCCookie is a cookie used only for WaitMSC requests.
|
||||||
// size: 32
|
|
||||||
type WaitMSCCookie struct {
|
type WaitMSCCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
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)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(waitMSCRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie)
|
c.NewRequest(waitMSCRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie)
|
||||||
return WaitMSCCookie{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 {
|
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)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(waitMSCRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie)
|
c.NewRequest(waitMSCRequest(c, Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo), cookie)
|
||||||
return WaitMSCCookie{cookie}
|
return WaitMSCCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for WaitMSC
|
// WaitMSCReply represents the data returned from a WaitMSC request.
|
||||||
// size: 32
|
|
||||||
type WaitMSCReply struct {
|
type WaitMSCReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
UstHi uint32
|
UstHi uint32
|
||||||
UstLo uint32
|
UstLo uint32
|
||||||
|
@ -1285,7 +1317,7 @@ type WaitMSCReply struct {
|
||||||
SbcLo uint32
|
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) {
|
func (cook WaitMSCCookie) Reply() (*WaitMSCReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1297,7 +1329,7 @@ func (cook WaitMSCCookie) Reply() (*WaitMSCReply, error) {
|
||||||
return waitMSCReply(buf), nil
|
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 {
|
func waitMSCReply(buf []byte) *WaitMSCReply {
|
||||||
v := new(WaitMSCReply)
|
v := new(WaitMSCReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -1332,6 +1364,7 @@ func waitMSCReply(buf []byte) *WaitMSCReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for WaitMSC
|
// 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 {
|
func waitMSCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) []byte {
|
||||||
size := 32
|
size := 32
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -1370,29 +1403,31 @@ func waitMSCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, T
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request WaitSBC
|
// WaitSBCCookie is a cookie used only for WaitSBC requests.
|
||||||
// size: 16
|
|
||||||
type WaitSBCCookie struct {
|
type WaitSBCCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func WaitSBC(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) WaitSBCCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(waitSBCRequest(c, Drawable, TargetSbcHi, TargetSbcLo), cookie)
|
c.NewRequest(waitSBCRequest(c, Drawable, TargetSbcHi, TargetSbcLo), cookie)
|
||||||
return WaitSBCCookie{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 {
|
func WaitSBCUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) WaitSBCCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(waitSBCRequest(c, Drawable, TargetSbcHi, TargetSbcLo), cookie)
|
c.NewRequest(waitSBCRequest(c, Drawable, TargetSbcHi, TargetSbcLo), cookie)
|
||||||
return WaitSBCCookie{cookie}
|
return WaitSBCCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for WaitSBC
|
// WaitSBCReply represents the data returned from a WaitSBC request.
|
||||||
// size: 32
|
|
||||||
type WaitSBCReply struct {
|
type WaitSBCReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
UstHi uint32
|
UstHi uint32
|
||||||
UstLo uint32
|
UstLo uint32
|
||||||
|
@ -1402,7 +1437,7 @@ type WaitSBCReply struct {
|
||||||
SbcLo uint32
|
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) {
|
func (cook WaitSBCCookie) Reply() (*WaitSBCReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1414,7 +1449,7 @@ func (cook WaitSBCCookie) Reply() (*WaitSBCReply, error) {
|
||||||
return waitSBCReply(buf), nil
|
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 {
|
func waitSBCReply(buf []byte) *WaitSBCReply {
|
||||||
v := new(WaitSBCReply)
|
v := new(WaitSBCReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -1449,6 +1484,7 @@ func waitSBCReply(buf []byte) *WaitSBCReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for WaitSBC
|
// 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 {
|
func waitSBCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) []byte {
|
||||||
size := 16
|
size := 16
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -1475,30 +1511,35 @@ func waitSBCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, T
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request SwapInterval
|
// SwapIntervalCookie is a cookie used only for SwapInterval requests.
|
||||||
// size: 12
|
|
||||||
type SwapIntervalCookie struct {
|
type SwapIntervalCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func SwapInterval(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(swapIntervalRequest(c, Drawable, Interval), cookie)
|
c.NewRequest(swapIntervalRequest(c, Drawable, Interval), cookie)
|
||||||
return SwapIntervalCookie{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 {
|
func SwapIntervalChecked(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(swapIntervalRequest(c, Drawable, Interval), cookie)
|
c.NewRequest(swapIntervalRequest(c, Drawable, Interval), cookie)
|
||||||
return SwapIntervalCookie{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 {
|
func (cook SwapIntervalCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for SwapInterval
|
// 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 {
|
func swapIntervalRequest(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
package ge
|
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!
|
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)
|
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 'Int32'
|
||||||
|
|
||||||
// Skipping definition for base type 'Void'
|
// Skipping definition for base type 'Void'
|
||||||
|
@ -64,36 +60,42 @@ func init() {
|
||||||
|
|
||||||
// Skipping definition for base type 'Float'
|
// Skipping definition for base type 'Float'
|
||||||
|
|
||||||
// Request QueryVersion
|
// Skipping definition for base type 'Card8'
|
||||||
// size: 8
|
|
||||||
|
// Skipping definition for base type 'Int16'
|
||||||
|
|
||||||
|
// QueryVersionCookie is a cookie used only for QueryVersion requests.
|
||||||
type QueryVersionCookie struct {
|
type QueryVersionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
||||||
return QueryVersionCookie{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 {
|
func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
||||||
return QueryVersionCookie{cookie}
|
return QueryVersionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryVersion
|
// QueryVersionReply represents the data returned from a QueryVersion request.
|
||||||
// size: 32
|
|
||||||
type QueryVersionReply struct {
|
type QueryVersionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
MajorVersion uint16
|
MajorVersion uint16
|
||||||
MinorVersion uint16
|
MinorVersion uint16
|
||||||
// padding: 20 bytes
|
// 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) {
|
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -105,7 +107,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
return queryVersionReply(buf), nil
|
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 {
|
func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
v := new(QueryVersionReply)
|
v := new(QueryVersionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -130,6 +132,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryVersion
|
// 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 {
|
func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
|
1778
nexgb/glx/glx.go
1778
nexgb/glx/glx.go
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -2,7 +2,7 @@
|
||||||
package record
|
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!
|
This file is automatically generated. Edit at your peril!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -90,14 +90,12 @@ type ElementHeader byte
|
||||||
|
|
||||||
type ClientSpec uint32
|
type ClientSpec uint32
|
||||||
|
|
||||||
// 'Range8' struct definition
|
|
||||||
// Size: 2
|
|
||||||
type Range8 struct {
|
type Range8 struct {
|
||||||
First byte
|
First byte
|
||||||
Last byte
|
Last byte
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct read Range8
|
// Range8Read reads a byte slice into a Range8 value.
|
||||||
func Range8Read(buf []byte, v *Range8) int {
|
func Range8Read(buf []byte, v *Range8) int {
|
||||||
b := 0
|
b := 0
|
||||||
|
|
||||||
|
@ -110,7 +108,7 @@ func Range8Read(buf []byte, v *Range8) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct list read Range8
|
// Range8ReadList reads a byte slice into a list of Range8 values.
|
||||||
func Range8ReadList(buf []byte, dest []Range8) int {
|
func Range8ReadList(buf []byte, dest []Range8) int {
|
||||||
b := 0
|
b := 0
|
||||||
for i := 0; i < len(dest); i++ {
|
for i := 0; i < len(dest); i++ {
|
||||||
|
@ -120,7 +118,7 @@ func Range8ReadList(buf []byte, dest []Range8) int {
|
||||||
return xgb.Pad(b)
|
return xgb.Pad(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct write Range8
|
// Bytes writes a Range8 value to a byte slice.
|
||||||
func (v Range8) Bytes() []byte {
|
func (v Range8) Bytes() []byte {
|
||||||
buf := make([]byte, 2)
|
buf := make([]byte, 2)
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -134,7 +132,7 @@ func (v Range8) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func Range8ListBytes(buf []byte, list []Range8) int {
|
||||||
b := 0
|
b := 0
|
||||||
var structBytes []byte
|
var structBytes []byte
|
||||||
|
@ -146,14 +144,12 @@ func Range8ListBytes(buf []byte, list []Range8) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'Range16' struct definition
|
|
||||||
// Size: 4
|
|
||||||
type Range16 struct {
|
type Range16 struct {
|
||||||
First uint16
|
First uint16
|
||||||
Last uint16
|
Last uint16
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct read Range16
|
// Range16Read reads a byte slice into a Range16 value.
|
||||||
func Range16Read(buf []byte, v *Range16) int {
|
func Range16Read(buf []byte, v *Range16) int {
|
||||||
b := 0
|
b := 0
|
||||||
|
|
||||||
|
@ -166,7 +162,7 @@ func Range16Read(buf []byte, v *Range16) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct list read Range16
|
// Range16ReadList reads a byte slice into a list of Range16 values.
|
||||||
func Range16ReadList(buf []byte, dest []Range16) int {
|
func Range16ReadList(buf []byte, dest []Range16) int {
|
||||||
b := 0
|
b := 0
|
||||||
for i := 0; i < len(dest); i++ {
|
for i := 0; i < len(dest); i++ {
|
||||||
|
@ -176,7 +172,7 @@ func Range16ReadList(buf []byte, dest []Range16) int {
|
||||||
return xgb.Pad(b)
|
return xgb.Pad(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct write Range16
|
// Bytes writes a Range16 value to a byte slice.
|
||||||
func (v Range16) Bytes() []byte {
|
func (v Range16) Bytes() []byte {
|
||||||
buf := make([]byte, 4)
|
buf := make([]byte, 4)
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -190,7 +186,7 @@ func (v Range16) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func Range16ListBytes(buf []byte, list []Range16) int {
|
||||||
b := 0
|
b := 0
|
||||||
var structBytes []byte
|
var structBytes []byte
|
||||||
|
@ -202,14 +198,12 @@ func Range16ListBytes(buf []byte, list []Range16) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'ExtRange' struct definition
|
|
||||||
// Size: 6
|
|
||||||
type ExtRange struct {
|
type ExtRange struct {
|
||||||
Major Range8
|
Major Range8
|
||||||
Minor Range16
|
Minor Range16
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct read ExtRange
|
// ExtRangeRead reads a byte slice into a ExtRange value.
|
||||||
func ExtRangeRead(buf []byte, v *ExtRange) int {
|
func ExtRangeRead(buf []byte, v *ExtRange) int {
|
||||||
b := 0
|
b := 0
|
||||||
|
|
||||||
|
@ -222,7 +216,7 @@ func ExtRangeRead(buf []byte, v *ExtRange) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct list read ExtRange
|
// ExtRangeReadList reads a byte slice into a list of ExtRange values.
|
||||||
func ExtRangeReadList(buf []byte, dest []ExtRange) int {
|
func ExtRangeReadList(buf []byte, dest []ExtRange) int {
|
||||||
b := 0
|
b := 0
|
||||||
for i := 0; i < len(dest); i++ {
|
for i := 0; i < len(dest); i++ {
|
||||||
|
@ -232,7 +226,7 @@ func ExtRangeReadList(buf []byte, dest []ExtRange) int {
|
||||||
return xgb.Pad(b)
|
return xgb.Pad(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct write ExtRange
|
// Bytes writes a ExtRange value to a byte slice.
|
||||||
func (v ExtRange) Bytes() []byte {
|
func (v ExtRange) Bytes() []byte {
|
||||||
buf := make([]byte, 6)
|
buf := make([]byte, 6)
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -252,7 +246,7 @@ func (v ExtRange) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func ExtRangeListBytes(buf []byte, list []ExtRange) int {
|
||||||
b := 0
|
b := 0
|
||||||
var structBytes []byte
|
var structBytes []byte
|
||||||
|
@ -264,8 +258,6 @@ func ExtRangeListBytes(buf []byte, list []ExtRange) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'Range' struct definition
|
|
||||||
// Size: 24
|
|
||||||
type Range struct {
|
type Range struct {
|
||||||
CoreRequests Range8
|
CoreRequests Range8
|
||||||
CoreReplies Range8
|
CoreReplies Range8
|
||||||
|
@ -278,7 +270,7 @@ type Range struct {
|
||||||
ClientDied bool
|
ClientDied bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct read Range
|
// RangeRead reads a byte slice into a Range value.
|
||||||
func RangeRead(buf []byte, v *Range) int {
|
func RangeRead(buf []byte, v *Range) int {
|
||||||
b := 0
|
b := 0
|
||||||
|
|
||||||
|
@ -320,7 +312,7 @@ func RangeRead(buf []byte, v *Range) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct list read Range
|
// RangeReadList reads a byte slice into a list of Range values.
|
||||||
func RangeReadList(buf []byte, dest []Range) int {
|
func RangeReadList(buf []byte, dest []Range) int {
|
||||||
b := 0
|
b := 0
|
||||||
for i := 0; i < len(dest); i++ {
|
for i := 0; i < len(dest); i++ {
|
||||||
|
@ -330,7 +322,7 @@ func RangeReadList(buf []byte, dest []Range) int {
|
||||||
return xgb.Pad(b)
|
return xgb.Pad(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct write Range
|
// Bytes writes a Range value to a byte slice.
|
||||||
func (v Range) Bytes() []byte {
|
func (v Range) Bytes() []byte {
|
||||||
buf := make([]byte, 24)
|
buf := make([]byte, 24)
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -394,7 +386,7 @@ func (v Range) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func RangeListBytes(buf []byte, list []Range) int {
|
||||||
b := 0
|
b := 0
|
||||||
var structBytes []byte
|
var structBytes []byte
|
||||||
|
@ -406,15 +398,13 @@ func RangeListBytes(buf []byte, list []Range) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'ClientInfo' struct definition
|
|
||||||
// Size: (8 + xgb.Pad((int(NumRanges) * 24)))
|
|
||||||
type ClientInfo struct {
|
type ClientInfo struct {
|
||||||
ClientResource ClientSpec
|
ClientResource ClientSpec
|
||||||
NumRanges uint32
|
NumRanges uint32
|
||||||
Ranges []Range // size: xgb.Pad((int(NumRanges) * 24))
|
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 {
|
func ClientInfoRead(buf []byte, v *ClientInfo) int {
|
||||||
b := 0
|
b := 0
|
||||||
|
|
||||||
|
@ -430,7 +420,7 @@ func ClientInfoRead(buf []byte, v *ClientInfo) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct list read ClientInfo
|
// ClientInfoReadList reads a byte slice into a list of ClientInfo values.
|
||||||
func ClientInfoReadList(buf []byte, dest []ClientInfo) int {
|
func ClientInfoReadList(buf []byte, dest []ClientInfo) int {
|
||||||
b := 0
|
b := 0
|
||||||
for i := 0; i < len(dest); i++ {
|
for i := 0; i < len(dest); i++ {
|
||||||
|
@ -440,7 +430,7 @@ func ClientInfoReadList(buf []byte, dest []ClientInfo) int {
|
||||||
return xgb.Pad(b)
|
return xgb.Pad(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct write ClientInfo
|
// Bytes writes a ClientInfo value to a byte slice.
|
||||||
func (v ClientInfo) Bytes() []byte {
|
func (v ClientInfo) Bytes() []byte {
|
||||||
buf := make([]byte, (8 + xgb.Pad((int(v.NumRanges) * 24))))
|
buf := make([]byte, (8 + xgb.Pad((int(v.NumRanges) * 24))))
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -456,7 +446,7 @@ func (v ClientInfo) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func ClientInfoListBytes(buf []byte, list []ClientInfo) int {
|
||||||
b := 0
|
b := 0
|
||||||
var structBytes []byte
|
var structBytes []byte
|
||||||
|
@ -468,7 +458,7 @@ func ClientInfoListBytes(buf []byte, list []ClientInfo) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct list size ClientInfo
|
// ClientInfoListSize computes the size (bytes) of a list of ClientInfo values.
|
||||||
func ClientInfoListSize(list []ClientInfo) int {
|
func ClientInfoListSize(list []ClientInfo) int {
|
||||||
size := 0
|
size := 0
|
||||||
for _, item := range list {
|
for _, item := range list {
|
||||||
|
@ -477,9 +467,7 @@ func ClientInfoListSize(list []ClientInfo) int {
|
||||||
return size
|
return size
|
||||||
}
|
}
|
||||||
|
|
||||||
// Error definition BadContext (0)
|
// BadBadContext is the error number for a BadBadContext.
|
||||||
// Size: 32
|
|
||||||
|
|
||||||
const BadBadContext = 0
|
const BadBadContext = 0
|
||||||
|
|
||||||
type BadContextError struct {
|
type BadContextError struct {
|
||||||
|
@ -488,7 +476,7 @@ type BadContextError struct {
|
||||||
InvalidRecord uint32
|
InvalidRecord uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
// Error read BadContext
|
// BadContextErrorNew constructs a BadContextError value that implements xgb.Error from a byte slice.
|
||||||
func BadContextErrorNew(buf []byte) xgb.Error {
|
func BadContextErrorNew(buf []byte) xgb.Error {
|
||||||
v := BadContextError{}
|
v := BadContextError{}
|
||||||
v.NiceName = "BadContext"
|
v.NiceName = "BadContext"
|
||||||
|
@ -505,8 +493,8 @@ func BadContextErrorNew(buf []byte) xgb.Error {
|
||||||
return v
|
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 {
|
func (err BadContextError) SequenceId() uint16 {
|
||||||
return err.Sequence
|
return err.Sequence
|
||||||
}
|
}
|
||||||
|
@ -527,35 +515,37 @@ func init() {
|
||||||
xgb.NewExtErrorFuncs["RECORD"][0] = BadContextErrorNew
|
xgb.NewExtErrorFuncs["RECORD"][0] = BadContextErrorNew
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request QueryVersion
|
// QueryVersionCookie is a cookie used only for QueryVersion requests.
|
||||||
// size: 8
|
|
||||||
type QueryVersionCookie struct {
|
type QueryVersionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryVersion(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie)
|
c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie)
|
||||||
return QueryVersionCookie{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 {
|
func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie)
|
c.NewRequest(queryVersionRequest(c, MajorVersion, MinorVersion), cookie)
|
||||||
return QueryVersionCookie{cookie}
|
return QueryVersionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryVersion
|
// QueryVersionReply represents the data returned from a QueryVersion request.
|
||||||
// size: 12
|
|
||||||
type QueryVersionReply struct {
|
type QueryVersionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
MajorVersion uint16
|
MajorVersion uint16
|
||||||
MinorVersion 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) {
|
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -567,7 +557,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
return queryVersionReply(buf), nil
|
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 {
|
func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
v := new(QueryVersionReply)
|
v := new(QueryVersionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -590,6 +580,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryVersion
|
// 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 {
|
func queryVersionRequest(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -613,30 +604,35 @@ func queryVersionRequest(c *xgb.Conn, MajorVersion uint16, MinorVersion uint16)
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request CreateContext
|
// CreateContextCookie is a cookie used only for CreateContext requests.
|
||||||
// size: xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24))))
|
|
||||||
type CreateContextCookie struct {
|
type CreateContextCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func CreateContext(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(createContextRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie)
|
c.NewRequest(createContextRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie)
|
||||||
return CreateContextCookie{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 {
|
func CreateContextChecked(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) CreateContextCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(createContextRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie)
|
c.NewRequest(createContextRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie)
|
||||||
return CreateContextCookie{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 {
|
func (cook CreateContextCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for CreateContext
|
// 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 {
|
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))))
|
size := xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24))))
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -676,30 +672,35 @@ func createContextRequest(c *xgb.Conn, Context Context, ElementHeader ElementHea
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request RegisterClients
|
// RegisterClientsCookie is a cookie used only for RegisterClients requests.
|
||||||
// size: xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24))))
|
|
||||||
type RegisterClientsCookie struct {
|
type RegisterClientsCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func RegisterClients(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) RegisterClientsCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(registerClientsRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie)
|
c.NewRequest(registerClientsRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie)
|
||||||
return RegisterClientsCookie{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 {
|
func RegisterClientsChecked(c *xgb.Conn, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) RegisterClientsCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(registerClientsRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie)
|
c.NewRequest(registerClientsRequest(c, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges), cookie)
|
||||||
return RegisterClientsCookie{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 {
|
func (cook RegisterClientsCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for RegisterClients
|
// 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 {
|
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))))
|
size := xgb.Pad(((20 + xgb.Pad((int(NumClientSpecs) * 4))) + xgb.Pad((int(NumRanges) * 24))))
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -739,30 +740,35 @@ func registerClientsRequest(c *xgb.Conn, Context Context, ElementHeader ElementH
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request UnregisterClients
|
// UnregisterClientsCookie is a cookie used only for UnregisterClients requests.
|
||||||
// size: xgb.Pad((12 + xgb.Pad((int(NumClientSpecs) * 4))))
|
|
||||||
type UnregisterClientsCookie struct {
|
type UnregisterClientsCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func UnregisterClients(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) UnregisterClientsCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(unregisterClientsRequest(c, Context, NumClientSpecs, ClientSpecs), cookie)
|
c.NewRequest(unregisterClientsRequest(c, Context, NumClientSpecs, ClientSpecs), cookie)
|
||||||
return UnregisterClientsCookie{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 {
|
func UnregisterClientsChecked(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) UnregisterClientsCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(unregisterClientsRequest(c, Context, NumClientSpecs, ClientSpecs), cookie)
|
c.NewRequest(unregisterClientsRequest(c, Context, NumClientSpecs, ClientSpecs), cookie)
|
||||||
return UnregisterClientsCookie{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 {
|
func (cook UnregisterClientsCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for UnregisterClients
|
// 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 {
|
func unregisterClientsRequest(c *xgb.Conn, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) []byte {
|
||||||
size := xgb.Pad((12 + xgb.Pad((int(NumClientSpecs) * 4))))
|
size := xgb.Pad((12 + xgb.Pad((int(NumClientSpecs) * 4))))
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -792,29 +798,31 @@ func unregisterClientsRequest(c *xgb.Conn, Context Context, NumClientSpecs uint3
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request GetContext
|
// GetContextCookie is a cookie used only for GetContext requests.
|
||||||
// size: 8
|
|
||||||
type GetContextCookie struct {
|
type GetContextCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GetContext(c *xgb.Conn, Context Context) GetContextCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getContextRequest(c, Context), cookie)
|
c.NewRequest(getContextRequest(c, Context), cookie)
|
||||||
return GetContextCookie{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 {
|
func GetContextUnchecked(c *xgb.Conn, Context Context) GetContextCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getContextRequest(c, Context), cookie)
|
c.NewRequest(getContextRequest(c, Context), cookie)
|
||||||
return GetContextCookie{cookie}
|
return GetContextCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetContext
|
// GetContextReply represents the data returned from a GetContext request.
|
||||||
// size: (32 + ClientInfoListSize(InterceptedClients))
|
|
||||||
type GetContextReply struct {
|
type GetContextReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
Enabled bool
|
Enabled bool
|
||||||
ElementHeader ElementHeader
|
ElementHeader ElementHeader
|
||||||
// padding: 3 bytes
|
// padding: 3 bytes
|
||||||
|
@ -823,7 +831,7 @@ type GetContextReply struct {
|
||||||
InterceptedClients []ClientInfo // size: ClientInfoListSize(InterceptedClients)
|
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) {
|
func (cook GetContextCookie) Reply() (*GetContextReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -835,7 +843,7 @@ func (cook GetContextCookie) Reply() (*GetContextReply, error) {
|
||||||
return getContextReply(buf), nil
|
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 {
|
func getContextReply(buf []byte) *GetContextReply {
|
||||||
v := new(GetContextReply)
|
v := new(GetContextReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -870,6 +878,7 @@ func getContextReply(buf []byte) *GetContextReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetContext
|
// Write request to wire for GetContext
|
||||||
|
// getContextRequest writes a GetContext request to a byte slice.
|
||||||
func getContextRequest(c *xgb.Conn, Context Context) []byte {
|
func getContextRequest(c *xgb.Conn, Context Context) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -890,29 +899,31 @@ func getContextRequest(c *xgb.Conn, Context Context) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request EnableContext
|
// EnableContextCookie is a cookie used only for EnableContext requests.
|
||||||
// size: 8
|
|
||||||
type EnableContextCookie struct {
|
type EnableContextCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func EnableContext(c *xgb.Conn, Context Context) EnableContextCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(enableContextRequest(c, Context), cookie)
|
c.NewRequest(enableContextRequest(c, Context), cookie)
|
||||||
return EnableContextCookie{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 {
|
func EnableContextUnchecked(c *xgb.Conn, Context Context) EnableContextCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(enableContextRequest(c, Context), cookie)
|
c.NewRequest(enableContextRequest(c, Context), cookie)
|
||||||
return EnableContextCookie{cookie}
|
return EnableContextCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for EnableContext
|
// EnableContextReply represents the data returned from a EnableContext request.
|
||||||
// size: (32 + xgb.Pad(((int(Length) * 4) * 1)))
|
|
||||||
type EnableContextReply struct {
|
type EnableContextReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
Category byte
|
Category byte
|
||||||
ElementHeader ElementHeader
|
ElementHeader ElementHeader
|
||||||
ClientSwapped bool
|
ClientSwapped bool
|
||||||
|
@ -924,7 +935,7 @@ type EnableContextReply struct {
|
||||||
Data []byte // size: xgb.Pad(((int(Length) * 4) * 1))
|
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) {
|
func (cook EnableContextCookie) Reply() (*EnableContextReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -936,7 +947,7 @@ func (cook EnableContextCookie) Reply() (*EnableContextReply, error) {
|
||||||
return enableContextReply(buf), nil
|
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 {
|
func enableContextReply(buf []byte) *EnableContextReply {
|
||||||
v := new(EnableContextReply)
|
v := new(EnableContextReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -981,6 +992,7 @@ func enableContextReply(buf []byte) *EnableContextReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for EnableContext
|
// Write request to wire for EnableContext
|
||||||
|
// enableContextRequest writes a EnableContext request to a byte slice.
|
||||||
func enableContextRequest(c *xgb.Conn, Context Context) []byte {
|
func enableContextRequest(c *xgb.Conn, Context Context) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -1001,30 +1013,35 @@ func enableContextRequest(c *xgb.Conn, Context Context) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request DisableContext
|
// DisableContextCookie is a cookie used only for DisableContext requests.
|
||||||
// size: 8
|
|
||||||
type DisableContextCookie struct {
|
type DisableContextCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func DisableContext(c *xgb.Conn, Context Context) DisableContextCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(disableContextRequest(c, Context), cookie)
|
c.NewRequest(disableContextRequest(c, Context), cookie)
|
||||||
return DisableContextCookie{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 {
|
func DisableContextChecked(c *xgb.Conn, Context Context) DisableContextCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(disableContextRequest(c, Context), cookie)
|
c.NewRequest(disableContextRequest(c, Context), cookie)
|
||||||
return DisableContextCookie{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 {
|
func (cook DisableContextCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for DisableContext
|
// Write request to wire for DisableContext
|
||||||
|
// disableContextRequest writes a DisableContext request to a byte slice.
|
||||||
func disableContextRequest(c *xgb.Conn, Context Context) []byte {
|
func disableContextRequest(c *xgb.Conn, Context Context) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -1045,30 +1062,35 @@ func disableContextRequest(c *xgb.Conn, Context Context) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request FreeContext
|
// FreeContextCookie is a cookie used only for FreeContext requests.
|
||||||
// size: 8
|
|
||||||
type FreeContextCookie struct {
|
type FreeContextCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func FreeContext(c *xgb.Conn, Context Context) FreeContextCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(freeContextRequest(c, Context), cookie)
|
c.NewRequest(freeContextRequest(c, Context), cookie)
|
||||||
return FreeContextCookie{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 {
|
func FreeContextChecked(c *xgb.Conn, Context Context) FreeContextCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(freeContextRequest(c, Context), cookie)
|
c.NewRequest(freeContextRequest(c, Context), cookie)
|
||||||
return FreeContextCookie{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 {
|
func (cook FreeContextCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for FreeContext
|
// Write request to wire for FreeContext
|
||||||
|
// freeContextRequest writes a FreeContext request to a byte slice.
|
||||||
func freeContextRequest(c *xgb.Conn, Context Context) []byte {
|
func freeContextRequest(c *xgb.Conn, Context Context) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2,7 +2,7 @@
|
||||||
package res
|
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!
|
This file is automatically generated. Edit at your peril!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -64,14 +64,12 @@ func init() {
|
||||||
|
|
||||||
// Skipping definition for base type 'Char'
|
// Skipping definition for base type 'Char'
|
||||||
|
|
||||||
// 'Client' struct definition
|
|
||||||
// Size: 8
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
ResourceBase uint32
|
ResourceBase uint32
|
||||||
ResourceMask uint32
|
ResourceMask uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct read Client
|
// ClientRead reads a byte slice into a Client value.
|
||||||
func ClientRead(buf []byte, v *Client) int {
|
func ClientRead(buf []byte, v *Client) int {
|
||||||
b := 0
|
b := 0
|
||||||
|
|
||||||
|
@ -84,7 +82,7 @@ func ClientRead(buf []byte, v *Client) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct list read Client
|
// ClientReadList reads a byte slice into a list of Client values.
|
||||||
func ClientReadList(buf []byte, dest []Client) int {
|
func ClientReadList(buf []byte, dest []Client) int {
|
||||||
b := 0
|
b := 0
|
||||||
for i := 0; i < len(dest); i++ {
|
for i := 0; i < len(dest); i++ {
|
||||||
|
@ -94,7 +92,7 @@ func ClientReadList(buf []byte, dest []Client) int {
|
||||||
return xgb.Pad(b)
|
return xgb.Pad(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct write Client
|
// Bytes writes a Client value to a byte slice.
|
||||||
func (v Client) Bytes() []byte {
|
func (v Client) Bytes() []byte {
|
||||||
buf := make([]byte, 8)
|
buf := make([]byte, 8)
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -108,7 +106,7 @@ func (v Client) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func ClientListBytes(buf []byte, list []Client) int {
|
||||||
b := 0
|
b := 0
|
||||||
var structBytes []byte
|
var structBytes []byte
|
||||||
|
@ -120,14 +118,12 @@ func ClientListBytes(buf []byte, list []Client) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'Type' struct definition
|
|
||||||
// Size: 8
|
|
||||||
type Type struct {
|
type Type struct {
|
||||||
ResourceType xproto.Atom
|
ResourceType xproto.Atom
|
||||||
Count uint32
|
Count uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct read Type
|
// TypeRead reads a byte slice into a Type value.
|
||||||
func TypeRead(buf []byte, v *Type) int {
|
func TypeRead(buf []byte, v *Type) int {
|
||||||
b := 0
|
b := 0
|
||||||
|
|
||||||
|
@ -140,7 +136,7 @@ func TypeRead(buf []byte, v *Type) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct list read Type
|
// TypeReadList reads a byte slice into a list of Type values.
|
||||||
func TypeReadList(buf []byte, dest []Type) int {
|
func TypeReadList(buf []byte, dest []Type) int {
|
||||||
b := 0
|
b := 0
|
||||||
for i := 0; i < len(dest); i++ {
|
for i := 0; i < len(dest); i++ {
|
||||||
|
@ -150,7 +146,7 @@ func TypeReadList(buf []byte, dest []Type) int {
|
||||||
return xgb.Pad(b)
|
return xgb.Pad(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct write Type
|
// Bytes writes a Type value to a byte slice.
|
||||||
func (v Type) Bytes() []byte {
|
func (v Type) Bytes() []byte {
|
||||||
buf := make([]byte, 8)
|
buf := make([]byte, 8)
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -164,7 +160,7 @@ func (v Type) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func TypeListBytes(buf []byte, list []Type) int {
|
||||||
b := 0
|
b := 0
|
||||||
var structBytes []byte
|
var structBytes []byte
|
||||||
|
@ -176,35 +172,37 @@ func TypeListBytes(buf []byte, list []Type) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request QueryVersion
|
// QueryVersionCookie is a cookie used only for QueryVersion requests.
|
||||||
// size: 8
|
|
||||||
type QueryVersionCookie struct {
|
type QueryVersionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie)
|
c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie)
|
||||||
return QueryVersionCookie{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 {
|
func QueryVersionUnchecked(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie)
|
c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie)
|
||||||
return QueryVersionCookie{cookie}
|
return QueryVersionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryVersion
|
// QueryVersionReply represents the data returned from a QueryVersion request.
|
||||||
// size: 12
|
|
||||||
type QueryVersionReply struct {
|
type QueryVersionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
ServerMajor uint16
|
ServerMajor uint16
|
||||||
ServerMinor 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) {
|
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -216,7 +214,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
return queryVersionReply(buf), nil
|
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 {
|
func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
v := new(QueryVersionReply)
|
v := new(QueryVersionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -239,6 +237,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryVersion
|
// 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 {
|
func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -262,36 +261,38 @@ func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request QueryClients
|
// QueryClientsCookie is a cookie used only for QueryClients requests.
|
||||||
// size: 4
|
|
||||||
type QueryClientsCookie struct {
|
type QueryClientsCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryClients(c *xgb.Conn) QueryClientsCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryClientsRequest(c), cookie)
|
c.NewRequest(queryClientsRequest(c), cookie)
|
||||||
return QueryClientsCookie{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 {
|
func QueryClientsUnchecked(c *xgb.Conn) QueryClientsCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryClientsRequest(c), cookie)
|
c.NewRequest(queryClientsRequest(c), cookie)
|
||||||
return QueryClientsCookie{cookie}
|
return QueryClientsCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryClients
|
// QueryClientsReply represents the data returned from a QueryClients request.
|
||||||
// size: (32 + xgb.Pad((int(NumClients) * 8)))
|
|
||||||
type QueryClientsReply struct {
|
type QueryClientsReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
NumClients uint32
|
NumClients uint32
|
||||||
// padding: 20 bytes
|
// padding: 20 bytes
|
||||||
Clients []Client // size: xgb.Pad((int(NumClients) * 8))
|
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) {
|
func (cook QueryClientsCookie) Reply() (*QueryClientsReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -303,7 +304,7 @@ func (cook QueryClientsCookie) Reply() (*QueryClientsReply, error) {
|
||||||
return queryClientsReply(buf), nil
|
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 {
|
func queryClientsReply(buf []byte) *QueryClientsReply {
|
||||||
v := new(QueryClientsReply)
|
v := new(QueryClientsReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -328,6 +329,7 @@ func queryClientsReply(buf []byte) *QueryClientsReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryClients
|
// Write request to wire for QueryClients
|
||||||
|
// queryClientsRequest writes a QueryClients request to a byte slice.
|
||||||
func queryClientsRequest(c *xgb.Conn) []byte {
|
func queryClientsRequest(c *xgb.Conn) []byte {
|
||||||
size := 4
|
size := 4
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -345,36 +347,38 @@ func queryClientsRequest(c *xgb.Conn) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request QueryClientResources
|
// QueryClientResourcesCookie is a cookie used only for QueryClientResources requests.
|
||||||
// size: 8
|
|
||||||
type QueryClientResourcesCookie struct {
|
type QueryClientResourcesCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryClientResources(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryClientResourcesRequest(c, Xid), cookie)
|
c.NewRequest(queryClientResourcesRequest(c, Xid), cookie)
|
||||||
return QueryClientResourcesCookie{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 {
|
func QueryClientResourcesUnchecked(c *xgb.Conn, Xid uint32) QueryClientResourcesCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryClientResourcesRequest(c, Xid), cookie)
|
c.NewRequest(queryClientResourcesRequest(c, Xid), cookie)
|
||||||
return QueryClientResourcesCookie{cookie}
|
return QueryClientResourcesCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryClientResources
|
// QueryClientResourcesReply represents the data returned from a QueryClientResources request.
|
||||||
// size: (32 + xgb.Pad((int(NumTypes) * 8)))
|
|
||||||
type QueryClientResourcesReply struct {
|
type QueryClientResourcesReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
NumTypes uint32
|
NumTypes uint32
|
||||||
// padding: 20 bytes
|
// padding: 20 bytes
|
||||||
Types []Type // size: xgb.Pad((int(NumTypes) * 8))
|
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) {
|
func (cook QueryClientResourcesCookie) Reply() (*QueryClientResourcesReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -386,7 +390,7 @@ func (cook QueryClientResourcesCookie) Reply() (*QueryClientResourcesReply, erro
|
||||||
return queryClientResourcesReply(buf), nil
|
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 {
|
func queryClientResourcesReply(buf []byte) *QueryClientResourcesReply {
|
||||||
v := new(QueryClientResourcesReply)
|
v := new(QueryClientResourcesReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -411,6 +415,7 @@ func queryClientResourcesReply(buf []byte) *QueryClientResourcesReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryClientResources
|
// Write request to wire for QueryClientResources
|
||||||
|
// queryClientResourcesRequest writes a QueryClientResources request to a byte slice.
|
||||||
func queryClientResourcesRequest(c *xgb.Conn, Xid uint32) []byte {
|
func queryClientResourcesRequest(c *xgb.Conn, Xid uint32) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -431,35 +436,37 @@ func queryClientResourcesRequest(c *xgb.Conn, Xid uint32) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request QueryClientPixmapBytes
|
// QueryClientPixmapBytesCookie is a cookie used only for QueryClientPixmapBytes requests.
|
||||||
// size: 8
|
|
||||||
type QueryClientPixmapBytesCookie struct {
|
type QueryClientPixmapBytesCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryClientPixmapBytes(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryClientPixmapBytesRequest(c, Xid), cookie)
|
c.NewRequest(queryClientPixmapBytesRequest(c, Xid), cookie)
|
||||||
return QueryClientPixmapBytesCookie{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 {
|
func QueryClientPixmapBytesUnchecked(c *xgb.Conn, Xid uint32) QueryClientPixmapBytesCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryClientPixmapBytesRequest(c, Xid), cookie)
|
c.NewRequest(queryClientPixmapBytesRequest(c, Xid), cookie)
|
||||||
return QueryClientPixmapBytesCookie{cookie}
|
return QueryClientPixmapBytesCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryClientPixmapBytes
|
// QueryClientPixmapBytesReply represents the data returned from a QueryClientPixmapBytes request.
|
||||||
// size: 16
|
|
||||||
type QueryClientPixmapBytesReply struct {
|
type QueryClientPixmapBytesReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
Bytes uint32
|
Bytes uint32
|
||||||
BytesOverflow 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) {
|
func (cook QueryClientPixmapBytesCookie) Reply() (*QueryClientPixmapBytesReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -471,7 +478,7 @@ func (cook QueryClientPixmapBytesCookie) Reply() (*QueryClientPixmapBytesReply,
|
||||||
return queryClientPixmapBytesReply(buf), nil
|
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 {
|
func queryClientPixmapBytesReply(buf []byte) *QueryClientPixmapBytesReply {
|
||||||
v := new(QueryClientPixmapBytesReply)
|
v := new(QueryClientPixmapBytesReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -494,6 +501,7 @@ func queryClientPixmapBytesReply(buf []byte) *QueryClientPixmapBytesReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryClientPixmapBytes
|
// Write request to wire for QueryClientPixmapBytes
|
||||||
|
// queryClientPixmapBytesRequest writes a QueryClientPixmapBytes request to a byte slice.
|
||||||
func queryClientPixmapBytesRequest(c *xgb.Conn, Xid uint32) []byte {
|
func queryClientPixmapBytesRequest(c *xgb.Conn, Xid uint32) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
package screensaver
|
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!
|
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)
|
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 'Bool'
|
||||||
|
|
||||||
// Skipping definition for base type 'Float'
|
// Skipping definition for base type 'Float'
|
||||||
|
@ -60,10 +64,6 @@ func init() {
|
||||||
|
|
||||||
// Skipping definition for base type 'Char'
|
// Skipping definition for base type 'Char'
|
||||||
|
|
||||||
// Skipping definition for base type 'Card32'
|
|
||||||
|
|
||||||
// Skipping definition for base type 'Double'
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
KindBlanked = 0
|
KindBlanked = 0
|
||||||
KindInternal = 1
|
KindInternal = 1
|
||||||
|
@ -82,9 +82,7 @@ const (
|
||||||
StateDisabled = 3
|
StateDisabled = 3
|
||||||
)
|
)
|
||||||
|
|
||||||
// Event definition Notify (0)
|
// Notify is the event number for a NotifyEvent.
|
||||||
// Size: 32
|
|
||||||
|
|
||||||
const Notify = 0
|
const Notify = 0
|
||||||
|
|
||||||
type NotifyEvent struct {
|
type NotifyEvent struct {
|
||||||
|
@ -101,7 +99,7 @@ type NotifyEvent struct {
|
||||||
// padding: 14 bytes
|
// 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 {
|
func NotifyEventNew(buf []byte) xgb.Event {
|
||||||
v := NotifyEvent{}
|
v := NotifyEvent{}
|
||||||
b := 1 // don't read event number
|
b := 1 // don't read event number
|
||||||
|
@ -144,7 +142,7 @@ func NotifyEventNew(buf []byte) xgb.Event {
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event write Notify
|
// Bytes writes a NotifyEvent value to a byte slice.
|
||||||
func (v NotifyEvent) Bytes() []byte {
|
func (v NotifyEvent) Bytes() []byte {
|
||||||
buf := make([]byte, 32)
|
buf := make([]byte, 32)
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -190,12 +188,14 @@ func (v NotifyEvent) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func (v NotifyEvent) SequenceId() uint16 {
|
||||||
return v.Sequence
|
return v.Sequence
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// String is a rudimentary string representation of NotifyEvent.
|
||||||
func (v NotifyEvent) String() string {
|
func (v NotifyEvent) String() string {
|
||||||
fieldVals := make([]string, 0, 10)
|
fieldVals := make([]string, 0, 10)
|
||||||
fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence))
|
fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence))
|
||||||
|
@ -214,36 +214,38 @@ func init() {
|
||||||
xgb.NewExtEventFuncs["MIT-SCREEN-SAVER"][0] = NotifyEventNew
|
xgb.NewExtEventFuncs["MIT-SCREEN-SAVER"][0] = NotifyEventNew
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request QueryVersion
|
// QueryVersionCookie is a cookie used only for QueryVersion requests.
|
||||||
// size: 8
|
|
||||||
type QueryVersionCookie struct {
|
type QueryVersionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryVersion(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
||||||
return QueryVersionCookie{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 {
|
func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
||||||
return QueryVersionCookie{cookie}
|
return QueryVersionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryVersion
|
// QueryVersionReply represents the data returned from a QueryVersion request.
|
||||||
// size: 32
|
|
||||||
type QueryVersionReply struct {
|
type QueryVersionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
ServerMajorVersion uint16
|
ServerMajorVersion uint16
|
||||||
ServerMinorVersion uint16
|
ServerMinorVersion uint16
|
||||||
// padding: 20 bytes
|
// 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) {
|
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -255,7 +257,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
return queryVersionReply(buf), nil
|
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 {
|
func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
v := new(QueryVersionReply)
|
v := new(QueryVersionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -280,6 +282,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryVersion
|
// 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 {
|
func queryVersionRequest(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersion byte) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -305,29 +308,31 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion byte, ClientMinorVersio
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request QueryInfo
|
// QueryInfoCookie is a cookie used only for QueryInfo requests.
|
||||||
// size: 8
|
|
||||||
type QueryInfoCookie struct {
|
type QueryInfoCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryInfo(c *xgb.Conn, Drawable xproto.Drawable) QueryInfoCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryInfoRequest(c, Drawable), cookie)
|
c.NewRequest(queryInfoRequest(c, Drawable), cookie)
|
||||||
return QueryInfoCookie{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 {
|
func QueryInfoUnchecked(c *xgb.Conn, Drawable xproto.Drawable) QueryInfoCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryInfoRequest(c, Drawable), cookie)
|
c.NewRequest(queryInfoRequest(c, Drawable), cookie)
|
||||||
return QueryInfoCookie{cookie}
|
return QueryInfoCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryInfo
|
// QueryInfoReply represents the data returned from a QueryInfo request.
|
||||||
// size: 32
|
|
||||||
type QueryInfoReply struct {
|
type QueryInfoReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
State byte
|
State byte
|
||||||
SaverWindow xproto.Window
|
SaverWindow xproto.Window
|
||||||
MsUntilServer uint32
|
MsUntilServer uint32
|
||||||
|
@ -337,7 +342,7 @@ type QueryInfoReply struct {
|
||||||
// padding: 7 bytes
|
// 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) {
|
func (cook QueryInfoCookie) Reply() (*QueryInfoReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -349,7 +354,7 @@ func (cook QueryInfoCookie) Reply() (*QueryInfoReply, error) {
|
||||||
return queryInfoReply(buf), nil
|
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 {
|
func queryInfoReply(buf []byte) *QueryInfoReply {
|
||||||
v := new(QueryInfoReply)
|
v := new(QueryInfoReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -384,6 +389,7 @@ func queryInfoReply(buf []byte) *QueryInfoReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryInfo
|
// Write request to wire for QueryInfo
|
||||||
|
// queryInfoRequest writes a QueryInfo request to a byte slice.
|
||||||
func queryInfoRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
|
func queryInfoRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -404,30 +410,35 @@ func queryInfoRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request SelectInput
|
// SelectInputCookie is a cookie used only for SelectInput requests.
|
||||||
// size: 12
|
|
||||||
type SelectInputCookie struct {
|
type SelectInputCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func SelectInput(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) SelectInputCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(selectInputRequest(c, Drawable, EventMask), cookie)
|
c.NewRequest(selectInputRequest(c, Drawable, EventMask), cookie)
|
||||||
return SelectInputCookie{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 {
|
func SelectInputChecked(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) SelectInputCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(selectInputRequest(c, Drawable, EventMask), cookie)
|
c.NewRequest(selectInputRequest(c, Drawable, EventMask), cookie)
|
||||||
return SelectInputCookie{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 {
|
func (cook SelectInputCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for SelectInput
|
// 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 {
|
func selectInputRequest(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -451,30 +462,35 @@ func selectInputRequest(c *xgb.Conn, Drawable xproto.Drawable, EventMask uint32)
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request SetAttributes
|
// SetAttributesCookie is a cookie used only for SetAttributes requests.
|
||||||
// size: xgb.Pad((24 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))))
|
|
||||||
type SetAttributesCookie struct {
|
type SetAttributesCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
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)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(setAttributesRequest(c, Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie)
|
c.NewRequest(setAttributesRequest(c, Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie)
|
||||||
return SetAttributesCookie{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 {
|
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)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(setAttributesRequest(c, Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie)
|
c.NewRequest(setAttributesRequest(c, Drawable, X, Y, Width, Height, BorderWidth, Class, Depth, Visual, ValueMask, ValueList), cookie)
|
||||||
return SetAttributesCookie{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 {
|
func (cook SetAttributesCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for SetAttributes
|
// 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 {
|
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)))))))
|
size := xgb.Pad((24 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask)))))))
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -527,30 +543,35 @@ func setAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int1
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request UnsetAttributes
|
// UnsetAttributesCookie is a cookie used only for UnsetAttributes requests.
|
||||||
// size: 8
|
|
||||||
type UnsetAttributesCookie struct {
|
type UnsetAttributesCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func UnsetAttributes(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(unsetAttributesRequest(c, Drawable), cookie)
|
c.NewRequest(unsetAttributesRequest(c, Drawable), cookie)
|
||||||
return UnsetAttributesCookie{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 {
|
func UnsetAttributesChecked(c *xgb.Conn, Drawable xproto.Drawable) UnsetAttributesCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(unsetAttributesRequest(c, Drawable), cookie)
|
c.NewRequest(unsetAttributesRequest(c, Drawable), cookie)
|
||||||
return UnsetAttributesCookie{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 {
|
func (cook UnsetAttributesCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for UnsetAttributes
|
// Write request to wire for UnsetAttributes
|
||||||
|
// unsetAttributesRequest writes a UnsetAttributes request to a byte slice.
|
||||||
func unsetAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
|
func unsetAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -571,30 +592,35 @@ func unsetAttributesRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Suspend
|
// SuspendCookie is a cookie used only for Suspend requests.
|
||||||
// size: 8
|
|
||||||
type SuspendCookie struct {
|
type SuspendCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func Suspend(c *xgb.Conn, Suspend bool) SuspendCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(suspendRequest(c, Suspend), cookie)
|
c.NewRequest(suspendRequest(c, Suspend), cookie)
|
||||||
return SuspendCookie{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 {
|
func SuspendChecked(c *xgb.Conn, Suspend bool) SuspendCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(suspendRequest(c, Suspend), cookie)
|
c.NewRequest(suspendRequest(c, Suspend), cookie)
|
||||||
return SuspendCookie{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 {
|
func (cook SuspendCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Suspend
|
// Write request to wire for Suspend
|
||||||
|
// suspendRequest writes a Suspend request to a byte slice.
|
||||||
func suspendRequest(c *xgb.Conn, Suspend bool) []byte {
|
func suspendRequest(c *xgb.Conn, Suspend bool) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
package shape
|
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!
|
This file is automatically generated. Edit at your peril!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -82,9 +82,7 @@ type Op byte
|
||||||
|
|
||||||
type Kind byte
|
type Kind byte
|
||||||
|
|
||||||
// Event definition Notify (0)
|
// Notify is the event number for a NotifyEvent.
|
||||||
// Size: 32
|
|
||||||
|
|
||||||
const Notify = 0
|
const Notify = 0
|
||||||
|
|
||||||
type NotifyEvent struct {
|
type NotifyEvent struct {
|
||||||
|
@ -100,7 +98,7 @@ type NotifyEvent struct {
|
||||||
// padding: 11 bytes
|
// 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 {
|
func NotifyEventNew(buf []byte) xgb.Event {
|
||||||
v := NotifyEvent{}
|
v := NotifyEvent{}
|
||||||
b := 1 // don't read event number
|
b := 1 // don't read event number
|
||||||
|
@ -141,7 +139,7 @@ func NotifyEventNew(buf []byte) xgb.Event {
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event write Notify
|
// Bytes writes a NotifyEvent value to a byte slice.
|
||||||
func (v NotifyEvent) Bytes() []byte {
|
func (v NotifyEvent) Bytes() []byte {
|
||||||
buf := make([]byte, 32)
|
buf := make([]byte, 32)
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -185,12 +183,14 @@ func (v NotifyEvent) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func (v NotifyEvent) SequenceId() uint16 {
|
||||||
return v.Sequence
|
return v.Sequence
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// String is a rudimentary string representation of NotifyEvent.
|
||||||
func (v NotifyEvent) String() string {
|
func (v NotifyEvent) String() string {
|
||||||
fieldVals := make([]string, 0, 9)
|
fieldVals := make([]string, 0, 9)
|
||||||
fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence))
|
fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence))
|
||||||
|
@ -209,35 +209,37 @@ func init() {
|
||||||
xgb.NewExtEventFuncs["SHAPE"][0] = NotifyEventNew
|
xgb.NewExtEventFuncs["SHAPE"][0] = NotifyEventNew
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request QueryVersion
|
// QueryVersionCookie is a cookie used only for QueryVersion requests.
|
||||||
// size: 4
|
|
||||||
type QueryVersionCookie struct {
|
type QueryVersionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryVersion(c *xgb.Conn) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryVersionRequest(c), cookie)
|
c.NewRequest(queryVersionRequest(c), cookie)
|
||||||
return QueryVersionCookie{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 {
|
func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryVersionRequest(c), cookie)
|
c.NewRequest(queryVersionRequest(c), cookie)
|
||||||
return QueryVersionCookie{cookie}
|
return QueryVersionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryVersion
|
// QueryVersionReply represents the data returned from a QueryVersion request.
|
||||||
// size: 12
|
|
||||||
type QueryVersionReply struct {
|
type QueryVersionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
MajorVersion uint16
|
MajorVersion uint16
|
||||||
MinorVersion 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) {
|
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -249,7 +251,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
return queryVersionReply(buf), nil
|
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 {
|
func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
v := new(QueryVersionReply)
|
v := new(QueryVersionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -272,6 +274,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryVersion
|
// Write request to wire for QueryVersion
|
||||||
|
// queryVersionRequest writes a QueryVersion request to a byte slice.
|
||||||
func queryVersionRequest(c *xgb.Conn) []byte {
|
func queryVersionRequest(c *xgb.Conn) []byte {
|
||||||
size := 4
|
size := 4
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -289,30 +292,35 @@ func queryVersionRequest(c *xgb.Conn) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Rectangles
|
// RectanglesCookie is a cookie used only for Rectangles requests.
|
||||||
// size: xgb.Pad((16 + xgb.Pad((len(Rectangles) * 8))))
|
|
||||||
type RectanglesCookie struct {
|
type RectanglesCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
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)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(rectanglesRequest(c, Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie)
|
c.NewRequest(rectanglesRequest(c, Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie)
|
||||||
return RectanglesCookie{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 {
|
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)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(rectanglesRequest(c, Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie)
|
c.NewRequest(rectanglesRequest(c, Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles), cookie)
|
||||||
return RectanglesCookie{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 {
|
func (cook RectanglesCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Rectangles
|
// 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 {
|
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))))
|
size := xgb.Pad((16 + xgb.Pad((len(Rectangles) * 8))))
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -352,30 +360,35 @@ func rectanglesRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Mask
|
// MaskCookie is a cookie used only for Mask requests.
|
||||||
// size: 20
|
|
||||||
type MaskCookie struct {
|
type MaskCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
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)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(maskRequest(c, Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie)
|
c.NewRequest(maskRequest(c, Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie)
|
||||||
return MaskCookie{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 {
|
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)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(maskRequest(c, Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie)
|
c.NewRequest(maskRequest(c, Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap), cookie)
|
||||||
return MaskCookie{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 {
|
func (cook MaskCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Mask
|
// 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 {
|
func maskRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) []byte {
|
||||||
size := 20
|
size := 20
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -413,30 +426,35 @@ func maskRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWin
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Combine
|
// CombineCookie is a cookie used only for Combine requests.
|
||||||
// size: 20
|
|
||||||
type CombineCookie struct {
|
type CombineCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
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)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(combineRequest(c, Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie)
|
c.NewRequest(combineRequest(c, Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie)
|
||||||
return CombineCookie{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 {
|
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)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(combineRequest(c, Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie)
|
c.NewRequest(combineRequest(c, Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow), cookie)
|
||||||
return CombineCookie{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 {
|
func (cook CombineCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Combine
|
// 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 {
|
func combineRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) []byte {
|
||||||
size := 20
|
size := 20
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -477,30 +495,35 @@ func combineRequest(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Offset
|
// OffsetCookie is a cookie used only for Offset requests.
|
||||||
// size: 16
|
|
||||||
type OffsetCookie struct {
|
type OffsetCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func Offset(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) OffsetCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(offsetRequest(c, DestinationKind, DestinationWindow, XOffset, YOffset), cookie)
|
c.NewRequest(offsetRequest(c, DestinationKind, DestinationWindow, XOffset, YOffset), cookie)
|
||||||
return OffsetCookie{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 {
|
func OffsetChecked(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) OffsetCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(offsetRequest(c, DestinationKind, DestinationWindow, XOffset, YOffset), cookie)
|
c.NewRequest(offsetRequest(c, DestinationKind, DestinationWindow, XOffset, YOffset), cookie)
|
||||||
return OffsetCookie{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 {
|
func (cook OffsetCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Offset
|
// 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 {
|
func offsetRequest(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) []byte {
|
||||||
size := 16
|
size := 16
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -532,29 +555,31 @@ func offsetRequest(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.W
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request QueryExtents
|
// QueryExtentsCookie is a cookie used only for QueryExtents requests.
|
||||||
// size: 8
|
|
||||||
type QueryExtentsCookie struct {
|
type QueryExtentsCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryExtents(c *xgb.Conn, DestinationWindow xproto.Window) QueryExtentsCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryExtentsRequest(c, DestinationWindow), cookie)
|
c.NewRequest(queryExtentsRequest(c, DestinationWindow), cookie)
|
||||||
return QueryExtentsCookie{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 {
|
func QueryExtentsUnchecked(c *xgb.Conn, DestinationWindow xproto.Window) QueryExtentsCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryExtentsRequest(c, DestinationWindow), cookie)
|
c.NewRequest(queryExtentsRequest(c, DestinationWindow), cookie)
|
||||||
return QueryExtentsCookie{cookie}
|
return QueryExtentsCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryExtents
|
// QueryExtentsReply represents the data returned from a QueryExtents request.
|
||||||
// size: 28
|
|
||||||
type QueryExtentsReply struct {
|
type QueryExtentsReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
BoundingShaped bool
|
BoundingShaped bool
|
||||||
ClipShaped bool
|
ClipShaped bool
|
||||||
|
@ -569,7 +594,7 @@ type QueryExtentsReply struct {
|
||||||
ClipShapeExtentsHeight uint16
|
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) {
|
func (cook QueryExtentsCookie) Reply() (*QueryExtentsReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -581,7 +606,7 @@ func (cook QueryExtentsCookie) Reply() (*QueryExtentsReply, error) {
|
||||||
return queryExtentsReply(buf), nil
|
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 {
|
func queryExtentsReply(buf []byte) *QueryExtentsReply {
|
||||||
v := new(QueryExtentsReply)
|
v := new(QueryExtentsReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -638,6 +663,7 @@ func queryExtentsReply(buf []byte) *QueryExtentsReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryExtents
|
// Write request to wire for QueryExtents
|
||||||
|
// queryExtentsRequest writes a QueryExtents request to a byte slice.
|
||||||
func queryExtentsRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte {
|
func queryExtentsRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -658,30 +684,35 @@ func queryExtentsRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request SelectInput
|
// SelectInputCookie is a cookie used only for SelectInput requests.
|
||||||
// size: 12
|
|
||||||
type SelectInputCookie struct {
|
type SelectInputCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func SelectInput(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) SelectInputCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(selectInputRequest(c, DestinationWindow, Enable), cookie)
|
c.NewRequest(selectInputRequest(c, DestinationWindow, Enable), cookie)
|
||||||
return SelectInputCookie{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 {
|
func SelectInputChecked(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) SelectInputCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(selectInputRequest(c, DestinationWindow, Enable), cookie)
|
c.NewRequest(selectInputRequest(c, DestinationWindow, Enable), cookie)
|
||||||
return SelectInputCookie{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 {
|
func (cook SelectInputCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for SelectInput
|
// 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 {
|
func selectInputRequest(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -711,33 +742,35 @@ func selectInputRequest(c *xgb.Conn, DestinationWindow xproto.Window, Enable boo
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request InputSelected
|
// InputSelectedCookie is a cookie used only for InputSelected requests.
|
||||||
// size: 8
|
|
||||||
type InputSelectedCookie struct {
|
type InputSelectedCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func InputSelected(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(inputSelectedRequest(c, DestinationWindow), cookie)
|
c.NewRequest(inputSelectedRequest(c, DestinationWindow), cookie)
|
||||||
return InputSelectedCookie{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 {
|
func InputSelectedUnchecked(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(inputSelectedRequest(c, DestinationWindow), cookie)
|
c.NewRequest(inputSelectedRequest(c, DestinationWindow), cookie)
|
||||||
return InputSelectedCookie{cookie}
|
return InputSelectedCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for InputSelected
|
// InputSelectedReply represents the data returned from a InputSelected request.
|
||||||
// size: 8
|
|
||||||
type InputSelectedReply struct {
|
type InputSelectedReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
Enabled bool
|
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) {
|
func (cook InputSelectedCookie) Reply() (*InputSelectedReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -749,7 +782,7 @@ func (cook InputSelectedCookie) Reply() (*InputSelectedReply, error) {
|
||||||
return inputSelectedReply(buf), nil
|
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 {
|
func inputSelectedReply(buf []byte) *InputSelectedReply {
|
||||||
v := new(InputSelectedReply)
|
v := new(InputSelectedReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -771,6 +804,7 @@ func inputSelectedReply(buf []byte) *InputSelectedReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for InputSelected
|
// Write request to wire for InputSelected
|
||||||
|
// inputSelectedRequest writes a InputSelected request to a byte slice.
|
||||||
func inputSelectedRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte {
|
func inputSelectedRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -791,36 +825,38 @@ func inputSelectedRequest(c *xgb.Conn, DestinationWindow xproto.Window) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request GetRectangles
|
// GetRectanglesCookie is a cookie used only for GetRectangles requests.
|
||||||
// size: 12
|
|
||||||
type GetRectanglesCookie struct {
|
type GetRectanglesCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GetRectangles(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getRectanglesRequest(c, Window, SourceKind), cookie)
|
c.NewRequest(getRectanglesRequest(c, Window, SourceKind), cookie)
|
||||||
return GetRectanglesCookie{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 {
|
func GetRectanglesUnchecked(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getRectanglesRequest(c, Window, SourceKind), cookie)
|
c.NewRequest(getRectanglesRequest(c, Window, SourceKind), cookie)
|
||||||
return GetRectanglesCookie{cookie}
|
return GetRectanglesCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetRectangles
|
// GetRectanglesReply represents the data returned from a GetRectangles request.
|
||||||
// size: (32 + xgb.Pad((int(RectanglesLen) * 8)))
|
|
||||||
type GetRectanglesReply struct {
|
type GetRectanglesReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
Ordering byte
|
Ordering byte
|
||||||
RectanglesLen uint32
|
RectanglesLen uint32
|
||||||
// padding: 20 bytes
|
// padding: 20 bytes
|
||||||
Rectangles []xproto.Rectangle // size: xgb.Pad((int(RectanglesLen) * 8))
|
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) {
|
func (cook GetRectanglesCookie) Reply() (*GetRectanglesReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -832,7 +868,7 @@ func (cook GetRectanglesCookie) Reply() (*GetRectanglesReply, error) {
|
||||||
return getRectanglesReply(buf), nil
|
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 {
|
func getRectanglesReply(buf []byte) *GetRectanglesReply {
|
||||||
v := new(GetRectanglesReply)
|
v := new(GetRectanglesReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -858,6 +894,7 @@ func getRectanglesReply(buf []byte) *GetRectanglesReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetRectangles
|
// 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 {
|
func getRectanglesRequest(c *xgb.Conn, Window xproto.Window, SourceKind Kind) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
|
110
nexgb/shm/shm.go
110
nexgb/shm/shm.go
|
@ -2,7 +2,7 @@
|
||||||
package shm
|
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!
|
This file is automatically generated. Edit at your peril!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -40,6 +40,8 @@ func init() {
|
||||||
xgb.NewExtErrorFuncs["MIT-SHM"] = make(map[int]xgb.NewErrorFun)
|
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 'Void'
|
||||||
|
|
||||||
// Skipping definition for base type 'Byte'
|
// Skipping definition for base type 'Byte'
|
||||||
|
@ -62,8 +64,6 @@ func init() {
|
||||||
|
|
||||||
// Skipping definition for base type 'Int16'
|
// Skipping definition for base type 'Int16'
|
||||||
|
|
||||||
// Skipping definition for base type 'Int32'
|
|
||||||
|
|
||||||
type Seg uint32
|
type Seg uint32
|
||||||
|
|
||||||
func NewSegId(c *xgb.Conn) (Seg, error) {
|
func NewSegId(c *xgb.Conn) (Seg, error) {
|
||||||
|
@ -74,9 +74,7 @@ func NewSegId(c *xgb.Conn) (Seg, error) {
|
||||||
return Seg(id), nil
|
return Seg(id), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event definition Completion (0)
|
// Completion is the event number for a CompletionEvent.
|
||||||
// Size: 32
|
|
||||||
|
|
||||||
const Completion = 0
|
const Completion = 0
|
||||||
|
|
||||||
type CompletionEvent struct {
|
type CompletionEvent struct {
|
||||||
|
@ -90,7 +88,7 @@ type CompletionEvent struct {
|
||||||
Offset uint32
|
Offset uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event read Completion
|
// CompletionEventNew constructs a CompletionEvent value that implements xgb.Event from a byte slice.
|
||||||
func CompletionEventNew(buf []byte) xgb.Event {
|
func CompletionEventNew(buf []byte) xgb.Event {
|
||||||
v := CompletionEvent{}
|
v := CompletionEvent{}
|
||||||
b := 1 // don't read event number
|
b := 1 // don't read event number
|
||||||
|
@ -120,7 +118,7 @@ func CompletionEventNew(buf []byte) xgb.Event {
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event write Completion
|
// Bytes writes a CompletionEvent value to a byte slice.
|
||||||
func (v CompletionEvent) Bytes() []byte {
|
func (v CompletionEvent) Bytes() []byte {
|
||||||
buf := make([]byte, 32)
|
buf := make([]byte, 32)
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -153,12 +151,14 @@ func (v CompletionEvent) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func (v CompletionEvent) SequenceId() uint16 {
|
||||||
return v.Sequence
|
return v.Sequence
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// String is a rudimentary string representation of CompletionEvent.
|
||||||
func (v CompletionEvent) String() string {
|
func (v CompletionEvent) String() string {
|
||||||
fieldVals := make([]string, 0, 7)
|
fieldVals := make([]string, 0, 7)
|
||||||
fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence))
|
fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence))
|
||||||
|
@ -174,20 +174,20 @@ func init() {
|
||||||
xgb.NewExtEventFuncs["MIT-SHM"][0] = CompletionEventNew
|
xgb.NewExtEventFuncs["MIT-SHM"][0] = CompletionEventNew
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErrorCopy definition BadSeg (0)
|
// BadBadSeg is the error number for a BadBadSeg.
|
||||||
|
|
||||||
const BadBadSeg = 0
|
const BadBadSeg = 0
|
||||||
|
|
||||||
type BadSegError xproto.ValueError
|
type BadSegError xproto.ValueError
|
||||||
|
|
||||||
|
// BadSegErrorNew constructs a BadSegError value that implements xgb.Error from a byte slice.
|
||||||
func BadSegErrorNew(buf []byte) xgb.Error {
|
func BadSegErrorNew(buf []byte) xgb.Error {
|
||||||
v := BadSegError(xproto.ValueErrorNew(buf).(xproto.ValueError))
|
v := BadSegError(xproto.ValueErrorNew(buf).(xproto.ValueError))
|
||||||
v.NiceName = "BadSeg"
|
v.NiceName = "BadSeg"
|
||||||
return v
|
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 {
|
func (err BadSegError) SequenceId() uint16 {
|
||||||
return err.Sequence
|
return err.Sequence
|
||||||
}
|
}
|
||||||
|
@ -210,29 +210,31 @@ func init() {
|
||||||
xgb.NewExtErrorFuncs["MIT-SHM"][0] = BadSegErrorNew
|
xgb.NewExtErrorFuncs["MIT-SHM"][0] = BadSegErrorNew
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request QueryVersion
|
// QueryVersionCookie is a cookie used only for QueryVersion requests.
|
||||||
// size: 4
|
|
||||||
type QueryVersionCookie struct {
|
type QueryVersionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryVersion(c *xgb.Conn) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryVersionRequest(c), cookie)
|
c.NewRequest(queryVersionRequest(c), cookie)
|
||||||
return QueryVersionCookie{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 {
|
func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryVersionRequest(c), cookie)
|
c.NewRequest(queryVersionRequest(c), cookie)
|
||||||
return QueryVersionCookie{cookie}
|
return QueryVersionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryVersion
|
// QueryVersionReply represents the data returned from a QueryVersion request.
|
||||||
// size: 32
|
|
||||||
type QueryVersionReply struct {
|
type QueryVersionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
SharedPixmaps bool
|
SharedPixmaps bool
|
||||||
MajorVersion uint16
|
MajorVersion uint16
|
||||||
MinorVersion uint16
|
MinorVersion uint16
|
||||||
|
@ -242,7 +244,7 @@ type QueryVersionReply struct {
|
||||||
// padding: 15 bytes
|
// 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) {
|
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -254,7 +256,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
return queryVersionReply(buf), nil
|
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 {
|
func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
v := new(QueryVersionReply)
|
v := new(QueryVersionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -293,6 +295,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryVersion
|
// Write request to wire for QueryVersion
|
||||||
|
// queryVersionRequest writes a QueryVersion request to a byte slice.
|
||||||
func queryVersionRequest(c *xgb.Conn) []byte {
|
func queryVersionRequest(c *xgb.Conn) []byte {
|
||||||
size := 4
|
size := 4
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -310,30 +313,35 @@ func queryVersionRequest(c *xgb.Conn) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Attach
|
// AttachCookie is a cookie used only for Attach requests.
|
||||||
// size: 16
|
|
||||||
type AttachCookie struct {
|
type AttachCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func Attach(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(attachRequest(c, Shmseg, Shmid, ReadOnly), cookie)
|
c.NewRequest(attachRequest(c, Shmseg, Shmid, ReadOnly), cookie)
|
||||||
return AttachCookie{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 {
|
func AttachChecked(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(attachRequest(c, Shmseg, Shmid, ReadOnly), cookie)
|
c.NewRequest(attachRequest(c, Shmseg, Shmid, ReadOnly), cookie)
|
||||||
return AttachCookie{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 {
|
func (cook AttachCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Attach
|
// 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 {
|
func attachRequest(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) []byte {
|
||||||
size := 16
|
size := 16
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -366,30 +374,35 @@ func attachRequest(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) []byte
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Detach
|
// DetachCookie is a cookie used only for Detach requests.
|
||||||
// size: 8
|
|
||||||
type DetachCookie struct {
|
type DetachCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func Detach(c *xgb.Conn, Shmseg Seg) DetachCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(detachRequest(c, Shmseg), cookie)
|
c.NewRequest(detachRequest(c, Shmseg), cookie)
|
||||||
return DetachCookie{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 {
|
func DetachChecked(c *xgb.Conn, Shmseg Seg) DetachCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(detachRequest(c, Shmseg), cookie)
|
c.NewRequest(detachRequest(c, Shmseg), cookie)
|
||||||
return DetachCookie{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 {
|
func (cook DetachCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Detach
|
// Write request to wire for Detach
|
||||||
|
// detachRequest writes a Detach request to a byte slice.
|
||||||
func detachRequest(c *xgb.Conn, Shmseg Seg) []byte {
|
func detachRequest(c *xgb.Conn, Shmseg Seg) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -410,30 +423,35 @@ func detachRequest(c *xgb.Conn, Shmseg Seg) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request PutImage
|
// PutImageCookie is a cookie used only for PutImage requests.
|
||||||
// size: 40
|
|
||||||
type PutImageCookie struct {
|
type PutImageCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
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)
|
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)
|
c.NewRequest(putImageRequest(c, Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie)
|
||||||
return PutImageCookie{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 {
|
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)
|
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)
|
c.NewRequest(putImageRequest(c, Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie)
|
||||||
return PutImageCookie{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 {
|
func (cook PutImageCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for PutImage
|
// 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 {
|
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
|
size := 40
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -498,35 +516,37 @@ func putImageRequest(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext,
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request GetImage
|
// GetImageCookie is a cookie used only for GetImage requests.
|
||||||
// size: 32
|
|
||||||
type GetImageCookie struct {
|
type GetImageCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
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)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getImageRequest(c, Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie)
|
c.NewRequest(getImageRequest(c, Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie)
|
||||||
return GetImageCookie{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 {
|
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)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getImageRequest(c, Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie)
|
c.NewRequest(getImageRequest(c, Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie)
|
||||||
return GetImageCookie{cookie}
|
return GetImageCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetImage
|
// GetImageReply represents the data returned from a GetImage request.
|
||||||
// size: 16
|
|
||||||
type GetImageReply struct {
|
type GetImageReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
Depth byte
|
Depth byte
|
||||||
Visual xproto.Visualid
|
Visual xproto.Visualid
|
||||||
Size uint32
|
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) {
|
func (cook GetImageCookie) Reply() (*GetImageReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -538,7 +558,7 @@ func (cook GetImageCookie) Reply() (*GetImageReply, error) {
|
||||||
return getImageReply(buf), nil
|
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 {
|
func getImageReply(buf []byte) *GetImageReply {
|
||||||
v := new(GetImageReply)
|
v := new(GetImageReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -562,6 +582,7 @@ func getImageReply(buf []byte) *GetImageReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetImage
|
// 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 {
|
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
|
size := 32
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -608,30 +629,35 @@ func getImageRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Wi
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request CreatePixmap
|
// CreatePixmapCookie is a cookie used only for CreatePixmap requests.
|
||||||
// size: 28
|
|
||||||
type CreatePixmapCookie struct {
|
type CreatePixmapCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
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)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(createPixmapRequest(c, Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie)
|
c.NewRequest(createPixmapRequest(c, Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie)
|
||||||
return CreatePixmapCookie{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 {
|
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)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(createPixmapRequest(c, Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie)
|
c.NewRequest(createPixmapRequest(c, Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie)
|
||||||
return CreatePixmapCookie{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 {
|
func (cook CreatePixmapCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for CreatePixmap
|
// 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 {
|
func createPixmapRequest(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) []byte {
|
||||||
size := 28
|
size := 28
|
||||||
b := 0
|
b := 0
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2,7 +2,7 @@
|
||||||
package xcmisc
|
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!
|
This file is automatically generated. Edit at your peril!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -64,35 +64,37 @@ func init() {
|
||||||
|
|
||||||
// Skipping definition for base type 'Bool'
|
// Skipping definition for base type 'Bool'
|
||||||
|
|
||||||
// Request GetVersion
|
// GetVersionCookie is a cookie used only for GetVersion requests.
|
||||||
// size: 8
|
|
||||||
type GetVersionCookie struct {
|
type GetVersionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
||||||
return GetVersionCookie{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 {
|
func GetVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
||||||
return GetVersionCookie{cookie}
|
return GetVersionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetVersion
|
// GetVersionReply represents the data returned from a GetVersion request.
|
||||||
// size: 12
|
|
||||||
type GetVersionReply struct {
|
type GetVersionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
ServerMajorVersion uint16
|
ServerMajorVersion uint16
|
||||||
ServerMinorVersion 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) {
|
func (cook GetVersionCookie) Reply() (*GetVersionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -104,7 +106,7 @@ func (cook GetVersionCookie) Reply() (*GetVersionReply, error) {
|
||||||
return getVersionReply(buf), nil
|
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 {
|
func getVersionReply(buf []byte) *GetVersionReply {
|
||||||
v := new(GetVersionReply)
|
v := new(GetVersionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -127,6 +129,7 @@ func getVersionReply(buf []byte) *GetVersionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetVersion
|
// 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 {
|
func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -150,35 +153,37 @@ func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersio
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request GetXIDRange
|
// GetXIDRangeCookie is a cookie used only for GetXIDRange requests.
|
||||||
// size: 4
|
|
||||||
type GetXIDRangeCookie struct {
|
type GetXIDRangeCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GetXIDRange(c *xgb.Conn) GetXIDRangeCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getXIDRangeRequest(c), cookie)
|
c.NewRequest(getXIDRangeRequest(c), cookie)
|
||||||
return GetXIDRangeCookie{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 {
|
func GetXIDRangeUnchecked(c *xgb.Conn) GetXIDRangeCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getXIDRangeRequest(c), cookie)
|
c.NewRequest(getXIDRangeRequest(c), cookie)
|
||||||
return GetXIDRangeCookie{cookie}
|
return GetXIDRangeCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetXIDRange
|
// GetXIDRangeReply represents the data returned from a GetXIDRange request.
|
||||||
// size: 16
|
|
||||||
type GetXIDRangeReply struct {
|
type GetXIDRangeReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
StartId uint32
|
StartId uint32
|
||||||
Count 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) {
|
func (cook GetXIDRangeCookie) Reply() (*GetXIDRangeReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -190,7 +195,7 @@ func (cook GetXIDRangeCookie) Reply() (*GetXIDRangeReply, error) {
|
||||||
return getXIDRangeReply(buf), nil
|
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 {
|
func getXIDRangeReply(buf []byte) *GetXIDRangeReply {
|
||||||
v := new(GetXIDRangeReply)
|
v := new(GetXIDRangeReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -213,6 +218,7 @@ func getXIDRangeReply(buf []byte) *GetXIDRangeReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetXIDRange
|
// Write request to wire for GetXIDRange
|
||||||
|
// getXIDRangeRequest writes a GetXIDRange request to a byte slice.
|
||||||
func getXIDRangeRequest(c *xgb.Conn) []byte {
|
func getXIDRangeRequest(c *xgb.Conn) []byte {
|
||||||
size := 4
|
size := 4
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -230,36 +236,38 @@ func getXIDRangeRequest(c *xgb.Conn) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request GetXIDList
|
// GetXIDListCookie is a cookie used only for GetXIDList requests.
|
||||||
// size: 8
|
|
||||||
type GetXIDListCookie struct {
|
type GetXIDListCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GetXIDList(c *xgb.Conn, Count uint32) GetXIDListCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getXIDListRequest(c, Count), cookie)
|
c.NewRequest(getXIDListRequest(c, Count), cookie)
|
||||||
return GetXIDListCookie{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 {
|
func GetXIDListUnchecked(c *xgb.Conn, Count uint32) GetXIDListCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getXIDListRequest(c, Count), cookie)
|
c.NewRequest(getXIDListRequest(c, Count), cookie)
|
||||||
return GetXIDListCookie{cookie}
|
return GetXIDListCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetXIDList
|
// GetXIDListReply represents the data returned from a GetXIDList request.
|
||||||
// size: (32 + xgb.Pad((int(IdsLen) * 4)))
|
|
||||||
type GetXIDListReply struct {
|
type GetXIDListReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
IdsLen uint32
|
IdsLen uint32
|
||||||
// padding: 20 bytes
|
// padding: 20 bytes
|
||||||
Ids []uint32 // size: xgb.Pad((int(IdsLen) * 4))
|
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) {
|
func (cook GetXIDListCookie) Reply() (*GetXIDListReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -271,7 +279,7 @@ func (cook GetXIDListCookie) Reply() (*GetXIDListReply, error) {
|
||||||
return getXIDListReply(buf), nil
|
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 {
|
func getXIDListReply(buf []byte) *GetXIDListReply {
|
||||||
v := new(GetXIDListReply)
|
v := new(GetXIDListReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -300,6 +308,7 @@ func getXIDListReply(buf []byte) *GetXIDListReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetXIDList
|
// Write request to wire for GetXIDList
|
||||||
|
// getXIDListRequest writes a GetXIDList request to a byte slice.
|
||||||
func getXIDListRequest(c *xgb.Conn, Count uint32) []byte {
|
func getXIDListRequest(c *xgb.Conn, Count uint32) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
package xevie
|
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!
|
This file is automatically generated. Edit at your peril!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -40,16 +40,6 @@ func init() {
|
||||||
xgb.NewExtErrorFuncs["XEVIE"] = make(map[int]xgb.NewErrorFun)
|
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 'Int8'
|
||||||
|
|
||||||
// Skipping definition for base type 'Card16'
|
// Skipping definition for base type 'Card16'
|
||||||
|
@ -64,18 +54,26 @@ func init() {
|
||||||
|
|
||||||
// Skipping definition for base type 'Float'
|
// 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 (
|
const (
|
||||||
DatatypeUnmodified = 0
|
DatatypeUnmodified = 0
|
||||||
DatatypeModified = 1
|
DatatypeModified = 1
|
||||||
)
|
)
|
||||||
|
|
||||||
// 'Event' struct definition
|
|
||||||
// Size: 32
|
|
||||||
type Event struct {
|
type Event struct {
|
||||||
// padding: 32 bytes
|
// padding: 32 bytes
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct read Event
|
// EventRead reads a byte slice into a Event value.
|
||||||
func EventRead(buf []byte, v *Event) int {
|
func EventRead(buf []byte, v *Event) int {
|
||||||
b := 0
|
b := 0
|
||||||
|
|
||||||
|
@ -84,7 +82,7 @@ func EventRead(buf []byte, v *Event) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct list read Event
|
// EventReadList reads a byte slice into a list of Event values.
|
||||||
func EventReadList(buf []byte, dest []Event) int {
|
func EventReadList(buf []byte, dest []Event) int {
|
||||||
b := 0
|
b := 0
|
||||||
for i := 0; i < len(dest); i++ {
|
for i := 0; i < len(dest); i++ {
|
||||||
|
@ -94,7 +92,7 @@ func EventReadList(buf []byte, dest []Event) int {
|
||||||
return xgb.Pad(b)
|
return xgb.Pad(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct write Event
|
// Bytes writes a Event value to a byte slice.
|
||||||
func (v Event) Bytes() []byte {
|
func (v Event) Bytes() []byte {
|
||||||
buf := make([]byte, 32)
|
buf := make([]byte, 32)
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -104,7 +102,7 @@ func (v Event) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func EventListBytes(buf []byte, list []Event) int {
|
||||||
b := 0
|
b := 0
|
||||||
var structBytes []byte
|
var structBytes []byte
|
||||||
|
@ -116,36 +114,38 @@ func EventListBytes(buf []byte, list []Event) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request QueryVersion
|
// QueryVersionCookie is a cookie used only for QueryVersion requests.
|
||||||
// size: 8
|
|
||||||
type QueryVersionCookie struct {
|
type QueryVersionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
||||||
return QueryVersionCookie{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 {
|
func QueryVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
c.NewRequest(queryVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
|
||||||
return QueryVersionCookie{cookie}
|
return QueryVersionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryVersion
|
// QueryVersionReply represents the data returned from a QueryVersion request.
|
||||||
// size: 32
|
|
||||||
type QueryVersionReply struct {
|
type QueryVersionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
ServerMajorVersion uint16
|
ServerMajorVersion uint16
|
||||||
ServerMinorVersion uint16
|
ServerMinorVersion uint16
|
||||||
// padding: 20 bytes
|
// 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) {
|
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -157,7 +157,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
return queryVersionReply(buf), nil
|
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 {
|
func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
v := new(QueryVersionReply)
|
v := new(QueryVersionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -182,6 +182,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryVersion
|
// 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 {
|
func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -205,34 +206,36 @@ func queryVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVers
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Start
|
// StartCookie is a cookie used only for Start requests.
|
||||||
// size: 8
|
|
||||||
type StartCookie struct {
|
type StartCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func Start(c *xgb.Conn, Screen uint32) StartCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(startRequest(c, Screen), cookie)
|
c.NewRequest(startRequest(c, Screen), cookie)
|
||||||
return StartCookie{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 {
|
func StartUnchecked(c *xgb.Conn, Screen uint32) StartCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(startRequest(c, Screen), cookie)
|
c.NewRequest(startRequest(c, Screen), cookie)
|
||||||
return StartCookie{cookie}
|
return StartCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for Start
|
// StartReply represents the data returned from a Start request.
|
||||||
// size: 32
|
|
||||||
type StartReply struct {
|
type StartReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
// padding: 24 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) {
|
func (cook StartCookie) Reply() (*StartReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -244,7 +247,7 @@ func (cook StartCookie) Reply() (*StartReply, error) {
|
||||||
return startReply(buf), nil
|
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 {
|
func startReply(buf []byte) *StartReply {
|
||||||
v := new(StartReply)
|
v := new(StartReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -263,6 +266,7 @@ func startReply(buf []byte) *StartReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Start
|
// Write request to wire for Start
|
||||||
|
// startRequest writes a Start request to a byte slice.
|
||||||
func startRequest(c *xgb.Conn, Screen uint32) []byte {
|
func startRequest(c *xgb.Conn, Screen uint32) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -283,34 +287,36 @@ func startRequest(c *xgb.Conn, Screen uint32) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request End
|
// EndCookie is a cookie used only for End requests.
|
||||||
// size: 8
|
|
||||||
type EndCookie struct {
|
type EndCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func End(c *xgb.Conn, Cmap uint32) EndCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(endRequest(c, Cmap), cookie)
|
c.NewRequest(endRequest(c, Cmap), cookie)
|
||||||
return EndCookie{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 {
|
func EndUnchecked(c *xgb.Conn, Cmap uint32) EndCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(endRequest(c, Cmap), cookie)
|
c.NewRequest(endRequest(c, Cmap), cookie)
|
||||||
return EndCookie{cookie}
|
return EndCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for End
|
// EndReply represents the data returned from a End request.
|
||||||
// size: 32
|
|
||||||
type EndReply struct {
|
type EndReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
// padding: 24 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) {
|
func (cook EndCookie) Reply() (*EndReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -322,7 +328,7 @@ func (cook EndCookie) Reply() (*EndReply, error) {
|
||||||
return endReply(buf), nil
|
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 {
|
func endReply(buf []byte) *EndReply {
|
||||||
v := new(EndReply)
|
v := new(EndReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -341,6 +347,7 @@ func endReply(buf []byte) *EndReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for End
|
// Write request to wire for End
|
||||||
|
// endRequest writes a End request to a byte slice.
|
||||||
func endRequest(c *xgb.Conn, Cmap uint32) []byte {
|
func endRequest(c *xgb.Conn, Cmap uint32) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -361,34 +368,36 @@ func endRequest(c *xgb.Conn, Cmap uint32) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request Send
|
// SendCookie is a cookie used only for Send requests.
|
||||||
// size: 104
|
|
||||||
type SendCookie struct {
|
type SendCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func Send(c *xgb.Conn, Event Event, DataType uint32) SendCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(sendRequest(c, Event, DataType), cookie)
|
c.NewRequest(sendRequest(c, Event, DataType), cookie)
|
||||||
return SendCookie{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 {
|
func SendUnchecked(c *xgb.Conn, Event Event, DataType uint32) SendCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(sendRequest(c, Event, DataType), cookie)
|
c.NewRequest(sendRequest(c, Event, DataType), cookie)
|
||||||
return SendCookie{cookie}
|
return SendCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for Send
|
// SendReply represents the data returned from a Send request.
|
||||||
// size: 32
|
|
||||||
type SendReply struct {
|
type SendReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
// padding: 24 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) {
|
func (cook SendCookie) Reply() (*SendReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -400,7 +409,7 @@ func (cook SendCookie) Reply() (*SendReply, error) {
|
||||||
return sendReply(buf), nil
|
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 {
|
func sendReply(buf []byte) *SendReply {
|
||||||
v := new(SendReply)
|
v := new(SendReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -419,6 +428,7 @@ func sendReply(buf []byte) *SendReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for Send
|
// 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 {
|
func sendRequest(c *xgb.Conn, Event Event, DataType uint32) []byte {
|
||||||
size := 104
|
size := 104
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -447,34 +457,36 @@ func sendRequest(c *xgb.Conn, Event Event, DataType uint32) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request SelectInput
|
// SelectInputCookie is a cookie used only for SelectInput requests.
|
||||||
// size: 8
|
|
||||||
type SelectInputCookie struct {
|
type SelectInputCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func SelectInput(c *xgb.Conn, EventMask uint32) SelectInputCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(selectInputRequest(c, EventMask), cookie)
|
c.NewRequest(selectInputRequest(c, EventMask), cookie)
|
||||||
return SelectInputCookie{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 {
|
func SelectInputUnchecked(c *xgb.Conn, EventMask uint32) SelectInputCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(selectInputRequest(c, EventMask), cookie)
|
c.NewRequest(selectInputRequest(c, EventMask), cookie)
|
||||||
return SelectInputCookie{cookie}
|
return SelectInputCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for SelectInput
|
// SelectInputReply represents the data returned from a SelectInput request.
|
||||||
// size: 32
|
|
||||||
type SelectInputReply struct {
|
type SelectInputReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
// padding: 24 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) {
|
func (cook SelectInputCookie) Reply() (*SelectInputReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -486,7 +498,7 @@ func (cook SelectInputCookie) Reply() (*SelectInputReply, error) {
|
||||||
return selectInputReply(buf), nil
|
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 {
|
func selectInputReply(buf []byte) *SelectInputReply {
|
||||||
v := new(SelectInputReply)
|
v := new(SelectInputReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -505,6 +517,7 @@ func selectInputReply(buf []byte) *SelectInputReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for SelectInput
|
// Write request to wire for SelectInput
|
||||||
|
// selectInputRequest writes a SelectInput request to a byte slice.
|
||||||
func selectInputRequest(c *xgb.Conn, EventMask uint32) []byte {
|
func selectInputRequest(c *xgb.Conn, EventMask uint32) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
package xf86dri
|
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!
|
This file is automatically generated. Edit at your peril!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -40,18 +40,6 @@ func init() {
|
||||||
xgb.NewExtErrorFuncs["XFree86-DRI"] = make(map[int]xgb.NewErrorFun)
|
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 'Float'
|
||||||
|
|
||||||
// Skipping definition for base type 'Card8'
|
// Skipping definition for base type 'Card8'
|
||||||
|
@ -64,8 +52,18 @@ func init() {
|
||||||
|
|
||||||
// Skipping definition for base type 'Byte'
|
// Skipping definition for base type 'Byte'
|
||||||
|
|
||||||
// 'DrmClipRect' struct definition
|
// Skipping definition for base type 'Int8'
|
||||||
// Size: 8
|
|
||||||
|
// 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 {
|
type DrmClipRect struct {
|
||||||
X1 int16
|
X1 int16
|
||||||
Y1 int16
|
Y1 int16
|
||||||
|
@ -73,7 +71,7 @@ type DrmClipRect struct {
|
||||||
X3 int16
|
X3 int16
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct read DrmClipRect
|
// DrmClipRectRead reads a byte slice into a DrmClipRect value.
|
||||||
func DrmClipRectRead(buf []byte, v *DrmClipRect) int {
|
func DrmClipRectRead(buf []byte, v *DrmClipRect) int {
|
||||||
b := 0
|
b := 0
|
||||||
|
|
||||||
|
@ -92,7 +90,7 @@ func DrmClipRectRead(buf []byte, v *DrmClipRect) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct list read DrmClipRect
|
// DrmClipRectReadList reads a byte slice into a list of DrmClipRect values.
|
||||||
func DrmClipRectReadList(buf []byte, dest []DrmClipRect) int {
|
func DrmClipRectReadList(buf []byte, dest []DrmClipRect) int {
|
||||||
b := 0
|
b := 0
|
||||||
for i := 0; i < len(dest); i++ {
|
for i := 0; i < len(dest); i++ {
|
||||||
|
@ -102,7 +100,7 @@ func DrmClipRectReadList(buf []byte, dest []DrmClipRect) int {
|
||||||
return xgb.Pad(b)
|
return xgb.Pad(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct write DrmClipRect
|
// Bytes writes a DrmClipRect value to a byte slice.
|
||||||
func (v DrmClipRect) Bytes() []byte {
|
func (v DrmClipRect) Bytes() []byte {
|
||||||
buf := make([]byte, 8)
|
buf := make([]byte, 8)
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -122,7 +120,7 @@ func (v DrmClipRect) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func DrmClipRectListBytes(buf []byte, list []DrmClipRect) int {
|
||||||
b := 0
|
b := 0
|
||||||
var structBytes []byte
|
var structBytes []byte
|
||||||
|
@ -134,36 +132,38 @@ func DrmClipRectListBytes(buf []byte, list []DrmClipRect) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request QueryVersion
|
// QueryVersionCookie is a cookie used only for QueryVersion requests.
|
||||||
// size: 4
|
|
||||||
type QueryVersionCookie struct {
|
type QueryVersionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryVersion(c *xgb.Conn) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryVersionRequest(c), cookie)
|
c.NewRequest(queryVersionRequest(c), cookie)
|
||||||
return QueryVersionCookie{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 {
|
func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryVersionRequest(c), cookie)
|
c.NewRequest(queryVersionRequest(c), cookie)
|
||||||
return QueryVersionCookie{cookie}
|
return QueryVersionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryVersion
|
// QueryVersionReply represents the data returned from a QueryVersion request.
|
||||||
// size: 16
|
|
||||||
type QueryVersionReply struct {
|
type QueryVersionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
DriMajorVersion uint16
|
DriMajorVersion uint16
|
||||||
DriMinorVersion uint16
|
DriMinorVersion uint16
|
||||||
DriMinorPatch uint32
|
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) {
|
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -175,7 +175,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
return queryVersionReply(buf), nil
|
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 {
|
func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
v := new(QueryVersionReply)
|
v := new(QueryVersionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -201,6 +201,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryVersion
|
// Write request to wire for QueryVersion
|
||||||
|
// queryVersionRequest writes a QueryVersion request to a byte slice.
|
||||||
func queryVersionRequest(c *xgb.Conn) []byte {
|
func queryVersionRequest(c *xgb.Conn) []byte {
|
||||||
size := 4
|
size := 4
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -218,34 +219,36 @@ func queryVersionRequest(c *xgb.Conn) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request QueryDirectRenderingCapable
|
// QueryDirectRenderingCapableCookie is a cookie used only for QueryDirectRenderingCapable requests.
|
||||||
// size: 8
|
|
||||||
type QueryDirectRenderingCapableCookie struct {
|
type QueryDirectRenderingCapableCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryDirectRenderingCapable(c *xgb.Conn, Screen uint32) QueryDirectRenderingCapableCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryDirectRenderingCapableRequest(c, Screen), cookie)
|
c.NewRequest(queryDirectRenderingCapableRequest(c, Screen), cookie)
|
||||||
return QueryDirectRenderingCapableCookie{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 {
|
func QueryDirectRenderingCapableUnchecked(c *xgb.Conn, Screen uint32) QueryDirectRenderingCapableCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryDirectRenderingCapableRequest(c, Screen), cookie)
|
c.NewRequest(queryDirectRenderingCapableRequest(c, Screen), cookie)
|
||||||
return QueryDirectRenderingCapableCookie{cookie}
|
return QueryDirectRenderingCapableCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryDirectRenderingCapable
|
// QueryDirectRenderingCapableReply represents the data returned from a QueryDirectRenderingCapable request.
|
||||||
// size: 9
|
|
||||||
type QueryDirectRenderingCapableReply struct {
|
type QueryDirectRenderingCapableReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
IsCapable bool
|
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) {
|
func (cook QueryDirectRenderingCapableCookie) Reply() (*QueryDirectRenderingCapableReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -257,7 +260,7 @@ func (cook QueryDirectRenderingCapableCookie) Reply() (*QueryDirectRenderingCapa
|
||||||
return queryDirectRenderingCapableReply(buf), nil
|
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 {
|
func queryDirectRenderingCapableReply(buf []byte) *QueryDirectRenderingCapableReply {
|
||||||
v := new(QueryDirectRenderingCapableReply)
|
v := new(QueryDirectRenderingCapableReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -281,6 +284,7 @@ func queryDirectRenderingCapableReply(buf []byte) *QueryDirectRenderingCapableRe
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryDirectRenderingCapable
|
// Write request to wire for QueryDirectRenderingCapable
|
||||||
|
// queryDirectRenderingCapableRequest writes a QueryDirectRenderingCapable request to a byte slice.
|
||||||
func queryDirectRenderingCapableRequest(c *xgb.Conn, Screen uint32) []byte {
|
func queryDirectRenderingCapableRequest(c *xgb.Conn, Screen uint32) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -301,29 +305,31 @@ func queryDirectRenderingCapableRequest(c *xgb.Conn, Screen uint32) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request OpenConnection
|
// OpenConnectionCookie is a cookie used only for OpenConnection requests.
|
||||||
// size: 8
|
|
||||||
type OpenConnectionCookie struct {
|
type OpenConnectionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func OpenConnection(c *xgb.Conn, Screen uint32) OpenConnectionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(openConnectionRequest(c, Screen), cookie)
|
c.NewRequest(openConnectionRequest(c, Screen), cookie)
|
||||||
return OpenConnectionCookie{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 {
|
func OpenConnectionUnchecked(c *xgb.Conn, Screen uint32) OpenConnectionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(openConnectionRequest(c, Screen), cookie)
|
c.NewRequest(openConnectionRequest(c, Screen), cookie)
|
||||||
return OpenConnectionCookie{cookie}
|
return OpenConnectionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for OpenConnection
|
// OpenConnectionReply represents the data returned from a OpenConnection request.
|
||||||
// size: (32 + xgb.Pad((int(BusIdLen) * 1)))
|
|
||||||
type OpenConnectionReply struct {
|
type OpenConnectionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
SareaHandleLow uint32
|
SareaHandleLow uint32
|
||||||
SareaHandleHigh uint32
|
SareaHandleHigh uint32
|
||||||
|
@ -332,7 +338,7 @@ type OpenConnectionReply struct {
|
||||||
BusId string // size: xgb.Pad((int(BusIdLen) * 1))
|
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) {
|
func (cook OpenConnectionCookie) Reply() (*OpenConnectionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -344,7 +350,7 @@ func (cook OpenConnectionCookie) Reply() (*OpenConnectionReply, error) {
|
||||||
return openConnectionReply(buf), nil
|
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 {
|
func openConnectionReply(buf []byte) *OpenConnectionReply {
|
||||||
v := new(OpenConnectionReply)
|
v := new(OpenConnectionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -379,6 +385,7 @@ func openConnectionReply(buf []byte) *OpenConnectionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for OpenConnection
|
// Write request to wire for OpenConnection
|
||||||
|
// openConnectionRequest writes a OpenConnection request to a byte slice.
|
||||||
func openConnectionRequest(c *xgb.Conn, Screen uint32) []byte {
|
func openConnectionRequest(c *xgb.Conn, Screen uint32) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -399,30 +406,35 @@ func openConnectionRequest(c *xgb.Conn, Screen uint32) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request CloseConnection
|
// CloseConnectionCookie is a cookie used only for CloseConnection requests.
|
||||||
// size: 8
|
|
||||||
type CloseConnectionCookie struct {
|
type CloseConnectionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func CloseConnection(c *xgb.Conn, Screen uint32) CloseConnectionCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(closeConnectionRequest(c, Screen), cookie)
|
c.NewRequest(closeConnectionRequest(c, Screen), cookie)
|
||||||
return CloseConnectionCookie{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 {
|
func CloseConnectionChecked(c *xgb.Conn, Screen uint32) CloseConnectionCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(closeConnectionRequest(c, Screen), cookie)
|
c.NewRequest(closeConnectionRequest(c, Screen), cookie)
|
||||||
return CloseConnectionCookie{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 {
|
func (cook CloseConnectionCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for CloseConnection
|
// Write request to wire for CloseConnection
|
||||||
|
// closeConnectionRequest writes a CloseConnection request to a byte slice.
|
||||||
func closeConnectionRequest(c *xgb.Conn, Screen uint32) []byte {
|
func closeConnectionRequest(c *xgb.Conn, Screen uint32) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -443,29 +455,31 @@ func closeConnectionRequest(c *xgb.Conn, Screen uint32) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request GetClientDriverName
|
// GetClientDriverNameCookie is a cookie used only for GetClientDriverName requests.
|
||||||
// size: 8
|
|
||||||
type GetClientDriverNameCookie struct {
|
type GetClientDriverNameCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GetClientDriverName(c *xgb.Conn, Screen uint32) GetClientDriverNameCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getClientDriverNameRequest(c, Screen), cookie)
|
c.NewRequest(getClientDriverNameRequest(c, Screen), cookie)
|
||||||
return GetClientDriverNameCookie{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 {
|
func GetClientDriverNameUnchecked(c *xgb.Conn, Screen uint32) GetClientDriverNameCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getClientDriverNameRequest(c, Screen), cookie)
|
c.NewRequest(getClientDriverNameRequest(c, Screen), cookie)
|
||||||
return GetClientDriverNameCookie{cookie}
|
return GetClientDriverNameCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetClientDriverName
|
// GetClientDriverNameReply represents the data returned from a GetClientDriverName request.
|
||||||
// size: (32 + xgb.Pad((int(ClientDriverNameLen) * 1)))
|
|
||||||
type GetClientDriverNameReply struct {
|
type GetClientDriverNameReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
ClientDriverMajorVersion uint32
|
ClientDriverMajorVersion uint32
|
||||||
ClientDriverMinorVersion uint32
|
ClientDriverMinorVersion uint32
|
||||||
|
@ -475,7 +489,7 @@ type GetClientDriverNameReply struct {
|
||||||
ClientDriverName string // size: xgb.Pad((int(ClientDriverNameLen) * 1))
|
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) {
|
func (cook GetClientDriverNameCookie) Reply() (*GetClientDriverNameReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -487,7 +501,7 @@ func (cook GetClientDriverNameCookie) Reply() (*GetClientDriverNameReply, error)
|
||||||
return getClientDriverNameReply(buf), nil
|
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 {
|
func getClientDriverNameReply(buf []byte) *GetClientDriverNameReply {
|
||||||
v := new(GetClientDriverNameReply)
|
v := new(GetClientDriverNameReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -525,6 +539,7 @@ func getClientDriverNameReply(buf []byte) *GetClientDriverNameReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetClientDriverName
|
// Write request to wire for GetClientDriverName
|
||||||
|
// getClientDriverNameRequest writes a GetClientDriverName request to a byte slice.
|
||||||
func getClientDriverNameRequest(c *xgb.Conn, Screen uint32) []byte {
|
func getClientDriverNameRequest(c *xgb.Conn, Screen uint32) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -545,34 +560,36 @@ func getClientDriverNameRequest(c *xgb.Conn, Screen uint32) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request CreateContext
|
// CreateContextCookie is a cookie used only for CreateContext requests.
|
||||||
// size: 16
|
|
||||||
type CreateContextCookie struct {
|
type CreateContextCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func CreateContext(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) CreateContextCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(createContextRequest(c, Screen, Visual, Context), cookie)
|
c.NewRequest(createContextRequest(c, Screen, Visual, Context), cookie)
|
||||||
return CreateContextCookie{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 {
|
func CreateContextUnchecked(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) CreateContextCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(createContextRequest(c, Screen, Visual, Context), cookie)
|
c.NewRequest(createContextRequest(c, Screen, Visual, Context), cookie)
|
||||||
return CreateContextCookie{cookie}
|
return CreateContextCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for CreateContext
|
// CreateContextReply represents the data returned from a CreateContext request.
|
||||||
// size: 12
|
|
||||||
type CreateContextReply struct {
|
type CreateContextReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
HwContext uint32
|
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) {
|
func (cook CreateContextCookie) Reply() (*CreateContextReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -584,7 +601,7 @@ func (cook CreateContextCookie) Reply() (*CreateContextReply, error) {
|
||||||
return createContextReply(buf), nil
|
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 {
|
func createContextReply(buf []byte) *CreateContextReply {
|
||||||
v := new(CreateContextReply)
|
v := new(CreateContextReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -604,6 +621,7 @@ func createContextReply(buf []byte) *CreateContextReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for CreateContext
|
// 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 {
|
func createContextRequest(c *xgb.Conn, Screen uint32, Visual uint32, Context uint32) []byte {
|
||||||
size := 16
|
size := 16
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -630,30 +648,35 @@ func createContextRequest(c *xgb.Conn, Screen uint32, Visual uint32, Context uin
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request DestroyContext
|
// DestroyContextCookie is a cookie used only for DestroyContext requests.
|
||||||
// size: 12
|
|
||||||
type DestroyContextCookie struct {
|
type DestroyContextCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func DestroyContext(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(destroyContextRequest(c, Screen, Context), cookie)
|
c.NewRequest(destroyContextRequest(c, Screen, Context), cookie)
|
||||||
return DestroyContextCookie{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 {
|
func DestroyContextChecked(c *xgb.Conn, Screen uint32, Context uint32) DestroyContextCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(destroyContextRequest(c, Screen, Context), cookie)
|
c.NewRequest(destroyContextRequest(c, Screen, Context), cookie)
|
||||||
return DestroyContextCookie{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 {
|
func (cook DestroyContextCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for DestroyContext
|
// 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 {
|
func destroyContextRequest(c *xgb.Conn, Screen uint32, Context uint32) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -677,34 +700,36 @@ func destroyContextRequest(c *xgb.Conn, Screen uint32, Context uint32) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request CreateDrawable
|
// CreateDrawableCookie is a cookie used only for CreateDrawable requests.
|
||||||
// size: 12
|
|
||||||
type CreateDrawableCookie struct {
|
type CreateDrawableCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func CreateDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(createDrawableRequest(c, Screen, Drawable), cookie)
|
c.NewRequest(createDrawableRequest(c, Screen, Drawable), cookie)
|
||||||
return CreateDrawableCookie{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 {
|
func CreateDrawableUnchecked(c *xgb.Conn, Screen uint32, Drawable uint32) CreateDrawableCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(createDrawableRequest(c, Screen, Drawable), cookie)
|
c.NewRequest(createDrawableRequest(c, Screen, Drawable), cookie)
|
||||||
return CreateDrawableCookie{cookie}
|
return CreateDrawableCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for CreateDrawable
|
// CreateDrawableReply represents the data returned from a CreateDrawable request.
|
||||||
// size: 12
|
|
||||||
type CreateDrawableReply struct {
|
type CreateDrawableReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
HwDrawableHandle uint32
|
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) {
|
func (cook CreateDrawableCookie) Reply() (*CreateDrawableReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -716,7 +741,7 @@ func (cook CreateDrawableCookie) Reply() (*CreateDrawableReply, error) {
|
||||||
return createDrawableReply(buf), nil
|
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 {
|
func createDrawableReply(buf []byte) *CreateDrawableReply {
|
||||||
v := new(CreateDrawableReply)
|
v := new(CreateDrawableReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -736,6 +761,7 @@ func createDrawableReply(buf []byte) *CreateDrawableReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for CreateDrawable
|
// 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 {
|
func createDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -759,30 +785,35 @@ func createDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request DestroyDrawable
|
// DestroyDrawableCookie is a cookie used only for DestroyDrawable requests.
|
||||||
// size: 12
|
|
||||||
type DestroyDrawableCookie struct {
|
type DestroyDrawableCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func DestroyDrawable(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawableCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(destroyDrawableRequest(c, Screen, Drawable), cookie)
|
c.NewRequest(destroyDrawableRequest(c, Screen, Drawable), cookie)
|
||||||
return DestroyDrawableCookie{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 {
|
func DestroyDrawableChecked(c *xgb.Conn, Screen uint32, Drawable uint32) DestroyDrawableCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(destroyDrawableRequest(c, Screen, Drawable), cookie)
|
c.NewRequest(destroyDrawableRequest(c, Screen, Drawable), cookie)
|
||||||
return DestroyDrawableCookie{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 {
|
func (cook DestroyDrawableCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for DestroyDrawable
|
// 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 {
|
func destroyDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -806,29 +837,31 @@ func destroyDrawableRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request GetDrawableInfo
|
// GetDrawableInfoCookie is a cookie used only for GetDrawableInfo requests.
|
||||||
// size: 12
|
|
||||||
type GetDrawableInfoCookie struct {
|
type GetDrawableInfoCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GetDrawableInfo(c *xgb.Conn, Screen uint32, Drawable uint32) GetDrawableInfoCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getDrawableInfoRequest(c, Screen, Drawable), cookie)
|
c.NewRequest(getDrawableInfoRequest(c, Screen, Drawable), cookie)
|
||||||
return GetDrawableInfoCookie{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 {
|
func GetDrawableInfoUnchecked(c *xgb.Conn, Screen uint32, Drawable uint32) GetDrawableInfoCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getDrawableInfoRequest(c, Screen, Drawable), cookie)
|
c.NewRequest(getDrawableInfoRequest(c, Screen, Drawable), cookie)
|
||||||
return GetDrawableInfoCookie{cookie}
|
return GetDrawableInfoCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetDrawableInfo
|
// GetDrawableInfoReply represents the data returned from a GetDrawableInfo request.
|
||||||
// size: ((36 + xgb.Pad((int(NumClipRects) * 8))) + xgb.Pad((int(NumBackClipRects) * 8)))
|
|
||||||
type GetDrawableInfoReply struct {
|
type GetDrawableInfoReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
DrawableTableIndex uint32
|
DrawableTableIndex uint32
|
||||||
DrawableTableStamp uint32
|
DrawableTableStamp uint32
|
||||||
|
@ -844,7 +877,7 @@ type GetDrawableInfoReply struct {
|
||||||
BackClipRects []DrmClipRect // size: xgb.Pad((int(NumBackClipRects) * 8))
|
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) {
|
func (cook GetDrawableInfoCookie) Reply() (*GetDrawableInfoReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -856,7 +889,7 @@ func (cook GetDrawableInfoCookie) Reply() (*GetDrawableInfoReply, error) {
|
||||||
return getDrawableInfoReply(buf), nil
|
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 {
|
func getDrawableInfoReply(buf []byte) *GetDrawableInfoReply {
|
||||||
v := new(GetDrawableInfoReply)
|
v := new(GetDrawableInfoReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -909,6 +942,7 @@ func getDrawableInfoReply(buf []byte) *GetDrawableInfoReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetDrawableInfo
|
// 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 {
|
func getDrawableInfoRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -932,29 +966,31 @@ func getDrawableInfoRequest(c *xgb.Conn, Screen uint32, Drawable uint32) []byte
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request GetDeviceInfo
|
// GetDeviceInfoCookie is a cookie used only for GetDeviceInfo requests.
|
||||||
// size: 8
|
|
||||||
type GetDeviceInfoCookie struct {
|
type GetDeviceInfoCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GetDeviceInfo(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getDeviceInfoRequest(c, Screen), cookie)
|
c.NewRequest(getDeviceInfoRequest(c, Screen), cookie)
|
||||||
return GetDeviceInfoCookie{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 {
|
func GetDeviceInfoUnchecked(c *xgb.Conn, Screen uint32) GetDeviceInfoCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getDeviceInfoRequest(c, Screen), cookie)
|
c.NewRequest(getDeviceInfoRequest(c, Screen), cookie)
|
||||||
return GetDeviceInfoCookie{cookie}
|
return GetDeviceInfoCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetDeviceInfo
|
// GetDeviceInfoReply represents the data returned from a GetDeviceInfo request.
|
||||||
// size: (32 + xgb.Pad((int(DevicePrivateSize) * 4)))
|
|
||||||
type GetDeviceInfoReply struct {
|
type GetDeviceInfoReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
FramebufferHandleLow uint32
|
FramebufferHandleLow uint32
|
||||||
FramebufferHandleHigh uint32
|
FramebufferHandleHigh uint32
|
||||||
|
@ -965,7 +1001,7 @@ type GetDeviceInfoReply struct {
|
||||||
DevicePrivate []uint32 // size: xgb.Pad((int(DevicePrivateSize) * 4))
|
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) {
|
func (cook GetDeviceInfoCookie) Reply() (*GetDeviceInfoReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -977,7 +1013,7 @@ func (cook GetDeviceInfoCookie) Reply() (*GetDeviceInfoReply, error) {
|
||||||
return getDeviceInfoReply(buf), nil
|
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 {
|
func getDeviceInfoReply(buf []byte) *GetDeviceInfoReply {
|
||||||
v := new(GetDeviceInfoReply)
|
v := new(GetDeviceInfoReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -1019,6 +1055,7 @@ func getDeviceInfoReply(buf []byte) *GetDeviceInfoReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetDeviceInfo
|
// Write request to wire for GetDeviceInfo
|
||||||
|
// getDeviceInfoRequest writes a GetDeviceInfo request to a byte slice.
|
||||||
func getDeviceInfoRequest(c *xgb.Conn, Screen uint32) []byte {
|
func getDeviceInfoRequest(c *xgb.Conn, Screen uint32) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -1039,34 +1076,36 @@ func getDeviceInfoRequest(c *xgb.Conn, Screen uint32) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request AuthConnection
|
// AuthConnectionCookie is a cookie used only for AuthConnection requests.
|
||||||
// size: 12
|
|
||||||
type AuthConnectionCookie struct {
|
type AuthConnectionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func AuthConnection(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(authConnectionRequest(c, Screen, Magic), cookie)
|
c.NewRequest(authConnectionRequest(c, Screen, Magic), cookie)
|
||||||
return AuthConnectionCookie{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 {
|
func AuthConnectionUnchecked(c *xgb.Conn, Screen uint32, Magic uint32) AuthConnectionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(authConnectionRequest(c, Screen, Magic), cookie)
|
c.NewRequest(authConnectionRequest(c, Screen, Magic), cookie)
|
||||||
return AuthConnectionCookie{cookie}
|
return AuthConnectionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for AuthConnection
|
// AuthConnectionReply represents the data returned from a AuthConnection request.
|
||||||
// size: 12
|
|
||||||
type AuthConnectionReply struct {
|
type AuthConnectionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
Authenticated uint32
|
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) {
|
func (cook AuthConnectionCookie) Reply() (*AuthConnectionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1078,7 +1117,7 @@ func (cook AuthConnectionCookie) Reply() (*AuthConnectionReply, error) {
|
||||||
return authConnectionReply(buf), nil
|
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 {
|
func authConnectionReply(buf []byte) *AuthConnectionReply {
|
||||||
v := new(AuthConnectionReply)
|
v := new(AuthConnectionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -1098,6 +1137,7 @@ func authConnectionReply(buf []byte) *AuthConnectionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for AuthConnection
|
// 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 {
|
func authConnectionRequest(c *xgb.Conn, Screen uint32, Magic uint32) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -118,7 +118,6 @@ func (c *Conn) Close() {
|
||||||
// Event is an interface that can contain any of the events returned by the
|
// 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.
|
// server. Use a type assertion switch to extract the Event structs.
|
||||||
type Event interface {
|
type Event interface {
|
||||||
ImplementsEvent()
|
|
||||||
Bytes() []byte
|
Bytes() []byte
|
||||||
String() string
|
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
|
// 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.
|
// the server. Use a type assertion switch to extract the Error structs.
|
||||||
type Error interface {
|
type Error interface {
|
||||||
ImplementsError()
|
|
||||||
SequenceId() uint16
|
SequenceId() uint16
|
||||||
BadId() uint32
|
BadId() uint32
|
||||||
Error() string
|
Error() string
|
||||||
|
|
|
@ -6,9 +6,7 @@ import (
|
||||||
|
|
||||||
// Error types
|
// Error types
|
||||||
func (e *Error) Define(c *Context) {
|
func (e *Error) Define(c *Context) {
|
||||||
c.Putln("// Error definition %s (%d)", e.SrcName(), e.Number)
|
c.Putln("// %s is the error number for a %s.", e.ErrConst(), e.ErrConst())
|
||||||
c.Putln("// Size: %s", e.Size())
|
|
||||||
c.Putln("")
|
|
||||||
c.Putln("const %s = %d", e.ErrConst(), e.Number)
|
c.Putln("const %s = %d", e.ErrConst(), e.Number)
|
||||||
c.Putln("")
|
c.Putln("")
|
||||||
c.Putln("type %s struct {", e.ErrType())
|
c.Putln("type %s struct {", e.ErrType())
|
||||||
|
@ -40,7 +38,8 @@ func (e *Error) Define(c *Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *Error) Read(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("func %sNew(buf []byte) xgb.Error {", e.ErrType())
|
||||||
c.Putln("v := %s{}", e.ErrType())
|
c.Putln("v := %s{}", e.ErrType())
|
||||||
c.Putln("v.NiceName = \"%s\"", e.SrcName())
|
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.
|
// ImplementsError writes functions to implement the XGB Error interface.
|
||||||
func (e *Error) ImplementsError(c *Context) {
|
func (e *Error) ImplementsError(c *Context) {
|
||||||
c.Putln("func (err %s) ImplementsError() { }", e.ErrType())
|
c.Putln("// SequenceId returns the sequence id attached to the %s error.",
|
||||||
c.Putln("")
|
e.ErrConst())
|
||||||
|
c.Putln("// This is mostly used internally.")
|
||||||
c.Putln("func (err %s) SequenceId() uint16 {", e.ErrType())
|
c.Putln("func (err %s) SequenceId() uint16 {", e.ErrType())
|
||||||
c.Putln("return err.Sequence")
|
c.Putln("return err.Sequence")
|
||||||
c.Putln("}")
|
c.Putln("}")
|
||||||
|
@ -84,8 +84,7 @@ func (e *Error) ImplementsError(c *Context) {
|
||||||
|
|
||||||
// ErrorCopy types
|
// ErrorCopy types
|
||||||
func (e *ErrorCopy) Define(c *Context) {
|
func (e *ErrorCopy) Define(c *Context) {
|
||||||
c.Putln("// ErrorCopy definition %s (%d)", e.SrcName(), e.Number)
|
c.Putln("// %s is the error number for a %s.", e.ErrConst(), e.ErrConst())
|
||||||
c.Putln("")
|
|
||||||
c.Putln("const %s = %d", e.ErrConst(), e.Number)
|
c.Putln("const %s = %d", e.ErrConst(), e.Number)
|
||||||
c.Putln("")
|
c.Putln("")
|
||||||
c.Putln("type %s %s", e.ErrType(), e.Old.(*Error).ErrType())
|
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) {
|
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("func %sNew(buf []byte) xgb.Error {", e.ErrType())
|
||||||
c.Putln("v := %s(%sNew(buf).(%s))",
|
c.Putln("v := %s(%sNew(buf).(%s))",
|
||||||
e.ErrType(), e.Old.(*Error).ErrType(), e.Old.(*Error).ErrType())
|
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.
|
// ImplementsError writes functions to implement the XGB Error interface.
|
||||||
func (e *ErrorCopy) ImplementsError(c *Context) {
|
func (e *ErrorCopy) ImplementsError(c *Context) {
|
||||||
c.Putln("func (err %s) ImplementsError() { }", e.ErrType())
|
c.Putln("// SequenceId returns the sequence id attached to the %s error.",
|
||||||
c.Putln("")
|
e.ErrConst())
|
||||||
|
c.Putln("// This is mostly used internally.")
|
||||||
c.Putln("func (err %s) SequenceId() uint16 {", e.ErrType())
|
c.Putln("func (err %s) SequenceId() uint16 {", e.ErrType())
|
||||||
c.Putln("return err.Sequence")
|
c.Putln("return err.Sequence")
|
||||||
c.Putln("}")
|
c.Putln("}")
|
||||||
|
|
|
@ -6,9 +6,7 @@ import (
|
||||||
|
|
||||||
// Event types
|
// Event types
|
||||||
func (e *Event) Define(c *Context) {
|
func (e *Event) Define(c *Context) {
|
||||||
c.Putln("// Event definition %s (%d)", e.SrcName(), e.Number)
|
c.Putln("// %s is the event number for a %s.", e.SrcName(), e.EvType())
|
||||||
c.Putln("// Size: %s", e.Size())
|
|
||||||
c.Putln("")
|
|
||||||
c.Putln("const %s = %d", e.SrcName(), e.Number)
|
c.Putln("const %s = %d", e.SrcName(), e.Number)
|
||||||
c.Putln("")
|
c.Putln("")
|
||||||
c.Putln("type %s struct {", e.EvType())
|
c.Putln("type %s struct {", e.EvType())
|
||||||
|
@ -30,8 +28,10 @@ func (e *Event) Define(c *Context) {
|
||||||
e.Write(c)
|
e.Write(c)
|
||||||
|
|
||||||
// Makes sure that this event type is an Event interface.
|
// Makes sure that this event type is an Event interface.
|
||||||
c.Putln("func (v %s) ImplementsEvent() { }", e.EvType())
|
c.Putln("// SequenceId returns the sequence id attached to the %s event.",
|
||||||
c.Putln("")
|
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())
|
c.Putln("func (v %s) SequenceId() uint16 {", e.EvType())
|
||||||
if e.NoSequence {
|
if e.NoSequence {
|
||||||
c.Putln("return uint16(0)")
|
c.Putln("return uint16(0)")
|
||||||
|
@ -40,6 +40,8 @@ func (e *Event) Define(c *Context) {
|
||||||
}
|
}
|
||||||
c.Putln("}")
|
c.Putln("}")
|
||||||
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())
|
c.Putln("func (v %s) String() string {", e.EvType())
|
||||||
EventFieldString(c, e.Fields, e.SrcName())
|
EventFieldString(c, e.Fields, e.SrcName())
|
||||||
c.Putln("}")
|
c.Putln("}")
|
||||||
|
@ -58,7 +60,8 @@ func (e *Event) Define(c *Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *Event) Read(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("func %sNew(buf []byte) xgb.Event {", e.EvType())
|
||||||
c.Putln("v := %s{}", e.EvType())
|
c.Putln("v := %s{}", e.EvType())
|
||||||
c.Putln("b := 1 // don't read event number")
|
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) {
|
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("func (v %s) Bytes() []byte {", e.EvType())
|
||||||
c.Putln("buf := make([]byte, %s)", e.Size())
|
c.Putln("buf := make([]byte, %s)", e.Size())
|
||||||
c.Putln("b := 0")
|
c.Putln("b := 0")
|
||||||
|
@ -102,8 +105,7 @@ func (e *Event) Write(c *Context) {
|
||||||
|
|
||||||
// EventCopy types
|
// EventCopy types
|
||||||
func (e *EventCopy) Define(c *Context) {
|
func (e *EventCopy) Define(c *Context) {
|
||||||
c.Putln("// EventCopy definition %s (%d)", e.SrcName(), e.Number)
|
c.Putln("// %s is the event number for a %s.", e.SrcName(), e.EvType())
|
||||||
c.Putln("")
|
|
||||||
c.Putln("const %s = %d", e.SrcName(), e.Number)
|
c.Putln("const %s = %d", e.SrcName(), e.Number)
|
||||||
c.Putln("")
|
c.Putln("")
|
||||||
c.Putln("type %s %s", e.EvType(), e.Old.(*Event).EvType())
|
c.Putln("type %s %s", e.EvType(), e.Old.(*Event).EvType())
|
||||||
|
@ -118,8 +120,10 @@ func (e *EventCopy) Define(c *Context) {
|
||||||
e.Write(c)
|
e.Write(c)
|
||||||
|
|
||||||
// Makes sure that this event type is an Event interface.
|
// Makes sure that this event type is an Event interface.
|
||||||
c.Putln("func (v %s) ImplementsEvent() { }", e.EvType())
|
c.Putln("// SequenceId returns the sequence id attached to the %s event.",
|
||||||
c.Putln("")
|
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())
|
c.Putln("func (v %s) SequenceId() uint16 {", e.EvType())
|
||||||
if e.Old.(*Event).NoSequence {
|
if e.Old.(*Event).NoSequence {
|
||||||
c.Putln("return uint16(0)")
|
c.Putln("return uint16(0)")
|
||||||
|
@ -146,6 +150,8 @@ func (e *EventCopy) Define(c *Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *EventCopy) Read(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("func %sNew(buf []byte) xgb.Event {", e.EvType())
|
||||||
c.Putln("return %s(%sNew(buf).(%s))",
|
c.Putln("return %s(%sNew(buf).(%s))",
|
||||||
e.EvType(), e.Old.(*Event).EvType(), e.Old.(*Event).EvType())
|
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) {
|
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("func (v %s) Bytes() []byte {", e.EvType())
|
||||||
c.Putln("return %s(v).Bytes()", e.Old.(*Event).EvType())
|
c.Putln("return %s(v).Bytes()", e.Old.(*Event).EvType())
|
||||||
c.Putln("}")
|
c.Putln("}")
|
||||||
|
|
|
@ -6,13 +6,16 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (r *Request) Define(c *Context) {
|
func (r *Request) Define(c *Context) {
|
||||||
c.Putln("// Request %s", r.SrcName())
|
c.Putln("// %s is a cookie used only for %s requests.",
|
||||||
c.Putln("// size: %s", r.Size(c))
|
r.CookieName(), r.SrcName())
|
||||||
c.Putln("type %s struct {", r.CookieName())
|
c.Putln("type %s struct {", r.CookieName())
|
||||||
c.Putln("*xgb.Cookie")
|
c.Putln("*xgb.Cookie")
|
||||||
c.Putln("}")
|
c.Putln("}")
|
||||||
c.Putln("")
|
c.Putln("")
|
||||||
if r.Reply != nil {
|
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 {",
|
c.Putln("func %s(c *xgb.Conn, %s) %s {",
|
||||||
r.SrcName(), r.ParamNameTypes(), r.CookieName())
|
r.SrcName(), r.ParamNameTypes(), r.CookieName())
|
||||||
c.Putln("cookie := c.NewCookie(true, true)")
|
c.Putln("cookie := c.NewCookie(true, true)")
|
||||||
|
@ -21,6 +24,9 @@ func (r *Request) Define(c *Context) {
|
||||||
c.Putln("}")
|
c.Putln("}")
|
||||||
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 {",
|
c.Putln("func %sUnchecked(c *xgb.Conn, %s) %s {",
|
||||||
r.SrcName(), r.ParamNameTypes(), r.CookieName())
|
r.SrcName(), r.ParamNameTypes(), r.CookieName())
|
||||||
c.Putln("cookie := c.NewCookie(false, true)")
|
c.Putln("cookie := c.NewCookie(false, true)")
|
||||||
|
@ -31,7 +37,9 @@ func (r *Request) Define(c *Context) {
|
||||||
|
|
||||||
r.ReadReply(c)
|
r.ReadReply(c)
|
||||||
} else {
|
} 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 {",
|
c.Putln("func %s(c *xgb.Conn, %s) %s {",
|
||||||
r.SrcName(), r.ParamNameTypes(), r.CookieName())
|
r.SrcName(), r.ParamNameTypes(), r.CookieName())
|
||||||
c.Putln("cookie := c.NewCookie(false, false)")
|
c.Putln("cookie := c.NewCookie(false, false)")
|
||||||
|
@ -40,6 +48,9 @@ func (r *Request) Define(c *Context) {
|
||||||
c.Putln("}")
|
c.Putln("}")
|
||||||
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 {",
|
c.Putln("func %sChecked(c *xgb.Conn, %s) %s {",
|
||||||
r.SrcName(), r.ParamNameTypes(), r.CookieName())
|
r.SrcName(), r.ParamNameTypes(), r.CookieName())
|
||||||
c.Putln("cookie := c.NewCookie(true, false)")
|
c.Putln("cookie := c.NewCookie(true, false)")
|
||||||
|
@ -48,6 +59,10 @@ func (r *Request) Define(c *Context) {
|
||||||
c.Putln("}")
|
c.Putln("}")
|
||||||
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("func (cook %s) Check() error {", r.CookieName())
|
||||||
c.Putln("return cook.Cookie.Check()")
|
c.Putln("return cook.Cookie.Check()")
|
||||||
c.Putln("}")
|
c.Putln("}")
|
||||||
|
@ -57,18 +72,19 @@ func (r *Request) Define(c *Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Request) ReadReply(c *Context) {
|
func (r *Request) ReadReply(c *Context) {
|
||||||
c.Putln("// Request reply for %s", r.SrcName())
|
c.Putln("// %s represents the data returned from a %s request.",
|
||||||
c.Putln("// size: %s", r.Reply.Size())
|
r.ReplyTypeName(), r.SrcName())
|
||||||
c.Putln("type %s struct {", r.ReplyTypeName())
|
c.Putln("type %s struct {", r.ReplyTypeName())
|
||||||
c.Putln("Sequence uint16")
|
c.Putln("Sequence uint16 // sequence number of the request for this reply")
|
||||||
c.Putln("Length uint32")
|
c.Putln("Length uint32 // number of bytes in this reply")
|
||||||
for _, field := range r.Reply.Fields {
|
for _, field := range r.Reply.Fields {
|
||||||
field.Define(c)
|
field.Define(c)
|
||||||
}
|
}
|
||||||
c.Putln("}")
|
c.Putln("}")
|
||||||
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) {",
|
c.Putln("func (cook %s) Reply() (*%s, error) {",
|
||||||
r.CookieName(), r.ReplyTypeName())
|
r.CookieName(), r.ReplyTypeName())
|
||||||
c.Putln("buf, err := cook.Cookie.Reply()")
|
c.Putln("buf, err := cook.Cookie.Reply()")
|
||||||
|
@ -82,7 +98,8 @@ func (r *Request) ReadReply(c *Context) {
|
||||||
c.Putln("}")
|
c.Putln("}")
|
||||||
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 {",
|
c.Putln("func %s(buf []byte) *%s {",
|
||||||
r.ReplyName(), r.ReplyTypeName())
|
r.ReplyName(), r.ReplyTypeName())
|
||||||
c.Putln("v := new(%s)", r.ReplyTypeName())
|
c.Putln("v := new(%s)", r.ReplyTypeName())
|
||||||
|
@ -113,6 +130,8 @@ func (r *Request) WriteRequest(c *Context) {
|
||||||
c.Putln("")
|
c.Putln("")
|
||||||
}
|
}
|
||||||
c.Putln("// Write request to wire for %s", r.SrcName())
|
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 {",
|
c.Putln("func %s(c *xgb.Conn, %s) []byte {",
|
||||||
r.ReqName(), r.ParamNameTypes())
|
r.ReqName(), r.ParamNameTypes())
|
||||||
c.Putln("size := %s", r.Size(c))
|
c.Putln("size := %s", r.Size(c))
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
func (s *Struct) Define(c *Context) {
|
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())
|
c.Putln("type %s struct {", s.SrcName())
|
||||||
for _, field := range s.Fields {
|
for _, field := range s.Fields {
|
||||||
field.Define(c)
|
field.Define(c)
|
||||||
|
@ -34,7 +32,8 @@ func (s *Struct) Define(c *Context) {
|
||||||
// the number of bytes read off the buffer.
|
// the number of bytes read off the buffer.
|
||||||
// 'ReadStructName' should only be used to read raw reply data from the wire.
|
// 'ReadStructName' should only be used to read raw reply data from the wire.
|
||||||
func (s *Struct) Read(c *Context) {
|
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("func %sRead(buf []byte, v *%s) int {", s.SrcName(), s.SrcName())
|
||||||
|
|
||||||
c.Putln("b := 0")
|
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
|
// a source (i.e., the buffer) byte slice, and a destination slice and returns
|
||||||
// the number of bytes read from the byte slice.
|
// the number of bytes read from the byte slice.
|
||||||
func (s *Struct) ReadList(c *Context) {
|
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 {",
|
c.Putln("func %sReadList(buf []byte, dest []%s) int {",
|
||||||
s.SrcName(), s.SrcName())
|
s.SrcName(), s.SrcName())
|
||||||
|
|
||||||
c.Putln("b := 0")
|
c.Putln("b := 0")
|
||||||
c.Putln("for i := 0; i < len(dest); i++ {")
|
c.Putln("for i := 0; i < len(dest); i++ {")
|
||||||
c.Putln("dest[i] = %s{}", s.SrcName())
|
c.Putln("dest[i] = %s{}", s.SrcName())
|
||||||
|
@ -70,7 +69,7 @@ func (s *Struct) ReadList(c *Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Struct) Write(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("func (v %s) Bytes() []byte {", s.SrcName())
|
||||||
c.Putln("buf := make([]byte, %s)", s.Size().Reduce("v."))
|
c.Putln("buf := make([]byte, %s)", s.Size().Reduce("v."))
|
||||||
c.Putln("b := 0")
|
c.Putln("b := 0")
|
||||||
|
@ -85,7 +84,8 @@ func (s *Struct) Write(c *Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Struct) WriteList(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 {",
|
c.Putln("func %sListBytes(buf []byte, list []%s) int {",
|
||||||
s.SrcName(), s.SrcName())
|
s.SrcName(), s.SrcName())
|
||||||
c.Putln("b := 0")
|
c.Putln("b := 0")
|
||||||
|
@ -101,7 +101,8 @@ func (s *Struct) WriteList(c *Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Struct) WriteListSize(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("func %sListSize(list []%s) int {", s.SrcName(), s.SrcName())
|
||||||
c.Putln("size := 0")
|
c.Putln("size := 0")
|
||||||
if s.Size().Expression.Concrete() {
|
if s.Size().Expression.Concrete() {
|
||||||
|
|
|
@ -2,7 +2,8 @@ package main
|
||||||
|
|
||||||
// Union types
|
// Union types
|
||||||
func (u *Union) Define(c *Context) {
|
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("// Note that to *create* a Union, you should *never* create")
|
||||||
c.Putln("// this struct directly (unless you know what you're doing).")
|
c.Putln("// this struct directly (unless you know what you're doing).")
|
||||||
c.Putln("// Instead use one of the following constructors for '%s':",
|
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) {
|
func (u *Union) New(c *Context) {
|
||||||
for _, field := range u.Fields {
|
for _, field := range u.Fields {
|
||||||
c.Putln("// Union constructor for %s for field %s.",
|
c.Putln("// %s%sNew constructs a new %s union type with the %s field.",
|
||||||
u.SrcName(), field.SrcName())
|
u.SrcName(), field.SrcName(), u.SrcName(), field.SrcName())
|
||||||
c.Putln("func %s%sNew(%s %s) %s {",
|
c.Putln("func %s%sNew(%s %s) %s {",
|
||||||
u.SrcName(), field.SrcName(), field.SrcName(),
|
u.SrcName(), field.SrcName(), field.SrcName(),
|
||||||
field.SrcType(), u.SrcName())
|
field.SrcType(), u.SrcName())
|
||||||
|
@ -65,7 +66,8 @@ func (u *Union) New(c *Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *Union) Read(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("func %sRead(buf []byte, v *%s) int {", u.SrcName(), u.SrcName())
|
||||||
c.Putln("var b int")
|
c.Putln("var b int")
|
||||||
c.Putln("")
|
c.Putln("")
|
||||||
|
@ -80,7 +82,8 @@ func (u *Union) Read(c *Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *Union) ReadList(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 {",
|
c.Putln("func %sReadList(buf []byte, dest []%s) int {",
|
||||||
u.SrcName(), u.SrcName())
|
u.SrcName(), u.SrcName())
|
||||||
c.Putln("b := 0")
|
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
|
// *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.
|
// every field which allows us to simply pick the first field and write it.
|
||||||
func (u *Union) Write(c *Context) {
|
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("// 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("// So simply pick the first field and write that to the wire.")
|
||||||
c.Putln("func (v %s) Bytes() []byte {", u.SrcName())
|
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) {
|
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 {",
|
c.Putln("func %sListBytes(buf []byte, list []%s) int {",
|
||||||
u.SrcName(), u.SrcName())
|
u.SrcName(), u.SrcName())
|
||||||
c.Putln("b := 0")
|
c.Putln("b := 0")
|
||||||
|
@ -130,6 +134,8 @@ func (u *Union) WriteList(c *Context) {
|
||||||
|
|
||||||
func (u *Union) WriteListSize(c *Context) {
|
func (u *Union) WriteListSize(c *Context) {
|
||||||
c.Putln("// Union list size %s", u.SrcName())
|
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("func %sListSize(list []%s) int {", u.SrcName(), u.SrcName())
|
||||||
c.Putln("size := 0")
|
c.Putln("size := 0")
|
||||||
c.Putln("for _, item := range list {")
|
c.Putln("for _, item := range list {")
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
package xinerama
|
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!
|
This file is automatically generated. Edit at your peril!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -64,8 +64,6 @@ func init() {
|
||||||
|
|
||||||
// Skipping definition for base type 'Card8'
|
// Skipping definition for base type 'Card8'
|
||||||
|
|
||||||
// 'ScreenInfo' struct definition
|
|
||||||
// Size: 8
|
|
||||||
type ScreenInfo struct {
|
type ScreenInfo struct {
|
||||||
XOrg int16
|
XOrg int16
|
||||||
YOrg int16
|
YOrg int16
|
||||||
|
@ -73,7 +71,7 @@ type ScreenInfo struct {
|
||||||
Height uint16
|
Height uint16
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct read ScreenInfo
|
// ScreenInfoRead reads a byte slice into a ScreenInfo value.
|
||||||
func ScreenInfoRead(buf []byte, v *ScreenInfo) int {
|
func ScreenInfoRead(buf []byte, v *ScreenInfo) int {
|
||||||
b := 0
|
b := 0
|
||||||
|
|
||||||
|
@ -92,7 +90,7 @@ func ScreenInfoRead(buf []byte, v *ScreenInfo) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct list read ScreenInfo
|
// ScreenInfoReadList reads a byte slice into a list of ScreenInfo values.
|
||||||
func ScreenInfoReadList(buf []byte, dest []ScreenInfo) int {
|
func ScreenInfoReadList(buf []byte, dest []ScreenInfo) int {
|
||||||
b := 0
|
b := 0
|
||||||
for i := 0; i < len(dest); i++ {
|
for i := 0; i < len(dest); i++ {
|
||||||
|
@ -102,7 +100,7 @@ func ScreenInfoReadList(buf []byte, dest []ScreenInfo) int {
|
||||||
return xgb.Pad(b)
|
return xgb.Pad(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct write ScreenInfo
|
// Bytes writes a ScreenInfo value to a byte slice.
|
||||||
func (v ScreenInfo) Bytes() []byte {
|
func (v ScreenInfo) Bytes() []byte {
|
||||||
buf := make([]byte, 8)
|
buf := make([]byte, 8)
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -122,7 +120,7 @@ func (v ScreenInfo) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int {
|
||||||
b := 0
|
b := 0
|
||||||
var structBytes []byte
|
var structBytes []byte
|
||||||
|
@ -134,35 +132,37 @@ func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request QueryVersion
|
// QueryVersionCookie is a cookie used only for QueryVersion requests.
|
||||||
// size: 8
|
|
||||||
type QueryVersionCookie struct {
|
type QueryVersionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryVersion(c *xgb.Conn, Major byte, Minor byte) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryVersionRequest(c, Major, Minor), cookie)
|
c.NewRequest(queryVersionRequest(c, Major, Minor), cookie)
|
||||||
return QueryVersionCookie{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 {
|
func QueryVersionUnchecked(c *xgb.Conn, Major byte, Minor byte) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryVersionRequest(c, Major, Minor), cookie)
|
c.NewRequest(queryVersionRequest(c, Major, Minor), cookie)
|
||||||
return QueryVersionCookie{cookie}
|
return QueryVersionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryVersion
|
// QueryVersionReply represents the data returned from a QueryVersion request.
|
||||||
// size: 12
|
|
||||||
type QueryVersionReply struct {
|
type QueryVersionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
Major uint16
|
Major uint16
|
||||||
Minor 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) {
|
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -174,7 +174,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
return queryVersionReply(buf), nil
|
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 {
|
func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
v := new(QueryVersionReply)
|
v := new(QueryVersionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -197,6 +197,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryVersion
|
// 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 {
|
func queryVersionRequest(c *xgb.Conn, Major byte, Minor byte) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -220,34 +221,36 @@ func queryVersionRequest(c *xgb.Conn, Major byte, Minor byte) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request GetState
|
// GetStateCookie is a cookie used only for GetState requests.
|
||||||
// size: 8
|
|
||||||
type GetStateCookie struct {
|
type GetStateCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GetState(c *xgb.Conn, Window xproto.Window) GetStateCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getStateRequest(c, Window), cookie)
|
c.NewRequest(getStateRequest(c, Window), cookie)
|
||||||
return GetStateCookie{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 {
|
func GetStateUnchecked(c *xgb.Conn, Window xproto.Window) GetStateCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getStateRequest(c, Window), cookie)
|
c.NewRequest(getStateRequest(c, Window), cookie)
|
||||||
return GetStateCookie{cookie}
|
return GetStateCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetState
|
// GetStateReply represents the data returned from a GetState request.
|
||||||
// size: 12
|
|
||||||
type GetStateReply struct {
|
type GetStateReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
State byte
|
State byte
|
||||||
Window xproto.Window
|
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) {
|
func (cook GetStateCookie) Reply() (*GetStateReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -259,7 +262,7 @@ func (cook GetStateCookie) Reply() (*GetStateReply, error) {
|
||||||
return getStateReply(buf), nil
|
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 {
|
func getStateReply(buf []byte) *GetStateReply {
|
||||||
v := new(GetStateReply)
|
v := new(GetStateReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -280,6 +283,7 @@ func getStateReply(buf []byte) *GetStateReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetState
|
// Write request to wire for GetState
|
||||||
|
// getStateRequest writes a GetState request to a byte slice.
|
||||||
func getStateRequest(c *xgb.Conn, Window xproto.Window) []byte {
|
func getStateRequest(c *xgb.Conn, Window xproto.Window) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -300,34 +304,36 @@ func getStateRequest(c *xgb.Conn, Window xproto.Window) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request GetScreenCount
|
// GetScreenCountCookie is a cookie used only for GetScreenCount requests.
|
||||||
// size: 8
|
|
||||||
type GetScreenCountCookie struct {
|
type GetScreenCountCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GetScreenCount(c *xgb.Conn, Window xproto.Window) GetScreenCountCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getScreenCountRequest(c, Window), cookie)
|
c.NewRequest(getScreenCountRequest(c, Window), cookie)
|
||||||
return GetScreenCountCookie{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 {
|
func GetScreenCountUnchecked(c *xgb.Conn, Window xproto.Window) GetScreenCountCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getScreenCountRequest(c, Window), cookie)
|
c.NewRequest(getScreenCountRequest(c, Window), cookie)
|
||||||
return GetScreenCountCookie{cookie}
|
return GetScreenCountCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetScreenCount
|
// GetScreenCountReply represents the data returned from a GetScreenCount request.
|
||||||
// size: 12
|
|
||||||
type GetScreenCountReply struct {
|
type GetScreenCountReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
ScreenCount byte
|
ScreenCount byte
|
||||||
Window xproto.Window
|
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) {
|
func (cook GetScreenCountCookie) Reply() (*GetScreenCountReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -339,7 +345,7 @@ func (cook GetScreenCountCookie) Reply() (*GetScreenCountReply, error) {
|
||||||
return getScreenCountReply(buf), nil
|
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 {
|
func getScreenCountReply(buf []byte) *GetScreenCountReply {
|
||||||
v := new(GetScreenCountReply)
|
v := new(GetScreenCountReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -360,6 +366,7 @@ func getScreenCountReply(buf []byte) *GetScreenCountReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetScreenCount
|
// Write request to wire for GetScreenCount
|
||||||
|
// getScreenCountRequest writes a GetScreenCount request to a byte slice.
|
||||||
func getScreenCountRequest(c *xgb.Conn, Window xproto.Window) []byte {
|
func getScreenCountRequest(c *xgb.Conn, Window xproto.Window) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -380,29 +387,31 @@ func getScreenCountRequest(c *xgb.Conn, Window xproto.Window) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request GetScreenSize
|
// GetScreenSizeCookie is a cookie used only for GetScreenSize requests.
|
||||||
// size: 12
|
|
||||||
type GetScreenSizeCookie struct {
|
type GetScreenSizeCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GetScreenSize(c *xgb.Conn, Window xproto.Window, Screen uint32) GetScreenSizeCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getScreenSizeRequest(c, Window, Screen), cookie)
|
c.NewRequest(getScreenSizeRequest(c, Window, Screen), cookie)
|
||||||
return GetScreenSizeCookie{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 {
|
func GetScreenSizeUnchecked(c *xgb.Conn, Window xproto.Window, Screen uint32) GetScreenSizeCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getScreenSizeRequest(c, Window, Screen), cookie)
|
c.NewRequest(getScreenSizeRequest(c, Window, Screen), cookie)
|
||||||
return GetScreenSizeCookie{cookie}
|
return GetScreenSizeCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetScreenSize
|
// GetScreenSizeReply represents the data returned from a GetScreenSize request.
|
||||||
// size: 24
|
|
||||||
type GetScreenSizeReply struct {
|
type GetScreenSizeReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
Width uint32
|
Width uint32
|
||||||
Height uint32
|
Height uint32
|
||||||
|
@ -410,7 +419,7 @@ type GetScreenSizeReply struct {
|
||||||
Screen uint32
|
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) {
|
func (cook GetScreenSizeCookie) Reply() (*GetScreenSizeReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -422,7 +431,7 @@ func (cook GetScreenSizeCookie) Reply() (*GetScreenSizeReply, error) {
|
||||||
return getScreenSizeReply(buf), nil
|
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 {
|
func getScreenSizeReply(buf []byte) *GetScreenSizeReply {
|
||||||
v := new(GetScreenSizeReply)
|
v := new(GetScreenSizeReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -451,6 +460,7 @@ func getScreenSizeReply(buf []byte) *GetScreenSizeReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetScreenSize
|
// 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 {
|
func getScreenSizeRequest(c *xgb.Conn, Window xproto.Window, Screen uint32) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -474,34 +484,36 @@ func getScreenSizeRequest(c *xgb.Conn, Window xproto.Window, Screen uint32) []by
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request IsActive
|
// IsActiveCookie is a cookie used only for IsActive requests.
|
||||||
// size: 4
|
|
||||||
type IsActiveCookie struct {
|
type IsActiveCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func IsActive(c *xgb.Conn) IsActiveCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(isActiveRequest(c), cookie)
|
c.NewRequest(isActiveRequest(c), cookie)
|
||||||
return IsActiveCookie{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 {
|
func IsActiveUnchecked(c *xgb.Conn) IsActiveCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(isActiveRequest(c), cookie)
|
c.NewRequest(isActiveRequest(c), cookie)
|
||||||
return IsActiveCookie{cookie}
|
return IsActiveCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for IsActive
|
// IsActiveReply represents the data returned from a IsActive request.
|
||||||
// size: 12
|
|
||||||
type IsActiveReply struct {
|
type IsActiveReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
State uint32
|
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) {
|
func (cook IsActiveCookie) Reply() (*IsActiveReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -513,7 +525,7 @@ func (cook IsActiveCookie) Reply() (*IsActiveReply, error) {
|
||||||
return isActiveReply(buf), nil
|
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 {
|
func isActiveReply(buf []byte) *IsActiveReply {
|
||||||
v := new(IsActiveReply)
|
v := new(IsActiveReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -533,6 +545,7 @@ func isActiveReply(buf []byte) *IsActiveReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for IsActive
|
// Write request to wire for IsActive
|
||||||
|
// isActiveRequest writes a IsActive request to a byte slice.
|
||||||
func isActiveRequest(c *xgb.Conn) []byte {
|
func isActiveRequest(c *xgb.Conn) []byte {
|
||||||
size := 4
|
size := 4
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -550,36 +563,38 @@ func isActiveRequest(c *xgb.Conn) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request QueryScreens
|
// QueryScreensCookie is a cookie used only for QueryScreens requests.
|
||||||
// size: 4
|
|
||||||
type QueryScreensCookie struct {
|
type QueryScreensCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryScreens(c *xgb.Conn) QueryScreensCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryScreensRequest(c), cookie)
|
c.NewRequest(queryScreensRequest(c), cookie)
|
||||||
return QueryScreensCookie{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 {
|
func QueryScreensUnchecked(c *xgb.Conn) QueryScreensCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryScreensRequest(c), cookie)
|
c.NewRequest(queryScreensRequest(c), cookie)
|
||||||
return QueryScreensCookie{cookie}
|
return QueryScreensCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryScreens
|
// QueryScreensReply represents the data returned from a QueryScreens request.
|
||||||
// size: (32 + xgb.Pad((int(Number) * 8)))
|
|
||||||
type QueryScreensReply struct {
|
type QueryScreensReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
Number uint32
|
Number uint32
|
||||||
// padding: 20 bytes
|
// padding: 20 bytes
|
||||||
ScreenInfo []ScreenInfo // size: xgb.Pad((int(Number) * 8))
|
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) {
|
func (cook QueryScreensCookie) Reply() (*QueryScreensReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -591,7 +606,7 @@ func (cook QueryScreensCookie) Reply() (*QueryScreensReply, error) {
|
||||||
return queryScreensReply(buf), nil
|
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 {
|
func queryScreensReply(buf []byte) *QueryScreensReply {
|
||||||
v := new(QueryScreensReply)
|
v := new(QueryScreensReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -616,6 +631,7 @@ func queryScreensReply(buf []byte) *QueryScreensReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryScreens
|
// Write request to wire for QueryScreens
|
||||||
|
// queryScreensRequest writes a QueryScreens request to a byte slice.
|
||||||
func queryScreensRequest(c *xgb.Conn) []byte {
|
func queryScreensRequest(c *xgb.Conn) []byte {
|
||||||
size := 4
|
size := 4
|
||||||
b := 0
|
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
|
@ -2,7 +2,7 @@
|
||||||
package xtest
|
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!
|
This file is automatically generated. Edit at your peril!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -69,34 +69,36 @@ const (
|
||||||
CursorCurrent = 1
|
CursorCurrent = 1
|
||||||
)
|
)
|
||||||
|
|
||||||
// Request GetVersion
|
// GetVersionCookie is a cookie used only for GetVersion requests.
|
||||||
// size: 8
|
|
||||||
type GetVersionCookie struct {
|
type GetVersionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GetVersion(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) GetVersionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(getVersionRequest(c, MajorVersion, MinorVersion), cookie)
|
c.NewRequest(getVersionRequest(c, MajorVersion, MinorVersion), cookie)
|
||||||
return GetVersionCookie{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 {
|
func GetVersionUnchecked(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) GetVersionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(getVersionRequest(c, MajorVersion, MinorVersion), cookie)
|
c.NewRequest(getVersionRequest(c, MajorVersion, MinorVersion), cookie)
|
||||||
return GetVersionCookie{cookie}
|
return GetVersionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for GetVersion
|
// GetVersionReply represents the data returned from a GetVersion request.
|
||||||
// size: 10
|
|
||||||
type GetVersionReply struct {
|
type GetVersionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
MajorVersion byte
|
MajorVersion byte
|
||||||
MinorVersion uint16
|
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) {
|
func (cook GetVersionCookie) Reply() (*GetVersionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -108,7 +110,7 @@ func (cook GetVersionCookie) Reply() (*GetVersionReply, error) {
|
||||||
return getVersionReply(buf), nil
|
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 {
|
func getVersionReply(buf []byte) *GetVersionReply {
|
||||||
v := new(GetVersionReply)
|
v := new(GetVersionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -129,6 +131,7 @@ func getVersionReply(buf []byte) *GetVersionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GetVersion
|
// 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 {
|
func getVersionRequest(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -154,33 +157,35 @@ func getVersionRequest(c *xgb.Conn, MajorVersion byte, MinorVersion uint16) []by
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request CompareCursor
|
// CompareCursorCookie is a cookie used only for CompareCursor requests.
|
||||||
// size: 12
|
|
||||||
type CompareCursorCookie struct {
|
type CompareCursorCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func CompareCursor(c *xgb.Conn, Window xproto.Window, Cursor xproto.Cursor) CompareCursorCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(compareCursorRequest(c, Window, Cursor), cookie)
|
c.NewRequest(compareCursorRequest(c, Window, Cursor), cookie)
|
||||||
return CompareCursorCookie{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 {
|
func CompareCursorUnchecked(c *xgb.Conn, Window xproto.Window, Cursor xproto.Cursor) CompareCursorCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(compareCursorRequest(c, Window, Cursor), cookie)
|
c.NewRequest(compareCursorRequest(c, Window, Cursor), cookie)
|
||||||
return CompareCursorCookie{cookie}
|
return CompareCursorCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for CompareCursor
|
// CompareCursorReply represents the data returned from a CompareCursor request.
|
||||||
// size: 8
|
|
||||||
type CompareCursorReply struct {
|
type CompareCursorReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
Same bool
|
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) {
|
func (cook CompareCursorCookie) Reply() (*CompareCursorReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -192,7 +197,7 @@ func (cook CompareCursorCookie) Reply() (*CompareCursorReply, error) {
|
||||||
return compareCursorReply(buf), nil
|
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 {
|
func compareCursorReply(buf []byte) *CompareCursorReply {
|
||||||
v := new(CompareCursorReply)
|
v := new(CompareCursorReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -214,6 +219,7 @@ func compareCursorReply(buf []byte) *CompareCursorReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for CompareCursor
|
// 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 {
|
func compareCursorRequest(c *xgb.Conn, Window xproto.Window, Cursor xproto.Cursor) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -237,30 +243,35 @@ func compareCursorRequest(c *xgb.Conn, Window xproto.Window, Cursor xproto.Curso
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request FakeInput
|
// FakeInputCookie is a cookie used only for FakeInput requests.
|
||||||
// size: 36
|
|
||||||
type FakeInputCookie struct {
|
type FakeInputCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
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)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(fakeInputRequest(c, Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie)
|
c.NewRequest(fakeInputRequest(c, Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie)
|
||||||
return FakeInputCookie{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 {
|
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)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(fakeInputRequest(c, Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie)
|
c.NewRequest(fakeInputRequest(c, Type, Detail, Time, Root, RootX, RootY, Deviceid), cookie)
|
||||||
return FakeInputCookie{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 {
|
func (cook FakeInputCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for FakeInput
|
// 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 {
|
func fakeInputRequest(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xproto.Window, RootX int16, RootY int16, Deviceid byte) []byte {
|
||||||
size := 36
|
size := 36
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -305,30 +316,35 @@ func fakeInputRequest(c *xgb.Conn, Type byte, Detail byte, Time uint32, Root xpr
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request GrabControl
|
// GrabControlCookie is a cookie used only for GrabControl requests.
|
||||||
// size: 8
|
|
||||||
type GrabControlCookie struct {
|
type GrabControlCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func GrabControl(c *xgb.Conn, Impervious bool) GrabControlCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(grabControlRequest(c, Impervious), cookie)
|
c.NewRequest(grabControlRequest(c, Impervious), cookie)
|
||||||
return GrabControlCookie{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 {
|
func GrabControlChecked(c *xgb.Conn, Impervious bool) GrabControlCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(grabControlRequest(c, Impervious), cookie)
|
c.NewRequest(grabControlRequest(c, Impervious), cookie)
|
||||||
return GrabControlCookie{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 {
|
func (cook GrabControlCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for GrabControl
|
// Write request to wire for GrabControl
|
||||||
|
// grabControlRequest writes a GrabControl request to a byte slice.
|
||||||
func grabControlRequest(c *xgb.Conn, Impervious bool) []byte {
|
func grabControlRequest(c *xgb.Conn, Impervious bool) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
|
440
nexgb/xv/xv.go
440
nexgb/xv/xv.go
File diff suppressed because it is too large
Load Diff
|
@ -2,7 +2,7 @@
|
||||||
package xvmc
|
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!
|
This file is automatically generated. Edit at your peril!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -41,6 +41,16 @@ func init() {
|
||||||
xgb.NewExtErrorFuncs["XVideo-MotionCompensation"] = make(map[int]xgb.NewErrorFun)
|
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 'Float'
|
||||||
|
|
||||||
// Skipping definition for base type 'Card8'
|
// Skipping definition for base type 'Card8'
|
||||||
|
@ -55,16 +65,6 @@ func init() {
|
||||||
|
|
||||||
// Skipping definition for base type 'Int8'
|
// 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
|
type Context uint32
|
||||||
|
|
||||||
func NewContextId(c *xgb.Conn) (Context, error) {
|
func NewContextId(c *xgb.Conn) (Context, error) {
|
||||||
|
@ -95,8 +95,6 @@ func NewSubpictureId(c *xgb.Conn) (Subpicture, error) {
|
||||||
return Subpicture(id), nil
|
return Subpicture(id), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'SurfaceInfo' struct definition
|
|
||||||
// Size: 24
|
|
||||||
type SurfaceInfo struct {
|
type SurfaceInfo struct {
|
||||||
Id Surface
|
Id Surface
|
||||||
ChromaFormat uint16
|
ChromaFormat uint16
|
||||||
|
@ -109,7 +107,7 @@ type SurfaceInfo struct {
|
||||||
Flags uint32
|
Flags uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct read SurfaceInfo
|
// SurfaceInfoRead reads a byte slice into a SurfaceInfo value.
|
||||||
func SurfaceInfoRead(buf []byte, v *SurfaceInfo) int {
|
func SurfaceInfoRead(buf []byte, v *SurfaceInfo) int {
|
||||||
b := 0
|
b := 0
|
||||||
|
|
||||||
|
@ -143,7 +141,7 @@ func SurfaceInfoRead(buf []byte, v *SurfaceInfo) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct list read SurfaceInfo
|
// SurfaceInfoReadList reads a byte slice into a list of SurfaceInfo values.
|
||||||
func SurfaceInfoReadList(buf []byte, dest []SurfaceInfo) int {
|
func SurfaceInfoReadList(buf []byte, dest []SurfaceInfo) int {
|
||||||
b := 0
|
b := 0
|
||||||
for i := 0; i < len(dest); i++ {
|
for i := 0; i < len(dest); i++ {
|
||||||
|
@ -153,7 +151,7 @@ func SurfaceInfoReadList(buf []byte, dest []SurfaceInfo) int {
|
||||||
return xgb.Pad(b)
|
return xgb.Pad(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Struct write SurfaceInfo
|
// Bytes writes a SurfaceInfo value to a byte slice.
|
||||||
func (v SurfaceInfo) Bytes() []byte {
|
func (v SurfaceInfo) Bytes() []byte {
|
||||||
buf := make([]byte, 24)
|
buf := make([]byte, 24)
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -188,7 +186,7 @@ func (v SurfaceInfo) Bytes() []byte {
|
||||||
return buf
|
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 {
|
func SurfaceInfoListBytes(buf []byte, list []SurfaceInfo) int {
|
||||||
b := 0
|
b := 0
|
||||||
var structBytes []byte
|
var structBytes []byte
|
||||||
|
@ -200,35 +198,37 @@ func SurfaceInfoListBytes(buf []byte, list []SurfaceInfo) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request QueryVersion
|
// QueryVersionCookie is a cookie used only for QueryVersion requests.
|
||||||
// size: 4
|
|
||||||
type QueryVersionCookie struct {
|
type QueryVersionCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func QueryVersion(c *xgb.Conn) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(queryVersionRequest(c), cookie)
|
c.NewRequest(queryVersionRequest(c), cookie)
|
||||||
return QueryVersionCookie{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 {
|
func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(queryVersionRequest(c), cookie)
|
c.NewRequest(queryVersionRequest(c), cookie)
|
||||||
return QueryVersionCookie{cookie}
|
return QueryVersionCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for QueryVersion
|
// QueryVersionReply represents the data returned from a QueryVersion request.
|
||||||
// size: 16
|
|
||||||
type QueryVersionReply struct {
|
type QueryVersionReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
Major uint32
|
Major uint32
|
||||||
Minor 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) {
|
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -240,7 +240,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
|
||||||
return queryVersionReply(buf), nil
|
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 {
|
func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
v := new(QueryVersionReply)
|
v := new(QueryVersionReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -263,6 +263,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for QueryVersion
|
// Write request to wire for QueryVersion
|
||||||
|
// queryVersionRequest writes a QueryVersion request to a byte slice.
|
||||||
func queryVersionRequest(c *xgb.Conn) []byte {
|
func queryVersionRequest(c *xgb.Conn) []byte {
|
||||||
size := 4
|
size := 4
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -280,36 +281,38 @@ func queryVersionRequest(c *xgb.Conn) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request ListSurfaceTypes
|
// ListSurfaceTypesCookie is a cookie used only for ListSurfaceTypes requests.
|
||||||
// size: 8
|
|
||||||
type ListSurfaceTypesCookie struct {
|
type ListSurfaceTypesCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func ListSurfaceTypes(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(listSurfaceTypesRequest(c, PortId), cookie)
|
c.NewRequest(listSurfaceTypesRequest(c, PortId), cookie)
|
||||||
return ListSurfaceTypesCookie{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 {
|
func ListSurfaceTypesUnchecked(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(listSurfaceTypesRequest(c, PortId), cookie)
|
c.NewRequest(listSurfaceTypesRequest(c, PortId), cookie)
|
||||||
return ListSurfaceTypesCookie{cookie}
|
return ListSurfaceTypesCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for ListSurfaceTypes
|
// ListSurfaceTypesReply represents the data returned from a ListSurfaceTypes request.
|
||||||
// size: (32 + xgb.Pad((int(Num) * 24)))
|
|
||||||
type ListSurfaceTypesReply struct {
|
type ListSurfaceTypesReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
Num uint32
|
Num uint32
|
||||||
// padding: 20 bytes
|
// padding: 20 bytes
|
||||||
Surfaces []SurfaceInfo // size: xgb.Pad((int(Num) * 24))
|
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) {
|
func (cook ListSurfaceTypesCookie) Reply() (*ListSurfaceTypesReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -321,7 +324,7 @@ func (cook ListSurfaceTypesCookie) Reply() (*ListSurfaceTypesReply, error) {
|
||||||
return listSurfaceTypesReply(buf), nil
|
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 {
|
func listSurfaceTypesReply(buf []byte) *ListSurfaceTypesReply {
|
||||||
v := new(ListSurfaceTypesReply)
|
v := new(ListSurfaceTypesReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -346,6 +349,7 @@ func listSurfaceTypesReply(buf []byte) *ListSurfaceTypesReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for ListSurfaceTypes
|
// Write request to wire for ListSurfaceTypes
|
||||||
|
// listSurfaceTypesRequest writes a ListSurfaceTypes request to a byte slice.
|
||||||
func listSurfaceTypesRequest(c *xgb.Conn, PortId xv.Port) []byte {
|
func listSurfaceTypesRequest(c *xgb.Conn, PortId xv.Port) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -366,29 +370,31 @@ func listSurfaceTypesRequest(c *xgb.Conn, PortId xv.Port) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request CreateContext
|
// CreateContextCookie is a cookie used only for CreateContext requests.
|
||||||
// size: 24
|
|
||||||
type CreateContextCookie struct {
|
type CreateContextCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func CreateContext(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) CreateContextCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(createContextRequest(c, ContextId, PortId, SurfaceId, Width, Height, Flags), cookie)
|
c.NewRequest(createContextRequest(c, ContextId, PortId, SurfaceId, Width, Height, Flags), cookie)
|
||||||
return CreateContextCookie{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 {
|
func CreateContextUnchecked(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) CreateContextCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(createContextRequest(c, ContextId, PortId, SurfaceId, Width, Height, Flags), cookie)
|
c.NewRequest(createContextRequest(c, ContextId, PortId, SurfaceId, Width, Height, Flags), cookie)
|
||||||
return CreateContextCookie{cookie}
|
return CreateContextCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for CreateContext
|
// CreateContextReply represents the data returned from a CreateContext request.
|
||||||
// size: (36 + xgb.Pad((int(Length) * 4)))
|
|
||||||
type CreateContextReply struct {
|
type CreateContextReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
WidthActual uint16
|
WidthActual uint16
|
||||||
HeightActual uint16
|
HeightActual uint16
|
||||||
|
@ -397,7 +403,7 @@ type CreateContextReply struct {
|
||||||
PrivData []uint32 // size: xgb.Pad((int(Length) * 4))
|
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) {
|
func (cook CreateContextCookie) Reply() (*CreateContextReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -409,7 +415,7 @@ func (cook CreateContextCookie) Reply() (*CreateContextReply, error) {
|
||||||
return createContextReply(buf), nil
|
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 {
|
func createContextReply(buf []byte) *CreateContextReply {
|
||||||
v := new(CreateContextReply)
|
v := new(CreateContextReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -444,6 +450,7 @@ func createContextReply(buf []byte) *CreateContextReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for CreateContext
|
// 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 {
|
func createContextRequest(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) []byte {
|
||||||
size := 24
|
size := 24
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -479,30 +486,35 @@ func createContextRequest(c *xgb.Conn, ContextId Context, PortId xv.Port, Surfac
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request DestroyContext
|
// DestroyContextCookie is a cookie used only for DestroyContext requests.
|
||||||
// size: 8
|
|
||||||
type DestroyContextCookie struct {
|
type DestroyContextCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func DestroyContext(c *xgb.Conn, ContextId Context) DestroyContextCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(destroyContextRequest(c, ContextId), cookie)
|
c.NewRequest(destroyContextRequest(c, ContextId), cookie)
|
||||||
return DestroyContextCookie{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 {
|
func DestroyContextChecked(c *xgb.Conn, ContextId Context) DestroyContextCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(destroyContextRequest(c, ContextId), cookie)
|
c.NewRequest(destroyContextRequest(c, ContextId), cookie)
|
||||||
return DestroyContextCookie{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 {
|
func (cook DestroyContextCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for DestroyContext
|
// Write request to wire for DestroyContext
|
||||||
|
// destroyContextRequest writes a DestroyContext request to a byte slice.
|
||||||
func destroyContextRequest(c *xgb.Conn, ContextId Context) []byte {
|
func destroyContextRequest(c *xgb.Conn, ContextId Context) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -523,35 +535,37 @@ func destroyContextRequest(c *xgb.Conn, ContextId Context) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request CreateSurface
|
// CreateSurfaceCookie is a cookie used only for CreateSurface requests.
|
||||||
// size: 12
|
|
||||||
type CreateSurfaceCookie struct {
|
type CreateSurfaceCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func CreateSurface(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(createSurfaceRequest(c, SurfaceId, ContextId), cookie)
|
c.NewRequest(createSurfaceRequest(c, SurfaceId, ContextId), cookie)
|
||||||
return CreateSurfaceCookie{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 {
|
func CreateSurfaceUnchecked(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(createSurfaceRequest(c, SurfaceId, ContextId), cookie)
|
c.NewRequest(createSurfaceRequest(c, SurfaceId, ContextId), cookie)
|
||||||
return CreateSurfaceCookie{cookie}
|
return CreateSurfaceCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for CreateSurface
|
// CreateSurfaceReply represents the data returned from a CreateSurface request.
|
||||||
// size: (32 + xgb.Pad((int(Length) * 4)))
|
|
||||||
type CreateSurfaceReply struct {
|
type CreateSurfaceReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
// padding: 24 bytes
|
// padding: 24 bytes
|
||||||
PrivData []uint32 // size: xgb.Pad((int(Length) * 4))
|
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) {
|
func (cook CreateSurfaceCookie) Reply() (*CreateSurfaceReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -563,7 +577,7 @@ func (cook CreateSurfaceCookie) Reply() (*CreateSurfaceReply, error) {
|
||||||
return createSurfaceReply(buf), nil
|
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 {
|
func createSurfaceReply(buf []byte) *CreateSurfaceReply {
|
||||||
v := new(CreateSurfaceReply)
|
v := new(CreateSurfaceReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -589,6 +603,7 @@ func createSurfaceReply(buf []byte) *CreateSurfaceReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for CreateSurface
|
// 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 {
|
func createSurfaceRequest(c *xgb.Conn, SurfaceId Surface, ContextId Context) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -612,30 +627,35 @@ func createSurfaceRequest(c *xgb.Conn, SurfaceId Surface, ContextId Context) []b
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request DestroySurface
|
// DestroySurfaceCookie is a cookie used only for DestroySurface requests.
|
||||||
// size: 8
|
|
||||||
type DestroySurfaceCookie struct {
|
type DestroySurfaceCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func DestroySurface(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(destroySurfaceRequest(c, SurfaceId), cookie)
|
c.NewRequest(destroySurfaceRequest(c, SurfaceId), cookie)
|
||||||
return DestroySurfaceCookie{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 {
|
func DestroySurfaceChecked(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(destroySurfaceRequest(c, SurfaceId), cookie)
|
c.NewRequest(destroySurfaceRequest(c, SurfaceId), cookie)
|
||||||
return DestroySurfaceCookie{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 {
|
func (cook DestroySurfaceCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for DestroySurface
|
// Write request to wire for DestroySurface
|
||||||
|
// destroySurfaceRequest writes a DestroySurface request to a byte slice.
|
||||||
func destroySurfaceRequest(c *xgb.Conn, SurfaceId Surface) []byte {
|
func destroySurfaceRequest(c *xgb.Conn, SurfaceId Surface) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -656,29 +676,31 @@ func destroySurfaceRequest(c *xgb.Conn, SurfaceId Surface) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request CreateSubpicture
|
// CreateSubpictureCookie is a cookie used only for CreateSubpicture requests.
|
||||||
// size: 20
|
|
||||||
type CreateSubpictureCookie struct {
|
type CreateSubpictureCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func CreateSubpicture(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) CreateSubpictureCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(createSubpictureRequest(c, SubpictureId, Context, XvimageId, Width, Height), cookie)
|
c.NewRequest(createSubpictureRequest(c, SubpictureId, Context, XvimageId, Width, Height), cookie)
|
||||||
return CreateSubpictureCookie{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 {
|
func CreateSubpictureUnchecked(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) CreateSubpictureCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(createSubpictureRequest(c, SubpictureId, Context, XvimageId, Width, Height), cookie)
|
c.NewRequest(createSubpictureRequest(c, SubpictureId, Context, XvimageId, Width, Height), cookie)
|
||||||
return CreateSubpictureCookie{cookie}
|
return CreateSubpictureCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for CreateSubpicture
|
// CreateSubpictureReply represents the data returned from a CreateSubpicture request.
|
||||||
// size: (32 + xgb.Pad((int(Length) * 4)))
|
|
||||||
type CreateSubpictureReply struct {
|
type CreateSubpictureReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
WidthActual uint16
|
WidthActual uint16
|
||||||
HeightActual uint16
|
HeightActual uint16
|
||||||
|
@ -689,7 +711,7 @@ type CreateSubpictureReply struct {
|
||||||
PrivData []uint32 // size: xgb.Pad((int(Length) * 4))
|
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) {
|
func (cook CreateSubpictureCookie) Reply() (*CreateSubpictureReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -701,7 +723,7 @@ func (cook CreateSubpictureCookie) Reply() (*CreateSubpictureReply, error) {
|
||||||
return createSubpictureReply(buf), nil
|
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 {
|
func createSubpictureReply(buf []byte) *CreateSubpictureReply {
|
||||||
v := new(CreateSubpictureReply)
|
v := new(CreateSubpictureReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -743,6 +765,7 @@ func createSubpictureReply(buf []byte) *CreateSubpictureReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for CreateSubpicture
|
// 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 {
|
func createSubpictureRequest(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) []byte {
|
||||||
size := 20
|
size := 20
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -775,30 +798,35 @@ func createSubpictureRequest(c *xgb.Conn, SubpictureId Subpicture, Context Conte
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request DestroySubpicture
|
// DestroySubpictureCookie is a cookie used only for DestroySubpicture requests.
|
||||||
// size: 8
|
|
||||||
type DestroySubpictureCookie struct {
|
type DestroySubpictureCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func DestroySubpicture(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCookie {
|
||||||
cookie := c.NewCookie(false, false)
|
cookie := c.NewCookie(false, false)
|
||||||
c.NewRequest(destroySubpictureRequest(c, SubpictureId), cookie)
|
c.NewRequest(destroySubpictureRequest(c, SubpictureId), cookie)
|
||||||
return DestroySubpictureCookie{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 {
|
func DestroySubpictureChecked(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCookie {
|
||||||
cookie := c.NewCookie(true, false)
|
cookie := c.NewCookie(true, false)
|
||||||
c.NewRequest(destroySubpictureRequest(c, SubpictureId), cookie)
|
c.NewRequest(destroySubpictureRequest(c, SubpictureId), cookie)
|
||||||
return DestroySubpictureCookie{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 {
|
func (cook DestroySubpictureCookie) Check() error {
|
||||||
return cook.Cookie.Check()
|
return cook.Cookie.Check()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for DestroySubpicture
|
// Write request to wire for DestroySubpicture
|
||||||
|
// destroySubpictureRequest writes a DestroySubpicture request to a byte slice.
|
||||||
func destroySubpictureRequest(c *xgb.Conn, SubpictureId Subpicture) []byte {
|
func destroySubpictureRequest(c *xgb.Conn, SubpictureId Subpicture) []byte {
|
||||||
size := 8
|
size := 8
|
||||||
b := 0
|
b := 0
|
||||||
|
@ -819,36 +847,38 @@ func destroySubpictureRequest(c *xgb.Conn, SubpictureId Subpicture) []byte {
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request ListSubpictureTypes
|
// ListSubpictureTypesCookie is a cookie used only for ListSubpictureTypes requests.
|
||||||
// size: 12
|
|
||||||
type ListSubpictureTypesCookie struct {
|
type ListSubpictureTypesCookie struct {
|
||||||
*xgb.Cookie
|
*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 {
|
func ListSubpictureTypes(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSubpictureTypesCookie {
|
||||||
cookie := c.NewCookie(true, true)
|
cookie := c.NewCookie(true, true)
|
||||||
c.NewRequest(listSubpictureTypesRequest(c, PortId, SurfaceId), cookie)
|
c.NewRequest(listSubpictureTypesRequest(c, PortId, SurfaceId), cookie)
|
||||||
return ListSubpictureTypesCookie{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 {
|
func ListSubpictureTypesUnchecked(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSubpictureTypesCookie {
|
||||||
cookie := c.NewCookie(false, true)
|
cookie := c.NewCookie(false, true)
|
||||||
c.NewRequest(listSubpictureTypesRequest(c, PortId, SurfaceId), cookie)
|
c.NewRequest(listSubpictureTypesRequest(c, PortId, SurfaceId), cookie)
|
||||||
return ListSubpictureTypesCookie{cookie}
|
return ListSubpictureTypesCookie{cookie}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request reply for ListSubpictureTypes
|
// ListSubpictureTypesReply represents the data returned from a ListSubpictureTypes request.
|
||||||
// size: (32 + xv.ImageFormatInfoListSize(Types))
|
|
||||||
type ListSubpictureTypesReply struct {
|
type ListSubpictureTypesReply struct {
|
||||||
Sequence uint16
|
Sequence uint16 // sequence number of the request for this reply
|
||||||
Length uint32
|
Length uint32 // number of bytes in this reply
|
||||||
// padding: 1 bytes
|
// padding: 1 bytes
|
||||||
Num uint32
|
Num uint32
|
||||||
// padding: 20 bytes
|
// padding: 20 bytes
|
||||||
Types []xv.ImageFormatInfo // size: xv.ImageFormatInfoListSize(Types)
|
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) {
|
func (cook ListSubpictureTypesCookie) Reply() (*ListSubpictureTypesReply, error) {
|
||||||
buf, err := cook.Cookie.Reply()
|
buf, err := cook.Cookie.Reply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -860,7 +890,7 @@ func (cook ListSubpictureTypesCookie) Reply() (*ListSubpictureTypesReply, error)
|
||||||
return listSubpictureTypesReply(buf), nil
|
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 {
|
func listSubpictureTypesReply(buf []byte) *ListSubpictureTypesReply {
|
||||||
v := new(ListSubpictureTypesReply)
|
v := new(ListSubpictureTypesReply)
|
||||||
b := 1 // skip reply determinant
|
b := 1 // skip reply determinant
|
||||||
|
@ -885,6 +915,7 @@ func listSubpictureTypesReply(buf []byte) *ListSubpictureTypesReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write request to wire for ListSubpictureTypes
|
// 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 {
|
func listSubpictureTypesRequest(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) []byte {
|
||||||
size := 12
|
size := 12
|
||||||
b := 0
|
b := 0
|
||||||
|
|
Loading…
Reference in New Issue