From c00652934e4ec68016a152b9bea10273b0be8726 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Thu, 10 May 2012 23:57:34 -0400 Subject: better docs --- nexgb/xselinux/xselinux.go | 395 +++++++++++++++++++++++++++------------------ 1 file changed, 238 insertions(+), 157 deletions(-) (limited to 'nexgb/xselinux/xselinux.go') diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index cb0532f..ac11a77 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -2,7 +2,7 @@ package xselinux /* - This file was generated by xselinux.xml on May 10 2012 8:04:33pm EDT. + This file was generated by xselinux.xml on May 10 2012 11:56:20pm EDT. This file is automatically generated. Edit at your peril! */ @@ -64,8 +64,6 @@ func init() { // Skipping definition for base type 'Byte' -// 'ListItem' struct definition -// Size: ((12 + xgb.Pad((int(ObjectContextLen) * 1))) + xgb.Pad((int(DataContextLen) * 1))) type ListItem struct { Name xproto.Atom ObjectContextLen uint32 @@ -74,7 +72,7 @@ type ListItem struct { DataContext string // size: xgb.Pad((int(DataContextLen) * 1)) } -// Struct read ListItem +// ListItemRead reads a byte slice into a ListItem value. func ListItemRead(buf []byte, v *ListItem) int { b := 0 @@ -104,7 +102,7 @@ func ListItemRead(buf []byte, v *ListItem) int { return b } -// Struct list read ListItem +// ListItemReadList reads a byte slice into a list of ListItem values. func ListItemReadList(buf []byte, dest []ListItem) int { b := 0 for i := 0; i < len(dest); i++ { @@ -114,7 +112,7 @@ func ListItemReadList(buf []byte, dest []ListItem) int { return xgb.Pad(b) } -// Struct write ListItem +// Bytes writes a ListItem value to a byte slice. func (v ListItem) Bytes() []byte { buf := make([]byte, ((12 + xgb.Pad((int(v.ObjectContextLen) * 1))) + xgb.Pad((int(v.DataContextLen) * 1)))) b := 0 @@ -137,7 +135,7 @@ func (v ListItem) Bytes() []byte { return buf } -// Write struct list ListItem +// ListItemListBytes writes a list of %s(MISSING) values to a byte slice. func ListItemListBytes(buf []byte, list []ListItem) int { b := 0 var structBytes []byte @@ -149,7 +147,7 @@ func ListItemListBytes(buf []byte, list []ListItem) int { return b } -// Struct list size ListItem +// ListItemListSize computes the size (bytes) of a list of ListItem values. func ListItemListSize(list []ListItem) int { size := 0 for _, item := range list { @@ -158,35 +156,37 @@ func ListItemListSize(list []ListItem) int { return size } -// Request QueryVersion -// size: 8 +// QueryVersionCookie is a cookie used only for QueryVersion requests. type QueryVersionCookie struct { *xgb.Cookie } +// QueryVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply() func QueryVersion(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) return QueryVersionCookie{cookie} } +// QueryVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryVersionUnchecked(c *xgb.Conn, ClientMajor byte, ClientMinor byte) QueryVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryVersionRequest(c, ClientMajor, ClientMinor), cookie) return QueryVersionCookie{cookie} } -// Request reply for QueryVersion -// size: 12 +// QueryVersionReply represents the data returned from a QueryVersion request. type QueryVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ServerMajor uint16 ServerMinor uint16 } -// Waits and reads reply data from request QueryVersion +// Reply blocks and returns the reply data for a QueryVersion request. func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -198,7 +198,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) { return queryVersionReply(buf), nil } -// Read reply into structure from buffer for QueryVersion +// queryVersionReply reads a byte slice into a QueryVersionReply value. func queryVersionReply(buf []byte) *QueryVersionReply { v := new(QueryVersionReply) b := 1 // skip reply determinant @@ -221,6 +221,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply { } // Write request to wire for QueryVersion +// queryVersionRequest writes a QueryVersion request to a byte slice. func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte { size := 8 b := 0 @@ -244,30 +245,35 @@ func queryVersionRequest(c *xgb.Conn, ClientMajor byte, ClientMinor byte) []byte return buf } -// Request SetDeviceCreateContext -// size: xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) +// SetDeviceCreateContextCookie is a cookie used only for SetDeviceCreateContext requests. type SetDeviceCreateContextCookie struct { *xgb.Cookie } -// Write request to wire for SetDeviceCreateContext +// SetDeviceCreateContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetDeviceCreateContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(setDeviceCreateContextRequest(c, ContextLen, Context), cookie) return SetDeviceCreateContextCookie{cookie} } +// SetDeviceCreateContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetDeviceCreateContextCookie.Check() func SetDeviceCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetDeviceCreateContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(setDeviceCreateContextRequest(c, ContextLen, Context), cookie) return SetDeviceCreateContextCookie{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 SetDeviceCreateContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetDeviceCreateContext +// setDeviceCreateContextRequest writes a SetDeviceCreateContext request to a byte slice. func setDeviceCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) b := 0 @@ -291,36 +297,38 @@ func setDeviceCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context strin return buf } -// Request GetDeviceCreateContext -// size: 4 +// GetDeviceCreateContextCookie is a cookie used only for GetDeviceCreateContext requests. type GetDeviceCreateContextCookie struct { *xgb.Cookie } +// GetDeviceCreateContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceCreateContextCookie.Reply() func GetDeviceCreateContext(c *xgb.Conn) GetDeviceCreateContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceCreateContextRequest(c), cookie) return GetDeviceCreateContextCookie{cookie} } +// GetDeviceCreateContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceCreateContextUnchecked(c *xgb.Conn) GetDeviceCreateContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceCreateContextRequest(c), cookie) return GetDeviceCreateContextCookie{cookie} } -// Request reply for GetDeviceCreateContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetDeviceCreateContextReply represents the data returned from a GetDeviceCreateContext request. type GetDeviceCreateContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetDeviceCreateContext +// Reply blocks and returns the reply data for a GetDeviceCreateContext request. func (cook GetDeviceCreateContextCookie) Reply() (*GetDeviceCreateContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -332,7 +340,7 @@ func (cook GetDeviceCreateContextCookie) Reply() (*GetDeviceCreateContextReply, return getDeviceCreateContextReply(buf), nil } -// Read reply into structure from buffer for GetDeviceCreateContext +// getDeviceCreateContextReply reads a byte slice into a GetDeviceCreateContextReply value. func getDeviceCreateContextReply(buf []byte) *GetDeviceCreateContextReply { v := new(GetDeviceCreateContextReply) b := 1 // skip reply determinant @@ -361,6 +369,7 @@ func getDeviceCreateContextReply(buf []byte) *GetDeviceCreateContextReply { } // Write request to wire for GetDeviceCreateContext +// getDeviceCreateContextRequest writes a GetDeviceCreateContext request to a byte slice. func getDeviceCreateContextRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -378,30 +387,35 @@ func getDeviceCreateContextRequest(c *xgb.Conn) []byte { return buf } -// Request SetDeviceContext -// size: xgb.Pad((12 + xgb.Pad((int(ContextLen) * 1)))) +// SetDeviceContextCookie is a cookie used only for SetDeviceContext requests. type SetDeviceContextCookie struct { *xgb.Cookie } -// Write request to wire for SetDeviceContext +// SetDeviceContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceContext(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) SetDeviceContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(setDeviceContextRequest(c, Device, ContextLen, Context), cookie) return SetDeviceContextCookie{cookie} } +// SetDeviceContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetDeviceContextCookie.Check() func SetDeviceContextChecked(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) SetDeviceContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(setDeviceContextRequest(c, Device, ContextLen, Context), cookie) return SetDeviceContextCookie{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 SetDeviceContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetDeviceContext +// setDeviceContextRequest writes a SetDeviceContext request to a byte slice. func setDeviceContextRequest(c *xgb.Conn, Device uint32, ContextLen uint32, Context string) []byte { size := xgb.Pad((12 + xgb.Pad((int(ContextLen) * 1)))) b := 0 @@ -428,36 +442,38 @@ func setDeviceContextRequest(c *xgb.Conn, Device uint32, ContextLen uint32, Cont return buf } -// Request GetDeviceContext -// size: 8 +// GetDeviceContextCookie is a cookie used only for GetDeviceContext requests. type GetDeviceContextCookie struct { *xgb.Cookie } +// GetDeviceContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceContextCookie.Reply() func GetDeviceContext(c *xgb.Conn, Device uint32) GetDeviceContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceContextRequest(c, Device), cookie) return GetDeviceContextCookie{cookie} } +// GetDeviceContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceContextUnchecked(c *xgb.Conn, Device uint32) GetDeviceContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceContextRequest(c, Device), cookie) return GetDeviceContextCookie{cookie} } -// Request reply for GetDeviceContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetDeviceContextReply represents the data returned from a GetDeviceContext request. type GetDeviceContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetDeviceContext +// Reply blocks and returns the reply data for a GetDeviceContext request. func (cook GetDeviceContextCookie) Reply() (*GetDeviceContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -469,7 +485,7 @@ func (cook GetDeviceContextCookie) Reply() (*GetDeviceContextReply, error) { return getDeviceContextReply(buf), nil } -// Read reply into structure from buffer for GetDeviceContext +// getDeviceContextReply reads a byte slice into a GetDeviceContextReply value. func getDeviceContextReply(buf []byte) *GetDeviceContextReply { v := new(GetDeviceContextReply) b := 1 // skip reply determinant @@ -498,6 +514,7 @@ func getDeviceContextReply(buf []byte) *GetDeviceContextReply { } // Write request to wire for GetDeviceContext +// getDeviceContextRequest writes a GetDeviceContext request to a byte slice. func getDeviceContextRequest(c *xgb.Conn, Device uint32) []byte { size := 8 b := 0 @@ -518,30 +535,35 @@ func getDeviceContextRequest(c *xgb.Conn, Device uint32) []byte { return buf } -// Request SetWindowCreateContext -// size: xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) +// SetWindowCreateContextCookie is a cookie used only for SetWindowCreateContext requests. type SetWindowCreateContextCookie struct { *xgb.Cookie } -// Write request to wire for SetWindowCreateContext +// SetWindowCreateContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetWindowCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetWindowCreateContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(setWindowCreateContextRequest(c, ContextLen, Context), cookie) return SetWindowCreateContextCookie{cookie} } +// SetWindowCreateContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetWindowCreateContextCookie.Check() func SetWindowCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetWindowCreateContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(setWindowCreateContextRequest(c, ContextLen, Context), cookie) return SetWindowCreateContextCookie{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 SetWindowCreateContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetWindowCreateContext +// setWindowCreateContextRequest writes a SetWindowCreateContext request to a byte slice. func setWindowCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) b := 0 @@ -565,36 +587,38 @@ func setWindowCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context strin return buf } -// Request GetWindowCreateContext -// size: 4 +// GetWindowCreateContextCookie is a cookie used only for GetWindowCreateContext requests. type GetWindowCreateContextCookie struct { *xgb.Cookie } +// GetWindowCreateContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetWindowCreateContextCookie.Reply() func GetWindowCreateContext(c *xgb.Conn) GetWindowCreateContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getWindowCreateContextRequest(c), cookie) return GetWindowCreateContextCookie{cookie} } +// GetWindowCreateContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetWindowCreateContextUnchecked(c *xgb.Conn) GetWindowCreateContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getWindowCreateContextRequest(c), cookie) return GetWindowCreateContextCookie{cookie} } -// Request reply for GetWindowCreateContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetWindowCreateContextReply represents the data returned from a GetWindowCreateContext request. type GetWindowCreateContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetWindowCreateContext +// Reply blocks and returns the reply data for a GetWindowCreateContext request. func (cook GetWindowCreateContextCookie) Reply() (*GetWindowCreateContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -606,7 +630,7 @@ func (cook GetWindowCreateContextCookie) Reply() (*GetWindowCreateContextReply, return getWindowCreateContextReply(buf), nil } -// Read reply into structure from buffer for GetWindowCreateContext +// getWindowCreateContextReply reads a byte slice into a GetWindowCreateContextReply value. func getWindowCreateContextReply(buf []byte) *GetWindowCreateContextReply { v := new(GetWindowCreateContextReply) b := 1 // skip reply determinant @@ -635,6 +659,7 @@ func getWindowCreateContextReply(buf []byte) *GetWindowCreateContextReply { } // Write request to wire for GetWindowCreateContext +// getWindowCreateContextRequest writes a GetWindowCreateContext request to a byte slice. func getWindowCreateContextRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -652,36 +677,38 @@ func getWindowCreateContextRequest(c *xgb.Conn) []byte { return buf } -// Request GetWindowContext -// size: 8 +// GetWindowContextCookie is a cookie used only for GetWindowContext requests. type GetWindowContextCookie struct { *xgb.Cookie } +// GetWindowContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetWindowContextCookie.Reply() func GetWindowContext(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getWindowContextRequest(c, Window), cookie) return GetWindowContextCookie{cookie} } +// GetWindowContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetWindowContextUnchecked(c *xgb.Conn, Window xproto.Window) GetWindowContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getWindowContextRequest(c, Window), cookie) return GetWindowContextCookie{cookie} } -// Request reply for GetWindowContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetWindowContextReply represents the data returned from a GetWindowContext request. type GetWindowContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetWindowContext +// Reply blocks and returns the reply data for a GetWindowContext request. func (cook GetWindowContextCookie) Reply() (*GetWindowContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -693,7 +720,7 @@ func (cook GetWindowContextCookie) Reply() (*GetWindowContextReply, error) { return getWindowContextReply(buf), nil } -// Read reply into structure from buffer for GetWindowContext +// getWindowContextReply reads a byte slice into a GetWindowContextReply value. func getWindowContextReply(buf []byte) *GetWindowContextReply { v := new(GetWindowContextReply) b := 1 // skip reply determinant @@ -722,6 +749,7 @@ func getWindowContextReply(buf []byte) *GetWindowContextReply { } // Write request to wire for GetWindowContext +// getWindowContextRequest writes a GetWindowContext request to a byte slice. func getWindowContextRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 @@ -742,30 +770,35 @@ func getWindowContextRequest(c *xgb.Conn, Window xproto.Window) []byte { return buf } -// Request SetPropertyCreateContext -// size: xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) +// SetPropertyCreateContextCookie is a cookie used only for SetPropertyCreateContext requests. type SetPropertyCreateContextCookie struct { *xgb.Cookie } -// Write request to wire for SetPropertyCreateContext +// SetPropertyCreateContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPropertyCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyCreateContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(setPropertyCreateContextRequest(c, ContextLen, Context), cookie) return SetPropertyCreateContextCookie{cookie} } +// SetPropertyCreateContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetPropertyCreateContextCookie.Check() func SetPropertyCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyCreateContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(setPropertyCreateContextRequest(c, ContextLen, Context), cookie) return SetPropertyCreateContextCookie{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 SetPropertyCreateContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetPropertyCreateContext +// setPropertyCreateContextRequest writes a SetPropertyCreateContext request to a byte slice. func setPropertyCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) b := 0 @@ -789,36 +822,38 @@ func setPropertyCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context str return buf } -// Request GetPropertyCreateContext -// size: 4 +// GetPropertyCreateContextCookie is a cookie used only for GetPropertyCreateContext requests. type GetPropertyCreateContextCookie struct { *xgb.Cookie } +// GetPropertyCreateContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPropertyCreateContextCookie.Reply() func GetPropertyCreateContext(c *xgb.Conn) GetPropertyCreateContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPropertyCreateContextRequest(c), cookie) return GetPropertyCreateContextCookie{cookie} } +// GetPropertyCreateContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyCreateContextUnchecked(c *xgb.Conn) GetPropertyCreateContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPropertyCreateContextRequest(c), cookie) return GetPropertyCreateContextCookie{cookie} } -// Request reply for GetPropertyCreateContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetPropertyCreateContextReply represents the data returned from a GetPropertyCreateContext request. type GetPropertyCreateContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetPropertyCreateContext +// Reply blocks and returns the reply data for a GetPropertyCreateContext request. func (cook GetPropertyCreateContextCookie) Reply() (*GetPropertyCreateContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -830,7 +865,7 @@ func (cook GetPropertyCreateContextCookie) Reply() (*GetPropertyCreateContextRep return getPropertyCreateContextReply(buf), nil } -// Read reply into structure from buffer for GetPropertyCreateContext +// getPropertyCreateContextReply reads a byte slice into a GetPropertyCreateContextReply value. func getPropertyCreateContextReply(buf []byte) *GetPropertyCreateContextReply { v := new(GetPropertyCreateContextReply) b := 1 // skip reply determinant @@ -859,6 +894,7 @@ func getPropertyCreateContextReply(buf []byte) *GetPropertyCreateContextReply { } // Write request to wire for GetPropertyCreateContext +// getPropertyCreateContextRequest writes a GetPropertyCreateContext request to a byte slice. func getPropertyCreateContextRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -876,30 +912,35 @@ func getPropertyCreateContextRequest(c *xgb.Conn) []byte { return buf } -// Request SetPropertyUseContext -// size: xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) +// SetPropertyUseContextCookie is a cookie used only for SetPropertyUseContext requests. type SetPropertyUseContextCookie struct { *xgb.Cookie } -// Write request to wire for SetPropertyUseContext +// SetPropertyUseContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPropertyUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyUseContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(setPropertyUseContextRequest(c, ContextLen, Context), cookie) return SetPropertyUseContextCookie{cookie} } +// SetPropertyUseContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetPropertyUseContextCookie.Check() func SetPropertyUseContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetPropertyUseContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(setPropertyUseContextRequest(c, ContextLen, Context), cookie) return SetPropertyUseContextCookie{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 SetPropertyUseContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetPropertyUseContext +// setPropertyUseContextRequest writes a SetPropertyUseContext request to a byte slice. func setPropertyUseContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) b := 0 @@ -923,36 +964,38 @@ func setPropertyUseContextRequest(c *xgb.Conn, ContextLen uint32, Context string return buf } -// Request GetPropertyUseContext -// size: 4 +// GetPropertyUseContextCookie is a cookie used only for GetPropertyUseContext requests. type GetPropertyUseContextCookie struct { *xgb.Cookie } +// GetPropertyUseContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPropertyUseContextCookie.Reply() func GetPropertyUseContext(c *xgb.Conn) GetPropertyUseContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPropertyUseContextRequest(c), cookie) return GetPropertyUseContextCookie{cookie} } +// GetPropertyUseContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyUseContextUnchecked(c *xgb.Conn) GetPropertyUseContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPropertyUseContextRequest(c), cookie) return GetPropertyUseContextCookie{cookie} } -// Request reply for GetPropertyUseContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetPropertyUseContextReply represents the data returned from a GetPropertyUseContext request. type GetPropertyUseContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetPropertyUseContext +// Reply blocks and returns the reply data for a GetPropertyUseContext request. func (cook GetPropertyUseContextCookie) Reply() (*GetPropertyUseContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -964,7 +1007,7 @@ func (cook GetPropertyUseContextCookie) Reply() (*GetPropertyUseContextReply, er return getPropertyUseContextReply(buf), nil } -// Read reply into structure from buffer for GetPropertyUseContext +// getPropertyUseContextReply reads a byte slice into a GetPropertyUseContextReply value. func getPropertyUseContextReply(buf []byte) *GetPropertyUseContextReply { v := new(GetPropertyUseContextReply) b := 1 // skip reply determinant @@ -993,6 +1036,7 @@ func getPropertyUseContextReply(buf []byte) *GetPropertyUseContextReply { } // Write request to wire for GetPropertyUseContext +// getPropertyUseContextRequest writes a GetPropertyUseContext request to a byte slice. func getPropertyUseContextRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -1010,36 +1054,38 @@ func getPropertyUseContextRequest(c *xgb.Conn) []byte { return buf } -// Request GetPropertyContext -// size: 12 +// GetPropertyContextCookie is a cookie used only for GetPropertyContext requests. type GetPropertyContextCookie struct { *xgb.Cookie } +// GetPropertyContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPropertyContextCookie.Reply() func GetPropertyContext(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPropertyContextRequest(c, Window, Property), cookie) return GetPropertyContextCookie{cookie} } +// GetPropertyContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyContextUnchecked(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPropertyContextRequest(c, Window, Property), cookie) return GetPropertyContextCookie{cookie} } -// Request reply for GetPropertyContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetPropertyContextReply represents the data returned from a GetPropertyContext request. type GetPropertyContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetPropertyContext +// Reply blocks and returns the reply data for a GetPropertyContext request. func (cook GetPropertyContextCookie) Reply() (*GetPropertyContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1051,7 +1097,7 @@ func (cook GetPropertyContextCookie) Reply() (*GetPropertyContextReply, error) { return getPropertyContextReply(buf), nil } -// Read reply into structure from buffer for GetPropertyContext +// getPropertyContextReply reads a byte slice into a GetPropertyContextReply value. func getPropertyContextReply(buf []byte) *GetPropertyContextReply { v := new(GetPropertyContextReply) b := 1 // skip reply determinant @@ -1080,6 +1126,7 @@ func getPropertyContextReply(buf []byte) *GetPropertyContextReply { } // Write request to wire for GetPropertyContext +// getPropertyContextRequest writes a GetPropertyContext request to a byte slice. func getPropertyContextRequest(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) []byte { size := 12 b := 0 @@ -1103,36 +1150,38 @@ func getPropertyContextRequest(c *xgb.Conn, Window xproto.Window, Property xprot return buf } -// Request GetPropertyDataContext -// size: 12 +// GetPropertyDataContextCookie is a cookie used only for GetPropertyDataContext requests. type GetPropertyDataContextCookie struct { *xgb.Cookie } +// GetPropertyDataContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPropertyDataContextCookie.Reply() func GetPropertyDataContext(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyDataContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPropertyDataContextRequest(c, Window, Property), cookie) return GetPropertyDataContextCookie{cookie} } +// GetPropertyDataContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyDataContextUnchecked(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) GetPropertyDataContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPropertyDataContextRequest(c, Window, Property), cookie) return GetPropertyDataContextCookie{cookie} } -// Request reply for GetPropertyDataContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetPropertyDataContextReply represents the data returned from a GetPropertyDataContext request. type GetPropertyDataContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetPropertyDataContext +// Reply blocks and returns the reply data for a GetPropertyDataContext request. func (cook GetPropertyDataContextCookie) Reply() (*GetPropertyDataContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1144,7 +1193,7 @@ func (cook GetPropertyDataContextCookie) Reply() (*GetPropertyDataContextReply, return getPropertyDataContextReply(buf), nil } -// Read reply into structure from buffer for GetPropertyDataContext +// getPropertyDataContextReply reads a byte slice into a GetPropertyDataContextReply value. func getPropertyDataContextReply(buf []byte) *GetPropertyDataContextReply { v := new(GetPropertyDataContextReply) b := 1 // skip reply determinant @@ -1173,6 +1222,7 @@ func getPropertyDataContextReply(buf []byte) *GetPropertyDataContextReply { } // Write request to wire for GetPropertyDataContext +// getPropertyDataContextRequest writes a GetPropertyDataContext request to a byte slice. func getPropertyDataContextRequest(c *xgb.Conn, Window xproto.Window, Property xproto.Atom) []byte { size := 12 b := 0 @@ -1196,36 +1246,38 @@ func getPropertyDataContextRequest(c *xgb.Conn, Window xproto.Window, Property x return buf } -// Request ListProperties -// size: 8 +// ListPropertiesCookie is a cookie used only for ListProperties requests. type ListPropertiesCookie struct { *xgb.Cookie } +// ListProperties sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListPropertiesCookie.Reply() func ListProperties(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { cookie := c.NewCookie(true, true) c.NewRequest(listPropertiesRequest(c, Window), cookie) return ListPropertiesCookie{cookie} } +// ListPropertiesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListPropertiesUnchecked(c *xgb.Conn, Window xproto.Window) ListPropertiesCookie { cookie := c.NewCookie(false, true) c.NewRequest(listPropertiesRequest(c, Window), cookie) return ListPropertiesCookie{cookie} } -// Request reply for ListProperties -// size: (32 + ListItemListSize(Properties)) +// ListPropertiesReply represents the data returned from a ListProperties request. type ListPropertiesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes PropertiesLen uint32 // padding: 20 bytes Properties []ListItem // size: ListItemListSize(Properties) } -// Waits and reads reply data from request ListProperties +// Reply blocks and returns the reply data for a ListProperties request. func (cook ListPropertiesCookie) Reply() (*ListPropertiesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1237,7 +1289,7 @@ func (cook ListPropertiesCookie) Reply() (*ListPropertiesReply, error) { return listPropertiesReply(buf), nil } -// Read reply into structure from buffer for ListProperties +// listPropertiesReply reads a byte slice into a ListPropertiesReply value. func listPropertiesReply(buf []byte) *ListPropertiesReply { v := new(ListPropertiesReply) b := 1 // skip reply determinant @@ -1262,6 +1314,7 @@ func listPropertiesReply(buf []byte) *ListPropertiesReply { } // Write request to wire for ListProperties +// listPropertiesRequest writes a ListProperties request to a byte slice. func listPropertiesRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 @@ -1282,30 +1335,35 @@ func listPropertiesRequest(c *xgb.Conn, Window xproto.Window) []byte { return buf } -// Request SetSelectionCreateContext -// size: xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) +// SetSelectionCreateContextCookie is a cookie used only for SetSelectionCreateContext requests. type SetSelectionCreateContextCookie struct { *xgb.Cookie } -// Write request to wire for SetSelectionCreateContext +// SetSelectionCreateContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetSelectionCreateContext(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionCreateContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(setSelectionCreateContextRequest(c, ContextLen, Context), cookie) return SetSelectionCreateContextCookie{cookie} } +// SetSelectionCreateContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetSelectionCreateContextCookie.Check() func SetSelectionCreateContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionCreateContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(setSelectionCreateContextRequest(c, ContextLen, Context), cookie) return SetSelectionCreateContextCookie{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 SetSelectionCreateContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetSelectionCreateContext +// setSelectionCreateContextRequest writes a SetSelectionCreateContext request to a byte slice. func setSelectionCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) b := 0 @@ -1329,36 +1387,38 @@ func setSelectionCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context st return buf } -// Request GetSelectionCreateContext -// size: 4 +// GetSelectionCreateContextCookie is a cookie used only for GetSelectionCreateContext requests. type GetSelectionCreateContextCookie struct { *xgb.Cookie } +// GetSelectionCreateContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetSelectionCreateContextCookie.Reply() func GetSelectionCreateContext(c *xgb.Conn) GetSelectionCreateContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getSelectionCreateContextRequest(c), cookie) return GetSelectionCreateContextCookie{cookie} } +// GetSelectionCreateContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionCreateContextUnchecked(c *xgb.Conn) GetSelectionCreateContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getSelectionCreateContextRequest(c), cookie) return GetSelectionCreateContextCookie{cookie} } -// Request reply for GetSelectionCreateContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetSelectionCreateContextReply represents the data returned from a GetSelectionCreateContext request. type GetSelectionCreateContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetSelectionCreateContext +// Reply blocks and returns the reply data for a GetSelectionCreateContext request. func (cook GetSelectionCreateContextCookie) Reply() (*GetSelectionCreateContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1370,7 +1430,7 @@ func (cook GetSelectionCreateContextCookie) Reply() (*GetSelectionCreateContextR return getSelectionCreateContextReply(buf), nil } -// Read reply into structure from buffer for GetSelectionCreateContext +// getSelectionCreateContextReply reads a byte slice into a GetSelectionCreateContextReply value. func getSelectionCreateContextReply(buf []byte) *GetSelectionCreateContextReply { v := new(GetSelectionCreateContextReply) b := 1 // skip reply determinant @@ -1399,6 +1459,7 @@ func getSelectionCreateContextReply(buf []byte) *GetSelectionCreateContextReply } // Write request to wire for GetSelectionCreateContext +// getSelectionCreateContextRequest writes a GetSelectionCreateContext request to a byte slice. func getSelectionCreateContextRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -1416,30 +1477,35 @@ func getSelectionCreateContextRequest(c *xgb.Conn) []byte { return buf } -// Request SetSelectionUseContext -// size: xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) +// SetSelectionUseContextCookie is a cookie used only for SetSelectionUseContext requests. type SetSelectionUseContextCookie struct { *xgb.Cookie } -// Write request to wire for SetSelectionUseContext +// SetSelectionUseContext sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetSelectionUseContext(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionUseContextCookie { cookie := c.NewCookie(false, false) c.NewRequest(setSelectionUseContextRequest(c, ContextLen, Context), cookie) return SetSelectionUseContextCookie{cookie} } +// SetSelectionUseContextChecked sends a checked request. +// If an error occurs, it can be retrieved using SetSelectionUseContextCookie.Check() func SetSelectionUseContextChecked(c *xgb.Conn, ContextLen uint32, Context string) SetSelectionUseContextCookie { cookie := c.NewCookie(true, false) c.NewRequest(setSelectionUseContextRequest(c, ContextLen, Context), cookie) return SetSelectionUseContextCookie{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 SetSelectionUseContextCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetSelectionUseContext +// setSelectionUseContextRequest writes a SetSelectionUseContext request to a byte slice. func setSelectionUseContextRequest(c *xgb.Conn, ContextLen uint32, Context string) []byte { size := xgb.Pad((8 + xgb.Pad((int(ContextLen) * 1)))) b := 0 @@ -1463,36 +1529,38 @@ func setSelectionUseContextRequest(c *xgb.Conn, ContextLen uint32, Context strin return buf } -// Request GetSelectionUseContext -// size: 4 +// GetSelectionUseContextCookie is a cookie used only for GetSelectionUseContext requests. type GetSelectionUseContextCookie struct { *xgb.Cookie } +// GetSelectionUseContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetSelectionUseContextCookie.Reply() func GetSelectionUseContext(c *xgb.Conn) GetSelectionUseContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getSelectionUseContextRequest(c), cookie) return GetSelectionUseContextCookie{cookie} } +// GetSelectionUseContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionUseContextUnchecked(c *xgb.Conn) GetSelectionUseContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getSelectionUseContextRequest(c), cookie) return GetSelectionUseContextCookie{cookie} } -// Request reply for GetSelectionUseContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetSelectionUseContextReply represents the data returned from a GetSelectionUseContext request. type GetSelectionUseContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetSelectionUseContext +// Reply blocks and returns the reply data for a GetSelectionUseContext request. func (cook GetSelectionUseContextCookie) Reply() (*GetSelectionUseContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1504,7 +1572,7 @@ func (cook GetSelectionUseContextCookie) Reply() (*GetSelectionUseContextReply, return getSelectionUseContextReply(buf), nil } -// Read reply into structure from buffer for GetSelectionUseContext +// getSelectionUseContextReply reads a byte slice into a GetSelectionUseContextReply value. func getSelectionUseContextReply(buf []byte) *GetSelectionUseContextReply { v := new(GetSelectionUseContextReply) b := 1 // skip reply determinant @@ -1533,6 +1601,7 @@ func getSelectionUseContextReply(buf []byte) *GetSelectionUseContextReply { } // Write request to wire for GetSelectionUseContext +// getSelectionUseContextRequest writes a GetSelectionUseContext request to a byte slice. func getSelectionUseContextRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -1550,36 +1619,38 @@ func getSelectionUseContextRequest(c *xgb.Conn) []byte { return buf } -// Request GetSelectionContext -// size: 8 +// GetSelectionContextCookie is a cookie used only for GetSelectionContext requests. type GetSelectionContextCookie struct { *xgb.Cookie } +// GetSelectionContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetSelectionContextCookie.Reply() func GetSelectionContext(c *xgb.Conn, Selection xproto.Atom) GetSelectionContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getSelectionContextRequest(c, Selection), cookie) return GetSelectionContextCookie{cookie} } +// GetSelectionContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionContextUnchecked(c *xgb.Conn, Selection xproto.Atom) GetSelectionContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getSelectionContextRequest(c, Selection), cookie) return GetSelectionContextCookie{cookie} } -// Request reply for GetSelectionContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetSelectionContextReply represents the data returned from a GetSelectionContext request. type GetSelectionContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetSelectionContext +// Reply blocks and returns the reply data for a GetSelectionContext request. func (cook GetSelectionContextCookie) Reply() (*GetSelectionContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1591,7 +1662,7 @@ func (cook GetSelectionContextCookie) Reply() (*GetSelectionContextReply, error) return getSelectionContextReply(buf), nil } -// Read reply into structure from buffer for GetSelectionContext +// getSelectionContextReply reads a byte slice into a GetSelectionContextReply value. func getSelectionContextReply(buf []byte) *GetSelectionContextReply { v := new(GetSelectionContextReply) b := 1 // skip reply determinant @@ -1620,6 +1691,7 @@ func getSelectionContextReply(buf []byte) *GetSelectionContextReply { } // Write request to wire for GetSelectionContext +// getSelectionContextRequest writes a GetSelectionContext request to a byte slice. func getSelectionContextRequest(c *xgb.Conn, Selection xproto.Atom) []byte { size := 8 b := 0 @@ -1640,36 +1712,38 @@ func getSelectionContextRequest(c *xgb.Conn, Selection xproto.Atom) []byte { return buf } -// Request GetSelectionDataContext -// size: 8 +// GetSelectionDataContextCookie is a cookie used only for GetSelectionDataContext requests. type GetSelectionDataContextCookie struct { *xgb.Cookie } +// GetSelectionDataContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetSelectionDataContextCookie.Reply() func GetSelectionDataContext(c *xgb.Conn, Selection xproto.Atom) GetSelectionDataContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getSelectionDataContextRequest(c, Selection), cookie) return GetSelectionDataContextCookie{cookie} } +// GetSelectionDataContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionDataContextUnchecked(c *xgb.Conn, Selection xproto.Atom) GetSelectionDataContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getSelectionDataContextRequest(c, Selection), cookie) return GetSelectionDataContextCookie{cookie} } -// Request reply for GetSelectionDataContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetSelectionDataContextReply represents the data returned from a GetSelectionDataContext request. type GetSelectionDataContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetSelectionDataContext +// Reply blocks and returns the reply data for a GetSelectionDataContext request. func (cook GetSelectionDataContextCookie) Reply() (*GetSelectionDataContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1681,7 +1755,7 @@ func (cook GetSelectionDataContextCookie) Reply() (*GetSelectionDataContextReply return getSelectionDataContextReply(buf), nil } -// Read reply into structure from buffer for GetSelectionDataContext +// getSelectionDataContextReply reads a byte slice into a GetSelectionDataContextReply value. func getSelectionDataContextReply(buf []byte) *GetSelectionDataContextReply { v := new(GetSelectionDataContextReply) b := 1 // skip reply determinant @@ -1710,6 +1784,7 @@ func getSelectionDataContextReply(buf []byte) *GetSelectionDataContextReply { } // Write request to wire for GetSelectionDataContext +// getSelectionDataContextRequest writes a GetSelectionDataContext request to a byte slice. func getSelectionDataContextRequest(c *xgb.Conn, Selection xproto.Atom) []byte { size := 8 b := 0 @@ -1730,36 +1805,38 @@ func getSelectionDataContextRequest(c *xgb.Conn, Selection xproto.Atom) []byte { return buf } -// Request ListSelections -// size: 4 +// ListSelectionsCookie is a cookie used only for ListSelections requests. type ListSelectionsCookie struct { *xgb.Cookie } +// ListSelections sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListSelectionsCookie.Reply() func ListSelections(c *xgb.Conn) ListSelectionsCookie { cookie := c.NewCookie(true, true) c.NewRequest(listSelectionsRequest(c), cookie) return ListSelectionsCookie{cookie} } +// ListSelectionsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListSelectionsUnchecked(c *xgb.Conn) ListSelectionsCookie { cookie := c.NewCookie(false, true) c.NewRequest(listSelectionsRequest(c), cookie) return ListSelectionsCookie{cookie} } -// Request reply for ListSelections -// size: (32 + ListItemListSize(Selections)) +// ListSelectionsReply represents the data returned from a ListSelections request. type ListSelectionsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes SelectionsLen uint32 // padding: 20 bytes Selections []ListItem // size: ListItemListSize(Selections) } -// Waits and reads reply data from request ListSelections +// Reply blocks and returns the reply data for a ListSelections request. func (cook ListSelectionsCookie) Reply() (*ListSelectionsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1771,7 +1848,7 @@ func (cook ListSelectionsCookie) Reply() (*ListSelectionsReply, error) { return listSelectionsReply(buf), nil } -// Read reply into structure from buffer for ListSelections +// listSelectionsReply reads a byte slice into a ListSelectionsReply value. func listSelectionsReply(buf []byte) *ListSelectionsReply { v := new(ListSelectionsReply) b := 1 // skip reply determinant @@ -1796,6 +1873,7 @@ func listSelectionsReply(buf []byte) *ListSelectionsReply { } // Write request to wire for ListSelections +// listSelectionsRequest writes a ListSelections request to a byte slice. func listSelectionsRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -1813,36 +1891,38 @@ func listSelectionsRequest(c *xgb.Conn) []byte { return buf } -// Request GetClientContext -// size: 8 +// GetClientContextCookie is a cookie used only for GetClientContext requests. type GetClientContextCookie struct { *xgb.Cookie } +// GetClientContext sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetClientContextCookie.Reply() func GetClientContext(c *xgb.Conn, Resource uint32) GetClientContextCookie { cookie := c.NewCookie(true, true) c.NewRequest(getClientContextRequest(c, Resource), cookie) return GetClientContextCookie{cookie} } +// GetClientContextUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetClientContextUnchecked(c *xgb.Conn, Resource uint32) GetClientContextCookie { cookie := c.NewCookie(false, true) c.NewRequest(getClientContextRequest(c, Resource), cookie) return GetClientContextCookie{cookie} } -// Request reply for GetClientContext -// size: (32 + xgb.Pad((int(ContextLen) * 1))) +// GetClientContextReply represents the data returned from a GetClientContext request. type GetClientContextReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ContextLen uint32 // padding: 20 bytes Context string // size: xgb.Pad((int(ContextLen) * 1)) } -// Waits and reads reply data from request GetClientContext +// Reply blocks and returns the reply data for a GetClientContext request. func (cook GetClientContextCookie) Reply() (*GetClientContextReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -1854,7 +1934,7 @@ func (cook GetClientContextCookie) Reply() (*GetClientContextReply, error) { return getClientContextReply(buf), nil } -// Read reply into structure from buffer for GetClientContext +// getClientContextReply reads a byte slice into a GetClientContextReply value. func getClientContextReply(buf []byte) *GetClientContextReply { v := new(GetClientContextReply) b := 1 // skip reply determinant @@ -1883,6 +1963,7 @@ func getClientContextReply(buf []byte) *GetClientContextReply { } // Write request to wire for GetClientContext +// getClientContextRequest writes a GetClientContext request to a byte slice. func getClientContextRequest(c *xgb.Conn, Resource uint32) []byte { size := 8 b := 0 -- cgit v1.2.3