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/xproto/xproto.go | 2476 +++++++++++++++++++++++++++++------------------- 1 file changed, 1481 insertions(+), 995 deletions(-) (limited to 'nexgb/xproto') diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index 39956f1..6b0fb6b 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -2,7 +2,7 @@ package xproto /* - This file was generated by xproto.xml on May 10 2012 8:04:32pm EDT. + This file was generated by xproto.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -23,16 +23,6 @@ func (s *SetupInfo) DefaultScreen(c *xgb.Conn) *ScreenInfo { return &s.Roots[c.DefaultScreen] } -// Skipping definition for base type 'Char' - -// Skipping definition for base type 'Card32' - -// Skipping definition for base type 'Double' - -// Skipping definition for base type 'Bool' - -// Skipping definition for base type 'Float' - // Skipping definition for base type 'Card8' // Skipping definition for base type 'Int16' @@ -47,6 +37,16 @@ func (s *SetupInfo) DefaultScreen(c *xgb.Conn) *ScreenInfo { // Skipping definition for base type 'Card16' +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + +// Skipping definition for base type 'Bool' + +// Skipping definition for base type 'Float' + const ( VisualClassStaticGray = 0 VisualClassGrayScale = 1 @@ -733,14 +733,12 @@ type Keycode byte type Button byte -// 'Char2b' struct definition -// Size: 2 type Char2b struct { Byte1 byte Byte2 byte } -// Struct read Char2b +// Char2bRead reads a byte slice into a Char2b value. func Char2bRead(buf []byte, v *Char2b) int { b := 0 @@ -753,7 +751,7 @@ func Char2bRead(buf []byte, v *Char2b) int { return b } -// Struct list read Char2b +// Char2bReadList reads a byte slice into a list of Char2b values. func Char2bReadList(buf []byte, dest []Char2b) int { b := 0 for i := 0; i < len(dest); i++ { @@ -763,7 +761,7 @@ func Char2bReadList(buf []byte, dest []Char2b) int { return xgb.Pad(b) } -// Struct write Char2b +// Bytes writes a Char2b value to a byte slice. func (v Char2b) Bytes() []byte { buf := make([]byte, 2) b := 0 @@ -777,7 +775,7 @@ func (v Char2b) Bytes() []byte { return buf } -// Write struct list Char2b +// Char2bListBytes writes a list of %s(MISSING) values to a byte slice. func Char2bListBytes(buf []byte, list []Char2b) int { b := 0 var structBytes []byte @@ -789,14 +787,12 @@ func Char2bListBytes(buf []byte, list []Char2b) int { return b } -// 'Point' struct definition -// Size: 4 type Point struct { X int16 Y int16 } -// Struct read Point +// PointRead reads a byte slice into a Point value. func PointRead(buf []byte, v *Point) int { b := 0 @@ -809,7 +805,7 @@ func PointRead(buf []byte, v *Point) int { return b } -// Struct list read Point +// PointReadList reads a byte slice into a list of Point values. func PointReadList(buf []byte, dest []Point) int { b := 0 for i := 0; i < len(dest); i++ { @@ -819,7 +815,7 @@ func PointReadList(buf []byte, dest []Point) int { return xgb.Pad(b) } -// Struct write Point +// Bytes writes a Point value to a byte slice. func (v Point) Bytes() []byte { buf := make([]byte, 4) b := 0 @@ -833,7 +829,7 @@ func (v Point) Bytes() []byte { return buf } -// Write struct list Point +// PointListBytes writes a list of %s(MISSING) values to a byte slice. func PointListBytes(buf []byte, list []Point) int { b := 0 var structBytes []byte @@ -845,8 +841,6 @@ func PointListBytes(buf []byte, list []Point) int { return b } -// 'Rectangle' struct definition -// Size: 8 type Rectangle struct { X int16 Y int16 @@ -854,7 +848,7 @@ type Rectangle struct { Height uint16 } -// Struct read Rectangle +// RectangleRead reads a byte slice into a Rectangle value. func RectangleRead(buf []byte, v *Rectangle) int { b := 0 @@ -873,7 +867,7 @@ func RectangleRead(buf []byte, v *Rectangle) int { return b } -// Struct list read Rectangle +// RectangleReadList reads a byte slice into a list of Rectangle values. func RectangleReadList(buf []byte, dest []Rectangle) int { b := 0 for i := 0; i < len(dest); i++ { @@ -883,7 +877,7 @@ func RectangleReadList(buf []byte, dest []Rectangle) int { return xgb.Pad(b) } -// Struct write Rectangle +// Bytes writes a Rectangle value to a byte slice. func (v Rectangle) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -903,7 +897,7 @@ func (v Rectangle) Bytes() []byte { return buf } -// Write struct list Rectangle +// RectangleListBytes writes a list of %s(MISSING) values to a byte slice. func RectangleListBytes(buf []byte, list []Rectangle) int { b := 0 var structBytes []byte @@ -915,8 +909,6 @@ func RectangleListBytes(buf []byte, list []Rectangle) int { return b } -// 'Arc' struct definition -// Size: 12 type Arc struct { X int16 Y int16 @@ -926,7 +918,7 @@ type Arc struct { Angle2 int16 } -// Struct read Arc +// ArcRead reads a byte slice into a Arc value. func ArcRead(buf []byte, v *Arc) int { b := 0 @@ -951,7 +943,7 @@ func ArcRead(buf []byte, v *Arc) int { return b } -// Struct list read Arc +// ArcReadList reads a byte slice into a list of Arc values. func ArcReadList(buf []byte, dest []Arc) int { b := 0 for i := 0; i < len(dest); i++ { @@ -961,7 +953,7 @@ func ArcReadList(buf []byte, dest []Arc) int { return xgb.Pad(b) } -// Struct write Arc +// Bytes writes a Arc value to a byte slice. func (v Arc) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -987,7 +979,7 @@ func (v Arc) Bytes() []byte { return buf } -// Write struct list Arc +// ArcListBytes writes a list of %s(MISSING) values to a byte slice. func ArcListBytes(buf []byte, list []Arc) int { b := 0 var structBytes []byte @@ -999,8 +991,6 @@ func ArcListBytes(buf []byte, list []Arc) int { return b } -// 'Format' struct definition -// Size: 8 type Format struct { Depth byte BitsPerPixel byte @@ -1008,7 +998,7 @@ type Format struct { // padding: 5 bytes } -// Struct read Format +// FormatRead reads a byte slice into a Format value. func FormatRead(buf []byte, v *Format) int { b := 0 @@ -1026,7 +1016,7 @@ func FormatRead(buf []byte, v *Format) int { return b } -// Struct list read Format +// FormatReadList reads a byte slice into a list of Format values. func FormatReadList(buf []byte, dest []Format) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1036,7 +1026,7 @@ func FormatReadList(buf []byte, dest []Format) int { return xgb.Pad(b) } -// Struct write Format +// Bytes writes a Format value to a byte slice. func (v Format) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -1055,7 +1045,7 @@ func (v Format) Bytes() []byte { return buf } -// Write struct list Format +// FormatListBytes writes a list of %s(MISSING) values to a byte slice. func FormatListBytes(buf []byte, list []Format) int { b := 0 var structBytes []byte @@ -1067,8 +1057,6 @@ func FormatListBytes(buf []byte, list []Format) int { return b } -// 'VisualInfo' struct definition -// Size: 24 type VisualInfo struct { VisualId Visualid Class byte @@ -1080,7 +1068,7 @@ type VisualInfo struct { // padding: 4 bytes } -// Struct read VisualInfo +// VisualInfoRead reads a byte slice into a VisualInfo value. func VisualInfoRead(buf []byte, v *VisualInfo) int { b := 0 @@ -1110,7 +1098,7 @@ func VisualInfoRead(buf []byte, v *VisualInfo) int { return b } -// Struct list read VisualInfo +// VisualInfoReadList reads a byte slice into a list of VisualInfo values. func VisualInfoReadList(buf []byte, dest []VisualInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1120,7 +1108,7 @@ func VisualInfoReadList(buf []byte, dest []VisualInfo) int { return xgb.Pad(b) } -// Struct write VisualInfo +// Bytes writes a VisualInfo value to a byte slice. func (v VisualInfo) Bytes() []byte { buf := make([]byte, 24) b := 0 @@ -1151,7 +1139,7 @@ func (v VisualInfo) Bytes() []byte { return buf } -// Write struct list VisualInfo +// VisualInfoListBytes writes a list of %s(MISSING) values to a byte slice. func VisualInfoListBytes(buf []byte, list []VisualInfo) int { b := 0 var structBytes []byte @@ -1163,8 +1151,6 @@ func VisualInfoListBytes(buf []byte, list []VisualInfo) int { return b } -// 'DepthInfo' struct definition -// Size: (8 + xgb.Pad((int(VisualsLen) * 24))) type DepthInfo struct { Depth byte // padding: 1 bytes @@ -1173,7 +1159,7 @@ type DepthInfo struct { Visuals []VisualInfo // size: xgb.Pad((int(VisualsLen) * 24)) } -// Struct read DepthInfo +// DepthInfoRead reads a byte slice into a DepthInfo value. func DepthInfoRead(buf []byte, v *DepthInfo) int { b := 0 @@ -1193,7 +1179,7 @@ func DepthInfoRead(buf []byte, v *DepthInfo) int { return b } -// Struct list read DepthInfo +// DepthInfoReadList reads a byte slice into a list of DepthInfo values. func DepthInfoReadList(buf []byte, dest []DepthInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1203,7 +1189,7 @@ func DepthInfoReadList(buf []byte, dest []DepthInfo) int { return xgb.Pad(b) } -// Struct write DepthInfo +// Bytes writes a DepthInfo value to a byte slice. func (v DepthInfo) Bytes() []byte { buf := make([]byte, (8 + xgb.Pad((int(v.VisualsLen) * 24)))) b := 0 @@ -1223,7 +1209,7 @@ func (v DepthInfo) Bytes() []byte { return buf } -// Write struct list DepthInfo +// DepthInfoListBytes writes a list of %s(MISSING) values to a byte slice. func DepthInfoListBytes(buf []byte, list []DepthInfo) int { b := 0 var structBytes []byte @@ -1235,7 +1221,7 @@ func DepthInfoListBytes(buf []byte, list []DepthInfo) int { return b } -// Struct list size DepthInfo +// DepthInfoListSize computes the size (bytes) of a list of DepthInfo values. func DepthInfoListSize(list []DepthInfo) int { size := 0 for _, item := range list { @@ -1244,8 +1230,6 @@ func DepthInfoListSize(list []DepthInfo) int { return size } -// 'ScreenInfo' struct definition -// Size: (40 + DepthInfoListSize(AllowedDepths)) type ScreenInfo struct { Root Window DefaultColormap Colormap @@ -1266,7 +1250,7 @@ type ScreenInfo struct { AllowedDepths []DepthInfo // size: DepthInfoListSize(AllowedDepths) } -// Struct read ScreenInfo +// ScreenInfoRead reads a byte slice into a ScreenInfo value. func ScreenInfoRead(buf []byte, v *ScreenInfo) int { b := 0 @@ -1328,7 +1312,7 @@ func ScreenInfoRead(buf []byte, v *ScreenInfo) int { return b } -// Struct list read ScreenInfo +// ScreenInfoReadList reads a byte slice into a list of ScreenInfo values. func ScreenInfoReadList(buf []byte, dest []ScreenInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1338,7 +1322,7 @@ func ScreenInfoReadList(buf []byte, dest []ScreenInfo) int { return xgb.Pad(b) } -// Struct write ScreenInfo +// Bytes writes a ScreenInfo value to a byte slice. func (v ScreenInfo) Bytes() []byte { buf := make([]byte, (40 + DepthInfoListSize(v.AllowedDepths))) b := 0 @@ -1400,7 +1384,7 @@ func (v ScreenInfo) Bytes() []byte { return buf } -// Write struct list ScreenInfo +// ScreenInfoListBytes writes a list of %s(MISSING) values to a byte slice. func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int { b := 0 var structBytes []byte @@ -1412,7 +1396,7 @@ func ScreenInfoListBytes(buf []byte, list []ScreenInfo) int { return b } -// Struct list size ScreenInfo +// ScreenInfoListSize computes the size (bytes) of a list of ScreenInfo values. func ScreenInfoListSize(list []ScreenInfo) int { size := 0 for _, item := range list { @@ -1421,8 +1405,6 @@ func ScreenInfoListSize(list []ScreenInfo) int { return size } -// 'SetupRequest' struct definition -// Size: ((12 + xgb.Pad((int(AuthorizationProtocolNameLen) * 1))) + xgb.Pad((int(AuthorizationProtocolDataLen) * 1))) type SetupRequest struct { ByteOrder byte // padding: 1 bytes @@ -1435,7 +1417,7 @@ type SetupRequest struct { AuthorizationProtocolData string // size: xgb.Pad((int(AuthorizationProtocolDataLen) * 1)) } -// Struct read SetupRequest +// SetupRequestRead reads a byte slice into a SetupRequest value. func SetupRequestRead(buf []byte, v *SetupRequest) int { b := 0 @@ -1475,7 +1457,7 @@ func SetupRequestRead(buf []byte, v *SetupRequest) int { return b } -// Struct list read SetupRequest +// SetupRequestReadList reads a byte slice into a list of SetupRequest values. func SetupRequestReadList(buf []byte, dest []SetupRequest) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1485,7 +1467,7 @@ func SetupRequestReadList(buf []byte, dest []SetupRequest) int { return xgb.Pad(b) } -// Struct write SetupRequest +// Bytes writes a SetupRequest value to a byte slice. func (v SetupRequest) Bytes() []byte { buf := make([]byte, ((12 + xgb.Pad((int(v.AuthorizationProtocolNameLen) * 1))) + xgb.Pad((int(v.AuthorizationProtocolDataLen) * 1)))) b := 0 @@ -1518,7 +1500,7 @@ func (v SetupRequest) Bytes() []byte { return buf } -// Write struct list SetupRequest +// SetupRequestListBytes writes a list of %s(MISSING) values to a byte slice. func SetupRequestListBytes(buf []byte, list []SetupRequest) int { b := 0 var structBytes []byte @@ -1530,7 +1512,7 @@ func SetupRequestListBytes(buf []byte, list []SetupRequest) int { return b } -// Struct list size SetupRequest +// SetupRequestListSize computes the size (bytes) of a list of SetupRequest values. func SetupRequestListSize(list []SetupRequest) int { size := 0 for _, item := range list { @@ -1539,8 +1521,6 @@ func SetupRequestListSize(list []SetupRequest) int { return size } -// 'SetupFailed' struct definition -// Size: (8 + xgb.Pad((int(ReasonLen) * 1))) type SetupFailed struct { Status byte ReasonLen byte @@ -1550,7 +1530,7 @@ type SetupFailed struct { Reason string // size: xgb.Pad((int(ReasonLen) * 1)) } -// Struct read SetupFailed +// SetupFailedRead reads a byte slice into a SetupFailed value. func SetupFailedRead(buf []byte, v *SetupFailed) int { b := 0 @@ -1579,7 +1559,7 @@ func SetupFailedRead(buf []byte, v *SetupFailed) int { return b } -// Struct list read SetupFailed +// SetupFailedReadList reads a byte slice into a list of SetupFailed values. func SetupFailedReadList(buf []byte, dest []SetupFailed) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1589,7 +1569,7 @@ func SetupFailedReadList(buf []byte, dest []SetupFailed) int { return xgb.Pad(b) } -// Struct write SetupFailed +// Bytes writes a SetupFailed value to a byte slice. func (v SetupFailed) Bytes() []byte { buf := make([]byte, (8 + xgb.Pad((int(v.ReasonLen) * 1)))) b := 0 @@ -1615,7 +1595,7 @@ func (v SetupFailed) Bytes() []byte { return buf } -// Write struct list SetupFailed +// SetupFailedListBytes writes a list of %s(MISSING) values to a byte slice. func SetupFailedListBytes(buf []byte, list []SetupFailed) int { b := 0 var structBytes []byte @@ -1627,7 +1607,7 @@ func SetupFailedListBytes(buf []byte, list []SetupFailed) int { return b } -// Struct list size SetupFailed +// SetupFailedListSize computes the size (bytes) of a list of SetupFailed values. func SetupFailedListSize(list []SetupFailed) int { size := 0 for _, item := range list { @@ -1636,8 +1616,6 @@ func SetupFailedListSize(list []SetupFailed) int { return size } -// 'SetupAuthenticate' struct definition -// Size: (8 + xgb.Pad(((int(Length) * 4) * 1))) type SetupAuthenticate struct { Status byte // padding: 5 bytes @@ -1645,7 +1623,7 @@ type SetupAuthenticate struct { Reason string // size: xgb.Pad(((int(Length) * 4) * 1)) } -// Struct read SetupAuthenticate +// SetupAuthenticateRead reads a byte slice into a SetupAuthenticate value. func SetupAuthenticateRead(buf []byte, v *SetupAuthenticate) int { b := 0 @@ -1667,7 +1645,7 @@ func SetupAuthenticateRead(buf []byte, v *SetupAuthenticate) int { return b } -// Struct list read SetupAuthenticate +// SetupAuthenticateReadList reads a byte slice into a list of SetupAuthenticate values. func SetupAuthenticateReadList(buf []byte, dest []SetupAuthenticate) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1677,7 +1655,7 @@ func SetupAuthenticateReadList(buf []byte, dest []SetupAuthenticate) int { return xgb.Pad(b) } -// Struct write SetupAuthenticate +// Bytes writes a SetupAuthenticate value to a byte slice. func (v SetupAuthenticate) Bytes() []byte { buf := make([]byte, (8 + xgb.Pad(((int(v.Length) * 4) * 1)))) b := 0 @@ -1696,7 +1674,7 @@ func (v SetupAuthenticate) Bytes() []byte { return buf } -// Write struct list SetupAuthenticate +// SetupAuthenticateListBytes writes a list of %s(MISSING) values to a byte slice. func SetupAuthenticateListBytes(buf []byte, list []SetupAuthenticate) int { b := 0 var structBytes []byte @@ -1708,7 +1686,7 @@ func SetupAuthenticateListBytes(buf []byte, list []SetupAuthenticate) int { return b } -// Struct list size SetupAuthenticate +// SetupAuthenticateListSize computes the size (bytes) of a list of SetupAuthenticate values. func SetupAuthenticateListSize(list []SetupAuthenticate) int { size := 0 for _, item := range list { @@ -1717,8 +1695,6 @@ func SetupAuthenticateListSize(list []SetupAuthenticate) int { return size } -// 'SetupInfo' struct definition -// Size: (((40 + xgb.Pad((int(VendorLen) * 1))) + xgb.Pad((int(PixmapFormatsLen) * 8))) + ScreenInfoListSize(Roots)) type SetupInfo struct { Status byte // padding: 1 bytes @@ -1745,7 +1721,7 @@ type SetupInfo struct { Roots []ScreenInfo // size: ScreenInfoListSize(Roots) } -// Struct read SetupInfo +// SetupInfoRead reads a byte slice into a SetupInfo value. func SetupInfoRead(buf []byte, v *SetupInfo) int { b := 0 @@ -1823,7 +1799,7 @@ func SetupInfoRead(buf []byte, v *SetupInfo) int { return b } -// Struct list read SetupInfo +// SetupInfoReadList reads a byte slice into a list of SetupInfo values. func SetupInfoReadList(buf []byte, dest []SetupInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1833,7 +1809,7 @@ func SetupInfoReadList(buf []byte, dest []SetupInfo) int { return xgb.Pad(b) } -// Struct write SetupInfo +// Bytes writes a SetupInfo value to a byte slice. func (v SetupInfo) Bytes() []byte { buf := make([]byte, (((40 + xgb.Pad((int(v.VendorLen) * 1))) + xgb.Pad((int(v.PixmapFormatsLen) * 8))) + ScreenInfoListSize(v.Roots))) b := 0 @@ -1906,7 +1882,7 @@ func (v SetupInfo) Bytes() []byte { return buf } -// Write struct list SetupInfo +// SetupInfoListBytes writes a list of %s(MISSING) values to a byte slice. func SetupInfoListBytes(buf []byte, list []SetupInfo) int { b := 0 var structBytes []byte @@ -1918,7 +1894,7 @@ func SetupInfoListBytes(buf []byte, list []SetupInfo) int { return b } -// Struct list size SetupInfo +// SetupInfoListSize computes the size (bytes) of a list of SetupInfo values. func SetupInfoListSize(list []SetupInfo) int { size := 0 for _, item := range list { @@ -1927,15 +1903,13 @@ func SetupInfoListSize(list []SetupInfo) int { return size } -// 'Timecoord' struct definition -// Size: 8 type Timecoord struct { Time Timestamp X int16 Y int16 } -// Struct read Timecoord +// TimecoordRead reads a byte slice into a Timecoord value. func TimecoordRead(buf []byte, v *Timecoord) int { b := 0 @@ -1951,7 +1925,7 @@ func TimecoordRead(buf []byte, v *Timecoord) int { return b } -// Struct list read Timecoord +// TimecoordReadList reads a byte slice into a list of Timecoord values. func TimecoordReadList(buf []byte, dest []Timecoord) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1961,7 +1935,7 @@ func TimecoordReadList(buf []byte, dest []Timecoord) int { return xgb.Pad(b) } -// Struct write Timecoord +// Bytes writes a Timecoord value to a byte slice. func (v Timecoord) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -1978,7 +1952,7 @@ func (v Timecoord) Bytes() []byte { return buf } -// Write struct list Timecoord +// TimecoordListBytes writes a list of %s(MISSING) values to a byte slice. func TimecoordListBytes(buf []byte, list []Timecoord) int { b := 0 var structBytes []byte @@ -1990,14 +1964,12 @@ func TimecoordListBytes(buf []byte, list []Timecoord) int { return b } -// 'Fontprop' struct definition -// Size: 8 type Fontprop struct { Name Atom Value uint32 } -// Struct read Fontprop +// FontpropRead reads a byte slice into a Fontprop value. func FontpropRead(buf []byte, v *Fontprop) int { b := 0 @@ -2010,7 +1982,7 @@ func FontpropRead(buf []byte, v *Fontprop) int { return b } -// Struct list read Fontprop +// FontpropReadList reads a byte slice into a list of Fontprop values. func FontpropReadList(buf []byte, dest []Fontprop) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2020,7 +1992,7 @@ func FontpropReadList(buf []byte, dest []Fontprop) int { return xgb.Pad(b) } -// Struct write Fontprop +// Bytes writes a Fontprop value to a byte slice. func (v Fontprop) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -2034,7 +2006,7 @@ func (v Fontprop) Bytes() []byte { return buf } -// Write struct list Fontprop +// FontpropListBytes writes a list of %s(MISSING) values to a byte slice. func FontpropListBytes(buf []byte, list []Fontprop) int { b := 0 var structBytes []byte @@ -2046,8 +2018,6 @@ func FontpropListBytes(buf []byte, list []Fontprop) int { return b } -// 'Charinfo' struct definition -// Size: 12 type Charinfo struct { LeftSideBearing int16 RightSideBearing int16 @@ -2057,7 +2027,7 @@ type Charinfo struct { Attributes uint16 } -// Struct read Charinfo +// CharinfoRead reads a byte slice into a Charinfo value. func CharinfoRead(buf []byte, v *Charinfo) int { b := 0 @@ -2082,7 +2052,7 @@ func CharinfoRead(buf []byte, v *Charinfo) int { return b } -// Struct list read Charinfo +// CharinfoReadList reads a byte slice into a list of Charinfo values. func CharinfoReadList(buf []byte, dest []Charinfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2092,7 +2062,7 @@ func CharinfoReadList(buf []byte, dest []Charinfo) int { return xgb.Pad(b) } -// Struct write Charinfo +// Bytes writes a Charinfo value to a byte slice. func (v Charinfo) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -2118,7 +2088,7 @@ func (v Charinfo) Bytes() []byte { return buf } -// Write struct list Charinfo +// CharinfoListBytes writes a list of %s(MISSING) values to a byte slice. func CharinfoListBytes(buf []byte, list []Charinfo) int { b := 0 var structBytes []byte @@ -2130,14 +2100,12 @@ func CharinfoListBytes(buf []byte, list []Charinfo) int { return b } -// 'Str' struct definition -// Size: (1 + xgb.Pad((int(NameLen) * 1))) type Str struct { NameLen byte Name string // size: xgb.Pad((int(NameLen) * 1)) } -// Struct read Str +// StrRead reads a byte slice into a Str value. func StrRead(buf []byte, v *Str) int { b := 0 @@ -2154,7 +2122,7 @@ func StrRead(buf []byte, v *Str) int { return b } -// Struct list read Str +// StrReadList reads a byte slice into a list of Str values. func StrReadList(buf []byte, dest []Str) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2164,7 +2132,7 @@ func StrReadList(buf []byte, dest []Str) int { return xgb.Pad(b) } -// Struct write Str +// Bytes writes a Str value to a byte slice. func (v Str) Bytes() []byte { buf := make([]byte, (1 + xgb.Pad((int(v.NameLen) * 1)))) b := 0 @@ -2178,7 +2146,7 @@ func (v Str) Bytes() []byte { return buf } -// Write struct list Str +// StrListBytes writes a list of %s(MISSING) values to a byte slice. func StrListBytes(buf []byte, list []Str) int { b := 0 var structBytes []byte @@ -2190,7 +2158,7 @@ func StrListBytes(buf []byte, list []Str) int { return b } -// Struct list size Str +// StrListSize computes the size (bytes) of a list of Str values. func StrListSize(list []Str) int { size := 0 for _, item := range list { @@ -2199,8 +2167,6 @@ func StrListSize(list []Str) int { return size } -// 'Segment' struct definition -// Size: 8 type Segment struct { X1 int16 Y1 int16 @@ -2208,7 +2174,7 @@ type Segment struct { Y2 int16 } -// Struct read Segment +// SegmentRead reads a byte slice into a Segment value. func SegmentRead(buf []byte, v *Segment) int { b := 0 @@ -2227,7 +2193,7 @@ func SegmentRead(buf []byte, v *Segment) int { return b } -// Struct list read Segment +// SegmentReadList reads a byte slice into a list of Segment values. func SegmentReadList(buf []byte, dest []Segment) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2237,7 +2203,7 @@ func SegmentReadList(buf []byte, dest []Segment) int { return xgb.Pad(b) } -// Struct write Segment +// Bytes writes a Segment value to a byte slice. func (v Segment) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -2257,7 +2223,7 @@ func (v Segment) Bytes() []byte { return buf } -// Write struct list Segment +// SegmentListBytes writes a list of %s(MISSING) values to a byte slice. func SegmentListBytes(buf []byte, list []Segment) int { b := 0 var structBytes []byte @@ -2269,8 +2235,6 @@ func SegmentListBytes(buf []byte, list []Segment) int { return b } -// 'Coloritem' struct definition -// Size: 12 type Coloritem struct { Pixel uint32 Red uint16 @@ -2280,7 +2244,7 @@ type Coloritem struct { // padding: 1 bytes } -// Struct read Coloritem +// ColoritemRead reads a byte slice into a Coloritem value. func ColoritemRead(buf []byte, v *Coloritem) int { b := 0 @@ -2304,7 +2268,7 @@ func ColoritemRead(buf []byte, v *Coloritem) int { return b } -// Struct list read Coloritem +// ColoritemReadList reads a byte slice into a list of Coloritem values. func ColoritemReadList(buf []byte, dest []Coloritem) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2314,7 +2278,7 @@ func ColoritemReadList(buf []byte, dest []Coloritem) int { return xgb.Pad(b) } -// Struct write Coloritem +// Bytes writes a Coloritem value to a byte slice. func (v Coloritem) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -2339,7 +2303,7 @@ func (v Coloritem) Bytes() []byte { return buf } -// Write struct list Coloritem +// ColoritemListBytes writes a list of %s(MISSING) values to a byte slice. func ColoritemListBytes(buf []byte, list []Coloritem) int { b := 0 var structBytes []byte @@ -2351,8 +2315,6 @@ func ColoritemListBytes(buf []byte, list []Coloritem) int { return b } -// 'Rgb' struct definition -// Size: 8 type Rgb struct { Red uint16 Green uint16 @@ -2360,7 +2322,7 @@ type Rgb struct { // padding: 2 bytes } -// Struct read Rgb +// RgbRead reads a byte slice into a Rgb value. func RgbRead(buf []byte, v *Rgb) int { b := 0 @@ -2378,7 +2340,7 @@ func RgbRead(buf []byte, v *Rgb) int { return b } -// Struct list read Rgb +// RgbReadList reads a byte slice into a list of Rgb values. func RgbReadList(buf []byte, dest []Rgb) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2388,7 +2350,7 @@ func RgbReadList(buf []byte, dest []Rgb) int { return xgb.Pad(b) } -// Struct write Rgb +// Bytes writes a Rgb value to a byte slice. func (v Rgb) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -2407,7 +2369,7 @@ func (v Rgb) Bytes() []byte { return buf } -// Write struct list Rgb +// RgbListBytes writes a list of %s(MISSING) values to a byte slice. func RgbListBytes(buf []byte, list []Rgb) int { b := 0 var structBytes []byte @@ -2419,8 +2381,6 @@ func RgbListBytes(buf []byte, list []Rgb) int { return b } -// 'Host' struct definition -// Size: (4 + xgb.Pad((int(AddressLen) * 1))) type Host struct { Family byte // padding: 1 bytes @@ -2428,7 +2388,7 @@ type Host struct { Address []byte // size: xgb.Pad((int(AddressLen) * 1)) } -// Struct read Host +// HostRead reads a byte slice into a Host value. func HostRead(buf []byte, v *Host) int { b := 0 @@ -2447,7 +2407,7 @@ func HostRead(buf []byte, v *Host) int { return b } -// Struct list read Host +// HostReadList reads a byte slice into a list of Host values. func HostReadList(buf []byte, dest []Host) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2457,7 +2417,7 @@ func HostReadList(buf []byte, dest []Host) int { return xgb.Pad(b) } -// Struct write Host +// Bytes writes a Host value to a byte slice. func (v Host) Bytes() []byte { buf := make([]byte, (4 + xgb.Pad((int(v.AddressLen) * 1)))) b := 0 @@ -2476,7 +2436,7 @@ func (v Host) Bytes() []byte { return buf } -// Write struct list Host +// HostListBytes writes a list of %s(MISSING) values to a byte slice. func HostListBytes(buf []byte, list []Host) int { b := 0 var structBytes []byte @@ -2488,7 +2448,7 @@ func HostListBytes(buf []byte, list []Host) int { return b } -// Struct list size Host +// HostListSize computes the size (bytes) of a list of Host values. func HostListSize(list []Host) int { size := 0 for _, item := range list { @@ -2497,7 +2457,7 @@ func HostListSize(list []Host) int { return size } -// Union definition ClientMessageDataUnion +// ClientMessageDataUnion is a represention of the ClientMessageDataUnion union type. // Note that to *create* a Union, you should *never* create // this struct directly (unless you know what you're doing). // Instead use one of the following constructors for 'ClientMessageDataUnion': @@ -2510,7 +2470,7 @@ type ClientMessageDataUnion struct { Data32 []uint32 // size: 20 } -// Union constructor for ClientMessageDataUnion for field Data8. +// ClientMessageDataUnionData8New constructs a new ClientMessageDataUnion union type with the Data8 field. func ClientMessageDataUnionData8New(Data8 []byte) ClientMessageDataUnion { var b int buf := make([]byte, 20) @@ -2547,7 +2507,7 @@ func ClientMessageDataUnionData8New(Data8 []byte) ClientMessageDataUnion { return v } -// Union constructor for ClientMessageDataUnion for field Data16. +// ClientMessageDataUnionData16New constructs a new ClientMessageDataUnion union type with the Data16 field. func ClientMessageDataUnionData16New(Data16 []uint16) ClientMessageDataUnion { var b int buf := make([]byte, 20) @@ -2587,7 +2547,7 @@ func ClientMessageDataUnionData16New(Data16 []uint16) ClientMessageDataUnion { return v } -// Union constructor for ClientMessageDataUnion for field Data32. +// ClientMessageDataUnionData32New constructs a new ClientMessageDataUnion union type with the Data32 field. func ClientMessageDataUnionData32New(Data32 []uint32) ClientMessageDataUnion { var b int buf := make([]byte, 20) @@ -2627,7 +2587,7 @@ func ClientMessageDataUnionData32New(Data32 []uint32) ClientMessageDataUnion { return v } -// Union read ClientMessageDataUnion +// ClientMessageDataUnionRead reads a byte slice into a ClientMessageDataUnion value. func ClientMessageDataUnionRead(buf []byte, v *ClientMessageDataUnion) int { var b int @@ -2655,7 +2615,7 @@ func ClientMessageDataUnionRead(buf []byte, v *ClientMessageDataUnion) int { return 20 } -// Union list read ClientMessageDataUnion +// ClientMessageDataUnionReadList reads a byte slice into a list of ClientMessageDataUnion values. func ClientMessageDataUnionReadList(buf []byte, dest []ClientMessageDataUnion) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2665,7 +2625,7 @@ func ClientMessageDataUnionReadList(buf []byte, dest []ClientMessageDataUnion) i return xgb.Pad(b) } -// Union write ClientMessageDataUnion +// Bytes writes a ClientMessageDataUnion value to a byte slice. // Each field in a union must contain the same data. // So simply pick the first field and write that to the wire. func (v ClientMessageDataUnion) Bytes() []byte { @@ -2677,7 +2637,7 @@ func (v ClientMessageDataUnion) Bytes() []byte { return buf } -// Union list write ClientMessageDataUnion +// ClientMessageDataUnionListBytes writes a list of %s(MISSING) values to a byte slice. func ClientMessageDataUnionListBytes(buf []byte, list []ClientMessageDataUnion) int { b := 0 var unionBytes []byte @@ -2689,9 +2649,7 @@ func ClientMessageDataUnionListBytes(buf []byte, list []ClientMessageDataUnion) return b } -// Event definition KeyPress (2) -// Size: 32 - +// KeyPress is the event number for a KeyPressEvent. const KeyPress = 2 type KeyPressEvent struct { @@ -2710,7 +2668,7 @@ type KeyPressEvent struct { // padding: 1 bytes } -// Event read KeyPress +// KeyPressEventNew constructs a KeyPressEvent value that implements xgb.Event from a byte slice. func KeyPressEventNew(buf []byte) xgb.Event { v := KeyPressEvent{} b := 1 // don't read event number @@ -2760,7 +2718,7 @@ func KeyPressEventNew(buf []byte) xgb.Event { return v } -// Event write KeyPress +// Bytes writes a KeyPressEvent value to a byte slice. func (v KeyPressEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -2813,12 +2771,14 @@ func (v KeyPressEvent) Bytes() []byte { return buf } -func (v KeyPressEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the KeyPress event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v KeyPressEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of KeyPressEvent. func (v KeyPressEvent) String() string { fieldVals := make([]string, 0, 12) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -2840,9 +2800,7 @@ func init() { xgb.NewEventFuncs[2] = KeyPressEventNew } -// Event definition ButtonPress (4) -// Size: 32 - +// ButtonPress is the event number for a ButtonPressEvent. const ButtonPress = 4 type ButtonPressEvent struct { @@ -2861,7 +2819,7 @@ type ButtonPressEvent struct { // padding: 1 bytes } -// Event read ButtonPress +// ButtonPressEventNew constructs a ButtonPressEvent value that implements xgb.Event from a byte slice. func ButtonPressEventNew(buf []byte) xgb.Event { v := ButtonPressEvent{} b := 1 // don't read event number @@ -2911,7 +2869,7 @@ func ButtonPressEventNew(buf []byte) xgb.Event { return v } -// Event write ButtonPress +// Bytes writes a ButtonPressEvent value to a byte slice. func (v ButtonPressEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -2964,12 +2922,14 @@ func (v ButtonPressEvent) Bytes() []byte { return buf } -func (v ButtonPressEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ButtonPress event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ButtonPressEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ButtonPressEvent. func (v ButtonPressEvent) String() string { fieldVals := make([]string, 0, 12) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -2991,9 +2951,7 @@ func init() { xgb.NewEventFuncs[4] = ButtonPressEventNew } -// Event definition MotionNotify (6) -// Size: 32 - +// MotionNotify is the event number for a MotionNotifyEvent. const MotionNotify = 6 type MotionNotifyEvent struct { @@ -3012,7 +2970,7 @@ type MotionNotifyEvent struct { // padding: 1 bytes } -// Event read MotionNotify +// MotionNotifyEventNew constructs a MotionNotifyEvent value that implements xgb.Event from a byte slice. func MotionNotifyEventNew(buf []byte) xgb.Event { v := MotionNotifyEvent{} b := 1 // don't read event number @@ -3062,7 +3020,7 @@ func MotionNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write MotionNotify +// Bytes writes a MotionNotifyEvent value to a byte slice. func (v MotionNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3115,12 +3073,14 @@ func (v MotionNotifyEvent) Bytes() []byte { return buf } -func (v MotionNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the MotionNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v MotionNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of MotionNotifyEvent. func (v MotionNotifyEvent) String() string { fieldVals := make([]string, 0, 12) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3142,9 +3102,7 @@ func init() { xgb.NewEventFuncs[6] = MotionNotifyEventNew } -// Event definition EnterNotify (7) -// Size: 32 - +// EnterNotify is the event number for a EnterNotifyEvent. const EnterNotify = 7 type EnterNotifyEvent struct { @@ -3163,7 +3121,7 @@ type EnterNotifyEvent struct { SameScreenFocus byte } -// Event read EnterNotify +// EnterNotifyEventNew constructs a EnterNotifyEvent value that implements xgb.Event from a byte slice. func EnterNotifyEventNew(buf []byte) xgb.Event { v := EnterNotifyEvent{} b := 1 // don't read event number @@ -3210,7 +3168,7 @@ func EnterNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write EnterNotify +// Bytes writes a EnterNotifyEvent value to a byte slice. func (v EnterNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3260,12 +3218,14 @@ func (v EnterNotifyEvent) Bytes() []byte { return buf } -func (v EnterNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the EnterNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v EnterNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of EnterNotifyEvent. func (v EnterNotifyEvent) String() string { fieldVals := make([]string, 0, 12) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3288,9 +3248,7 @@ func init() { xgb.NewEventFuncs[7] = EnterNotifyEventNew } -// Event definition FocusIn (9) -// Size: 32 - +// FocusIn is the event number for a FocusInEvent. const FocusIn = 9 type FocusInEvent struct { @@ -3301,7 +3259,7 @@ type FocusInEvent struct { // padding: 3 bytes } -// Event read FocusIn +// FocusInEventNew constructs a FocusInEvent value that implements xgb.Event from a byte slice. func FocusInEventNew(buf []byte) xgb.Event { v := FocusInEvent{} b := 1 // don't read event number @@ -3323,7 +3281,7 @@ func FocusInEventNew(buf []byte) xgb.Event { return v } -// Event write FocusIn +// Bytes writes a FocusInEvent value to a byte slice. func (v FocusInEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3348,12 +3306,14 @@ func (v FocusInEvent) Bytes() []byte { return buf } -func (v FocusInEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the FocusIn event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v FocusInEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of FocusInEvent. func (v FocusInEvent) String() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3367,16 +3327,14 @@ func init() { xgb.NewEventFuncs[9] = FocusInEventNew } -// Event definition KeymapNotify (11) -// Size: 32 - +// KeymapNotify is the event number for a KeymapNotifyEvent. const KeymapNotify = 11 type KeymapNotifyEvent struct { Keys []byte // size: 32 } -// Event read KeymapNotify +// KeymapNotifyEventNew constructs a KeymapNotifyEvent value that implements xgb.Event from a byte slice. func KeymapNotifyEventNew(buf []byte) xgb.Event { v := KeymapNotifyEvent{} b := 1 // don't read event number @@ -3388,7 +3346,7 @@ func KeymapNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write KeymapNotify +// Bytes writes a KeymapNotifyEvent value to a byte slice. func (v KeymapNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3403,12 +3361,14 @@ func (v KeymapNotifyEvent) Bytes() []byte { return buf } -func (v KeymapNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the KeymapNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v KeymapNotifyEvent) SequenceId() uint16 { return uint16(0) } +// String is a rudimentary string representation of KeymapNotifyEvent. func (v KeymapNotifyEvent) String() string { fieldVals := make([]string, 0, 1) return "KeymapNotify {" + xgb.StringsJoin(fieldVals, ", ") + "}" @@ -3418,9 +3378,7 @@ func init() { xgb.NewEventFuncs[11] = KeymapNotifyEventNew } -// Event definition Expose (12) -// Size: 32 - +// Expose is the event number for a ExposeEvent. const Expose = 12 type ExposeEvent struct { @@ -3435,7 +3393,7 @@ type ExposeEvent struct { // padding: 2 bytes } -// Event read Expose +// ExposeEventNew constructs a ExposeEvent value that implements xgb.Event from a byte slice. func ExposeEventNew(buf []byte) xgb.Event { v := ExposeEvent{} b := 1 // don't read event number @@ -3468,7 +3426,7 @@ func ExposeEventNew(buf []byte) xgb.Event { return v } -// Event write Expose +// Bytes writes a ExposeEvent value to a byte slice. func (v ExposeEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3504,12 +3462,14 @@ func (v ExposeEvent) Bytes() []byte { return buf } -func (v ExposeEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the Expose event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ExposeEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ExposeEvent. func (v ExposeEvent) String() string { fieldVals := make([]string, 0, 8) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3526,9 +3486,7 @@ func init() { xgb.NewEventFuncs[12] = ExposeEventNew } -// Event definition GraphicsExposure (13) -// Size: 32 - +// GraphicsExposure is the event number for a GraphicsExposureEvent. const GraphicsExposure = 13 type GraphicsExposureEvent struct { @@ -3545,7 +3503,7 @@ type GraphicsExposureEvent struct { // padding: 3 bytes } -// Event read GraphicsExposure +// GraphicsExposureEventNew constructs a GraphicsExposureEvent value that implements xgb.Event from a byte slice. func GraphicsExposureEventNew(buf []byte) xgb.Event { v := GraphicsExposureEvent{} b := 1 // don't read event number @@ -3584,7 +3542,7 @@ func GraphicsExposureEventNew(buf []byte) xgb.Event { return v } -// Event write GraphicsExposure +// Bytes writes a GraphicsExposureEvent value to a byte slice. func (v GraphicsExposureEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3626,12 +3584,14 @@ func (v GraphicsExposureEvent) Bytes() []byte { return buf } -func (v GraphicsExposureEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the GraphicsExposure event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v GraphicsExposureEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of GraphicsExposureEvent. func (v GraphicsExposureEvent) String() string { fieldVals := make([]string, 0, 10) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3650,9 +3610,7 @@ func init() { xgb.NewEventFuncs[13] = GraphicsExposureEventNew } -// Event definition NoExposure (14) -// Size: 32 - +// NoExposure is the event number for a NoExposureEvent. const NoExposure = 14 type NoExposureEvent struct { @@ -3664,7 +3622,7 @@ type NoExposureEvent struct { // padding: 1 bytes } -// Event read NoExposure +// NoExposureEventNew constructs a NoExposureEvent value that implements xgb.Event from a byte slice. func NoExposureEventNew(buf []byte) xgb.Event { v := NoExposureEvent{} b := 1 // don't read event number @@ -3688,7 +3646,7 @@ func NoExposureEventNew(buf []byte) xgb.Event { return v } -// Event write NoExposure +// Bytes writes a NoExposureEvent value to a byte slice. func (v NoExposureEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3715,12 +3673,14 @@ func (v NoExposureEvent) Bytes() []byte { return buf } -func (v NoExposureEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the NoExposure event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v NoExposureEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of NoExposureEvent. func (v NoExposureEvent) String() string { fieldVals := make([]string, 0, 5) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3734,9 +3694,7 @@ func init() { xgb.NewEventFuncs[14] = NoExposureEventNew } -// Event definition VisibilityNotify (15) -// Size: 32 - +// VisibilityNotify is the event number for a VisibilityNotifyEvent. const VisibilityNotify = 15 type VisibilityNotifyEvent struct { @@ -3747,7 +3705,7 @@ type VisibilityNotifyEvent struct { // padding: 3 bytes } -// Event read VisibilityNotify +// VisibilityNotifyEventNew constructs a VisibilityNotifyEvent value that implements xgb.Event from a byte slice. func VisibilityNotifyEventNew(buf []byte) xgb.Event { v := VisibilityNotifyEvent{} b := 1 // don't read event number @@ -3768,7 +3726,7 @@ func VisibilityNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write VisibilityNotify +// Bytes writes a VisibilityNotifyEvent value to a byte slice. func (v VisibilityNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3792,12 +3750,14 @@ func (v VisibilityNotifyEvent) Bytes() []byte { return buf } -func (v VisibilityNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the VisibilityNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v VisibilityNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of VisibilityNotifyEvent. func (v VisibilityNotifyEvent) String() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3810,9 +3770,7 @@ func init() { xgb.NewEventFuncs[15] = VisibilityNotifyEventNew } -// Event definition CreateNotify (16) -// Size: 32 - +// CreateNotify is the event number for a CreateNotifyEvent. const CreateNotify = 16 type CreateNotifyEvent struct { @@ -3829,7 +3787,7 @@ type CreateNotifyEvent struct { // padding: 1 bytes } -// Event read CreateNotify +// CreateNotifyEventNew constructs a CreateNotifyEvent value that implements xgb.Event from a byte slice. func CreateNotifyEventNew(buf []byte) xgb.Event { v := CreateNotifyEvent{} b := 1 // don't read event number @@ -3872,7 +3830,7 @@ func CreateNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write CreateNotify +// Bytes writes a CreateNotifyEvent value to a byte slice. func (v CreateNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3918,12 +3876,14 @@ func (v CreateNotifyEvent) Bytes() []byte { return buf } -func (v CreateNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the CreateNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v CreateNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of CreateNotifyEvent. func (v CreateNotifyEvent) String() string { fieldVals := make([]string, 0, 10) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3942,9 +3902,7 @@ func init() { xgb.NewEventFuncs[16] = CreateNotifyEventNew } -// Event definition DestroyNotify (17) -// Size: 32 - +// DestroyNotify is the event number for a DestroyNotifyEvent. const DestroyNotify = 17 type DestroyNotifyEvent struct { @@ -3954,7 +3912,7 @@ type DestroyNotifyEvent struct { Window Window } -// Event read DestroyNotify +// DestroyNotifyEventNew constructs a DestroyNotifyEvent value that implements xgb.Event from a byte slice. func DestroyNotifyEventNew(buf []byte) xgb.Event { v := DestroyNotifyEvent{} b := 1 // don't read event number @@ -3973,7 +3931,7 @@ func DestroyNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write DestroyNotify +// Bytes writes a DestroyNotifyEvent value to a byte slice. func (v DestroyNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3995,12 +3953,14 @@ func (v DestroyNotifyEvent) Bytes() []byte { return buf } -func (v DestroyNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DestroyNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DestroyNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of DestroyNotifyEvent. func (v DestroyNotifyEvent) String() string { fieldVals := make([]string, 0, 3) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4013,9 +3973,7 @@ func init() { xgb.NewEventFuncs[17] = DestroyNotifyEventNew } -// Event definition UnmapNotify (18) -// Size: 32 - +// UnmapNotify is the event number for a UnmapNotifyEvent. const UnmapNotify = 18 type UnmapNotifyEvent struct { @@ -4027,7 +3985,7 @@ type UnmapNotifyEvent struct { // padding: 3 bytes } -// Event read UnmapNotify +// UnmapNotifyEventNew constructs a UnmapNotifyEvent value that implements xgb.Event from a byte slice. func UnmapNotifyEventNew(buf []byte) xgb.Event { v := UnmapNotifyEvent{} b := 1 // don't read event number @@ -4055,7 +4013,7 @@ func UnmapNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write UnmapNotify +// Bytes writes a UnmapNotifyEvent value to a byte slice. func (v UnmapNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4086,12 +4044,14 @@ func (v UnmapNotifyEvent) Bytes() []byte { return buf } -func (v UnmapNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the UnmapNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v UnmapNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of UnmapNotifyEvent. func (v UnmapNotifyEvent) String() string { fieldVals := make([]string, 0, 5) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4105,9 +4065,7 @@ func init() { xgb.NewEventFuncs[18] = UnmapNotifyEventNew } -// Event definition MapNotify (19) -// Size: 32 - +// MapNotify is the event number for a MapNotifyEvent. const MapNotify = 19 type MapNotifyEvent struct { @@ -4119,7 +4077,7 @@ type MapNotifyEvent struct { // padding: 3 bytes } -// Event read MapNotify +// MapNotifyEventNew constructs a MapNotifyEvent value that implements xgb.Event from a byte slice. func MapNotifyEventNew(buf []byte) xgb.Event { v := MapNotifyEvent{} b := 1 // don't read event number @@ -4147,7 +4105,7 @@ func MapNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write MapNotify +// Bytes writes a MapNotifyEvent value to a byte slice. func (v MapNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4178,12 +4136,14 @@ func (v MapNotifyEvent) Bytes() []byte { return buf } -func (v MapNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the MapNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v MapNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of MapNotifyEvent. func (v MapNotifyEvent) String() string { fieldVals := make([]string, 0, 5) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4197,9 +4157,7 @@ func init() { xgb.NewEventFuncs[19] = MapNotifyEventNew } -// Event definition MapRequest (20) -// Size: 32 - +// MapRequest is the event number for a MapRequestEvent. const MapRequest = 20 type MapRequestEvent struct { @@ -4209,7 +4167,7 @@ type MapRequestEvent struct { Window Window } -// Event read MapRequest +// MapRequestEventNew constructs a MapRequestEvent value that implements xgb.Event from a byte slice. func MapRequestEventNew(buf []byte) xgb.Event { v := MapRequestEvent{} b := 1 // don't read event number @@ -4228,7 +4186,7 @@ func MapRequestEventNew(buf []byte) xgb.Event { return v } -// Event write MapRequest +// Bytes writes a MapRequestEvent value to a byte slice. func (v MapRequestEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4250,12 +4208,14 @@ func (v MapRequestEvent) Bytes() []byte { return buf } -func (v MapRequestEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the MapRequest event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v MapRequestEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of MapRequestEvent. func (v MapRequestEvent) String() string { fieldVals := make([]string, 0, 3) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4268,9 +4228,7 @@ func init() { xgb.NewEventFuncs[20] = MapRequestEventNew } -// Event definition ReparentNotify (21) -// Size: 32 - +// ReparentNotify is the event number for a ReparentNotifyEvent. const ReparentNotify = 21 type ReparentNotifyEvent struct { @@ -4285,7 +4243,7 @@ type ReparentNotifyEvent struct { // padding: 3 bytes } -// Event read ReparentNotify +// ReparentNotifyEventNew constructs a ReparentNotifyEvent value that implements xgb.Event from a byte slice. func ReparentNotifyEventNew(buf []byte) xgb.Event { v := ReparentNotifyEvent{} b := 1 // don't read event number @@ -4322,7 +4280,7 @@ func ReparentNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write ReparentNotify +// Bytes writes a ReparentNotifyEvent value to a byte slice. func (v ReparentNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4362,12 +4320,14 @@ func (v ReparentNotifyEvent) Bytes() []byte { return buf } -func (v ReparentNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ReparentNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ReparentNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ReparentNotifyEvent. func (v ReparentNotifyEvent) String() string { fieldVals := make([]string, 0, 8) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4384,9 +4344,7 @@ func init() { xgb.NewEventFuncs[21] = ReparentNotifyEventNew } -// Event definition ConfigureNotify (22) -// Size: 32 - +// ConfigureNotify is the event number for a ConfigureNotifyEvent. const ConfigureNotify = 22 type ConfigureNotifyEvent struct { @@ -4404,7 +4362,7 @@ type ConfigureNotifyEvent struct { // padding: 1 bytes } -// Event read ConfigureNotify +// ConfigureNotifyEventNew constructs a ConfigureNotifyEvent value that implements xgb.Event from a byte slice. func ConfigureNotifyEventNew(buf []byte) xgb.Event { v := ConfigureNotifyEvent{} b := 1 // don't read event number @@ -4450,7 +4408,7 @@ func ConfigureNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write ConfigureNotify +// Bytes writes a ConfigureNotifyEvent value to a byte slice. func (v ConfigureNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4499,12 +4457,14 @@ func (v ConfigureNotifyEvent) Bytes() []byte { return buf } -func (v ConfigureNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ConfigureNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ConfigureNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ConfigureNotifyEvent. func (v ConfigureNotifyEvent) String() string { fieldVals := make([]string, 0, 11) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4524,9 +4484,7 @@ func init() { xgb.NewEventFuncs[22] = ConfigureNotifyEventNew } -// Event definition ConfigureRequest (23) -// Size: 32 - +// ConfigureRequest is the event number for a ConfigureRequestEvent. const ConfigureRequest = 23 type ConfigureRequestEvent struct { @@ -4543,7 +4501,7 @@ type ConfigureRequestEvent struct { ValueMask uint16 } -// Event read ConfigureRequest +// ConfigureRequestEventNew constructs a ConfigureRequestEvent value that implements xgb.Event from a byte slice. func ConfigureRequestEventNew(buf []byte) xgb.Event { v := ConfigureRequestEvent{} b := 1 // don't read event number @@ -4584,7 +4542,7 @@ func ConfigureRequestEventNew(buf []byte) xgb.Event { return v } -// Event write ConfigureRequest +// Bytes writes a ConfigureRequestEvent value to a byte slice. func (v ConfigureRequestEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4628,12 +4586,14 @@ func (v ConfigureRequestEvent) Bytes() []byte { return buf } -func (v ConfigureRequestEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ConfigureRequest event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ConfigureRequestEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ConfigureRequestEvent. func (v ConfigureRequestEvent) String() string { fieldVals := make([]string, 0, 10) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4654,9 +4614,7 @@ func init() { xgb.NewEventFuncs[23] = ConfigureRequestEventNew } -// Event definition GravityNotify (24) -// Size: 32 - +// GravityNotify is the event number for a GravityNotifyEvent. const GravityNotify = 24 type GravityNotifyEvent struct { @@ -4668,7 +4626,7 @@ type GravityNotifyEvent struct { Y int16 } -// Event read GravityNotify +// GravityNotifyEventNew constructs a GravityNotifyEvent value that implements xgb.Event from a byte slice. func GravityNotifyEventNew(buf []byte) xgb.Event { v := GravityNotifyEvent{} b := 1 // don't read event number @@ -4693,7 +4651,7 @@ func GravityNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write GravityNotify +// Bytes writes a GravityNotifyEvent value to a byte slice. func (v GravityNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4721,12 +4679,14 @@ func (v GravityNotifyEvent) Bytes() []byte { return buf } -func (v GravityNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the GravityNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v GravityNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of GravityNotifyEvent. func (v GravityNotifyEvent) String() string { fieldVals := make([]string, 0, 5) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4741,9 +4701,7 @@ func init() { xgb.NewEventFuncs[24] = GravityNotifyEventNew } -// Event definition ResizeRequest (25) -// Size: 32 - +// ResizeRequest is the event number for a ResizeRequestEvent. const ResizeRequest = 25 type ResizeRequestEvent struct { @@ -4754,7 +4712,7 @@ type ResizeRequestEvent struct { Height uint16 } -// Event read ResizeRequest +// ResizeRequestEventNew constructs a ResizeRequestEvent value that implements xgb.Event from a byte slice. func ResizeRequestEventNew(buf []byte) xgb.Event { v := ResizeRequestEvent{} b := 1 // don't read event number @@ -4776,7 +4734,7 @@ func ResizeRequestEventNew(buf []byte) xgb.Event { return v } -// Event write ResizeRequest +// Bytes writes a ResizeRequestEvent value to a byte slice. func (v ResizeRequestEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4801,12 +4759,14 @@ func (v ResizeRequestEvent) Bytes() []byte { return buf } -func (v ResizeRequestEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ResizeRequest event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ResizeRequestEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ResizeRequestEvent. func (v ResizeRequestEvent) String() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4820,9 +4780,7 @@ func init() { xgb.NewEventFuncs[25] = ResizeRequestEventNew } -// Event definition CirculateNotify (26) -// Size: 32 - +// CirculateNotify is the event number for a CirculateNotifyEvent. const CirculateNotify = 26 type CirculateNotifyEvent struct { @@ -4835,7 +4793,7 @@ type CirculateNotifyEvent struct { // padding: 3 bytes } -// Event read CirculateNotify +// CirculateNotifyEventNew constructs a CirculateNotifyEvent value that implements xgb.Event from a byte slice. func CirculateNotifyEventNew(buf []byte) xgb.Event { v := CirculateNotifyEvent{} b := 1 // don't read event number @@ -4861,7 +4819,7 @@ func CirculateNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write CirculateNotify +// Bytes writes a CirculateNotifyEvent value to a byte slice. func (v CirculateNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4890,12 +4848,14 @@ func (v CirculateNotifyEvent) Bytes() []byte { return buf } -func (v CirculateNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the CirculateNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v CirculateNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of CirculateNotifyEvent. func (v CirculateNotifyEvent) String() string { fieldVals := make([]string, 0, 6) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4909,9 +4869,7 @@ func init() { xgb.NewEventFuncs[26] = CirculateNotifyEventNew } -// Event definition PropertyNotify (28) -// Size: 32 - +// PropertyNotify is the event number for a PropertyNotifyEvent. const PropertyNotify = 28 type PropertyNotifyEvent struct { @@ -4924,7 +4882,7 @@ type PropertyNotifyEvent struct { // padding: 3 bytes } -// Event read PropertyNotify +// PropertyNotifyEventNew constructs a PropertyNotifyEvent value that implements xgb.Event from a byte slice. func PropertyNotifyEventNew(buf []byte) xgb.Event { v := PropertyNotifyEvent{} b := 1 // don't read event number @@ -4951,7 +4909,7 @@ func PropertyNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write PropertyNotify +// Bytes writes a PropertyNotifyEvent value to a byte slice. func (v PropertyNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4981,12 +4939,14 @@ func (v PropertyNotifyEvent) Bytes() []byte { return buf } -func (v PropertyNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the PropertyNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v PropertyNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of PropertyNotifyEvent. func (v PropertyNotifyEvent) String() string { fieldVals := make([]string, 0, 6) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -5001,9 +4961,7 @@ func init() { xgb.NewEventFuncs[28] = PropertyNotifyEventNew } -// Event definition SelectionClear (29) -// Size: 32 - +// SelectionClear is the event number for a SelectionClearEvent. const SelectionClear = 29 type SelectionClearEvent struct { @@ -5014,7 +4972,7 @@ type SelectionClearEvent struct { Selection Atom } -// Event read SelectionClear +// SelectionClearEventNew constructs a SelectionClearEvent value that implements xgb.Event from a byte slice. func SelectionClearEventNew(buf []byte) xgb.Event { v := SelectionClearEvent{} b := 1 // don't read event number @@ -5036,7 +4994,7 @@ func SelectionClearEventNew(buf []byte) xgb.Event { return v } -// Event write SelectionClear +// Bytes writes a SelectionClearEvent value to a byte slice. func (v SelectionClearEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -5061,12 +5019,14 @@ func (v SelectionClearEvent) Bytes() []byte { return buf } -func (v SelectionClearEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the SelectionClear event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v SelectionClearEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of SelectionClearEvent. func (v SelectionClearEvent) String() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -5080,9 +5040,7 @@ func init() { xgb.NewEventFuncs[29] = SelectionClearEventNew } -// Event definition SelectionRequest (30) -// Size: 32 - +// SelectionRequest is the event number for a SelectionRequestEvent. const SelectionRequest = 30 type SelectionRequestEvent struct { @@ -5096,7 +5054,7 @@ type SelectionRequestEvent struct { Property Atom } -// Event read SelectionRequest +// SelectionRequestEventNew constructs a SelectionRequestEvent value that implements xgb.Event from a byte slice. func SelectionRequestEventNew(buf []byte) xgb.Event { v := SelectionRequestEvent{} b := 1 // don't read event number @@ -5127,7 +5085,7 @@ func SelectionRequestEventNew(buf []byte) xgb.Event { return v } -// Event write SelectionRequest +// Bytes writes a SelectionRequestEvent value to a byte slice. func (v SelectionRequestEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -5161,12 +5119,14 @@ func (v SelectionRequestEvent) Bytes() []byte { return buf } -func (v SelectionRequestEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the SelectionRequest event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v SelectionRequestEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of SelectionRequestEvent. func (v SelectionRequestEvent) String() string { fieldVals := make([]string, 0, 7) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -5183,9 +5143,7 @@ func init() { xgb.NewEventFuncs[30] = SelectionRequestEventNew } -// Event definition SelectionNotify (31) -// Size: 32 - +// SelectionNotify is the event number for a SelectionNotifyEvent. const SelectionNotify = 31 type SelectionNotifyEvent struct { @@ -5198,7 +5156,7 @@ type SelectionNotifyEvent struct { Property Atom } -// Event read SelectionNotify +// SelectionNotifyEventNew constructs a SelectionNotifyEvent value that implements xgb.Event from a byte slice. func SelectionNotifyEventNew(buf []byte) xgb.Event { v := SelectionNotifyEvent{} b := 1 // don't read event number @@ -5226,7 +5184,7 @@ func SelectionNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write SelectionNotify +// Bytes writes a SelectionNotifyEvent value to a byte slice. func (v SelectionNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -5257,12 +5215,14 @@ func (v SelectionNotifyEvent) Bytes() []byte { return buf } -func (v SelectionNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the SelectionNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v SelectionNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of SelectionNotifyEvent. func (v SelectionNotifyEvent) String() string { fieldVals := make([]string, 0, 6) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -5278,9 +5238,7 @@ func init() { xgb.NewEventFuncs[31] = SelectionNotifyEventNew } -// Event definition ColormapNotify (32) -// Size: 32 - +// ColormapNotify is the event number for a ColormapNotifyEvent. const ColormapNotify = 32 type ColormapNotifyEvent struct { @@ -5293,7 +5251,7 @@ type ColormapNotifyEvent struct { // padding: 2 bytes } -// Event read ColormapNotify +// ColormapNotifyEventNew constructs a ColormapNotifyEvent value that implements xgb.Event from a byte slice. func ColormapNotifyEventNew(buf []byte) xgb.Event { v := ColormapNotifyEvent{} b := 1 // don't read event number @@ -5324,7 +5282,7 @@ func ColormapNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write ColormapNotify +// Bytes writes a ColormapNotifyEvent value to a byte slice. func (v ColormapNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -5358,12 +5316,14 @@ func (v ColormapNotifyEvent) Bytes() []byte { return buf } -func (v ColormapNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ColormapNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ColormapNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ColormapNotifyEvent. func (v ColormapNotifyEvent) String() string { fieldVals := make([]string, 0, 6) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -5378,9 +5338,7 @@ func init() { xgb.NewEventFuncs[32] = ColormapNotifyEventNew } -// Event definition ClientMessage (33) -// Size: 32 - +// ClientMessage is the event number for a ClientMessageEvent. const ClientMessage = 33 type ClientMessageEvent struct { @@ -5391,7 +5349,7 @@ type ClientMessageEvent struct { Data ClientMessageDataUnion } -// Event read ClientMessage +// ClientMessageEventNew constructs a ClientMessageEvent value that implements xgb.Event from a byte slice. func ClientMessageEventNew(buf []byte) xgb.Event { v := ClientMessageEvent{} b := 1 // don't read event number @@ -5414,7 +5372,7 @@ func ClientMessageEventNew(buf []byte) xgb.Event { return v } -// Event write ClientMessage +// Bytes writes a ClientMessageEvent value to a byte slice. func (v ClientMessageEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -5443,12 +5401,14 @@ func (v ClientMessageEvent) Bytes() []byte { return buf } -func (v ClientMessageEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ClientMessage event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ClientMessageEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ClientMessageEvent. func (v ClientMessageEvent) String() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -5462,9 +5422,7 @@ func init() { xgb.NewEventFuncs[33] = ClientMessageEventNew } -// Event definition MappingNotify (34) -// Size: 32 - +// MappingNotify is the event number for a MappingNotifyEvent. const MappingNotify = 34 type MappingNotifyEvent struct { @@ -5476,7 +5434,7 @@ type MappingNotifyEvent struct { // padding: 1 bytes } -// Event read MappingNotify +// MappingNotifyEventNew constructs a MappingNotifyEvent value that implements xgb.Event from a byte slice. func MappingNotifyEventNew(buf []byte) xgb.Event { v := MappingNotifyEvent{} b := 1 // don't read event number @@ -5500,7 +5458,7 @@ func MappingNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write MappingNotify +// Bytes writes a MappingNotifyEvent value to a byte slice. func (v MappingNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -5527,12 +5485,14 @@ func (v MappingNotifyEvent) Bytes() []byte { return buf } -func (v MappingNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the MappingNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v MappingNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of MappingNotifyEvent. func (v MappingNotifyEvent) String() string { fieldVals := make([]string, 0, 5) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -5546,22 +5506,24 @@ func init() { xgb.NewEventFuncs[34] = MappingNotifyEventNew } -// EventCopy definition KeyRelease (3) - +// KeyRelease is the event number for a KeyReleaseEvent. const KeyRelease = 3 type KeyReleaseEvent KeyPressEvent +// KeyReleaseEventNew constructs a KeyReleaseEvent value that implements xgb.Event from a byte slice. func KeyReleaseEventNew(buf []byte) xgb.Event { return KeyReleaseEvent(KeyPressEventNew(buf).(KeyPressEvent)) } +// Bytes writes a KeyReleaseEvent value to a byte slice. func (v KeyReleaseEvent) Bytes() []byte { return KeyPressEvent(v).Bytes() } -func (v KeyReleaseEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the KeyRelease event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v KeyReleaseEvent) SequenceId() uint16 { return v.Sequence } @@ -5587,22 +5549,24 @@ func init() { xgb.NewEventFuncs[3] = KeyReleaseEventNew } -// EventCopy definition ButtonRelease (5) - +// ButtonRelease is the event number for a ButtonReleaseEvent. const ButtonRelease = 5 type ButtonReleaseEvent ButtonPressEvent +// ButtonReleaseEventNew constructs a ButtonReleaseEvent value that implements xgb.Event from a byte slice. func ButtonReleaseEventNew(buf []byte) xgb.Event { return ButtonReleaseEvent(ButtonPressEventNew(buf).(ButtonPressEvent)) } +// Bytes writes a ButtonReleaseEvent value to a byte slice. func (v ButtonReleaseEvent) Bytes() []byte { return ButtonPressEvent(v).Bytes() } -func (v ButtonReleaseEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ButtonRelease event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ButtonReleaseEvent) SequenceId() uint16 { return v.Sequence } @@ -5628,22 +5592,24 @@ func init() { xgb.NewEventFuncs[5] = ButtonReleaseEventNew } -// EventCopy definition LeaveNotify (8) - +// LeaveNotify is the event number for a LeaveNotifyEvent. const LeaveNotify = 8 type LeaveNotifyEvent EnterNotifyEvent +// LeaveNotifyEventNew constructs a LeaveNotifyEvent value that implements xgb.Event from a byte slice. func LeaveNotifyEventNew(buf []byte) xgb.Event { return LeaveNotifyEvent(EnterNotifyEventNew(buf).(EnterNotifyEvent)) } +// Bytes writes a LeaveNotifyEvent value to a byte slice. func (v LeaveNotifyEvent) Bytes() []byte { return EnterNotifyEvent(v).Bytes() } -func (v LeaveNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the LeaveNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v LeaveNotifyEvent) SequenceId() uint16 { return v.Sequence } @@ -5670,22 +5636,24 @@ func init() { xgb.NewEventFuncs[8] = LeaveNotifyEventNew } -// EventCopy definition FocusOut (10) - +// FocusOut is the event number for a FocusOutEvent. const FocusOut = 10 type FocusOutEvent FocusInEvent +// FocusOutEventNew constructs a FocusOutEvent value that implements xgb.Event from a byte slice. func FocusOutEventNew(buf []byte) xgb.Event { return FocusOutEvent(FocusInEventNew(buf).(FocusInEvent)) } +// Bytes writes a FocusOutEvent value to a byte slice. func (v FocusOutEvent) Bytes() []byte { return FocusInEvent(v).Bytes() } -func (v FocusOutEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the FocusOut event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v FocusOutEvent) SequenceId() uint16 { return v.Sequence } @@ -5703,22 +5671,24 @@ func init() { xgb.NewEventFuncs[10] = FocusOutEventNew } -// EventCopy definition CirculateRequest (27) - +// CirculateRequest is the event number for a CirculateRequestEvent. const CirculateRequest = 27 type CirculateRequestEvent CirculateNotifyEvent +// CirculateRequestEventNew constructs a CirculateRequestEvent value that implements xgb.Event from a byte slice. func CirculateRequestEventNew(buf []byte) xgb.Event { return CirculateRequestEvent(CirculateNotifyEventNew(buf).(CirculateNotifyEvent)) } +// Bytes writes a CirculateRequestEvent value to a byte slice. func (v CirculateRequestEvent) Bytes() []byte { return CirculateNotifyEvent(v).Bytes() } -func (v CirculateRequestEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the CirculateRequest event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v CirculateRequestEvent) SequenceId() uint16 { return v.Sequence } @@ -5736,9 +5706,7 @@ func init() { xgb.NewEventFuncs[27] = CirculateRequestEventNew } -// Error definition Request (1) -// Size: 32 - +// BadRequest is the error number for a BadRequest. const BadRequest = 1 type RequestError struct { @@ -5750,7 +5718,7 @@ type RequestError struct { // padding: 1 bytes } -// Error read Request +// RequestErrorNew constructs a RequestError value that implements xgb.Error from a byte slice. func RequestErrorNew(buf []byte) xgb.Error { v := RequestError{} v.NiceName = "Request" @@ -5775,8 +5743,8 @@ func RequestErrorNew(buf []byte) xgb.Error { return v } -func (err RequestError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadRequest error. +// This is mostly used internally. func (err RequestError) SequenceId() uint16 { return err.Sequence } @@ -5799,9 +5767,7 @@ func init() { xgb.NewErrorFuncs[1] = RequestErrorNew } -// Error definition Value (2) -// Size: 32 - +// BadValue is the error number for a BadValue. const BadValue = 2 type ValueError struct { @@ -5813,7 +5779,7 @@ type ValueError struct { // padding: 1 bytes } -// Error read Value +// ValueErrorNew constructs a ValueError value that implements xgb.Error from a byte slice. func ValueErrorNew(buf []byte) xgb.Error { v := ValueError{} v.NiceName = "Value" @@ -5838,8 +5804,8 @@ func ValueErrorNew(buf []byte) xgb.Error { return v } -func (err ValueError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadValue error. +// This is mostly used internally. func (err ValueError) SequenceId() uint16 { return err.Sequence } @@ -5862,20 +5828,20 @@ func init() { xgb.NewErrorFuncs[2] = ValueErrorNew } -// ErrorCopy definition Window (3) - +// BadWindow is the error number for a BadWindow. const BadWindow = 3 type WindowError ValueError +// WindowErrorNew constructs a WindowError value that implements xgb.Error from a byte slice. func WindowErrorNew(buf []byte) xgb.Error { v := WindowError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Window" return v } -func (err WindowError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadWindow error. +// This is mostly used internally. func (err WindowError) SequenceId() uint16 { return err.Sequence } @@ -5898,20 +5864,20 @@ func init() { xgb.NewErrorFuncs[3] = WindowErrorNew } -// ErrorCopy definition Pixmap (4) - +// BadPixmap is the error number for a BadPixmap. const BadPixmap = 4 type PixmapError ValueError +// PixmapErrorNew constructs a PixmapError value that implements xgb.Error from a byte slice. func PixmapErrorNew(buf []byte) xgb.Error { v := PixmapError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Pixmap" return v } -func (err PixmapError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadPixmap error. +// This is mostly used internally. func (err PixmapError) SequenceId() uint16 { return err.Sequence } @@ -5934,20 +5900,20 @@ func init() { xgb.NewErrorFuncs[4] = PixmapErrorNew } -// ErrorCopy definition Atom (5) - +// BadAtom is the error number for a BadAtom. const BadAtom = 5 type AtomError ValueError +// AtomErrorNew constructs a AtomError value that implements xgb.Error from a byte slice. func AtomErrorNew(buf []byte) xgb.Error { v := AtomError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Atom" return v } -func (err AtomError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadAtom error. +// This is mostly used internally. func (err AtomError) SequenceId() uint16 { return err.Sequence } @@ -5970,20 +5936,20 @@ func init() { xgb.NewErrorFuncs[5] = AtomErrorNew } -// ErrorCopy definition Cursor (6) - +// BadCursor is the error number for a BadCursor. const BadCursor = 6 type CursorError ValueError +// CursorErrorNew constructs a CursorError value that implements xgb.Error from a byte slice. func CursorErrorNew(buf []byte) xgb.Error { v := CursorError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Cursor" return v } -func (err CursorError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadCursor error. +// This is mostly used internally. func (err CursorError) SequenceId() uint16 { return err.Sequence } @@ -6006,20 +5972,20 @@ func init() { xgb.NewErrorFuncs[6] = CursorErrorNew } -// ErrorCopy definition Font (7) - +// BadFont is the error number for a BadFont. const BadFont = 7 type FontError ValueError +// FontErrorNew constructs a FontError value that implements xgb.Error from a byte slice. func FontErrorNew(buf []byte) xgb.Error { v := FontError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Font" return v } -func (err FontError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadFont error. +// This is mostly used internally. func (err FontError) SequenceId() uint16 { return err.Sequence } @@ -6042,20 +6008,20 @@ func init() { xgb.NewErrorFuncs[7] = FontErrorNew } -// ErrorCopy definition Match (8) - +// BadMatch is the error number for a BadMatch. const BadMatch = 8 type MatchError RequestError +// MatchErrorNew constructs a MatchError value that implements xgb.Error from a byte slice. func MatchErrorNew(buf []byte) xgb.Error { v := MatchError(RequestErrorNew(buf).(RequestError)) v.NiceName = "Match" return v } -func (err MatchError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadMatch error. +// This is mostly used internally. func (err MatchError) SequenceId() uint16 { return err.Sequence } @@ -6078,20 +6044,20 @@ func init() { xgb.NewErrorFuncs[8] = MatchErrorNew } -// ErrorCopy definition Drawable (9) - +// BadDrawable is the error number for a BadDrawable. const BadDrawable = 9 type DrawableError ValueError +// DrawableErrorNew constructs a DrawableError value that implements xgb.Error from a byte slice. func DrawableErrorNew(buf []byte) xgb.Error { v := DrawableError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Drawable" return v } -func (err DrawableError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadDrawable error. +// This is mostly used internally. func (err DrawableError) SequenceId() uint16 { return err.Sequence } @@ -6114,20 +6080,20 @@ func init() { xgb.NewErrorFuncs[9] = DrawableErrorNew } -// ErrorCopy definition Access (10) - +// BadAccess is the error number for a BadAccess. const BadAccess = 10 type AccessError RequestError +// AccessErrorNew constructs a AccessError value that implements xgb.Error from a byte slice. func AccessErrorNew(buf []byte) xgb.Error { v := AccessError(RequestErrorNew(buf).(RequestError)) v.NiceName = "Access" return v } -func (err AccessError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadAccess error. +// This is mostly used internally. func (err AccessError) SequenceId() uint16 { return err.Sequence } @@ -6150,20 +6116,20 @@ func init() { xgb.NewErrorFuncs[10] = AccessErrorNew } -// ErrorCopy definition Alloc (11) - +// BadAlloc is the error number for a BadAlloc. const BadAlloc = 11 type AllocError RequestError +// AllocErrorNew constructs a AllocError value that implements xgb.Error from a byte slice. func AllocErrorNew(buf []byte) xgb.Error { v := AllocError(RequestErrorNew(buf).(RequestError)) v.NiceName = "Alloc" return v } -func (err AllocError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadAlloc error. +// This is mostly used internally. func (err AllocError) SequenceId() uint16 { return err.Sequence } @@ -6186,20 +6152,20 @@ func init() { xgb.NewErrorFuncs[11] = AllocErrorNew } -// ErrorCopy definition Colormap (12) - +// BadColormap is the error number for a BadColormap. const BadColormap = 12 type ColormapError ValueError +// ColormapErrorNew constructs a ColormapError value that implements xgb.Error from a byte slice. func ColormapErrorNew(buf []byte) xgb.Error { v := ColormapError(ValueErrorNew(buf).(ValueError)) v.NiceName = "Colormap" return v } -func (err ColormapError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadColormap error. +// This is mostly used internally. func (err ColormapError) SequenceId() uint16 { return err.Sequence } @@ -6222,20 +6188,20 @@ func init() { xgb.NewErrorFuncs[12] = ColormapErrorNew } -// ErrorCopy definition GContext (13) - +// BadGContext is the error number for a BadGContext. const BadGContext = 13 type GContextError ValueError +// GContextErrorNew constructs a GContextError value that implements xgb.Error from a byte slice. func GContextErrorNew(buf []byte) xgb.Error { v := GContextError(ValueErrorNew(buf).(ValueError)) v.NiceName = "GContext" return v } -func (err GContextError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadGContext error. +// This is mostly used internally. func (err GContextError) SequenceId() uint16 { return err.Sequence } @@ -6258,20 +6224,20 @@ func init() { xgb.NewErrorFuncs[13] = GContextErrorNew } -// ErrorCopy definition IDChoice (14) - +// BadIDChoice is the error number for a BadIDChoice. const BadIDChoice = 14 type IDChoiceError ValueError +// IDChoiceErrorNew constructs a IDChoiceError value that implements xgb.Error from a byte slice. func IDChoiceErrorNew(buf []byte) xgb.Error { v := IDChoiceError(ValueErrorNew(buf).(ValueError)) v.NiceName = "IDChoice" return v } -func (err IDChoiceError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadIDChoice error. +// This is mostly used internally. func (err IDChoiceError) SequenceId() uint16 { return err.Sequence } @@ -6294,20 +6260,20 @@ func init() { xgb.NewErrorFuncs[14] = IDChoiceErrorNew } -// ErrorCopy definition Name (15) - +// BadName is the error number for a BadName. const BadName = 15 type NameError RequestError +// NameErrorNew constructs a NameError value that implements xgb.Error from a byte slice. func NameErrorNew(buf []byte) xgb.Error { v := NameError(RequestErrorNew(buf).(RequestError)) v.NiceName = "Name" return v } -func (err NameError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadName error. +// This is mostly used internally. func (err NameError) SequenceId() uint16 { return err.Sequence } @@ -6330,20 +6296,20 @@ func init() { xgb.NewErrorFuncs[15] = NameErrorNew } -// ErrorCopy definition Length (16) - +// BadLength is the error number for a BadLength. const BadLength = 16 type LengthError RequestError +// LengthErrorNew constructs a LengthError value that implements xgb.Error from a byte slice. func LengthErrorNew(buf []byte) xgb.Error { v := LengthError(RequestErrorNew(buf).(RequestError)) v.NiceName = "Length" return v } -func (err LengthError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadLength error. +// This is mostly used internally. func (err LengthError) SequenceId() uint16 { return err.Sequence } @@ -6366,20 +6332,20 @@ func init() { xgb.NewErrorFuncs[16] = LengthErrorNew } -// ErrorCopy definition Implementation (17) - +// BadImplementation is the error number for a BadImplementation. const BadImplementation = 17 type ImplementationError RequestError +// ImplementationErrorNew constructs a ImplementationError value that implements xgb.Error from a byte slice. func ImplementationErrorNew(buf []byte) xgb.Error { v := ImplementationError(RequestErrorNew(buf).(RequestError)) v.NiceName = "Implementation" return v } -func (err ImplementationError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadImplementation error. +// This is mostly used internally. func (err ImplementationError) SequenceId() uint16 { return err.Sequence } @@ -6402,30 +6368,35 @@ func init() { xgb.NewErrorFuncs[17] = ImplementationErrorNew } -// Request CreateWindow -// size: xgb.Pad((28 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// CreateWindowCookie is a cookie used only for CreateWindow requests. type CreateWindowCookie struct { *xgb.Cookie } -// Write request to wire for CreateWindow +// CreateWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateWindow(c *xgb.Conn, Depth byte, Wid Window, Parent Window, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) CreateWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(createWindowRequest(c, Depth, Wid, Parent, X, Y, Width, Height, BorderWidth, Class, Visual, ValueMask, ValueList), cookie) return CreateWindowCookie{cookie} } +// CreateWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateWindowCookie.Check() func CreateWindowChecked(c *xgb.Conn, Depth byte, Wid Window, Parent Window, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) CreateWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(createWindowRequest(c, Depth, Wid, Parent, X, Y, Width, Height, BorderWidth, Class, Visual, ValueMask, ValueList), cookie) return CreateWindowCookie{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 CreateWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateWindow +// createWindowRequest writes a CreateWindow request to a byte slice. func createWindowRequest(c *xgb.Conn, Depth byte, Wid Window, Parent Window, X int16, Y int16, Width uint16, Height uint16, BorderWidth uint16, Class uint16, Visual Visualid, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((28 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 @@ -6478,30 +6449,35 @@ func createWindowRequest(c *xgb.Conn, Depth byte, Wid Window, Parent Window, X i return buf } -// Request ChangeWindowAttributes -// size: xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// ChangeWindowAttributesCookie is a cookie used only for ChangeWindowAttributes requests. type ChangeWindowAttributesCookie struct { *xgb.Cookie } -// Write request to wire for ChangeWindowAttributes +// ChangeWindowAttributes sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeWindowAttributes(c *xgb.Conn, Window Window, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeWindowAttributesRequest(c, Window, ValueMask, ValueList), cookie) return ChangeWindowAttributesCookie{cookie} } +// ChangeWindowAttributesChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeWindowAttributesCookie.Check() func ChangeWindowAttributesChecked(c *xgb.Conn, Window Window, ValueMask uint32, ValueList []uint32) ChangeWindowAttributesCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeWindowAttributesRequest(c, Window, ValueMask, ValueList), cookie) return ChangeWindowAttributesCookie{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 ChangeWindowAttributesCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeWindowAttributes +// changeWindowAttributesRequest writes a ChangeWindowAttributes request to a byte slice. func changeWindowAttributesRequest(c *xgb.Conn, Window Window, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 @@ -6529,29 +6505,31 @@ func changeWindowAttributesRequest(c *xgb.Conn, Window Window, ValueMask uint32, return buf } -// Request GetWindowAttributes -// size: 8 +// GetWindowAttributesCookie is a cookie used only for GetWindowAttributes requests. type GetWindowAttributesCookie struct { *xgb.Cookie } +// GetWindowAttributes sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetWindowAttributesCookie.Reply() func GetWindowAttributes(c *xgb.Conn, Window Window) GetWindowAttributesCookie { cookie := c.NewCookie(true, true) c.NewRequest(getWindowAttributesRequest(c, Window), cookie) return GetWindowAttributesCookie{cookie} } +// GetWindowAttributesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetWindowAttributesUnchecked(c *xgb.Conn, Window Window) GetWindowAttributesCookie { cookie := c.NewCookie(false, true) c.NewRequest(getWindowAttributesRequest(c, Window), cookie) return GetWindowAttributesCookie{cookie} } -// Request reply for GetWindowAttributes -// size: 44 +// GetWindowAttributesReply represents the data returned from a GetWindowAttributes request. type GetWindowAttributesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply BackingStore byte Visual Visualid Class uint16 @@ -6570,7 +6548,7 @@ type GetWindowAttributesReply struct { // padding: 2 bytes } -// Waits and reads reply data from request GetWindowAttributes +// Reply blocks and returns the reply data for a GetWindowAttributes request. func (cook GetWindowAttributesCookie) Reply() (*GetWindowAttributesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6582,7 +6560,7 @@ func (cook GetWindowAttributesCookie) Reply() (*GetWindowAttributesReply, error) return getWindowAttributesReply(buf), nil } -// Read reply into structure from buffer for GetWindowAttributes +// getWindowAttributesReply reads a byte slice into a GetWindowAttributesReply value. func getWindowAttributesReply(buf []byte) *GetWindowAttributesReply { v := new(GetWindowAttributesReply) b := 1 // skip reply determinant @@ -6656,6 +6634,7 @@ func getWindowAttributesReply(buf []byte) *GetWindowAttributesReply { } // Write request to wire for GetWindowAttributes +// getWindowAttributesRequest writes a GetWindowAttributes request to a byte slice. func getWindowAttributesRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -6675,30 +6654,35 @@ func getWindowAttributesRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request DestroyWindow -// size: 8 +// DestroyWindowCookie is a cookie used only for DestroyWindow requests. type DestroyWindowCookie struct { *xgb.Cookie } -// Write request to wire for DestroyWindow +// DestroyWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroyWindow(c *xgb.Conn, Window Window) DestroyWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroyWindowRequest(c, Window), cookie) return DestroyWindowCookie{cookie} } +// DestroyWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroyWindowCookie.Check() func DestroyWindowChecked(c *xgb.Conn, Window Window) DestroyWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroyWindowRequest(c, Window), cookie) return DestroyWindowCookie{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 DestroyWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroyWindow +// destroyWindowRequest writes a DestroyWindow request to a byte slice. func destroyWindowRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -6718,30 +6702,35 @@ func destroyWindowRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request DestroySubwindows -// size: 8 +// DestroySubwindowsCookie is a cookie used only for DestroySubwindows requests. type DestroySubwindowsCookie struct { *xgb.Cookie } -// Write request to wire for DestroySubwindows +// DestroySubwindows sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DestroySubwindows(c *xgb.Conn, Window Window) DestroySubwindowsCookie { cookie := c.NewCookie(false, false) c.NewRequest(destroySubwindowsRequest(c, Window), cookie) return DestroySubwindowsCookie{cookie} } +// DestroySubwindowsChecked sends a checked request. +// If an error occurs, it can be retrieved using DestroySubwindowsCookie.Check() func DestroySubwindowsChecked(c *xgb.Conn, Window Window) DestroySubwindowsCookie { cookie := c.NewCookie(true, false) c.NewRequest(destroySubwindowsRequest(c, Window), cookie) return DestroySubwindowsCookie{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 DestroySubwindowsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DestroySubwindows +// destroySubwindowsRequest writes a DestroySubwindows request to a byte slice. func destroySubwindowsRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -6761,30 +6750,35 @@ func destroySubwindowsRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request ChangeSaveSet -// size: 8 +// ChangeSaveSetCookie is a cookie used only for ChangeSaveSet requests. type ChangeSaveSetCookie struct { *xgb.Cookie } -// Write request to wire for ChangeSaveSet +// ChangeSaveSet sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeSaveSet(c *xgb.Conn, Mode byte, Window Window) ChangeSaveSetCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeSaveSetRequest(c, Mode, Window), cookie) return ChangeSaveSetCookie{cookie} } +// ChangeSaveSetChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeSaveSetCookie.Check() func ChangeSaveSetChecked(c *xgb.Conn, Mode byte, Window Window) ChangeSaveSetCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeSaveSetRequest(c, Mode, Window), cookie) return ChangeSaveSetCookie{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 ChangeSaveSetCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeSaveSet +// changeSaveSetRequest writes a ChangeSaveSet request to a byte slice. func changeSaveSetRequest(c *xgb.Conn, Mode byte, Window Window) []byte { size := 8 b := 0 @@ -6805,30 +6799,35 @@ func changeSaveSetRequest(c *xgb.Conn, Mode byte, Window Window) []byte { return buf } -// Request ReparentWindow -// size: 16 +// ReparentWindowCookie is a cookie used only for ReparentWindow requests. type ReparentWindowCookie struct { *xgb.Cookie } -// Write request to wire for ReparentWindow +// ReparentWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ReparentWindow(c *xgb.Conn, Window Window, Parent Window, X int16, Y int16) ReparentWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(reparentWindowRequest(c, Window, Parent, X, Y), cookie) return ReparentWindowCookie{cookie} } +// ReparentWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using ReparentWindowCookie.Check() func ReparentWindowChecked(c *xgb.Conn, Window Window, Parent Window, X int16, Y int16) ReparentWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(reparentWindowRequest(c, Window, Parent, X, Y), cookie) return ReparentWindowCookie{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 ReparentWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ReparentWindow +// reparentWindowRequest writes a ReparentWindow request to a byte slice. func reparentWindowRequest(c *xgb.Conn, Window Window, Parent Window, X int16, Y int16) []byte { size := 16 b := 0 @@ -6857,30 +6856,35 @@ func reparentWindowRequest(c *xgb.Conn, Window Window, Parent Window, X int16, Y return buf } -// Request MapWindow -// size: 8 +// MapWindowCookie is a cookie used only for MapWindow requests. type MapWindowCookie struct { *xgb.Cookie } -// Write request to wire for MapWindow +// MapWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func MapWindow(c *xgb.Conn, Window Window) MapWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(mapWindowRequest(c, Window), cookie) return MapWindowCookie{cookie} } +// MapWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using MapWindowCookie.Check() func MapWindowChecked(c *xgb.Conn, Window Window) MapWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(mapWindowRequest(c, Window), cookie) return MapWindowCookie{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 MapWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for MapWindow +// mapWindowRequest writes a MapWindow request to a byte slice. func mapWindowRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -6900,30 +6904,35 @@ func mapWindowRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request MapSubwindows -// size: 8 +// MapSubwindowsCookie is a cookie used only for MapSubwindows requests. type MapSubwindowsCookie struct { *xgb.Cookie } -// Write request to wire for MapSubwindows +// MapSubwindows sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func MapSubwindows(c *xgb.Conn, Window Window) MapSubwindowsCookie { cookie := c.NewCookie(false, false) c.NewRequest(mapSubwindowsRequest(c, Window), cookie) return MapSubwindowsCookie{cookie} } +// MapSubwindowsChecked sends a checked request. +// If an error occurs, it can be retrieved using MapSubwindowsCookie.Check() func MapSubwindowsChecked(c *xgb.Conn, Window Window) MapSubwindowsCookie { cookie := c.NewCookie(true, false) c.NewRequest(mapSubwindowsRequest(c, Window), cookie) return MapSubwindowsCookie{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 MapSubwindowsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for MapSubwindows +// mapSubwindowsRequest writes a MapSubwindows request to a byte slice. func mapSubwindowsRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -6943,30 +6952,35 @@ func mapSubwindowsRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request UnmapWindow -// size: 8 +// UnmapWindowCookie is a cookie used only for UnmapWindow requests. type UnmapWindowCookie struct { *xgb.Cookie } -// Write request to wire for UnmapWindow +// UnmapWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnmapWindow(c *xgb.Conn, Window Window) UnmapWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(unmapWindowRequest(c, Window), cookie) return UnmapWindowCookie{cookie} } +// UnmapWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using UnmapWindowCookie.Check() func UnmapWindowChecked(c *xgb.Conn, Window Window) UnmapWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(unmapWindowRequest(c, Window), cookie) return UnmapWindowCookie{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 UnmapWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UnmapWindow +// unmapWindowRequest writes a UnmapWindow request to a byte slice. func unmapWindowRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -6986,30 +7000,35 @@ func unmapWindowRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request UnmapSubwindows -// size: 8 +// UnmapSubwindowsCookie is a cookie used only for UnmapSubwindows requests. type UnmapSubwindowsCookie struct { *xgb.Cookie } -// Write request to wire for UnmapSubwindows +// UnmapSubwindows sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UnmapSubwindows(c *xgb.Conn, Window Window) UnmapSubwindowsCookie { cookie := c.NewCookie(false, false) c.NewRequest(unmapSubwindowsRequest(c, Window), cookie) return UnmapSubwindowsCookie{cookie} } +// UnmapSubwindowsChecked sends a checked request. +// If an error occurs, it can be retrieved using UnmapSubwindowsCookie.Check() func UnmapSubwindowsChecked(c *xgb.Conn, Window Window) UnmapSubwindowsCookie { cookie := c.NewCookie(true, false) c.NewRequest(unmapSubwindowsRequest(c, Window), cookie) return UnmapSubwindowsCookie{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 UnmapSubwindowsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UnmapSubwindows +// unmapSubwindowsRequest writes a UnmapSubwindows request to a byte slice. func unmapSubwindowsRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -7029,30 +7048,35 @@ func unmapSubwindowsRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request ConfigureWindow -// size: xgb.Pad((10 + (2 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// ConfigureWindowCookie is a cookie used only for ConfigureWindow requests. type ConfigureWindowCookie struct { *xgb.Cookie } -// Write request to wire for ConfigureWindow +// ConfigureWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ConfigureWindow(c *xgb.Conn, Window Window, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(configureWindowRequest(c, Window, ValueMask, ValueList), cookie) return ConfigureWindowCookie{cookie} } +// ConfigureWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using ConfigureWindowCookie.Check() func ConfigureWindowChecked(c *xgb.Conn, Window Window, ValueMask uint16, ValueList []uint32) ConfigureWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(configureWindowRequest(c, Window, ValueMask, ValueList), cookie) return ConfigureWindowCookie{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 ConfigureWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ConfigureWindow +// configureWindowRequest writes a ConfigureWindow request to a byte slice. func configureWindowRequest(c *xgb.Conn, Window Window, ValueMask uint16, ValueList []uint32) []byte { size := xgb.Pad((10 + (2 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 @@ -7083,30 +7107,35 @@ func configureWindowRequest(c *xgb.Conn, Window Window, ValueMask uint16, ValueL return buf } -// Request CirculateWindow -// size: 8 +// CirculateWindowCookie is a cookie used only for CirculateWindow requests. type CirculateWindowCookie struct { *xgb.Cookie } -// Write request to wire for CirculateWindow +// CirculateWindow sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CirculateWindow(c *xgb.Conn, Direction byte, Window Window) CirculateWindowCookie { cookie := c.NewCookie(false, false) c.NewRequest(circulateWindowRequest(c, Direction, Window), cookie) return CirculateWindowCookie{cookie} } +// CirculateWindowChecked sends a checked request. +// If an error occurs, it can be retrieved using CirculateWindowCookie.Check() func CirculateWindowChecked(c *xgb.Conn, Direction byte, Window Window) CirculateWindowCookie { cookie := c.NewCookie(true, false) c.NewRequest(circulateWindowRequest(c, Direction, Window), cookie) return CirculateWindowCookie{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 CirculateWindowCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CirculateWindow +// circulateWindowRequest writes a CirculateWindow request to a byte slice. func circulateWindowRequest(c *xgb.Conn, Direction byte, Window Window) []byte { size := 8 b := 0 @@ -7127,29 +7156,31 @@ func circulateWindowRequest(c *xgb.Conn, Direction byte, Window Window) []byte { return buf } -// Request GetGeometry -// size: 8 +// GetGeometryCookie is a cookie used only for GetGeometry requests. type GetGeometryCookie struct { *xgb.Cookie } +// GetGeometry sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetGeometryCookie.Reply() func GetGeometry(c *xgb.Conn, Drawable Drawable) GetGeometryCookie { cookie := c.NewCookie(true, true) c.NewRequest(getGeometryRequest(c, Drawable), cookie) return GetGeometryCookie{cookie} } +// GetGeometryUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetGeometryUnchecked(c *xgb.Conn, Drawable Drawable) GetGeometryCookie { cookie := c.NewCookie(false, true) c.NewRequest(getGeometryRequest(c, Drawable), cookie) return GetGeometryCookie{cookie} } -// Request reply for GetGeometry -// size: 24 +// GetGeometryReply represents the data returned from a GetGeometry request. type GetGeometryReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Depth byte Root Window X int16 @@ -7160,7 +7191,7 @@ type GetGeometryReply struct { // padding: 2 bytes } -// Waits and reads reply data from request GetGeometry +// Reply blocks and returns the reply data for a GetGeometry request. func (cook GetGeometryCookie) Reply() (*GetGeometryReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7172,7 +7203,7 @@ func (cook GetGeometryCookie) Reply() (*GetGeometryReply, error) { return getGeometryReply(buf), nil } -// Read reply into structure from buffer for GetGeometry +// getGeometryReply reads a byte slice into a GetGeometryReply value. func getGeometryReply(buf []byte) *GetGeometryReply { v := new(GetGeometryReply) b := 1 // skip reply determinant @@ -7210,6 +7241,7 @@ func getGeometryReply(buf []byte) *GetGeometryReply { } // Write request to wire for GetGeometry +// getGeometryRequest writes a GetGeometry request to a byte slice. func getGeometryRequest(c *xgb.Conn, Drawable Drawable) []byte { size := 8 b := 0 @@ -7229,29 +7261,31 @@ func getGeometryRequest(c *xgb.Conn, Drawable Drawable) []byte { return buf } -// Request QueryTree -// size: 8 +// QueryTreeCookie is a cookie used only for QueryTree requests. type QueryTreeCookie struct { *xgb.Cookie } +// QueryTree sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryTreeCookie.Reply() func QueryTree(c *xgb.Conn, Window Window) QueryTreeCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryTreeRequest(c, Window), cookie) return QueryTreeCookie{cookie} } +// QueryTreeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryTreeUnchecked(c *xgb.Conn, Window Window) QueryTreeCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryTreeRequest(c, Window), cookie) return QueryTreeCookie{cookie} } -// Request reply for QueryTree -// size: (32 + xgb.Pad((int(ChildrenLen) * 4))) +// QueryTreeReply represents the data returned from a QueryTree request. type QueryTreeReply 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 Root Window Parent Window @@ -7260,7 +7294,7 @@ type QueryTreeReply struct { Children []Window // size: xgb.Pad((int(ChildrenLen) * 4)) } -// Waits and reads reply data from request QueryTree +// Reply blocks and returns the reply data for a QueryTree request. func (cook QueryTreeCookie) Reply() (*QueryTreeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7272,7 +7306,7 @@ func (cook QueryTreeCookie) Reply() (*QueryTreeReply, error) { return queryTreeReply(buf), nil } -// Read reply into structure from buffer for QueryTree +// queryTreeReply reads a byte slice into a QueryTreeReply value. func queryTreeReply(buf []byte) *QueryTreeReply { v := new(QueryTreeReply) b := 1 // skip reply determinant @@ -7307,6 +7341,7 @@ func queryTreeReply(buf []byte) *QueryTreeReply { } // Write request to wire for QueryTree +// queryTreeRequest writes a QueryTree request to a byte slice. func queryTreeRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -7326,34 +7361,36 @@ func queryTreeRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request InternAtom -// size: xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) +// InternAtomCookie is a cookie used only for InternAtom requests. type InternAtomCookie struct { *xgb.Cookie } +// InternAtom sends a checked request. +// If an error occurs, it will be returned with the reply by calling InternAtomCookie.Reply() func InternAtom(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name string) InternAtomCookie { cookie := c.NewCookie(true, true) c.NewRequest(internAtomRequest(c, OnlyIfExists, NameLen, Name), cookie) return InternAtomCookie{cookie} } +// InternAtomUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func InternAtomUnchecked(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name string) InternAtomCookie { cookie := c.NewCookie(false, true) c.NewRequest(internAtomRequest(c, OnlyIfExists, NameLen, Name), cookie) return InternAtomCookie{cookie} } -// Request reply for InternAtom -// size: 12 +// InternAtomReply represents the data returned from a InternAtom request. type InternAtomReply 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 Atom Atom } -// Waits and reads reply data from request InternAtom +// Reply blocks and returns the reply data for a InternAtom request. func (cook InternAtomCookie) Reply() (*InternAtomReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7365,7 +7402,7 @@ func (cook InternAtomCookie) Reply() (*InternAtomReply, error) { return internAtomReply(buf), nil } -// Read reply into structure from buffer for InternAtom +// internAtomReply reads a byte slice into a InternAtomReply value. func internAtomReply(buf []byte) *InternAtomReply { v := new(InternAtomReply) b := 1 // skip reply determinant @@ -7385,6 +7422,7 @@ func internAtomReply(buf []byte) *InternAtomReply { } // Write request to wire for InternAtom +// internAtomRequest writes a InternAtom request to a byte slice. func internAtomRequest(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name string) []byte { size := xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -7414,36 +7452,38 @@ func internAtomRequest(c *xgb.Conn, OnlyIfExists bool, NameLen uint16, Name stri return buf } -// Request GetAtomName -// size: 8 +// GetAtomNameCookie is a cookie used only for GetAtomName requests. type GetAtomNameCookie struct { *xgb.Cookie } +// GetAtomName sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetAtomNameCookie.Reply() func GetAtomName(c *xgb.Conn, Atom Atom) GetAtomNameCookie { cookie := c.NewCookie(true, true) c.NewRequest(getAtomNameRequest(c, Atom), cookie) return GetAtomNameCookie{cookie} } +// GetAtomNameUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetAtomNameUnchecked(c *xgb.Conn, Atom Atom) GetAtomNameCookie { cookie := c.NewCookie(false, true) c.NewRequest(getAtomNameRequest(c, Atom), cookie) return GetAtomNameCookie{cookie} } -// Request reply for GetAtomName -// size: (32 + xgb.Pad((int(NameLen) * 1))) +// GetAtomNameReply represents the data returned from a GetAtomName request. type GetAtomNameReply 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 NameLen uint16 // padding: 22 bytes Name string // size: xgb.Pad((int(NameLen) * 1)) } -// Waits and reads reply data from request GetAtomName +// Reply blocks and returns the reply data for a GetAtomName request. func (cook GetAtomNameCookie) Reply() (*GetAtomNameReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7455,7 +7495,7 @@ func (cook GetAtomNameCookie) Reply() (*GetAtomNameReply, error) { return getAtomNameReply(buf), nil } -// Read reply into structure from buffer for GetAtomName +// getAtomNameReply reads a byte slice into a GetAtomNameReply value. func getAtomNameReply(buf []byte) *GetAtomNameReply { v := new(GetAtomNameReply) b := 1 // skip reply determinant @@ -7484,6 +7524,7 @@ func getAtomNameReply(buf []byte) *GetAtomNameReply { } // Write request to wire for GetAtomName +// getAtomNameRequest writes a GetAtomName request to a byte slice. func getAtomNameRequest(c *xgb.Conn, Atom Atom) []byte { size := 8 b := 0 @@ -7503,30 +7544,35 @@ func getAtomNameRequest(c *xgb.Conn, Atom Atom) []byte { return buf } -// Request ChangeProperty -// size: xgb.Pad((24 + xgb.Pad((((int(DataLen) * int(Format)) / 8) * 1)))) +// ChangePropertyCookie is a cookie used only for ChangeProperty requests. type ChangePropertyCookie struct { *xgb.Cookie } -// Write request to wire for ChangeProperty +// ChangeProperty sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeProperty(c *xgb.Conn, Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { cookie := c.NewCookie(false, false) c.NewRequest(changePropertyRequest(c, Mode, Window, Property, Type, Format, DataLen, Data), cookie) return ChangePropertyCookie{cookie} } +// ChangePropertyChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangePropertyCookie.Check() func ChangePropertyChecked(c *xgb.Conn, Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) ChangePropertyCookie { cookie := c.NewCookie(true, false) c.NewRequest(changePropertyRequest(c, Mode, Window, Property, Type, Format, DataLen, Data), cookie) return ChangePropertyCookie{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 ChangePropertyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeProperty +// changePropertyRequest writes a ChangeProperty request to a byte slice. func changePropertyRequest(c *xgb.Conn, Mode byte, Window Window, Property Atom, Type Atom, Format byte, DataLen uint32, Data []byte) []byte { size := xgb.Pad((24 + xgb.Pad((((int(DataLen) * int(Format)) / 8) * 1)))) b := 0 @@ -7564,30 +7610,35 @@ func changePropertyRequest(c *xgb.Conn, Mode byte, Window Window, Property Atom, return buf } -// Request DeleteProperty -// size: 12 +// DeletePropertyCookie is a cookie used only for DeleteProperty requests. type DeletePropertyCookie struct { *xgb.Cookie } -// Write request to wire for DeleteProperty +// DeleteProperty sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeleteProperty(c *xgb.Conn, Window Window, Property Atom) DeletePropertyCookie { cookie := c.NewCookie(false, false) c.NewRequest(deletePropertyRequest(c, Window, Property), cookie) return DeletePropertyCookie{cookie} } +// DeletePropertyChecked sends a checked request. +// If an error occurs, it can be retrieved using DeletePropertyCookie.Check() func DeletePropertyChecked(c *xgb.Conn, Window Window, Property Atom) DeletePropertyCookie { cookie := c.NewCookie(true, false) c.NewRequest(deletePropertyRequest(c, Window, Property), cookie) return DeletePropertyCookie{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 DeletePropertyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DeleteProperty +// deletePropertyRequest writes a DeleteProperty request to a byte slice. func deletePropertyRequest(c *xgb.Conn, Window Window, Property Atom) []byte { size := 12 b := 0 @@ -7610,29 +7661,31 @@ func deletePropertyRequest(c *xgb.Conn, Window Window, Property Atom) []byte { return buf } -// Request GetProperty -// size: 24 +// GetPropertyCookie is a cookie used only for GetProperty requests. type GetPropertyCookie struct { *xgb.Cookie } +// GetProperty sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPropertyCookie.Reply() func GetProperty(c *xgb.Conn, Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) GetPropertyCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPropertyRequest(c, Delete, Window, Property, Type, LongOffset, LongLength), cookie) return GetPropertyCookie{cookie} } +// GetPropertyUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPropertyUnchecked(c *xgb.Conn, Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) GetPropertyCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPropertyRequest(c, Delete, Window, Property, Type, LongOffset, LongLength), cookie) return GetPropertyCookie{cookie} } -// Request reply for GetProperty -// size: (32 + xgb.Pad(((int(ValueLen) * (int(Format) / 8)) * 1))) +// GetPropertyReply represents the data returned from a GetProperty request. type GetPropertyReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Format byte Type Atom BytesAfter uint32 @@ -7641,7 +7694,7 @@ type GetPropertyReply struct { Value []byte // size: xgb.Pad(((int(ValueLen) * (int(Format) / 8)) * 1)) } -// Waits and reads reply data from request GetProperty +// Reply blocks and returns the reply data for a GetProperty request. func (cook GetPropertyCookie) Reply() (*GetPropertyReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7653,7 +7706,7 @@ func (cook GetPropertyCookie) Reply() (*GetPropertyReply, error) { return getPropertyReply(buf), nil } -// Read reply into structure from buffer for GetProperty +// getPropertyReply reads a byte slice into a GetPropertyReply value. func getPropertyReply(buf []byte) *GetPropertyReply { v := new(GetPropertyReply) b := 1 // skip reply determinant @@ -7686,6 +7739,7 @@ func getPropertyReply(buf []byte) *GetPropertyReply { } // Write request to wire for GetProperty +// getPropertyRequest writes a GetProperty request to a byte slice. func getPropertyRequest(c *xgb.Conn, Delete bool, Window Window, Property Atom, Type Atom, LongOffset uint32, LongLength uint32) []byte { size := 24 b := 0 @@ -7722,36 +7776,38 @@ func getPropertyRequest(c *xgb.Conn, Delete bool, Window Window, Property Atom, 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 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 Window) ListPropertiesCookie { cookie := c.NewCookie(false, true) c.NewRequest(listPropertiesRequest(c, Window), cookie) return ListPropertiesCookie{cookie} } -// Request reply for ListProperties -// size: (32 + xgb.Pad((int(AtomsLen) * 4))) +// 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 AtomsLen uint16 // padding: 22 bytes Atoms []Atom // size: xgb.Pad((int(AtomsLen) * 4)) } -// 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 { @@ -7763,7 +7819,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 @@ -7792,6 +7848,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 Window) []byte { size := 8 b := 0 @@ -7811,30 +7868,35 @@ func listPropertiesRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request SetSelectionOwner -// size: 16 +// SetSelectionOwnerCookie is a cookie used only for SetSelectionOwner requests. type SetSelectionOwnerCookie struct { *xgb.Cookie } -// Write request to wire for SetSelectionOwner +// SetSelectionOwner sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetSelectionOwner(c *xgb.Conn, Owner Window, Selection Atom, Time Timestamp) SetSelectionOwnerCookie { cookie := c.NewCookie(false, false) c.NewRequest(setSelectionOwnerRequest(c, Owner, Selection, Time), cookie) return SetSelectionOwnerCookie{cookie} } +// SetSelectionOwnerChecked sends a checked request. +// If an error occurs, it can be retrieved using SetSelectionOwnerCookie.Check() func SetSelectionOwnerChecked(c *xgb.Conn, Owner Window, Selection Atom, Time Timestamp) SetSelectionOwnerCookie { cookie := c.NewCookie(true, false) c.NewRequest(setSelectionOwnerRequest(c, Owner, Selection, Time), cookie) return SetSelectionOwnerCookie{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 SetSelectionOwnerCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetSelectionOwner +// setSelectionOwnerRequest writes a SetSelectionOwner request to a byte slice. func setSelectionOwnerRequest(c *xgb.Conn, Owner Window, Selection Atom, Time Timestamp) []byte { size := 16 b := 0 @@ -7860,34 +7922,36 @@ func setSelectionOwnerRequest(c *xgb.Conn, Owner Window, Selection Atom, Time Ti return buf } -// Request GetSelectionOwner -// size: 8 +// GetSelectionOwnerCookie is a cookie used only for GetSelectionOwner requests. type GetSelectionOwnerCookie struct { *xgb.Cookie } +// GetSelectionOwner sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetSelectionOwnerCookie.Reply() func GetSelectionOwner(c *xgb.Conn, Selection Atom) GetSelectionOwnerCookie { cookie := c.NewCookie(true, true) c.NewRequest(getSelectionOwnerRequest(c, Selection), cookie) return GetSelectionOwnerCookie{cookie} } +// GetSelectionOwnerUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectionOwnerUnchecked(c *xgb.Conn, Selection Atom) GetSelectionOwnerCookie { cookie := c.NewCookie(false, true) c.NewRequest(getSelectionOwnerRequest(c, Selection), cookie) return GetSelectionOwnerCookie{cookie} } -// Request reply for GetSelectionOwner -// size: 12 +// GetSelectionOwnerReply represents the data returned from a GetSelectionOwner request. type GetSelectionOwnerReply 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 Owner Window } -// Waits and reads reply data from request GetSelectionOwner +// Reply blocks and returns the reply data for a GetSelectionOwner request. func (cook GetSelectionOwnerCookie) Reply() (*GetSelectionOwnerReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7899,7 +7963,7 @@ func (cook GetSelectionOwnerCookie) Reply() (*GetSelectionOwnerReply, error) { return getSelectionOwnerReply(buf), nil } -// Read reply into structure from buffer for GetSelectionOwner +// getSelectionOwnerReply reads a byte slice into a GetSelectionOwnerReply value. func getSelectionOwnerReply(buf []byte) *GetSelectionOwnerReply { v := new(GetSelectionOwnerReply) b := 1 // skip reply determinant @@ -7919,6 +7983,7 @@ func getSelectionOwnerReply(buf []byte) *GetSelectionOwnerReply { } // Write request to wire for GetSelectionOwner +// getSelectionOwnerRequest writes a GetSelectionOwner request to a byte slice. func getSelectionOwnerRequest(c *xgb.Conn, Selection Atom) []byte { size := 8 b := 0 @@ -7938,30 +8003,35 @@ func getSelectionOwnerRequest(c *xgb.Conn, Selection Atom) []byte { return buf } -// Request ConvertSelection -// size: 24 +// ConvertSelectionCookie is a cookie used only for ConvertSelection requests. type ConvertSelectionCookie struct { *xgb.Cookie } -// Write request to wire for ConvertSelection +// ConvertSelection sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ConvertSelection(c *xgb.Conn, Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) ConvertSelectionCookie { cookie := c.NewCookie(false, false) c.NewRequest(convertSelectionRequest(c, Requestor, Selection, Target, Property, Time), cookie) return ConvertSelectionCookie{cookie} } +// ConvertSelectionChecked sends a checked request. +// If an error occurs, it can be retrieved using ConvertSelectionCookie.Check() func ConvertSelectionChecked(c *xgb.Conn, Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) ConvertSelectionCookie { cookie := c.NewCookie(true, false) c.NewRequest(convertSelectionRequest(c, Requestor, Selection, Target, Property, Time), cookie) return ConvertSelectionCookie{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 ConvertSelectionCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ConvertSelection +// convertSelectionRequest writes a ConvertSelection request to a byte slice. func convertSelectionRequest(c *xgb.Conn, Requestor Window, Selection Atom, Target Atom, Property Atom, Time Timestamp) []byte { size := 24 b := 0 @@ -7993,30 +8063,35 @@ func convertSelectionRequest(c *xgb.Conn, Requestor Window, Selection Atom, Targ return buf } -// Request SendEvent -// size: 44 +// SendEventCookie is a cookie used only for SendEvent requests. type SendEventCookie struct { *xgb.Cookie } -// Write request to wire for SendEvent +// SendEvent sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SendEvent(c *xgb.Conn, Propagate bool, Destination Window, EventMask uint32, Event string) SendEventCookie { cookie := c.NewCookie(false, false) c.NewRequest(sendEventRequest(c, Propagate, Destination, EventMask, Event), cookie) return SendEventCookie{cookie} } +// SendEventChecked sends a checked request. +// If an error occurs, it can be retrieved using SendEventCookie.Check() func SendEventChecked(c *xgb.Conn, Propagate bool, Destination Window, EventMask uint32, Event string) SendEventCookie { cookie := c.NewCookie(true, false) c.NewRequest(sendEventRequest(c, Propagate, Destination, EventMask, Event), cookie) return SendEventCookie{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 SendEventCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SendEvent +// sendEventRequest writes a SendEvent request to a byte slice. func sendEventRequest(c *xgb.Conn, Propagate bool, Destination Window, EventMask uint32, Event string) []byte { size := 44 b := 0 @@ -8047,33 +8122,35 @@ func sendEventRequest(c *xgb.Conn, Propagate bool, Destination Window, EventMask return buf } -// Request GrabPointer -// size: 24 +// GrabPointerCookie is a cookie used only for GrabPointer requests. type GrabPointerCookie struct { *xgb.Cookie } +// GrabPointer sends a checked request. +// If an error occurs, it will be returned with the reply by calling GrabPointerCookie.Reply() func GrabPointer(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Time Timestamp) GrabPointerCookie { cookie := c.NewCookie(true, true) c.NewRequest(grabPointerRequest(c, OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Time), cookie) return GrabPointerCookie{cookie} } +// GrabPointerUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabPointerUnchecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Time Timestamp) GrabPointerCookie { cookie := c.NewCookie(false, true) c.NewRequest(grabPointerRequest(c, OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Time), cookie) return GrabPointerCookie{cookie} } -// Request reply for GrabPointer -// size: 8 +// GrabPointerReply represents the data returned from a GrabPointer request. type GrabPointerReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Status byte } -// Waits and reads reply data from request GrabPointer +// Reply blocks and returns the reply data for a GrabPointer request. func (cook GrabPointerCookie) Reply() (*GrabPointerReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8085,7 +8162,7 @@ func (cook GrabPointerCookie) Reply() (*GrabPointerReply, error) { return grabPointerReply(buf), nil } -// Read reply into structure from buffer for GrabPointer +// grabPointerReply reads a byte slice into a GrabPointerReply value. func grabPointerReply(buf []byte) *GrabPointerReply { v := new(GrabPointerReply) b := 1 // skip reply determinant @@ -8103,6 +8180,7 @@ func grabPointerReply(buf []byte) *GrabPointerReply { } // Write request to wire for GrabPointer +// grabPointerRequest writes a GrabPointer request to a byte slice. func grabPointerRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Time Timestamp) []byte { size := 24 b := 0 @@ -8145,30 +8223,35 @@ func grabPointerRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventM return buf } -// Request UngrabPointer -// size: 8 +// UngrabPointerCookie is a cookie used only for UngrabPointer requests. type UngrabPointerCookie struct { *xgb.Cookie } -// Write request to wire for UngrabPointer +// UngrabPointer sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabPointer(c *xgb.Conn, Time Timestamp) UngrabPointerCookie { cookie := c.NewCookie(false, false) c.NewRequest(ungrabPointerRequest(c, Time), cookie) return UngrabPointerCookie{cookie} } +// UngrabPointerChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabPointerCookie.Check() func UngrabPointerChecked(c *xgb.Conn, Time Timestamp) UngrabPointerCookie { cookie := c.NewCookie(true, false) c.NewRequest(ungrabPointerRequest(c, Time), cookie) return UngrabPointerCookie{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 UngrabPointerCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UngrabPointer +// ungrabPointerRequest writes a UngrabPointer request to a byte slice. func ungrabPointerRequest(c *xgb.Conn, Time Timestamp) []byte { size := 8 b := 0 @@ -8188,30 +8271,35 @@ func ungrabPointerRequest(c *xgb.Conn, Time Timestamp) []byte { return buf } -// Request GrabButton -// size: 24 +// GrabButtonCookie is a cookie used only for GrabButton requests. type GrabButtonCookie struct { *xgb.Cookie } -// Write request to wire for GrabButton +// GrabButton sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabButton(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) GrabButtonCookie { cookie := c.NewCookie(false, false) c.NewRequest(grabButtonRequest(c, OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) return GrabButtonCookie{cookie} } +// GrabButtonChecked sends a checked request. +// If an error occurs, it can be retrieved using GrabButtonCookie.Check() func GrabButtonChecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) GrabButtonCookie { cookie := c.NewCookie(true, false) c.NewRequest(grabButtonRequest(c, OwnerEvents, GrabWindow, EventMask, PointerMode, KeyboardMode, ConfineTo, Cursor, Button, Modifiers), cookie) return GrabButtonCookie{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 GrabButtonCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for GrabButton +// grabButtonRequest writes a GrabButton request to a byte slice. func grabButtonRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMask uint16, PointerMode byte, KeyboardMode byte, ConfineTo Window, Cursor Cursor, Button byte, Modifiers uint16) []byte { size := 24 b := 0 @@ -8259,30 +8347,35 @@ func grabButtonRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, EventMa return buf } -// Request UngrabButton -// size: 12 +// UngrabButtonCookie is a cookie used only for UngrabButton requests. type UngrabButtonCookie struct { *xgb.Cookie } -// Write request to wire for UngrabButton +// UngrabButton sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabButton(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers uint16) UngrabButtonCookie { cookie := c.NewCookie(false, false) c.NewRequest(ungrabButtonRequest(c, Button, GrabWindow, Modifiers), cookie) return UngrabButtonCookie{cookie} } +// UngrabButtonChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabButtonCookie.Check() func UngrabButtonChecked(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers uint16) UngrabButtonCookie { cookie := c.NewCookie(true, false) c.NewRequest(ungrabButtonRequest(c, Button, GrabWindow, Modifiers), cookie) return UngrabButtonCookie{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 UngrabButtonCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UngrabButton +// ungrabButtonRequest writes a UngrabButton request to a byte slice. func ungrabButtonRequest(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers uint16) []byte { size := 12 b := 0 @@ -8308,30 +8401,35 @@ func ungrabButtonRequest(c *xgb.Conn, Button byte, GrabWindow Window, Modifiers return buf } -// Request ChangeActivePointerGrab -// size: 16 +// ChangeActivePointerGrabCookie is a cookie used only for ChangeActivePointerGrab requests. type ChangeActivePointerGrabCookie struct { *xgb.Cookie } -// Write request to wire for ChangeActivePointerGrab +// ChangeActivePointerGrab sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeActivePointerGrab(c *xgb.Conn, Cursor Cursor, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeActivePointerGrabRequest(c, Cursor, Time, EventMask), cookie) return ChangeActivePointerGrabCookie{cookie} } +// ChangeActivePointerGrabChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeActivePointerGrabCookie.Check() func ChangeActivePointerGrabChecked(c *xgb.Conn, Cursor Cursor, Time Timestamp, EventMask uint16) ChangeActivePointerGrabCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeActivePointerGrabRequest(c, Cursor, Time, EventMask), cookie) return ChangeActivePointerGrabCookie{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 ChangeActivePointerGrabCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeActivePointerGrab +// changeActivePointerGrabRequest writes a ChangeActivePointerGrab request to a byte slice. func changeActivePointerGrabRequest(c *xgb.Conn, Cursor Cursor, Time Timestamp, EventMask uint16) []byte { size := 16 b := 0 @@ -8359,33 +8457,35 @@ func changeActivePointerGrabRequest(c *xgb.Conn, Cursor Cursor, Time Timestamp, return buf } -// Request GrabKeyboard -// size: 16 +// GrabKeyboardCookie is a cookie used only for GrabKeyboard requests. type GrabKeyboardCookie struct { *xgb.Cookie } +// GrabKeyboard sends a checked request. +// If an error occurs, it will be returned with the reply by calling GrabKeyboardCookie.Reply() func GrabKeyboard(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { cookie := c.NewCookie(true, true) c.NewRequest(grabKeyboardRequest(c, OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) return GrabKeyboardCookie{cookie} } +// GrabKeyboardUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabKeyboardUnchecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) GrabKeyboardCookie { cookie := c.NewCookie(false, true) c.NewRequest(grabKeyboardRequest(c, OwnerEvents, GrabWindow, Time, PointerMode, KeyboardMode), cookie) return GrabKeyboardCookie{cookie} } -// Request reply for GrabKeyboard -// size: 8 +// GrabKeyboardReply represents the data returned from a GrabKeyboard request. type GrabKeyboardReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Status byte } -// Waits and reads reply data from request GrabKeyboard +// Reply blocks and returns the reply data for a GrabKeyboard request. func (cook GrabKeyboardCookie) Reply() (*GrabKeyboardReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8397,7 +8497,7 @@ func (cook GrabKeyboardCookie) Reply() (*GrabKeyboardReply, error) { return grabKeyboardReply(buf), nil } -// Read reply into structure from buffer for GrabKeyboard +// grabKeyboardReply reads a byte slice into a GrabKeyboardReply value. func grabKeyboardReply(buf []byte) *GrabKeyboardReply { v := new(GrabKeyboardReply) b := 1 // skip reply determinant @@ -8415,6 +8515,7 @@ func grabKeyboardReply(buf []byte) *GrabKeyboardReply { } // Write request to wire for GrabKeyboard +// grabKeyboardRequest writes a GrabKeyboard request to a byte slice. func grabKeyboardRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time Timestamp, PointerMode byte, KeyboardMode byte) []byte { size := 16 b := 0 @@ -8450,30 +8551,35 @@ func grabKeyboardRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Time return buf } -// Request UngrabKeyboard -// size: 8 +// UngrabKeyboardCookie is a cookie used only for UngrabKeyboard requests. type UngrabKeyboardCookie struct { *xgb.Cookie } -// Write request to wire for UngrabKeyboard +// UngrabKeyboard sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabKeyboard(c *xgb.Conn, Time Timestamp) UngrabKeyboardCookie { cookie := c.NewCookie(false, false) c.NewRequest(ungrabKeyboardRequest(c, Time), cookie) return UngrabKeyboardCookie{cookie} } +// UngrabKeyboardChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabKeyboardCookie.Check() func UngrabKeyboardChecked(c *xgb.Conn, Time Timestamp) UngrabKeyboardCookie { cookie := c.NewCookie(true, false) c.NewRequest(ungrabKeyboardRequest(c, Time), cookie) return UngrabKeyboardCookie{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 UngrabKeyboardCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UngrabKeyboard +// ungrabKeyboardRequest writes a UngrabKeyboard request to a byte slice. func ungrabKeyboardRequest(c *xgb.Conn, Time Timestamp) []byte { size := 8 b := 0 @@ -8493,30 +8599,35 @@ func ungrabKeyboardRequest(c *xgb.Conn, Time Timestamp) []byte { return buf } -// Request GrabKey -// size: 16 +// GrabKeyCookie is a cookie used only for GrabKey requests. type GrabKeyCookie struct { *xgb.Cookie } -// Write request to wire for GrabKey +// GrabKey sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabKey(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { cookie := c.NewCookie(false, false) c.NewRequest(grabKeyRequest(c, OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) return GrabKeyCookie{cookie} } +// GrabKeyChecked sends a checked request. +// If an error occurs, it can be retrieved using GrabKeyCookie.Check() func GrabKeyChecked(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) GrabKeyCookie { cookie := c.NewCookie(true, false) c.NewRequest(grabKeyRequest(c, OwnerEvents, GrabWindow, Modifiers, Key, PointerMode, KeyboardMode), cookie) return GrabKeyCookie{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 GrabKeyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for GrabKey +// grabKeyRequest writes a GrabKey request to a byte slice. func grabKeyRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers uint16, Key Keycode, PointerMode byte, KeyboardMode byte) []byte { size := 16 b := 0 @@ -8555,30 +8666,35 @@ func grabKeyRequest(c *xgb.Conn, OwnerEvents bool, GrabWindow Window, Modifiers return buf } -// Request UngrabKey -// size: 12 +// UngrabKeyCookie is a cookie used only for UngrabKey requests. type UngrabKeyCookie struct { *xgb.Cookie } -// Write request to wire for UngrabKey +// UngrabKey sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabKey(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uint16) UngrabKeyCookie { cookie := c.NewCookie(false, false) c.NewRequest(ungrabKeyRequest(c, Key, GrabWindow, Modifiers), cookie) return UngrabKeyCookie{cookie} } +// UngrabKeyChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabKeyCookie.Check() func UngrabKeyChecked(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uint16) UngrabKeyCookie { cookie := c.NewCookie(true, false) c.NewRequest(ungrabKeyRequest(c, Key, GrabWindow, Modifiers), cookie) return UngrabKeyCookie{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 UngrabKeyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UngrabKey +// ungrabKeyRequest writes a UngrabKey request to a byte slice. func ungrabKeyRequest(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uint16) []byte { size := 12 b := 0 @@ -8604,30 +8720,35 @@ func ungrabKeyRequest(c *xgb.Conn, Key Keycode, GrabWindow Window, Modifiers uin return buf } -// Request AllowEvents -// size: 8 +// AllowEventsCookie is a cookie used only for AllowEvents requests. type AllowEventsCookie struct { *xgb.Cookie } -// Write request to wire for AllowEvents +// AllowEvents sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AllowEvents(c *xgb.Conn, Mode byte, Time Timestamp) AllowEventsCookie { cookie := c.NewCookie(false, false) c.NewRequest(allowEventsRequest(c, Mode, Time), cookie) return AllowEventsCookie{cookie} } +// AllowEventsChecked sends a checked request. +// If an error occurs, it can be retrieved using AllowEventsCookie.Check() func AllowEventsChecked(c *xgb.Conn, Mode byte, Time Timestamp) AllowEventsCookie { cookie := c.NewCookie(true, false) c.NewRequest(allowEventsRequest(c, Mode, Time), cookie) return AllowEventsCookie{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 AllowEventsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for AllowEvents +// allowEventsRequest writes a AllowEvents request to a byte slice. func allowEventsRequest(c *xgb.Conn, Mode byte, Time Timestamp) []byte { size := 8 b := 0 @@ -8648,30 +8769,35 @@ func allowEventsRequest(c *xgb.Conn, Mode byte, Time Timestamp) []byte { return buf } -// Request GrabServer -// size: 4 +// GrabServerCookie is a cookie used only for GrabServer requests. type GrabServerCookie struct { *xgb.Cookie } -// Write request to wire for GrabServer +// GrabServer sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabServer(c *xgb.Conn) GrabServerCookie { cookie := c.NewCookie(false, false) c.NewRequest(grabServerRequest(c), cookie) return GrabServerCookie{cookie} } +// GrabServerChecked sends a checked request. +// If an error occurs, it can be retrieved using GrabServerCookie.Check() func GrabServerChecked(c *xgb.Conn) GrabServerCookie { cookie := c.NewCookie(true, false) c.NewRequest(grabServerRequest(c), cookie) return GrabServerCookie{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 GrabServerCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for GrabServer +// grabServerRequest writes a GrabServer request to a byte slice. func grabServerRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -8687,30 +8813,35 @@ func grabServerRequest(c *xgb.Conn) []byte { return buf } -// Request UngrabServer -// size: 4 +// UngrabServerCookie is a cookie used only for UngrabServer requests. type UngrabServerCookie struct { *xgb.Cookie } -// Write request to wire for UngrabServer +// UngrabServer sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabServer(c *xgb.Conn) UngrabServerCookie { cookie := c.NewCookie(false, false) c.NewRequest(ungrabServerRequest(c), cookie) return UngrabServerCookie{cookie} } +// UngrabServerChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabServerCookie.Check() func UngrabServerChecked(c *xgb.Conn) UngrabServerCookie { cookie := c.NewCookie(true, false) c.NewRequest(ungrabServerRequest(c), cookie) return UngrabServerCookie{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 UngrabServerCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UngrabServer +// ungrabServerRequest writes a UngrabServer request to a byte slice. func ungrabServerRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -8726,29 +8857,31 @@ func ungrabServerRequest(c *xgb.Conn) []byte { return buf } -// Request QueryPointer -// size: 8 +// QueryPointerCookie is a cookie used only for QueryPointer requests. type QueryPointerCookie struct { *xgb.Cookie } +// QueryPointer sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryPointerCookie.Reply() func QueryPointer(c *xgb.Conn, Window Window) QueryPointerCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryPointerRequest(c, Window), cookie) return QueryPointerCookie{cookie} } +// QueryPointerUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryPointerUnchecked(c *xgb.Conn, Window Window) QueryPointerCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryPointerRequest(c, Window), cookie) return QueryPointerCookie{cookie} } -// Request reply for QueryPointer -// size: 28 +// QueryPointerReply represents the data returned from a QueryPointer request. type QueryPointerReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply SameScreen bool Root Window Child Window @@ -8760,7 +8893,7 @@ type QueryPointerReply struct { // padding: 2 bytes } -// Waits and reads reply data from request QueryPointer +// Reply blocks and returns the reply data for a QueryPointer request. func (cook QueryPointerCookie) Reply() (*QueryPointerReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8772,7 +8905,7 @@ func (cook QueryPointerCookie) Reply() (*QueryPointerReply, error) { return queryPointerReply(buf), nil } -// Read reply into structure from buffer for QueryPointer +// queryPointerReply reads a byte slice into a QueryPointerReply value. func queryPointerReply(buf []byte) *QueryPointerReply { v := new(QueryPointerReply) b := 1 // skip reply determinant @@ -8817,6 +8950,7 @@ func queryPointerReply(buf []byte) *QueryPointerReply { } // Write request to wire for QueryPointer +// queryPointerRequest writes a QueryPointer request to a byte slice. func queryPointerRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -8836,36 +8970,38 @@ func queryPointerRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request GetMotionEvents -// size: 16 +// GetMotionEventsCookie is a cookie used only for GetMotionEvents requests. type GetMotionEventsCookie struct { *xgb.Cookie } +// GetMotionEvents sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetMotionEventsCookie.Reply() func GetMotionEvents(c *xgb.Conn, Window Window, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { cookie := c.NewCookie(true, true) c.NewRequest(getMotionEventsRequest(c, Window, Start, Stop), cookie) return GetMotionEventsCookie{cookie} } +// GetMotionEventsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetMotionEventsUnchecked(c *xgb.Conn, Window Window, Start Timestamp, Stop Timestamp) GetMotionEventsCookie { cookie := c.NewCookie(false, true) c.NewRequest(getMotionEventsRequest(c, Window, Start, Stop), cookie) return GetMotionEventsCookie{cookie} } -// Request reply for GetMotionEvents -// size: (32 + xgb.Pad((int(EventsLen) * 8))) +// GetMotionEventsReply represents the data returned from a GetMotionEvents request. type GetMotionEventsReply 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 EventsLen uint32 // padding: 20 bytes Events []Timecoord // size: xgb.Pad((int(EventsLen) * 8)) } -// Waits and reads reply data from request GetMotionEvents +// Reply blocks and returns the reply data for a GetMotionEvents request. func (cook GetMotionEventsCookie) Reply() (*GetMotionEventsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8877,7 +9013,7 @@ func (cook GetMotionEventsCookie) Reply() (*GetMotionEventsReply, error) { return getMotionEventsReply(buf), nil } -// Read reply into structure from buffer for GetMotionEvents +// getMotionEventsReply reads a byte slice into a GetMotionEventsReply value. func getMotionEventsReply(buf []byte) *GetMotionEventsReply { v := new(GetMotionEventsReply) b := 1 // skip reply determinant @@ -8902,6 +9038,7 @@ func getMotionEventsReply(buf []byte) *GetMotionEventsReply { } // Write request to wire for GetMotionEvents +// getMotionEventsRequest writes a GetMotionEvents request to a byte slice. func getMotionEventsRequest(c *xgb.Conn, Window Window, Start Timestamp, Stop Timestamp) []byte { size := 16 b := 0 @@ -8927,36 +9064,38 @@ func getMotionEventsRequest(c *xgb.Conn, Window Window, Start Timestamp, Stop Ti return buf } -// Request TranslateCoordinates -// size: 16 +// TranslateCoordinatesCookie is a cookie used only for TranslateCoordinates requests. type TranslateCoordinatesCookie struct { *xgb.Cookie } +// TranslateCoordinates sends a checked request. +// If an error occurs, it will be returned with the reply by calling TranslateCoordinatesCookie.Reply() func TranslateCoordinates(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) TranslateCoordinatesCookie { cookie := c.NewCookie(true, true) c.NewRequest(translateCoordinatesRequest(c, SrcWindow, DstWindow, SrcX, SrcY), cookie) return TranslateCoordinatesCookie{cookie} } +// TranslateCoordinatesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func TranslateCoordinatesUnchecked(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) TranslateCoordinatesCookie { cookie := c.NewCookie(false, true) c.NewRequest(translateCoordinatesRequest(c, SrcWindow, DstWindow, SrcX, SrcY), cookie) return TranslateCoordinatesCookie{cookie} } -// Request reply for TranslateCoordinates -// size: 16 +// TranslateCoordinatesReply represents the data returned from a TranslateCoordinates request. type TranslateCoordinatesReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply SameScreen bool Child Window DstX int16 DstY int16 } -// Waits and reads reply data from request TranslateCoordinates +// Reply blocks and returns the reply data for a TranslateCoordinates request. func (cook TranslateCoordinatesCookie) Reply() (*TranslateCoordinatesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -8968,7 +9107,7 @@ func (cook TranslateCoordinatesCookie) Reply() (*TranslateCoordinatesReply, erro return translateCoordinatesReply(buf), nil } -// Read reply into structure from buffer for TranslateCoordinates +// translateCoordinatesReply reads a byte slice into a TranslateCoordinatesReply value. func translateCoordinatesReply(buf []byte) *TranslateCoordinatesReply { v := new(TranslateCoordinatesReply) b := 1 // skip reply determinant @@ -8999,6 +9138,7 @@ func translateCoordinatesReply(buf []byte) *TranslateCoordinatesReply { } // Write request to wire for TranslateCoordinates +// translateCoordinatesRequest writes a TranslateCoordinates request to a byte slice. func translateCoordinatesRequest(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16) []byte { size := 16 b := 0 @@ -9027,30 +9167,35 @@ func translateCoordinatesRequest(c *xgb.Conn, SrcWindow Window, DstWindow Window return buf } -// Request WarpPointer -// size: 24 +// WarpPointerCookie is a cookie used only for WarpPointer requests. type WarpPointerCookie struct { *xgb.Cookie } -// Write request to wire for WarpPointer +// WarpPointer sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func WarpPointer(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { cookie := c.NewCookie(false, false) c.NewRequest(warpPointerRequest(c, SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) return WarpPointerCookie{cookie} } +// WarpPointerChecked sends a checked request. +// If an error occurs, it can be retrieved using WarpPointerCookie.Check() func WarpPointerChecked(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) WarpPointerCookie { cookie := c.NewCookie(true, false) c.NewRequest(warpPointerRequest(c, SrcWindow, DstWindow, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY), cookie) return WarpPointerCookie{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 WarpPointerCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for WarpPointer +// warpPointerRequest writes a WarpPointer request to a byte slice. func warpPointerRequest(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX int16, SrcY int16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16) []byte { size := 24 b := 0 @@ -9091,30 +9236,35 @@ func warpPointerRequest(c *xgb.Conn, SrcWindow Window, DstWindow Window, SrcX in return buf } -// Request SetInputFocus -// size: 12 +// SetInputFocusCookie is a cookie used only for SetInputFocus requests. type SetInputFocusCookie struct { *xgb.Cookie } -// Write request to wire for SetInputFocus +// SetInputFocus sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetInputFocus(c *xgb.Conn, RevertTo byte, Focus Window, Time Timestamp) SetInputFocusCookie { cookie := c.NewCookie(false, false) c.NewRequest(setInputFocusRequest(c, RevertTo, Focus, Time), cookie) return SetInputFocusCookie{cookie} } +// SetInputFocusChecked sends a checked request. +// If an error occurs, it can be retrieved using SetInputFocusCookie.Check() func SetInputFocusChecked(c *xgb.Conn, RevertTo byte, Focus Window, Time Timestamp) SetInputFocusCookie { cookie := c.NewCookie(true, false) c.NewRequest(setInputFocusRequest(c, RevertTo, Focus, Time), cookie) return SetInputFocusCookie{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 SetInputFocusCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetInputFocus +// setInputFocusRequest writes a SetInputFocus request to a byte slice. func setInputFocusRequest(c *xgb.Conn, RevertTo byte, Focus Window, Time Timestamp) []byte { size := 12 b := 0 @@ -9138,34 +9288,36 @@ func setInputFocusRequest(c *xgb.Conn, RevertTo byte, Focus Window, Time Timesta return buf } -// Request GetInputFocus -// size: 4 +// GetInputFocusCookie is a cookie used only for GetInputFocus requests. type GetInputFocusCookie struct { *xgb.Cookie } +// GetInputFocus sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetInputFocusCookie.Reply() func GetInputFocus(c *xgb.Conn) GetInputFocusCookie { cookie := c.NewCookie(true, true) c.NewRequest(getInputFocusRequest(c), cookie) return GetInputFocusCookie{cookie} } +// GetInputFocusUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetInputFocusUnchecked(c *xgb.Conn) GetInputFocusCookie { cookie := c.NewCookie(false, true) c.NewRequest(getInputFocusRequest(c), cookie) return GetInputFocusCookie{cookie} } -// Request reply for GetInputFocus -// size: 12 +// GetInputFocusReply represents the data returned from a GetInputFocus request. type GetInputFocusReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply RevertTo byte Focus Window } -// Waits and reads reply data from request GetInputFocus +// Reply blocks and returns the reply data for a GetInputFocus request. func (cook GetInputFocusCookie) Reply() (*GetInputFocusReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -9177,7 +9329,7 @@ func (cook GetInputFocusCookie) Reply() (*GetInputFocusReply, error) { return getInputFocusReply(buf), nil } -// Read reply into structure from buffer for GetInputFocus +// getInputFocusReply reads a byte slice into a GetInputFocusReply value. func getInputFocusReply(buf []byte) *GetInputFocusReply { v := new(GetInputFocusReply) b := 1 // skip reply determinant @@ -9198,6 +9350,7 @@ func getInputFocusReply(buf []byte) *GetInputFocusReply { } // Write request to wire for GetInputFocus +// getInputFocusRequest writes a GetInputFocus request to a byte slice. func getInputFocusRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -9213,34 +9366,36 @@ func getInputFocusRequest(c *xgb.Conn) []byte { return buf } -// Request QueryKeymap -// size: 4 +// QueryKeymapCookie is a cookie used only for QueryKeymap requests. type QueryKeymapCookie struct { *xgb.Cookie } +// QueryKeymap sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryKeymapCookie.Reply() func QueryKeymap(c *xgb.Conn) QueryKeymapCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryKeymapRequest(c), cookie) return QueryKeymapCookie{cookie} } +// QueryKeymapUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryKeymapUnchecked(c *xgb.Conn) QueryKeymapCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryKeymapRequest(c), cookie) return QueryKeymapCookie{cookie} } -// Request reply for QueryKeymap -// size: 40 +// QueryKeymapReply represents the data returned from a QueryKeymap request. type QueryKeymapReply 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 Keys []byte // size: 32 } -// Waits and reads reply data from request QueryKeymap +// Reply blocks and returns the reply data for a QueryKeymap request. func (cook QueryKeymapCookie) Reply() (*QueryKeymapReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -9252,7 +9407,7 @@ func (cook QueryKeymapCookie) Reply() (*QueryKeymapReply, error) { return queryKeymapReply(buf), nil } -// Read reply into structure from buffer for QueryKeymap +// queryKeymapReply reads a byte slice into a QueryKeymapReply value. func queryKeymapReply(buf []byte) *QueryKeymapReply { v := new(QueryKeymapReply) b := 1 // skip reply determinant @@ -9273,6 +9428,7 @@ func queryKeymapReply(buf []byte) *QueryKeymapReply { } // Write request to wire for QueryKeymap +// queryKeymapRequest writes a QueryKeymap request to a byte slice. func queryKeymapRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -9288,30 +9444,35 @@ func queryKeymapRequest(c *xgb.Conn) []byte { return buf } -// Request OpenFont -// size: xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) +// OpenFontCookie is a cookie used only for OpenFont requests. type OpenFontCookie struct { *xgb.Cookie } -// Write request to wire for OpenFont +// OpenFont sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func OpenFont(c *xgb.Conn, Fid Font, NameLen uint16, Name string) OpenFontCookie { cookie := c.NewCookie(false, false) c.NewRequest(openFontRequest(c, Fid, NameLen, Name), cookie) return OpenFontCookie{cookie} } +// OpenFontChecked sends a checked request. +// If an error occurs, it can be retrieved using OpenFontCookie.Check() func OpenFontChecked(c *xgb.Conn, Fid Font, NameLen uint16, Name string) OpenFontCookie { cookie := c.NewCookie(true, false) c.NewRequest(openFontRequest(c, Fid, NameLen, Name), cookie) return OpenFontCookie{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 OpenFontCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for OpenFont +// openFontRequest writes a OpenFont request to a byte slice. func openFontRequest(c *xgb.Conn, Fid Font, NameLen uint16, Name string) []byte { size := xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -9339,30 +9500,35 @@ func openFontRequest(c *xgb.Conn, Fid Font, NameLen uint16, Name string) []byte return buf } -// Request CloseFont -// size: 8 +// CloseFontCookie is a cookie used only for CloseFont requests. type CloseFontCookie struct { *xgb.Cookie } -// Write request to wire for CloseFont +// CloseFont sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CloseFont(c *xgb.Conn, Font Font) CloseFontCookie { cookie := c.NewCookie(false, false) c.NewRequest(closeFontRequest(c, Font), cookie) return CloseFontCookie{cookie} } +// CloseFontChecked sends a checked request. +// If an error occurs, it can be retrieved using CloseFontCookie.Check() func CloseFontChecked(c *xgb.Conn, Font Font) CloseFontCookie { cookie := c.NewCookie(true, false) c.NewRequest(closeFontRequest(c, Font), cookie) return CloseFontCookie{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 CloseFontCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CloseFont +// closeFontRequest writes a CloseFont request to a byte slice. func closeFontRequest(c *xgb.Conn, Font Font) []byte { size := 8 b := 0 @@ -9382,29 +9548,31 @@ func closeFontRequest(c *xgb.Conn, Font Font) []byte { return buf } -// Request QueryFont -// size: 8 +// QueryFontCookie is a cookie used only for QueryFont requests. type QueryFontCookie struct { *xgb.Cookie } +// QueryFont sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryFontCookie.Reply() func QueryFont(c *xgb.Conn, Font Fontable) QueryFontCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryFontRequest(c, Font), cookie) return QueryFontCookie{cookie} } +// QueryFontUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryFontUnchecked(c *xgb.Conn, Font Fontable) QueryFontCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryFontRequest(c, Font), cookie) return QueryFontCookie{cookie} } -// Request reply for QueryFont -// size: ((60 + xgb.Pad((int(PropertiesLen) * 8))) + xgb.Pad((int(CharInfosLen) * 12))) +// QueryFontReply represents the data returned from a QueryFont request. type QueryFontReply 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 MinBounds Charinfo // padding: 4 bytes @@ -9425,7 +9593,7 @@ type QueryFontReply struct { CharInfos []Charinfo // size: xgb.Pad((int(CharInfosLen) * 12)) } -// Waits and reads reply data from request QueryFont +// Reply blocks and returns the reply data for a QueryFont request. func (cook QueryFontCookie) Reply() (*QueryFontReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -9437,7 +9605,7 @@ func (cook QueryFontCookie) Reply() (*QueryFontReply, error) { return queryFontReply(buf), nil } -// Read reply into structure from buffer for QueryFont +// queryFontReply reads a byte slice into a QueryFontReply value. func queryFontReply(buf []byte) *QueryFontReply { v := new(QueryFontReply) b := 1 // skip reply determinant @@ -9507,6 +9675,7 @@ func queryFontReply(buf []byte) *QueryFontReply { } // Write request to wire for QueryFont +// queryFontRequest writes a QueryFont request to a byte slice. func queryFontRequest(c *xgb.Conn, Font Fontable) []byte { size := 8 b := 0 @@ -9526,29 +9695,31 @@ func queryFontRequest(c *xgb.Conn, Font Fontable) []byte { return buf } -// Request QueryTextExtents -// size: xgb.Pad((8 + xgb.Pad((len(String) * 2)))) +// QueryTextExtentsCookie is a cookie used only for QueryTextExtents requests. type QueryTextExtentsCookie struct { *xgb.Cookie } +// QueryTextExtents sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryTextExtentsCookie.Reply() func QueryTextExtents(c *xgb.Conn, Font Fontable, String []Char2b, StringLen uint16) QueryTextExtentsCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryTextExtentsRequest(c, Font, String, StringLen), cookie) return QueryTextExtentsCookie{cookie} } +// QueryTextExtentsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryTextExtentsUnchecked(c *xgb.Conn, Font Fontable, String []Char2b, StringLen uint16) QueryTextExtentsCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryTextExtentsRequest(c, Font, String, StringLen), cookie) return QueryTextExtentsCookie{cookie} } -// Request reply for QueryTextExtents -// size: 28 +// QueryTextExtentsReply represents the data returned from a QueryTextExtents request. type QueryTextExtentsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply DrawDirection byte FontAscent int16 FontDescent int16 @@ -9559,7 +9730,7 @@ type QueryTextExtentsReply struct { OverallRight int32 } -// Waits and reads reply data from request QueryTextExtents +// Reply blocks and returns the reply data for a QueryTextExtents request. func (cook QueryTextExtentsCookie) Reply() (*QueryTextExtentsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -9571,7 +9742,7 @@ func (cook QueryTextExtentsCookie) Reply() (*QueryTextExtentsReply, error) { return queryTextExtentsReply(buf), nil } -// Read reply into structure from buffer for QueryTextExtents +// queryTextExtentsReply reads a byte slice into a QueryTextExtentsReply value. func queryTextExtentsReply(buf []byte) *QueryTextExtentsReply { v := new(QueryTextExtentsReply) b := 1 // skip reply determinant @@ -9610,6 +9781,7 @@ func queryTextExtentsReply(buf []byte) *QueryTextExtentsReply { } // Write request to wire for QueryTextExtents +// queryTextExtentsRequest writes a QueryTextExtents request to a byte slice. func queryTextExtentsRequest(c *xgb.Conn, Font Fontable, String []Char2b, StringLen uint16) []byte { size := xgb.Pad((8 + xgb.Pad((len(String) * 2)))) b := 0 @@ -9634,36 +9806,38 @@ func queryTextExtentsRequest(c *xgb.Conn, Font Fontable, String []Char2b, String return buf } -// Request ListFonts -// size: xgb.Pad((8 + xgb.Pad((int(PatternLen) * 1)))) +// ListFontsCookie is a cookie used only for ListFonts requests. type ListFontsCookie struct { *xgb.Cookie } +// ListFonts sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListFontsCookie.Reply() func ListFonts(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) ListFontsCookie { cookie := c.NewCookie(true, true) c.NewRequest(listFontsRequest(c, MaxNames, PatternLen, Pattern), cookie) return ListFontsCookie{cookie} } +// ListFontsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListFontsUnchecked(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) ListFontsCookie { cookie := c.NewCookie(false, true) c.NewRequest(listFontsRequest(c, MaxNames, PatternLen, Pattern), cookie) return ListFontsCookie{cookie} } -// Request reply for ListFonts -// size: (32 + StrListSize(Names)) +// ListFontsReply represents the data returned from a ListFonts request. type ListFontsReply 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 NamesLen uint16 // padding: 22 bytes Names []Str // size: StrListSize(Names) } -// Waits and reads reply data from request ListFonts +// Reply blocks and returns the reply data for a ListFonts request. func (cook ListFontsCookie) Reply() (*ListFontsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -9675,7 +9849,7 @@ func (cook ListFontsCookie) Reply() (*ListFontsReply, error) { return listFontsReply(buf), nil } -// Read reply into structure from buffer for ListFonts +// listFontsReply reads a byte slice into a ListFontsReply value. func listFontsReply(buf []byte) *ListFontsReply { v := new(ListFontsReply) b := 1 // skip reply determinant @@ -9700,6 +9874,7 @@ func listFontsReply(buf []byte) *ListFontsReply { } // Write request to wire for ListFonts +// listFontsRequest writes a ListFonts request to a byte slice. func listFontsRequest(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) []byte { size := xgb.Pad((8 + xgb.Pad((int(PatternLen) * 1)))) b := 0 @@ -9725,29 +9900,31 @@ func listFontsRequest(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern s return buf } -// Request ListFontsWithInfo -// size: xgb.Pad((8 + xgb.Pad((int(PatternLen) * 1)))) +// ListFontsWithInfoCookie is a cookie used only for ListFontsWithInfo requests. type ListFontsWithInfoCookie struct { *xgb.Cookie } +// ListFontsWithInfo sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListFontsWithInfoCookie.Reply() func ListFontsWithInfo(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) ListFontsWithInfoCookie { cookie := c.NewCookie(true, true) c.NewRequest(listFontsWithInfoRequest(c, MaxNames, PatternLen, Pattern), cookie) return ListFontsWithInfoCookie{cookie} } +// ListFontsWithInfoUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListFontsWithInfoUnchecked(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) ListFontsWithInfoCookie { cookie := c.NewCookie(false, true) c.NewRequest(listFontsWithInfoRequest(c, MaxNames, PatternLen, Pattern), cookie) return ListFontsWithInfoCookie{cookie} } -// Request reply for ListFontsWithInfo -// size: ((60 + xgb.Pad((int(PropertiesLen) * 8))) + xgb.Pad((int(NameLen) * 1))) +// ListFontsWithInfoReply represents the data returned from a ListFontsWithInfo request. type ListFontsWithInfoReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply NameLen byte MinBounds Charinfo // padding: 4 bytes @@ -9768,7 +9945,7 @@ type ListFontsWithInfoReply struct { Name string // size: xgb.Pad((int(NameLen) * 1)) } -// Waits and reads reply data from request ListFontsWithInfo +// Reply blocks and returns the reply data for a ListFontsWithInfo request. func (cook ListFontsWithInfoCookie) Reply() (*ListFontsWithInfoReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -9780,7 +9957,7 @@ func (cook ListFontsWithInfoCookie) Reply() (*ListFontsWithInfoReply, error) { return listFontsWithInfoReply(buf), nil } -// Read reply into structure from buffer for ListFontsWithInfo +// listFontsWithInfoReply reads a byte slice into a ListFontsWithInfoReply value. func listFontsWithInfoReply(buf []byte) *ListFontsWithInfoReply { v := new(ListFontsWithInfoReply) b := 1 // skip reply determinant @@ -9855,6 +10032,7 @@ func listFontsWithInfoReply(buf []byte) *ListFontsWithInfoReply { } // Write request to wire for ListFontsWithInfo +// listFontsWithInfoRequest writes a ListFontsWithInfo request to a byte slice. func listFontsWithInfoRequest(c *xgb.Conn, MaxNames uint16, PatternLen uint16, Pattern string) []byte { size := xgb.Pad((8 + xgb.Pad((int(PatternLen) * 1)))) b := 0 @@ -9880,30 +10058,35 @@ func listFontsWithInfoRequest(c *xgb.Conn, MaxNames uint16, PatternLen uint16, P return buf } -// Request SetFontPath -// size: xgb.Pad((8 + StrListSize(Font))) +// SetFontPathCookie is a cookie used only for SetFontPath requests. type SetFontPathCookie struct { *xgb.Cookie } -// Write request to wire for SetFontPath +// SetFontPath sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetFontPath(c *xgb.Conn, FontQty uint16, Font []Str) SetFontPathCookie { cookie := c.NewCookie(false, false) c.NewRequest(setFontPathRequest(c, FontQty, Font), cookie) return SetFontPathCookie{cookie} } +// SetFontPathChecked sends a checked request. +// If an error occurs, it can be retrieved using SetFontPathCookie.Check() func SetFontPathChecked(c *xgb.Conn, FontQty uint16, Font []Str) SetFontPathCookie { cookie := c.NewCookie(true, false) c.NewRequest(setFontPathRequest(c, FontQty, Font), cookie) return SetFontPathCookie{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 SetFontPathCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetFontPath +// setFontPathRequest writes a SetFontPath request to a byte slice. func setFontPathRequest(c *xgb.Conn, FontQty uint16, Font []Str) []byte { size := xgb.Pad((8 + StrListSize(Font))) b := 0 @@ -9927,36 +10110,38 @@ func setFontPathRequest(c *xgb.Conn, FontQty uint16, Font []Str) []byte { return buf } -// Request GetFontPath -// size: 4 +// GetFontPathCookie is a cookie used only for GetFontPath requests. type GetFontPathCookie struct { *xgb.Cookie } +// GetFontPath sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetFontPathCookie.Reply() func GetFontPath(c *xgb.Conn) GetFontPathCookie { cookie := c.NewCookie(true, true) c.NewRequest(getFontPathRequest(c), cookie) return GetFontPathCookie{cookie} } +// GetFontPathUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetFontPathUnchecked(c *xgb.Conn) GetFontPathCookie { cookie := c.NewCookie(false, true) c.NewRequest(getFontPathRequest(c), cookie) return GetFontPathCookie{cookie} } -// Request reply for GetFontPath -// size: (32 + StrListSize(Path)) +// GetFontPathReply represents the data returned from a GetFontPath request. type GetFontPathReply 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 PathLen uint16 // padding: 22 bytes Path []Str // size: StrListSize(Path) } -// Waits and reads reply data from request GetFontPath +// Reply blocks and returns the reply data for a GetFontPath request. func (cook GetFontPathCookie) Reply() (*GetFontPathReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -9968,7 +10153,7 @@ func (cook GetFontPathCookie) Reply() (*GetFontPathReply, error) { return getFontPathReply(buf), nil } -// Read reply into structure from buffer for GetFontPath +// getFontPathReply reads a byte slice into a GetFontPathReply value. func getFontPathReply(buf []byte) *GetFontPathReply { v := new(GetFontPathReply) b := 1 // skip reply determinant @@ -9993,6 +10178,7 @@ func getFontPathReply(buf []byte) *GetFontPathReply { } // Write request to wire for GetFontPath +// getFontPathRequest writes a GetFontPath request to a byte slice. func getFontPathRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -10008,30 +10194,35 @@ func getFontPathRequest(c *xgb.Conn) []byte { return buf } -// Request CreatePixmap -// size: 16 +// CreatePixmapCookie is a cookie used only for CreatePixmap requests. type CreatePixmapCookie struct { *xgb.Cookie } -// Write request to wire for CreatePixmap +// CreatePixmap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreatePixmap(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) CreatePixmapCookie { cookie := c.NewCookie(false, false) c.NewRequest(createPixmapRequest(c, Depth, Pid, Drawable, Width, Height), 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, Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) CreatePixmapCookie { cookie := c.NewCookie(true, false) c.NewRequest(createPixmapRequest(c, Depth, Pid, Drawable, Width, Height), cookie) return CreatePixmapCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook CreatePixmapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreatePixmap +// createPixmapRequest writes a CreatePixmap request to a byte slice. func createPixmapRequest(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, Width uint16, Height uint16) []byte { size := 16 b := 0 @@ -10061,30 +10252,35 @@ func createPixmapRequest(c *xgb.Conn, Depth byte, Pid Pixmap, Drawable Drawable, return buf } -// Request FreePixmap -// size: 8 +// FreePixmapCookie is a cookie used only for FreePixmap requests. type FreePixmapCookie struct { *xgb.Cookie } -// Write request to wire for FreePixmap +// FreePixmap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreePixmap(c *xgb.Conn, Pixmap Pixmap) FreePixmapCookie { cookie := c.NewCookie(false, false) c.NewRequest(freePixmapRequest(c, Pixmap), cookie) return FreePixmapCookie{cookie} } +// FreePixmapChecked sends a checked request. +// If an error occurs, it can be retrieved using FreePixmapCookie.Check() func FreePixmapChecked(c *xgb.Conn, Pixmap Pixmap) FreePixmapCookie { cookie := c.NewCookie(true, false) c.NewRequest(freePixmapRequest(c, Pixmap), cookie) return FreePixmapCookie{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 FreePixmapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FreePixmap +// freePixmapRequest writes a FreePixmap request to a byte slice. func freePixmapRequest(c *xgb.Conn, Pixmap Pixmap) []byte { size := 8 b := 0 @@ -10104,30 +10300,35 @@ func freePixmapRequest(c *xgb.Conn, Pixmap Pixmap) []byte { return buf } -// Request CreateGC -// size: xgb.Pad((12 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// CreateGCCookie is a cookie used only for CreateGC requests. type CreateGCCookie struct { *xgb.Cookie } -// Write request to wire for CreateGC +// CreateGC sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateGC(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) CreateGCCookie { cookie := c.NewCookie(false, false) c.NewRequest(createGCRequest(c, Cid, Drawable, ValueMask, ValueList), cookie) return CreateGCCookie{cookie} } +// CreateGCChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateGCCookie.Check() func CreateGCChecked(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) CreateGCCookie { cookie := c.NewCookie(true, false) c.NewRequest(createGCRequest(c, Cid, Drawable, ValueMask, ValueList), cookie) return CreateGCCookie{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 CreateGCCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateGC +// createGCRequest writes a CreateGC request to a byte slice. func createGCRequest(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((12 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 @@ -10158,30 +10359,35 @@ func createGCRequest(c *xgb.Conn, Cid Gcontext, Drawable Drawable, ValueMask uin return buf } -// Request ChangeGC -// size: xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// ChangeGCCookie is a cookie used only for ChangeGC requests. type ChangeGCCookie struct { *xgb.Cookie } -// Write request to wire for ChangeGC +// ChangeGC sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeGC(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uint32) ChangeGCCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeGCRequest(c, Gc, ValueMask, ValueList), cookie) return ChangeGCCookie{cookie} } +// ChangeGCChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeGCCookie.Check() func ChangeGCChecked(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uint32) ChangeGCCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeGCRequest(c, Gc, ValueMask, ValueList), cookie) return ChangeGCCookie{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 ChangeGCCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeGC +// changeGCRequest writes a ChangeGC request to a byte slice. func changeGCRequest(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((8 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 @@ -10209,30 +10415,35 @@ func changeGCRequest(c *xgb.Conn, Gc Gcontext, ValueMask uint32, ValueList []uin return buf } -// Request CopyGC -// size: 16 +// CopyGCCookie is a cookie used only for CopyGC requests. type CopyGCCookie struct { *xgb.Cookie } -// Write request to wire for CopyGC +// CopyGC sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CopyGC(c *xgb.Conn, SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) CopyGCCookie { cookie := c.NewCookie(false, false) c.NewRequest(copyGCRequest(c, SrcGc, DstGc, ValueMask), cookie) return CopyGCCookie{cookie} } +// CopyGCChecked sends a checked request. +// If an error occurs, it can be retrieved using CopyGCCookie.Check() func CopyGCChecked(c *xgb.Conn, SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) CopyGCCookie { cookie := c.NewCookie(true, false) c.NewRequest(copyGCRequest(c, SrcGc, DstGc, ValueMask), cookie) return CopyGCCookie{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 CopyGCCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CopyGC +// copyGCRequest writes a CopyGC request to a byte slice. func copyGCRequest(c *xgb.Conn, SrcGc Gcontext, DstGc Gcontext, ValueMask uint32) []byte { size := 16 b := 0 @@ -10258,30 +10469,35 @@ func copyGCRequest(c *xgb.Conn, SrcGc Gcontext, DstGc Gcontext, ValueMask uint32 return buf } -// Request SetDashes -// size: xgb.Pad((12 + xgb.Pad((int(DashesLen) * 1)))) +// SetDashesCookie is a cookie used only for SetDashes requests. type SetDashesCookie struct { *xgb.Cookie } -// Write request to wire for SetDashes +// SetDashes sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDashes(c *xgb.Conn, Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { cookie := c.NewCookie(false, false) c.NewRequest(setDashesRequest(c, Gc, DashOffset, DashesLen, Dashes), cookie) return SetDashesCookie{cookie} } +// SetDashesChecked sends a checked request. +// If an error occurs, it can be retrieved using SetDashesCookie.Check() func SetDashesChecked(c *xgb.Conn, Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) SetDashesCookie { cookie := c.NewCookie(true, false) c.NewRequest(setDashesRequest(c, Gc, DashOffset, DashesLen, Dashes), cookie) return SetDashesCookie{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 SetDashesCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetDashes +// setDashesRequest writes a SetDashes request to a byte slice. func setDashesRequest(c *xgb.Conn, Gc Gcontext, DashOffset uint16, DashesLen uint16, Dashes []byte) []byte { size := xgb.Pad((12 + xgb.Pad((int(DashesLen) * 1)))) b := 0 @@ -10310,30 +10526,35 @@ func setDashesRequest(c *xgb.Conn, Gc Gcontext, DashOffset uint16, DashesLen uin return buf } -// Request SetClipRectangles -// size: xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) +// SetClipRectanglesCookie is a cookie used only for SetClipRectangles requests. type SetClipRectanglesCookie struct { *xgb.Cookie } -// Write request to wire for SetClipRectangles +// SetClipRectangles sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetClipRectangles(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { cookie := c.NewCookie(false, false) c.NewRequest(setClipRectanglesRequest(c, Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) return SetClipRectanglesCookie{cookie} } +// SetClipRectanglesChecked sends a checked request. +// If an error occurs, it can be retrieved using SetClipRectanglesCookie.Check() func SetClipRectanglesChecked(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) SetClipRectanglesCookie { cookie := c.NewCookie(true, false) c.NewRequest(setClipRectanglesRequest(c, Ordering, Gc, ClipXOrigin, ClipYOrigin, Rectangles), cookie) return SetClipRectanglesCookie{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 SetClipRectanglesCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetClipRectangles +// setClipRectanglesRequest writes a SetClipRectangles request to a byte slice. func setClipRectanglesRequest(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrigin int16, ClipYOrigin int16, Rectangles []Rectangle) []byte { size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) b := 0 @@ -10362,30 +10583,35 @@ func setClipRectanglesRequest(c *xgb.Conn, Ordering byte, Gc Gcontext, ClipXOrig return buf } -// Request FreeGC -// size: 8 +// FreeGCCookie is a cookie used only for FreeGC requests. type FreeGCCookie struct { *xgb.Cookie } -// Write request to wire for FreeGC +// FreeGC sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreeGC(c *xgb.Conn, Gc Gcontext) FreeGCCookie { cookie := c.NewCookie(false, false) c.NewRequest(freeGCRequest(c, Gc), cookie) return FreeGCCookie{cookie} } +// FreeGCChecked sends a checked request. +// If an error occurs, it can be retrieved using FreeGCCookie.Check() func FreeGCChecked(c *xgb.Conn, Gc Gcontext) FreeGCCookie { cookie := c.NewCookie(true, false) c.NewRequest(freeGCRequest(c, Gc), cookie) return FreeGCCookie{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 FreeGCCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FreeGC +// freeGCRequest writes a FreeGC request to a byte slice. func freeGCRequest(c *xgb.Conn, Gc Gcontext) []byte { size := 8 b := 0 @@ -10405,30 +10631,35 @@ func freeGCRequest(c *xgb.Conn, Gc Gcontext) []byte { return buf } -// Request ClearArea -// size: 16 +// ClearAreaCookie is a cookie used only for ClearArea requests. type ClearAreaCookie struct { *xgb.Cookie } -// Write request to wire for ClearArea +// ClearArea sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ClearArea(c *xgb.Conn, Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { cookie := c.NewCookie(false, false) c.NewRequest(clearAreaRequest(c, Exposures, Window, X, Y, Width, Height), cookie) return ClearAreaCookie{cookie} } +// ClearAreaChecked sends a checked request. +// If an error occurs, it can be retrieved using ClearAreaCookie.Check() func ClearAreaChecked(c *xgb.Conn, Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) ClearAreaCookie { cookie := c.NewCookie(true, false) c.NewRequest(clearAreaRequest(c, Exposures, Window, X, Y, Width, Height), cookie) return ClearAreaCookie{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 ClearAreaCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ClearArea +// clearAreaRequest writes a ClearArea request to a byte slice. func clearAreaRequest(c *xgb.Conn, Exposures bool, Window Window, X int16, Y int16, Width uint16, Height uint16) []byte { size := 16 b := 0 @@ -10465,30 +10696,35 @@ func clearAreaRequest(c *xgb.Conn, Exposures bool, Window Window, X int16, Y int return buf } -// Request CopyArea -// size: 28 +// CopyAreaCookie is a cookie used only for CopyArea requests. type CopyAreaCookie struct { *xgb.Cookie } -// Write request to wire for CopyArea +// CopyArea sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CopyArea(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { cookie := c.NewCookie(false, false) c.NewRequest(copyAreaRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) return CopyAreaCookie{cookie} } +// CopyAreaChecked sends a checked request. +// If an error occurs, it can be retrieved using CopyAreaCookie.Check() func CopyAreaChecked(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) CopyAreaCookie { cookie := c.NewCookie(true, false) c.NewRequest(copyAreaRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height), cookie) return CopyAreaCookie{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 CopyAreaCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CopyArea +// copyAreaRequest writes a CopyArea request to a byte slice. func copyAreaRequest(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16) []byte { size := 28 b := 0 @@ -10532,30 +10768,35 @@ func copyAreaRequest(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc return buf } -// Request CopyPlane -// size: 32 +// CopyPlaneCookie is a cookie used only for CopyPlane requests. type CopyPlaneCookie struct { *xgb.Cookie } -// Write request to wire for CopyPlane +// CopyPlane sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CopyPlane(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { cookie := c.NewCookie(false, false) c.NewRequest(copyPlaneRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) return CopyPlaneCookie{cookie} } +// CopyPlaneChecked sends a checked request. +// If an error occurs, it can be retrieved using CopyPlaneCookie.Check() func CopyPlaneChecked(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) CopyPlaneCookie { cookie := c.NewCookie(true, false) c.NewRequest(copyPlaneRequest(c, SrcDrawable, DstDrawable, Gc, SrcX, SrcY, DstX, DstY, Width, Height, BitPlane), cookie) return CopyPlaneCookie{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 CopyPlaneCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CopyPlane +// copyPlaneRequest writes a CopyPlane request to a byte slice. func copyPlaneRequest(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, Gc Gcontext, SrcX int16, SrcY int16, DstX int16, DstY int16, Width uint16, Height uint16, BitPlane uint32) []byte { size := 32 b := 0 @@ -10602,30 +10843,35 @@ func copyPlaneRequest(c *xgb.Conn, SrcDrawable Drawable, DstDrawable Drawable, G return buf } -// Request PolyPoint -// size: xgb.Pad((12 + xgb.Pad((len(Points) * 4)))) +// PolyPointCookie is a cookie used only for PolyPoint requests. type PolyPointCookie struct { *xgb.Cookie } -// Write request to wire for PolyPoint +// PolyPoint sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PolyPoint(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyPointCookie { cookie := c.NewCookie(false, false) c.NewRequest(polyPointRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) return PolyPointCookie{cookie} } +// PolyPointChecked sends a checked request. +// If an error occurs, it can be retrieved using PolyPointCookie.Check() func PolyPointChecked(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyPointCookie { cookie := c.NewCookie(true, false) c.NewRequest(polyPointRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) return PolyPointCookie{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 PolyPointCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PolyPoint +// polyPointRequest writes a PolyPoint request to a byte slice. func polyPointRequest(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) []byte { size := xgb.Pad((12 + xgb.Pad((len(Points) * 4)))) b := 0 @@ -10651,30 +10897,35 @@ func polyPointRequest(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gc return buf } -// Request PolyLine -// size: xgb.Pad((12 + xgb.Pad((len(Points) * 4)))) +// PolyLineCookie is a cookie used only for PolyLine requests. type PolyLineCookie struct { *xgb.Cookie } -// Write request to wire for PolyLine +// PolyLine sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PolyLine(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyLineCookie { cookie := c.NewCookie(false, false) c.NewRequest(polyLineRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) return PolyLineCookie{cookie} } +// PolyLineChecked sends a checked request. +// If an error occurs, it can be retrieved using PolyLineCookie.Check() func PolyLineChecked(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) PolyLineCookie { cookie := c.NewCookie(true, false) c.NewRequest(polyLineRequest(c, CoordinateMode, Drawable, Gc, Points), cookie) return PolyLineCookie{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 PolyLineCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PolyLine +// polyLineRequest writes a PolyLine request to a byte slice. func polyLineRequest(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gcontext, Points []Point) []byte { size := xgb.Pad((12 + xgb.Pad((len(Points) * 4)))) b := 0 @@ -10700,30 +10951,35 @@ func polyLineRequest(c *xgb.Conn, CoordinateMode byte, Drawable Drawable, Gc Gco return buf } -// Request PolySegment -// size: xgb.Pad((12 + xgb.Pad((len(Segments) * 8)))) +// PolySegmentCookie is a cookie used only for PolySegment requests. type PolySegmentCookie struct { *xgb.Cookie } -// Write request to wire for PolySegment +// PolySegment sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PolySegment(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments []Segment) PolySegmentCookie { cookie := c.NewCookie(false, false) c.NewRequest(polySegmentRequest(c, Drawable, Gc, Segments), cookie) return PolySegmentCookie{cookie} } +// PolySegmentChecked sends a checked request. +// If an error occurs, it can be retrieved using PolySegmentCookie.Check() func PolySegmentChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments []Segment) PolySegmentCookie { cookie := c.NewCookie(true, false) c.NewRequest(polySegmentRequest(c, Drawable, Gc, Segments), cookie) return PolySegmentCookie{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 PolySegmentCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PolySegment +// polySegmentRequest writes a PolySegment request to a byte slice. func polySegmentRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments []Segment) []byte { size := xgb.Pad((12 + xgb.Pad((len(Segments) * 8)))) b := 0 @@ -10748,30 +11004,35 @@ func polySegmentRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Segments [] return buf } -// Request PolyRectangle -// size: xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) +// PolyRectangleCookie is a cookie used only for PolyRectangle requests. type PolyRectangleCookie struct { *xgb.Cookie } -// Write request to wire for PolyRectangle +// PolyRectangle sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PolyRectangle(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyRectangleCookie { cookie := c.NewCookie(false, false) c.NewRequest(polyRectangleRequest(c, Drawable, Gc, Rectangles), cookie) return PolyRectangleCookie{cookie} } +// PolyRectangleChecked sends a checked request. +// If an error occurs, it can be retrieved using PolyRectangleCookie.Check() func PolyRectangleChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyRectangleCookie { cookie := c.NewCookie(true, false) c.NewRequest(polyRectangleRequest(c, Drawable, Gc, Rectangles), cookie) return PolyRectangleCookie{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 PolyRectangleCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PolyRectangle +// polyRectangleRequest writes a PolyRectangle request to a byte slice. func polyRectangleRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) []byte { size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) b := 0 @@ -10796,30 +11057,35 @@ func polyRectangleRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangle return buf } -// Request PolyArc -// size: xgb.Pad((12 + xgb.Pad((len(Arcs) * 12)))) +// PolyArcCookie is a cookie used only for PolyArc requests. type PolyArcCookie struct { *xgb.Cookie } -// Write request to wire for PolyArc +// PolyArc sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PolyArc(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyArcCookie { cookie := c.NewCookie(false, false) c.NewRequest(polyArcRequest(c, Drawable, Gc, Arcs), cookie) return PolyArcCookie{cookie} } +// PolyArcChecked sends a checked request. +// If an error occurs, it can be retrieved using PolyArcCookie.Check() func PolyArcChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyArcCookie { cookie := c.NewCookie(true, false) c.NewRequest(polyArcRequest(c, Drawable, Gc, Arcs), cookie) return PolyArcCookie{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 PolyArcCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PolyArc +// polyArcRequest writes a PolyArc request to a byte slice. func polyArcRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) []byte { size := xgb.Pad((12 + xgb.Pad((len(Arcs) * 12)))) b := 0 @@ -10844,30 +11110,35 @@ func polyArcRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) []b return buf } -// Request FillPoly -// size: xgb.Pad((16 + xgb.Pad((len(Points) * 4)))) +// FillPolyCookie is a cookie used only for FillPoly requests. type FillPolyCookie struct { *xgb.Cookie } -// Write request to wire for FillPoly +// FillPoly sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FillPoly(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { cookie := c.NewCookie(false, false) c.NewRequest(fillPolyRequest(c, Drawable, Gc, Shape, CoordinateMode, Points), cookie) return FillPolyCookie{cookie} } +// FillPolyChecked sends a checked request. +// If an error occurs, it can be retrieved using FillPolyCookie.Check() func FillPolyChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) FillPolyCookie { cookie := c.NewCookie(true, false) c.NewRequest(fillPolyRequest(c, Drawable, Gc, Shape, CoordinateMode, Points), cookie) return FillPolyCookie{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 FillPolyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FillPoly +// fillPolyRequest writes a FillPoly request to a byte slice. func fillPolyRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape byte, CoordinateMode byte, Points []Point) []byte { size := xgb.Pad((16 + xgb.Pad((len(Points) * 4)))) b := 0 @@ -10900,30 +11171,35 @@ func fillPolyRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Shape byte, Co return buf } -// Request PolyFillRectangle -// size: xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) +// PolyFillRectangleCookie is a cookie used only for PolyFillRectangle requests. type PolyFillRectangleCookie struct { *xgb.Cookie } -// Write request to wire for PolyFillRectangle +// PolyFillRectangle sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PolyFillRectangle(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyFillRectangleCookie { cookie := c.NewCookie(false, false) c.NewRequest(polyFillRectangleRequest(c, Drawable, Gc, Rectangles), cookie) return PolyFillRectangleCookie{cookie} } +// PolyFillRectangleChecked sends a checked request. +// If an error occurs, it can be retrieved using PolyFillRectangleCookie.Check() func PolyFillRectangleChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) PolyFillRectangleCookie { cookie := c.NewCookie(true, false) c.NewRequest(polyFillRectangleRequest(c, Drawable, Gc, Rectangles), cookie) return PolyFillRectangleCookie{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 PolyFillRectangleCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PolyFillRectangle +// polyFillRectangleRequest writes a PolyFillRectangle request to a byte slice. func polyFillRectangleRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Rectangles []Rectangle) []byte { size := xgb.Pad((12 + xgb.Pad((len(Rectangles) * 8)))) b := 0 @@ -10948,30 +11224,35 @@ func polyFillRectangleRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Recta return buf } -// Request PolyFillArc -// size: xgb.Pad((12 + xgb.Pad((len(Arcs) * 12)))) +// PolyFillArcCookie is a cookie used only for PolyFillArc requests. type PolyFillArcCookie struct { *xgb.Cookie } -// Write request to wire for PolyFillArc +// PolyFillArc sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PolyFillArc(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyFillArcCookie { cookie := c.NewCookie(false, false) c.NewRequest(polyFillArcRequest(c, Drawable, Gc, Arcs), cookie) return PolyFillArcCookie{cookie} } +// PolyFillArcChecked sends a checked request. +// If an error occurs, it can be retrieved using PolyFillArcCookie.Check() func PolyFillArcChecked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) PolyFillArcCookie { cookie := c.NewCookie(true, false) c.NewRequest(polyFillArcRequest(c, Drawable, Gc, Arcs), cookie) return PolyFillArcCookie{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 PolyFillArcCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PolyFillArc +// polyFillArcRequest writes a PolyFillArc request to a byte slice. func polyFillArcRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) []byte { size := xgb.Pad((12 + xgb.Pad((len(Arcs) * 12)))) b := 0 @@ -10996,30 +11277,35 @@ func polyFillArcRequest(c *xgb.Conn, Drawable Drawable, Gc Gcontext, Arcs []Arc) return buf } -// Request PutImage -// size: xgb.Pad((24 + xgb.Pad((len(Data) * 1)))) +// PutImageCookie is a cookie used only for PutImage requests. type PutImageCookie struct { *xgb.Cookie } -// Write request to wire for PutImage +// PutImage sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PutImage(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { cookie := c.NewCookie(false, false) c.NewRequest(putImageRequest(c, Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), 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, Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) PutImageCookie { cookie := c.NewCookie(true, false) c.NewRequest(putImageRequest(c, Format, Drawable, Gc, Width, Height, DstX, DstY, LeftPad, Depth, Data), cookie) return PutImageCookie{cookie} } +// Check returns an error if one occurred for checked requests that are not expecting a reply. +// This cannot be called for requests expecting a reply, nor for unchecked requests. func (cook PutImageCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PutImage +// putImageRequest writes a PutImage request to a byte slice. func putImageRequest(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, Width uint16, Height uint16, DstX int16, DstY int16, LeftPad byte, Depth byte, Data []byte) []byte { size := xgb.Pad((24 + xgb.Pad((len(Data) * 1)))) b := 0 @@ -11066,36 +11352,38 @@ func putImageRequest(c *xgb.Conn, Format byte, Drawable Drawable, Gc Gcontext, W return buf } -// Request GetImage -// size: 20 +// GetImageCookie is a cookie used only for GetImage requests. type GetImageCookie struct { *xgb.Cookie } +// GetImage sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetImageCookie.Reply() func GetImage(c *xgb.Conn, Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { cookie := c.NewCookie(true, true) c.NewRequest(getImageRequest(c, Format, Drawable, X, Y, Width, Height, PlaneMask), 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, Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) GetImageCookie { cookie := c.NewCookie(false, true) c.NewRequest(getImageRequest(c, Format, Drawable, X, Y, Width, Height, PlaneMask), cookie) return GetImageCookie{cookie} } -// Request reply for GetImage -// size: (32 + xgb.Pad(((int(Length) * 4) * 1))) +// GetImageReply represents the data returned from a GetImage request. type GetImageReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Depth byte Visual Visualid // padding: 20 bytes Data []byte // size: xgb.Pad(((int(Length) * 4) * 1)) } -// Waits and reads reply data from request GetImage +// Reply blocks and returns the reply data for a GetImage request. func (cook GetImageCookie) Reply() (*GetImageReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -11107,7 +11395,7 @@ func (cook GetImageCookie) Reply() (*GetImageReply, error) { return getImageReply(buf), nil } -// Read reply into structure from buffer for GetImage +// getImageReply reads a byte slice into a GetImageReply value. func getImageReply(buf []byte) *GetImageReply { v := new(GetImageReply) b := 1 // skip reply determinant @@ -11134,6 +11422,7 @@ func getImageReply(buf []byte) *GetImageReply { } // Write request to wire for GetImage +// getImageRequest writes a GetImage request to a byte slice. func getImageRequest(c *xgb.Conn, Format byte, Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32) []byte { size := 20 b := 0 @@ -11169,30 +11458,35 @@ func getImageRequest(c *xgb.Conn, Format byte, Drawable Drawable, X int16, Y int return buf } -// Request PolyText8 -// size: xgb.Pad((16 + xgb.Pad((len(Items) * 1)))) +// PolyText8Cookie is a cookie used only for PolyText8 requests. type PolyText8Cookie struct { *xgb.Cookie } -// Write request to wire for PolyText8 +// PolyText8 sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PolyText8(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText8Cookie { cookie := c.NewCookie(false, false) c.NewRequest(polyText8Request(c, Drawable, Gc, X, Y, Items), cookie) return PolyText8Cookie{cookie} } +// PolyText8Checked sends a checked request. +// If an error occurs, it can be retrieved using PolyText8Cookie.Check() func PolyText8Checked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText8Cookie { cookie := c.NewCookie(true, false) c.NewRequest(polyText8Request(c, Drawable, Gc, X, Y, Items), cookie) return PolyText8Cookie{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 PolyText8Cookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PolyText8 +// polyText8Request writes a PolyText8 request to a byte slice. func polyText8Request(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) []byte { size := xgb.Pad((16 + xgb.Pad((len(Items) * 1)))) b := 0 @@ -11224,30 +11518,35 @@ func polyText8Request(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y in return buf } -// Request PolyText16 -// size: xgb.Pad((16 + xgb.Pad((len(Items) * 1)))) +// PolyText16Cookie is a cookie used only for PolyText16 requests. type PolyText16Cookie struct { *xgb.Cookie } -// Write request to wire for PolyText16 +// PolyText16 sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func PolyText16(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText16Cookie { cookie := c.NewCookie(false, false) c.NewRequest(polyText16Request(c, Drawable, Gc, X, Y, Items), cookie) return PolyText16Cookie{cookie} } +// PolyText16Checked sends a checked request. +// If an error occurs, it can be retrieved using PolyText16Cookie.Check() func PolyText16Checked(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) PolyText16Cookie { cookie := c.NewCookie(true, false) c.NewRequest(polyText16Request(c, Drawable, Gc, X, Y, Items), cookie) return PolyText16Cookie{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 PolyText16Cookie) Check() error { return cook.Cookie.Check() } // Write request to wire for PolyText16 +// polyText16Request writes a PolyText16 request to a byte slice. func polyText16Request(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y int16, Items []byte) []byte { size := xgb.Pad((16 + xgb.Pad((len(Items) * 1)))) b := 0 @@ -11279,30 +11578,35 @@ func polyText16Request(c *xgb.Conn, Drawable Drawable, Gc Gcontext, X int16, Y i return buf } -// Request ImageText8 -// size: xgb.Pad((16 + xgb.Pad((int(StringLen) * 1)))) +// ImageText8Cookie is a cookie used only for ImageText8 requests. type ImageText8Cookie struct { *xgb.Cookie } -// Write request to wire for ImageText8 +// ImageText8 sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ImageText8(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) ImageText8Cookie { cookie := c.NewCookie(false, false) c.NewRequest(imageText8Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) return ImageText8Cookie{cookie} } +// ImageText8Checked sends a checked request. +// If an error occurs, it can be retrieved using ImageText8Cookie.Check() func ImageText8Checked(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) ImageText8Cookie { cookie := c.NewCookie(true, false) c.NewRequest(imageText8Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) return ImageText8Cookie{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 ImageText8Cookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ImageText8 +// imageText8Request writes a ImageText8 request to a byte slice. func imageText8Request(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String string) []byte { size := xgb.Pad((16 + xgb.Pad((int(StringLen) * 1)))) b := 0 @@ -11335,30 +11639,35 @@ func imageText8Request(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gconte return buf } -// Request ImageText16 -// size: xgb.Pad((16 + xgb.Pad((int(StringLen) * 2)))) +// ImageText16Cookie is a cookie used only for ImageText16 requests. type ImageText16Cookie struct { *xgb.Cookie } -// Write request to wire for ImageText16 +// ImageText16 sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ImageText16(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) ImageText16Cookie { cookie := c.NewCookie(false, false) c.NewRequest(imageText16Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) return ImageText16Cookie{cookie} } +// ImageText16Checked sends a checked request. +// If an error occurs, it can be retrieved using ImageText16Cookie.Check() func ImageText16Checked(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) ImageText16Cookie { cookie := c.NewCookie(true, false) c.NewRequest(imageText16Request(c, StringLen, Drawable, Gc, X, Y, String), cookie) return ImageText16Cookie{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 ImageText16Cookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ImageText16 +// imageText16Request writes a ImageText16 request to a byte slice. func imageText16Request(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcontext, X int16, Y int16, String []Char2b) []byte { size := xgb.Pad((16 + xgb.Pad((int(StringLen) * 2)))) b := 0 @@ -11390,30 +11699,35 @@ func imageText16Request(c *xgb.Conn, StringLen byte, Drawable Drawable, Gc Gcont return buf } -// Request CreateColormap -// size: 16 +// CreateColormapCookie is a cookie used only for CreateColormap requests. type CreateColormapCookie struct { *xgb.Cookie } -// Write request to wire for CreateColormap +// CreateColormap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateColormap(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, Visual Visualid) CreateColormapCookie { cookie := c.NewCookie(false, false) c.NewRequest(createColormapRequest(c, Alloc, Mid, Window, Visual), cookie) return CreateColormapCookie{cookie} } +// CreateColormapChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateColormapCookie.Check() func CreateColormapChecked(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, Visual Visualid) CreateColormapCookie { cookie := c.NewCookie(true, false) c.NewRequest(createColormapRequest(c, Alloc, Mid, Window, Visual), cookie) return CreateColormapCookie{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 CreateColormapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateColormap +// createColormapRequest writes a CreateColormap request to a byte slice. func createColormapRequest(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, Visual Visualid) []byte { size := 16 b := 0 @@ -11440,30 +11754,35 @@ func createColormapRequest(c *xgb.Conn, Alloc byte, Mid Colormap, Window Window, return buf } -// Request FreeColormap -// size: 8 +// FreeColormapCookie is a cookie used only for FreeColormap requests. type FreeColormapCookie struct { *xgb.Cookie } -// Write request to wire for FreeColormap +// FreeColormap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreeColormap(c *xgb.Conn, Cmap Colormap) FreeColormapCookie { cookie := c.NewCookie(false, false) c.NewRequest(freeColormapRequest(c, Cmap), cookie) return FreeColormapCookie{cookie} } +// FreeColormapChecked sends a checked request. +// If an error occurs, it can be retrieved using FreeColormapCookie.Check() func FreeColormapChecked(c *xgb.Conn, Cmap Colormap) FreeColormapCookie { cookie := c.NewCookie(true, false) c.NewRequest(freeColormapRequest(c, Cmap), cookie) return FreeColormapCookie{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 FreeColormapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FreeColormap +// freeColormapRequest writes a FreeColormap request to a byte slice. func freeColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { size := 8 b := 0 @@ -11483,30 +11802,35 @@ func freeColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { return buf } -// Request CopyColormapAndFree -// size: 12 +// CopyColormapAndFreeCookie is a cookie used only for CopyColormapAndFree requests. type CopyColormapAndFreeCookie struct { *xgb.Cookie } -// Write request to wire for CopyColormapAndFree +// CopyColormapAndFree sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CopyColormapAndFree(c *xgb.Conn, Mid Colormap, SrcCmap Colormap) CopyColormapAndFreeCookie { cookie := c.NewCookie(false, false) c.NewRequest(copyColormapAndFreeRequest(c, Mid, SrcCmap), cookie) return CopyColormapAndFreeCookie{cookie} } +// CopyColormapAndFreeChecked sends a checked request. +// If an error occurs, it can be retrieved using CopyColormapAndFreeCookie.Check() func CopyColormapAndFreeChecked(c *xgb.Conn, Mid Colormap, SrcCmap Colormap) CopyColormapAndFreeCookie { cookie := c.NewCookie(true, false) c.NewRequest(copyColormapAndFreeRequest(c, Mid, SrcCmap), cookie) return CopyColormapAndFreeCookie{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 CopyColormapAndFreeCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CopyColormapAndFree +// copyColormapAndFreeRequest writes a CopyColormapAndFree request to a byte slice. func copyColormapAndFreeRequest(c *xgb.Conn, Mid Colormap, SrcCmap Colormap) []byte { size := 12 b := 0 @@ -11529,30 +11853,35 @@ func copyColormapAndFreeRequest(c *xgb.Conn, Mid Colormap, SrcCmap Colormap) []b return buf } -// Request InstallColormap -// size: 8 +// InstallColormapCookie is a cookie used only for InstallColormap requests. type InstallColormapCookie struct { *xgb.Cookie } -// Write request to wire for InstallColormap +// InstallColormap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func InstallColormap(c *xgb.Conn, Cmap Colormap) InstallColormapCookie { cookie := c.NewCookie(false, false) c.NewRequest(installColormapRequest(c, Cmap), cookie) return InstallColormapCookie{cookie} } +// InstallColormapChecked sends a checked request. +// If an error occurs, it can be retrieved using InstallColormapCookie.Check() func InstallColormapChecked(c *xgb.Conn, Cmap Colormap) InstallColormapCookie { cookie := c.NewCookie(true, false) c.NewRequest(installColormapRequest(c, Cmap), cookie) return InstallColormapCookie{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 InstallColormapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for InstallColormap +// installColormapRequest writes a InstallColormap request to a byte slice. func installColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { size := 8 b := 0 @@ -11572,30 +11901,35 @@ func installColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { return buf } -// Request UninstallColormap -// size: 8 +// UninstallColormapCookie is a cookie used only for UninstallColormap requests. type UninstallColormapCookie struct { *xgb.Cookie } -// Write request to wire for UninstallColormap +// UninstallColormap sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UninstallColormap(c *xgb.Conn, Cmap Colormap) UninstallColormapCookie { cookie := c.NewCookie(false, false) c.NewRequest(uninstallColormapRequest(c, Cmap), cookie) return UninstallColormapCookie{cookie} } +// UninstallColormapChecked sends a checked request. +// If an error occurs, it can be retrieved using UninstallColormapCookie.Check() func UninstallColormapChecked(c *xgb.Conn, Cmap Colormap) UninstallColormapCookie { cookie := c.NewCookie(true, false) c.NewRequest(uninstallColormapRequest(c, Cmap), cookie) return UninstallColormapCookie{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 UninstallColormapCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UninstallColormap +// uninstallColormapRequest writes a UninstallColormap request to a byte slice. func uninstallColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { size := 8 b := 0 @@ -11615,36 +11949,38 @@ func uninstallColormapRequest(c *xgb.Conn, Cmap Colormap) []byte { return buf } -// Request ListInstalledColormaps -// size: 8 +// ListInstalledColormapsCookie is a cookie used only for ListInstalledColormaps requests. type ListInstalledColormapsCookie struct { *xgb.Cookie } +// ListInstalledColormaps sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListInstalledColormapsCookie.Reply() func ListInstalledColormaps(c *xgb.Conn, Window Window) ListInstalledColormapsCookie { cookie := c.NewCookie(true, true) c.NewRequest(listInstalledColormapsRequest(c, Window), cookie) return ListInstalledColormapsCookie{cookie} } +// ListInstalledColormapsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListInstalledColormapsUnchecked(c *xgb.Conn, Window Window) ListInstalledColormapsCookie { cookie := c.NewCookie(false, true) c.NewRequest(listInstalledColormapsRequest(c, Window), cookie) return ListInstalledColormapsCookie{cookie} } -// Request reply for ListInstalledColormaps -// size: (32 + xgb.Pad((int(CmapsLen) * 4))) +// ListInstalledColormapsReply represents the data returned from a ListInstalledColormaps request. type ListInstalledColormapsReply 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 CmapsLen uint16 // padding: 22 bytes Cmaps []Colormap // size: xgb.Pad((int(CmapsLen) * 4)) } -// Waits and reads reply data from request ListInstalledColormaps +// Reply blocks and returns the reply data for a ListInstalledColormaps request. func (cook ListInstalledColormapsCookie) Reply() (*ListInstalledColormapsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -11656,7 +11992,7 @@ func (cook ListInstalledColormapsCookie) Reply() (*ListInstalledColormapsReply, return listInstalledColormapsReply(buf), nil } -// Read reply into structure from buffer for ListInstalledColormaps +// listInstalledColormapsReply reads a byte slice into a ListInstalledColormapsReply value. func listInstalledColormapsReply(buf []byte) *ListInstalledColormapsReply { v := new(ListInstalledColormapsReply) b := 1 // skip reply determinant @@ -11685,6 +12021,7 @@ func listInstalledColormapsReply(buf []byte) *ListInstalledColormapsReply { } // Write request to wire for ListInstalledColormaps +// listInstalledColormapsRequest writes a ListInstalledColormaps request to a byte slice. func listInstalledColormapsRequest(c *xgb.Conn, Window Window) []byte { size := 8 b := 0 @@ -11704,29 +12041,31 @@ func listInstalledColormapsRequest(c *xgb.Conn, Window Window) []byte { return buf } -// Request AllocColor -// size: 16 +// AllocColorCookie is a cookie used only for AllocColor requests. type AllocColorCookie struct { *xgb.Cookie } +// AllocColor sends a checked request. +// If an error occurs, it will be returned with the reply by calling AllocColorCookie.Reply() func AllocColor(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blue uint16) AllocColorCookie { cookie := c.NewCookie(true, true) c.NewRequest(allocColorRequest(c, Cmap, Red, Green, Blue), cookie) return AllocColorCookie{cookie} } +// AllocColorUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AllocColorUnchecked(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blue uint16) AllocColorCookie { cookie := c.NewCookie(false, true) c.NewRequest(allocColorRequest(c, Cmap, Red, Green, Blue), cookie) return AllocColorCookie{cookie} } -// Request reply for AllocColor -// size: 20 +// AllocColorReply represents the data returned from a AllocColor request. type AllocColorReply 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 Red uint16 Green uint16 @@ -11735,7 +12074,7 @@ type AllocColorReply struct { Pixel uint32 } -// Waits and reads reply data from request AllocColor +// Reply blocks and returns the reply data for a AllocColor request. func (cook AllocColorCookie) Reply() (*AllocColorReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -11747,7 +12086,7 @@ func (cook AllocColorCookie) Reply() (*AllocColorReply, error) { return allocColorReply(buf), nil } -// Read reply into structure from buffer for AllocColor +// allocColorReply reads a byte slice into a AllocColorReply value. func allocColorReply(buf []byte) *AllocColorReply { v := new(AllocColorReply) b := 1 // skip reply determinant @@ -11778,6 +12117,7 @@ func allocColorReply(buf []byte) *AllocColorReply { } // Write request to wire for AllocColor +// allocColorRequest writes a AllocColor request to a byte slice. func allocColorRequest(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blue uint16) []byte { size := 16 b := 0 @@ -11808,29 +12148,31 @@ func allocColorRequest(c *xgb.Conn, Cmap Colormap, Red uint16, Green uint16, Blu return buf } -// Request AllocNamedColor -// size: xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) +// AllocNamedColorCookie is a cookie used only for AllocNamedColor requests. type AllocNamedColorCookie struct { *xgb.Cookie } +// AllocNamedColor sends a checked request. +// If an error occurs, it will be returned with the reply by calling AllocNamedColorCookie.Reply() func AllocNamedColor(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) AllocNamedColorCookie { cookie := c.NewCookie(true, true) c.NewRequest(allocNamedColorRequest(c, Cmap, NameLen, Name), cookie) return AllocNamedColorCookie{cookie} } +// AllocNamedColorUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AllocNamedColorUnchecked(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) AllocNamedColorCookie { cookie := c.NewCookie(false, true) c.NewRequest(allocNamedColorRequest(c, Cmap, NameLen, Name), cookie) return AllocNamedColorCookie{cookie} } -// Request reply for AllocNamedColor -// size: 24 +// AllocNamedColorReply represents the data returned from a AllocNamedColor request. type AllocNamedColorReply 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 Pixel uint32 ExactRed uint16 @@ -11841,7 +12183,7 @@ type AllocNamedColorReply struct { VisualBlue uint16 } -// Waits and reads reply data from request AllocNamedColor +// Reply blocks and returns the reply data for a AllocNamedColor request. func (cook AllocNamedColorCookie) Reply() (*AllocNamedColorReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -11853,7 +12195,7 @@ func (cook AllocNamedColorCookie) Reply() (*AllocNamedColorReply, error) { return allocNamedColorReply(buf), nil } -// Read reply into structure from buffer for AllocNamedColor +// allocNamedColorReply reads a byte slice into a AllocNamedColorReply value. func allocNamedColorReply(buf []byte) *AllocNamedColorReply { v := new(AllocNamedColorReply) b := 1 // skip reply determinant @@ -11891,6 +12233,7 @@ func allocNamedColorReply(buf []byte) *AllocNamedColorReply { } // Write request to wire for AllocNamedColor +// allocNamedColorRequest writes a AllocNamedColor request to a byte slice. func allocNamedColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) []byte { size := xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -11918,29 +12261,31 @@ func allocNamedColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name str return buf } -// Request AllocColorCells -// size: 12 +// AllocColorCellsCookie is a cookie used only for AllocColorCells requests. type AllocColorCellsCookie struct { *xgb.Cookie } +// AllocColorCells sends a checked request. +// If an error occurs, it will be returned with the reply by calling AllocColorCellsCookie.Reply() func AllocColorCells(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) AllocColorCellsCookie { cookie := c.NewCookie(true, true) c.NewRequest(allocColorCellsRequest(c, Contiguous, Cmap, Colors, Planes), cookie) return AllocColorCellsCookie{cookie} } +// AllocColorCellsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AllocColorCellsUnchecked(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) AllocColorCellsCookie { cookie := c.NewCookie(false, true) c.NewRequest(allocColorCellsRequest(c, Contiguous, Cmap, Colors, Planes), cookie) return AllocColorCellsCookie{cookie} } -// Request reply for AllocColorCells -// size: ((32 + xgb.Pad((int(PixelsLen) * 4))) + xgb.Pad((int(MasksLen) * 4))) +// AllocColorCellsReply represents the data returned from a AllocColorCells request. type AllocColorCellsReply 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 PixelsLen uint16 MasksLen uint16 @@ -11949,7 +12294,7 @@ type AllocColorCellsReply struct { Masks []uint32 // size: xgb.Pad((int(MasksLen) * 4)) } -// Waits and reads reply data from request AllocColorCells +// Reply blocks and returns the reply data for a AllocColorCells request. func (cook AllocColorCellsCookie) Reply() (*AllocColorCellsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -11961,7 +12306,7 @@ func (cook AllocColorCellsCookie) Reply() (*AllocColorCellsReply, error) { return allocColorCellsReply(buf), nil } -// Read reply into structure from buffer for AllocColorCells +// allocColorCellsReply reads a byte slice into a AllocColorCellsReply value. func allocColorCellsReply(buf []byte) *AllocColorCellsReply { v := new(AllocColorCellsReply) b := 1 // skip reply determinant @@ -12000,6 +12345,7 @@ func allocColorCellsReply(buf []byte) *AllocColorCellsReply { } // Write request to wire for AllocColorCells +// allocColorCellsRequest writes a AllocColorCells request to a byte slice. func allocColorCellsRequest(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Planes uint16) []byte { size := 12 b := 0 @@ -12030,29 +12376,31 @@ func allocColorCellsRequest(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors return buf } -// Request AllocColorPlanes -// size: 16 +// AllocColorPlanesCookie is a cookie used only for AllocColorPlanes requests. type AllocColorPlanesCookie struct { *xgb.Cookie } +// AllocColorPlanes sends a checked request. +// If an error occurs, it will be returned with the reply by calling AllocColorPlanesCookie.Reply() func AllocColorPlanes(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { cookie := c.NewCookie(true, true) c.NewRequest(allocColorPlanesRequest(c, Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) return AllocColorPlanesCookie{cookie} } +// AllocColorPlanesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AllocColorPlanesUnchecked(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) AllocColorPlanesCookie { cookie := c.NewCookie(false, true) c.NewRequest(allocColorPlanesRequest(c, Contiguous, Cmap, Colors, Reds, Greens, Blues), cookie) return AllocColorPlanesCookie{cookie} } -// Request reply for AllocColorPlanes -// size: (32 + xgb.Pad((int(PixelsLen) * 4))) +// AllocColorPlanesReply represents the data returned from a AllocColorPlanes request. type AllocColorPlanesReply 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 PixelsLen uint16 // padding: 2 bytes @@ -12063,7 +12411,7 @@ type AllocColorPlanesReply struct { Pixels []uint32 // size: xgb.Pad((int(PixelsLen) * 4)) } -// Waits and reads reply data from request AllocColorPlanes +// Reply blocks and returns the reply data for a AllocColorPlanes request. func (cook AllocColorPlanesCookie) Reply() (*AllocColorPlanesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -12075,7 +12423,7 @@ func (cook AllocColorPlanesCookie) Reply() (*AllocColorPlanesReply, error) { return allocColorPlanesReply(buf), nil } -// Read reply into structure from buffer for AllocColorPlanes +// allocColorPlanesReply reads a byte slice into a AllocColorPlanesReply value. func allocColorPlanesReply(buf []byte) *AllocColorPlanesReply { v := new(AllocColorPlanesReply) b := 1 // skip reply determinant @@ -12115,6 +12463,7 @@ func allocColorPlanesReply(buf []byte) *AllocColorPlanesReply { } // Write request to wire for AllocColorPlanes +// allocColorPlanesRequest writes a AllocColorPlanes request to a byte slice. func allocColorPlanesRequest(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors uint16, Reds uint16, Greens uint16, Blues uint16) []byte { size := 16 b := 0 @@ -12151,30 +12500,35 @@ func allocColorPlanesRequest(c *xgb.Conn, Contiguous bool, Cmap Colormap, Colors return buf } -// Request FreeColors -// size: xgb.Pad((12 + xgb.Pad((len(Pixels) * 4)))) +// FreeColorsCookie is a cookie used only for FreeColors requests. type FreeColorsCookie struct { *xgb.Cookie } -// Write request to wire for FreeColors +// FreeColors sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreeColors(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { cookie := c.NewCookie(false, false) c.NewRequest(freeColorsRequest(c, Cmap, PlaneMask, Pixels), cookie) return FreeColorsCookie{cookie} } +// FreeColorsChecked sends a checked request. +// If an error occurs, it can be retrieved using FreeColorsCookie.Check() func FreeColorsChecked(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []uint32) FreeColorsCookie { cookie := c.NewCookie(true, false) c.NewRequest(freeColorsRequest(c, Cmap, PlaneMask, Pixels), cookie) return FreeColorsCookie{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 FreeColorsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FreeColors +// freeColorsRequest writes a FreeColors request to a byte slice. func freeColorsRequest(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []uint32) []byte { size := xgb.Pad((12 + xgb.Pad((len(Pixels) * 4)))) b := 0 @@ -12203,30 +12557,35 @@ func freeColorsRequest(c *xgb.Conn, Cmap Colormap, PlaneMask uint32, Pixels []ui return buf } -// Request StoreColors -// size: xgb.Pad((8 + xgb.Pad((len(Items) * 12)))) +// StoreColorsCookie is a cookie used only for StoreColors requests. type StoreColorsCookie struct { *xgb.Cookie } -// Write request to wire for StoreColors +// StoreColors sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func StoreColors(c *xgb.Conn, Cmap Colormap, Items []Coloritem) StoreColorsCookie { cookie := c.NewCookie(false, false) c.NewRequest(storeColorsRequest(c, Cmap, Items), cookie) return StoreColorsCookie{cookie} } +// StoreColorsChecked sends a checked request. +// If an error occurs, it can be retrieved using StoreColorsCookie.Check() func StoreColorsChecked(c *xgb.Conn, Cmap Colormap, Items []Coloritem) StoreColorsCookie { cookie := c.NewCookie(true, false) c.NewRequest(storeColorsRequest(c, Cmap, Items), cookie) return StoreColorsCookie{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 StoreColorsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for StoreColors +// storeColorsRequest writes a StoreColors request to a byte slice. func storeColorsRequest(c *xgb.Conn, Cmap Colormap, Items []Coloritem) []byte { size := xgb.Pad((8 + xgb.Pad((len(Items) * 12)))) b := 0 @@ -12248,30 +12607,35 @@ func storeColorsRequest(c *xgb.Conn, Cmap Colormap, Items []Coloritem) []byte { return buf } -// Request StoreNamedColor -// size: xgb.Pad((16 + xgb.Pad((int(NameLen) * 1)))) +// StoreNamedColorCookie is a cookie used only for StoreNamedColor requests. type StoreNamedColorCookie struct { *xgb.Cookie } -// Write request to wire for StoreNamedColor +// StoreNamedColor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func StoreNamedColor(c *xgb.Conn, Flags byte, Cmap Colormap, Pixel uint32, NameLen uint16, Name string) StoreNamedColorCookie { cookie := c.NewCookie(false, false) c.NewRequest(storeNamedColorRequest(c, Flags, Cmap, Pixel, NameLen, Name), cookie) return StoreNamedColorCookie{cookie} } +// StoreNamedColorChecked sends a checked request. +// If an error occurs, it can be retrieved using StoreNamedColorCookie.Check() func StoreNamedColorChecked(c *xgb.Conn, Flags byte, Cmap Colormap, Pixel uint32, NameLen uint16, Name string) StoreNamedColorCookie { cookie := c.NewCookie(true, false) c.NewRequest(storeNamedColorRequest(c, Flags, Cmap, Pixel, NameLen, Name), cookie) return StoreNamedColorCookie{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 StoreNamedColorCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for StoreNamedColor +// storeNamedColorRequest writes a StoreNamedColor request to a byte slice. func storeNamedColorRequest(c *xgb.Conn, Flags byte, Cmap Colormap, Pixel uint32, NameLen uint16, Name string) []byte { size := xgb.Pad((16 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -12303,36 +12667,38 @@ func storeNamedColorRequest(c *xgb.Conn, Flags byte, Cmap Colormap, Pixel uint32 return buf } -// Request QueryColors -// size: xgb.Pad((8 + xgb.Pad((len(Pixels) * 4)))) +// QueryColorsCookie is a cookie used only for QueryColors requests. type QueryColorsCookie struct { *xgb.Cookie } +// QueryColors sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryColorsCookie.Reply() func QueryColors(c *xgb.Conn, Cmap Colormap, Pixels []uint32) QueryColorsCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryColorsRequest(c, Cmap, Pixels), cookie) return QueryColorsCookie{cookie} } +// QueryColorsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryColorsUnchecked(c *xgb.Conn, Cmap Colormap, Pixels []uint32) QueryColorsCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryColorsRequest(c, Cmap, Pixels), cookie) return QueryColorsCookie{cookie} } -// Request reply for QueryColors -// size: (32 + xgb.Pad((int(ColorsLen) * 8))) +// QueryColorsReply represents the data returned from a QueryColors request. type QueryColorsReply 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 ColorsLen uint16 // padding: 22 bytes Colors []Rgb // size: xgb.Pad((int(ColorsLen) * 8)) } -// Waits and reads reply data from request QueryColors +// Reply blocks and returns the reply data for a QueryColors request. func (cook QueryColorsCookie) Reply() (*QueryColorsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -12344,7 +12710,7 @@ func (cook QueryColorsCookie) Reply() (*QueryColorsReply, error) { return queryColorsReply(buf), nil } -// Read reply into structure from buffer for QueryColors +// queryColorsReply reads a byte slice into a QueryColorsReply value. func queryColorsReply(buf []byte) *QueryColorsReply { v := new(QueryColorsReply) b := 1 // skip reply determinant @@ -12369,6 +12735,7 @@ func queryColorsReply(buf []byte) *QueryColorsReply { } // Write request to wire for QueryColors +// queryColorsRequest writes a QueryColors request to a byte slice. func queryColorsRequest(c *xgb.Conn, Cmap Colormap, Pixels []uint32) []byte { size := xgb.Pad((8 + xgb.Pad((len(Pixels) * 4)))) b := 0 @@ -12394,29 +12761,31 @@ func queryColorsRequest(c *xgb.Conn, Cmap Colormap, Pixels []uint32) []byte { return buf } -// Request LookupColor -// size: xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) +// LookupColorCookie is a cookie used only for LookupColor requests. type LookupColorCookie struct { *xgb.Cookie } +// LookupColor sends a checked request. +// If an error occurs, it will be returned with the reply by calling LookupColorCookie.Reply() func LookupColor(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) LookupColorCookie { cookie := c.NewCookie(true, true) c.NewRequest(lookupColorRequest(c, Cmap, NameLen, Name), cookie) return LookupColorCookie{cookie} } +// LookupColorUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func LookupColorUnchecked(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) LookupColorCookie { cookie := c.NewCookie(false, true) c.NewRequest(lookupColorRequest(c, Cmap, NameLen, Name), cookie) return LookupColorCookie{cookie} } -// Request reply for LookupColor -// size: 20 +// LookupColorReply represents the data returned from a LookupColor request. type LookupColorReply 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 ExactRed uint16 ExactGreen uint16 @@ -12426,7 +12795,7 @@ type LookupColorReply struct { VisualBlue uint16 } -// Waits and reads reply data from request LookupColor +// Reply blocks and returns the reply data for a LookupColor request. func (cook LookupColorCookie) Reply() (*LookupColorReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -12438,7 +12807,7 @@ func (cook LookupColorCookie) Reply() (*LookupColorReply, error) { return lookupColorReply(buf), nil } -// Read reply into structure from buffer for LookupColor +// lookupColorReply reads a byte slice into a LookupColorReply value. func lookupColorReply(buf []byte) *LookupColorReply { v := new(LookupColorReply) b := 1 // skip reply determinant @@ -12473,6 +12842,7 @@ func lookupColorReply(buf []byte) *LookupColorReply { } // Write request to wire for LookupColor +// lookupColorRequest writes a LookupColor request to a byte slice. func lookupColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) []byte { size := xgb.Pad((12 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -12500,30 +12870,35 @@ func lookupColorRequest(c *xgb.Conn, Cmap Colormap, NameLen uint16, Name string) return buf } -// Request CreateCursor -// size: 32 +// CreateCursorCookie is a cookie used only for CreateCursor requests. type CreateCursorCookie struct { *xgb.Cookie } -// Write request to wire for CreateCursor +// CreateCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateCursor(c *xgb.Conn, Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { cookie := c.NewCookie(false, false) c.NewRequest(createCursorRequest(c, Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) return CreateCursorCookie{cookie} } +// CreateCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateCursorCookie.Check() func CreateCursorChecked(c *xgb.Conn, Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) CreateCursorCookie { cookie := c.NewCookie(true, false) c.NewRequest(createCursorRequest(c, Cid, Source, Mask, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue, X, Y), cookie) return CreateCursorCookie{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 CreateCursorCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateCursor +// createCursorRequest writes a CreateCursor request to a byte slice. func createCursorRequest(c *xgb.Conn, Cid Cursor, Source Pixmap, Mask Pixmap, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16, X uint16, Y uint16) []byte { size := 32 b := 0 @@ -12573,30 +12948,35 @@ func createCursorRequest(c *xgb.Conn, Cid Cursor, Source Pixmap, Mask Pixmap, Fo return buf } -// Request CreateGlyphCursor -// size: 32 +// CreateGlyphCursorCookie is a cookie used only for CreateGlyphCursor requests. type CreateGlyphCursorCookie struct { *xgb.Cookie } -// Write request to wire for CreateGlyphCursor +// CreateGlyphCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CreateGlyphCursor(c *xgb.Conn, Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { cookie := c.NewCookie(false, false) c.NewRequest(createGlyphCursorRequest(c, Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) return CreateGlyphCursorCookie{cookie} } +// CreateGlyphCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using CreateGlyphCursorCookie.Check() func CreateGlyphCursorChecked(c *xgb.Conn, Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) CreateGlyphCursorCookie { cookie := c.NewCookie(true, false) c.NewRequest(createGlyphCursorRequest(c, Cid, SourceFont, MaskFont, SourceChar, MaskChar, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) return CreateGlyphCursorCookie{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 CreateGlyphCursorCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CreateGlyphCursor +// createGlyphCursorRequest writes a CreateGlyphCursor request to a byte slice. func createGlyphCursorRequest(c *xgb.Conn, Cid Cursor, SourceFont Font, MaskFont Font, SourceChar uint16, MaskChar uint16, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { size := 32 b := 0 @@ -12646,30 +13026,35 @@ func createGlyphCursorRequest(c *xgb.Conn, Cid Cursor, SourceFont Font, MaskFont return buf } -// Request FreeCursor -// size: 8 +// FreeCursorCookie is a cookie used only for FreeCursor requests. type FreeCursorCookie struct { *xgb.Cookie } -// Write request to wire for FreeCursor +// FreeCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func FreeCursor(c *xgb.Conn, Cursor Cursor) FreeCursorCookie { cookie := c.NewCookie(false, false) c.NewRequest(freeCursorRequest(c, Cursor), cookie) return FreeCursorCookie{cookie} } +// FreeCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using FreeCursorCookie.Check() func FreeCursorChecked(c *xgb.Conn, Cursor Cursor) FreeCursorCookie { cookie := c.NewCookie(true, false) c.NewRequest(freeCursorRequest(c, Cursor), cookie) return FreeCursorCookie{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 FreeCursorCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for FreeCursor +// freeCursorRequest writes a FreeCursor request to a byte slice. func freeCursorRequest(c *xgb.Conn, Cursor Cursor) []byte { size := 8 b := 0 @@ -12689,30 +13074,35 @@ func freeCursorRequest(c *xgb.Conn, Cursor Cursor) []byte { return buf } -// Request RecolorCursor -// size: 20 +// RecolorCursorCookie is a cookie used only for RecolorCursor requests. type RecolorCursorCookie struct { *xgb.Cookie } -// Write request to wire for RecolorCursor +// RecolorCursor sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RecolorCursor(c *xgb.Conn, Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { cookie := c.NewCookie(false, false) c.NewRequest(recolorCursorRequest(c, Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) return RecolorCursorCookie{cookie} } +// RecolorCursorChecked sends a checked request. +// If an error occurs, it can be retrieved using RecolorCursorCookie.Check() func RecolorCursorChecked(c *xgb.Conn, Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) RecolorCursorCookie { cookie := c.NewCookie(true, false) c.NewRequest(recolorCursorRequest(c, Cursor, ForeRed, ForeGreen, ForeBlue, BackRed, BackGreen, BackBlue), cookie) return RecolorCursorCookie{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 RecolorCursorCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for RecolorCursor +// recolorCursorRequest writes a RecolorCursor request to a byte slice. func recolorCursorRequest(c *xgb.Conn, Cursor Cursor, ForeRed uint16, ForeGreen uint16, ForeBlue uint16, BackRed uint16, BackGreen uint16, BackBlue uint16) []byte { size := 20 b := 0 @@ -12750,35 +13140,37 @@ func recolorCursorRequest(c *xgb.Conn, Cursor Cursor, ForeRed uint16, ForeGreen return buf } -// Request QueryBestSize -// size: 12 +// QueryBestSizeCookie is a cookie used only for QueryBestSize requests. type QueryBestSizeCookie struct { *xgb.Cookie } +// QueryBestSize sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryBestSizeCookie.Reply() func QueryBestSize(c *xgb.Conn, Class byte, Drawable Drawable, Width uint16, Height uint16) QueryBestSizeCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryBestSizeRequest(c, Class, Drawable, Width, Height), cookie) return QueryBestSizeCookie{cookie} } +// QueryBestSizeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryBestSizeUnchecked(c *xgb.Conn, Class byte, Drawable Drawable, Width uint16, Height uint16) QueryBestSizeCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryBestSizeRequest(c, Class, Drawable, Width, Height), cookie) return QueryBestSizeCookie{cookie} } -// Request reply for QueryBestSize -// size: 12 +// QueryBestSizeReply represents the data returned from a QueryBestSize request. type QueryBestSizeReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes Width uint16 Height uint16 } -// Waits and reads reply data from request QueryBestSize +// Reply blocks and returns the reply data for a QueryBestSize request. func (cook QueryBestSizeCookie) Reply() (*QueryBestSizeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -12790,7 +13182,7 @@ func (cook QueryBestSizeCookie) Reply() (*QueryBestSizeReply, error) { return queryBestSizeReply(buf), nil } -// Read reply into structure from buffer for QueryBestSize +// queryBestSizeReply reads a byte slice into a QueryBestSizeReply value. func queryBestSizeReply(buf []byte) *QueryBestSizeReply { v := new(QueryBestSizeReply) b := 1 // skip reply determinant @@ -12813,6 +13205,7 @@ func queryBestSizeReply(buf []byte) *QueryBestSizeReply { } // Write request to wire for QueryBestSize +// queryBestSizeRequest writes a QueryBestSize request to a byte slice. func queryBestSizeRequest(c *xgb.Conn, Class byte, Drawable Drawable, Width uint16, Height uint16) []byte { size := 12 b := 0 @@ -12839,29 +13232,31 @@ func queryBestSizeRequest(c *xgb.Conn, Class byte, Drawable Drawable, Width uint return buf } -// Request QueryExtension -// size: xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) +// QueryExtensionCookie is a cookie used only for QueryExtension requests. type QueryExtensionCookie struct { *xgb.Cookie } +// QueryExtension sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryExtensionCookie.Reply() func QueryExtension(c *xgb.Conn, NameLen uint16, Name string) QueryExtensionCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryExtensionRequest(c, NameLen, Name), cookie) return QueryExtensionCookie{cookie} } +// QueryExtensionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryExtensionUnchecked(c *xgb.Conn, NameLen uint16, Name string) QueryExtensionCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryExtensionRequest(c, NameLen, Name), cookie) return QueryExtensionCookie{cookie} } -// Request reply for QueryExtension -// size: 12 +// QueryExtensionReply represents the data returned from a QueryExtension request. type QueryExtensionReply 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 Present bool MajorOpcode byte @@ -12869,7 +13264,7 @@ type QueryExtensionReply struct { FirstError byte } -// Waits and reads reply data from request QueryExtension +// Reply blocks and returns the reply data for a QueryExtension request. func (cook QueryExtensionCookie) Reply() (*QueryExtensionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -12881,7 +13276,7 @@ func (cook QueryExtensionCookie) Reply() (*QueryExtensionReply, error) { return queryExtensionReply(buf), nil } -// Read reply into structure from buffer for QueryExtension +// queryExtensionReply reads a byte slice into a QueryExtensionReply value. func queryExtensionReply(buf []byte) *QueryExtensionReply { v := new(QueryExtensionReply) b := 1 // skip reply determinant @@ -12914,6 +13309,7 @@ func queryExtensionReply(buf []byte) *QueryExtensionReply { } // Write request to wire for QueryExtension +// queryExtensionRequest writes a QueryExtension request to a byte slice. func queryExtensionRequest(c *xgb.Conn, NameLen uint16, Name string) []byte { size := xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -12938,35 +13334,37 @@ func queryExtensionRequest(c *xgb.Conn, NameLen uint16, Name string) []byte { return buf } -// Request ListExtensions -// size: 4 +// ListExtensionsCookie is a cookie used only for ListExtensions requests. type ListExtensionsCookie struct { *xgb.Cookie } +// ListExtensions sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListExtensionsCookie.Reply() func ListExtensions(c *xgb.Conn) ListExtensionsCookie { cookie := c.NewCookie(true, true) c.NewRequest(listExtensionsRequest(c), cookie) return ListExtensionsCookie{cookie} } +// ListExtensionsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListExtensionsUnchecked(c *xgb.Conn) ListExtensionsCookie { cookie := c.NewCookie(false, true) c.NewRequest(listExtensionsRequest(c), cookie) return ListExtensionsCookie{cookie} } -// Request reply for ListExtensions -// size: (32 + StrListSize(Names)) +// ListExtensionsReply represents the data returned from a ListExtensions request. type ListExtensionsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply NamesLen byte // padding: 24 bytes Names []Str // size: StrListSize(Names) } -// Waits and reads reply data from request ListExtensions +// Reply blocks and returns the reply data for a ListExtensions request. func (cook ListExtensionsCookie) Reply() (*ListExtensionsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -12978,7 +13376,7 @@ func (cook ListExtensionsCookie) Reply() (*ListExtensionsReply, error) { return listExtensionsReply(buf), nil } -// Read reply into structure from buffer for ListExtensions +// listExtensionsReply reads a byte slice into a ListExtensionsReply value. func listExtensionsReply(buf []byte) *ListExtensionsReply { v := new(ListExtensionsReply) b := 1 // skip reply determinant @@ -13001,6 +13399,7 @@ func listExtensionsReply(buf []byte) *ListExtensionsReply { } // Write request to wire for ListExtensions +// listExtensionsRequest writes a ListExtensions request to a byte slice. func listExtensionsRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -13016,30 +13415,35 @@ func listExtensionsRequest(c *xgb.Conn) []byte { return buf } -// Request ChangeKeyboardMapping -// size: xgb.Pad((8 + xgb.Pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) +// ChangeKeyboardMappingCookie is a cookie used only for ChangeKeyboardMapping requests. type ChangeKeyboardMappingCookie struct { *xgb.Cookie } -// Write request to wire for ChangeKeyboardMapping +// ChangeKeyboardMapping sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeKeyboardMapping(c *xgb.Conn, KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) ChangeKeyboardMappingCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeKeyboardMappingRequest(c, KeycodeCount, FirstKeycode, KeysymsPerKeycode, Keysyms), cookie) return ChangeKeyboardMappingCookie{cookie} } +// ChangeKeyboardMappingChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeKeyboardMappingCookie.Check() func ChangeKeyboardMappingChecked(c *xgb.Conn, KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) ChangeKeyboardMappingCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeKeyboardMappingRequest(c, KeycodeCount, FirstKeycode, KeysymsPerKeycode, Keysyms), cookie) return ChangeKeyboardMappingCookie{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 ChangeKeyboardMappingCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeKeyboardMapping +// changeKeyboardMappingRequest writes a ChangeKeyboardMapping request to a byte slice. func changeKeyboardMappingRequest(c *xgb.Conn, KeycodeCount byte, FirstKeycode Keycode, KeysymsPerKeycode byte, Keysyms []Keysym) []byte { size := xgb.Pad((8 + xgb.Pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) b := 0 @@ -13071,35 +13475,37 @@ func changeKeyboardMappingRequest(c *xgb.Conn, KeycodeCount byte, FirstKeycode K return buf } -// Request GetKeyboardMapping -// size: 8 +// GetKeyboardMappingCookie is a cookie used only for GetKeyboardMapping requests. type GetKeyboardMappingCookie struct { *xgb.Cookie } +// GetKeyboardMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetKeyboardMappingCookie.Reply() func GetKeyboardMapping(c *xgb.Conn, FirstKeycode Keycode, Count byte) GetKeyboardMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(getKeyboardMappingRequest(c, FirstKeycode, Count), cookie) return GetKeyboardMappingCookie{cookie} } +// GetKeyboardMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetKeyboardMappingUnchecked(c *xgb.Conn, FirstKeycode Keycode, Count byte) GetKeyboardMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(getKeyboardMappingRequest(c, FirstKeycode, Count), cookie) return GetKeyboardMappingCookie{cookie} } -// Request reply for GetKeyboardMapping -// size: (32 + xgb.Pad((int(Length) * 4))) +// GetKeyboardMappingReply represents the data returned from a GetKeyboardMapping request. type GetKeyboardMappingReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply KeysymsPerKeycode byte // padding: 24 bytes Keysyms []Keysym // size: xgb.Pad((int(Length) * 4)) } -// Waits and reads reply data from request GetKeyboardMapping +// Reply blocks and returns the reply data for a GetKeyboardMapping request. func (cook GetKeyboardMappingCookie) Reply() (*GetKeyboardMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -13111,7 +13517,7 @@ func (cook GetKeyboardMappingCookie) Reply() (*GetKeyboardMappingReply, error) { return getKeyboardMappingReply(buf), nil } -// Read reply into structure from buffer for GetKeyboardMapping +// getKeyboardMappingReply reads a byte slice into a GetKeyboardMappingReply value. func getKeyboardMappingReply(buf []byte) *GetKeyboardMappingReply { v := new(GetKeyboardMappingReply) b := 1 // skip reply determinant @@ -13138,6 +13544,7 @@ func getKeyboardMappingReply(buf []byte) *GetKeyboardMappingReply { } // Write request to wire for GetKeyboardMapping +// getKeyboardMappingRequest writes a GetKeyboardMapping request to a byte slice. func getKeyboardMappingRequest(c *xgb.Conn, FirstKeycode Keycode, Count byte) []byte { size := 8 b := 0 @@ -13160,30 +13567,35 @@ func getKeyboardMappingRequest(c *xgb.Conn, FirstKeycode Keycode, Count byte) [] return buf } -// Request ChangeKeyboardControl -// size: xgb.Pad((4 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) +// ChangeKeyboardControlCookie is a cookie used only for ChangeKeyboardControl requests. type ChangeKeyboardControlCookie struct { *xgb.Cookie } -// Write request to wire for ChangeKeyboardControl +// ChangeKeyboardControl sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeKeyboardControl(c *xgb.Conn, ValueMask uint32, ValueList []uint32) ChangeKeyboardControlCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeKeyboardControlRequest(c, ValueMask, ValueList), cookie) return ChangeKeyboardControlCookie{cookie} } +// ChangeKeyboardControlChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeKeyboardControlCookie.Check() func ChangeKeyboardControlChecked(c *xgb.Conn, ValueMask uint32, ValueList []uint32) ChangeKeyboardControlCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeKeyboardControlRequest(c, ValueMask, ValueList), cookie) return ChangeKeyboardControlCookie{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 ChangeKeyboardControlCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeKeyboardControl +// changeKeyboardControlRequest writes a ChangeKeyboardControl request to a byte slice. func changeKeyboardControlRequest(c *xgb.Conn, ValueMask uint32, ValueList []uint32) []byte { size := xgb.Pad((4 + (4 + xgb.Pad((4 * xgb.PopCount(int(ValueMask))))))) b := 0 @@ -13208,29 +13620,31 @@ func changeKeyboardControlRequest(c *xgb.Conn, ValueMask uint32, ValueList []uin return buf } -// Request GetKeyboardControl -// size: 4 +// GetKeyboardControlCookie is a cookie used only for GetKeyboardControl requests. type GetKeyboardControlCookie struct { *xgb.Cookie } +// GetKeyboardControl sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetKeyboardControlCookie.Reply() func GetKeyboardControl(c *xgb.Conn) GetKeyboardControlCookie { cookie := c.NewCookie(true, true) c.NewRequest(getKeyboardControlRequest(c), cookie) return GetKeyboardControlCookie{cookie} } +// GetKeyboardControlUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetKeyboardControlUnchecked(c *xgb.Conn) GetKeyboardControlCookie { cookie := c.NewCookie(false, true) c.NewRequest(getKeyboardControlRequest(c), cookie) return GetKeyboardControlCookie{cookie} } -// Request reply for GetKeyboardControl -// size: 52 +// GetKeyboardControlReply represents the data returned from a GetKeyboardControl request. type GetKeyboardControlReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply GlobalAutoRepeat byte LedMask uint32 KeyClickPercent byte @@ -13241,7 +13655,7 @@ type GetKeyboardControlReply struct { AutoRepeats []byte // size: 32 } -// Waits and reads reply data from request GetKeyboardControl +// Reply blocks and returns the reply data for a GetKeyboardControl request. func (cook GetKeyboardControlCookie) Reply() (*GetKeyboardControlReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -13253,7 +13667,7 @@ func (cook GetKeyboardControlCookie) Reply() (*GetKeyboardControlReply, error) { return getKeyboardControlReply(buf), nil } -// Read reply into structure from buffer for GetKeyboardControl +// getKeyboardControlReply reads a byte slice into a GetKeyboardControlReply value. func getKeyboardControlReply(buf []byte) *GetKeyboardControlReply { v := new(GetKeyboardControlReply) b := 1 // skip reply determinant @@ -13292,6 +13706,7 @@ func getKeyboardControlReply(buf []byte) *GetKeyboardControlReply { } // Write request to wire for GetKeyboardControl +// getKeyboardControlRequest writes a GetKeyboardControl request to a byte slice. func getKeyboardControlRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -13307,30 +13722,35 @@ func getKeyboardControlRequest(c *xgb.Conn) []byte { return buf } -// Request Bell -// size: 4 +// BellCookie is a cookie used only for Bell requests. type BellCookie struct { *xgb.Cookie } -// Write request to wire for Bell +// Bell sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func Bell(c *xgb.Conn, Percent int8) BellCookie { cookie := c.NewCookie(false, false) c.NewRequest(bellRequest(c, Percent), cookie) return BellCookie{cookie} } +// BellChecked sends a checked request. +// If an error occurs, it can be retrieved using BellCookie.Check() func BellChecked(c *xgb.Conn, Percent int8) BellCookie { cookie := c.NewCookie(true, false) c.NewRequest(bellRequest(c, Percent), cookie) return BellCookie{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 BellCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for Bell +// bellRequest writes a Bell request to a byte slice. func bellRequest(c *xgb.Conn, Percent int8) []byte { size := 4 b := 0 @@ -13348,30 +13768,35 @@ func bellRequest(c *xgb.Conn, Percent int8) []byte { return buf } -// Request ChangePointerControl -// size: 12 +// ChangePointerControlCookie is a cookie used only for ChangePointerControl requests. type ChangePointerControlCookie struct { *xgb.Cookie } -// Write request to wire for ChangePointerControl +// ChangePointerControl sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangePointerControl(c *xgb.Conn, AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) ChangePointerControlCookie { cookie := c.NewCookie(false, false) c.NewRequest(changePointerControlRequest(c, AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) return ChangePointerControlCookie{cookie} } +// ChangePointerControlChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangePointerControlCookie.Check() func ChangePointerControlChecked(c *xgb.Conn, AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) ChangePointerControlCookie { cookie := c.NewCookie(true, false) c.NewRequest(changePointerControlRequest(c, AccelerationNumerator, AccelerationDenominator, Threshold, DoAcceleration, DoThreshold), cookie) return ChangePointerControlCookie{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 ChangePointerControlCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangePointerControl +// changePointerControlRequest writes a ChangePointerControl request to a byte slice. func changePointerControlRequest(c *xgb.Conn, AccelerationNumerator int16, AccelerationDenominator int16, Threshold int16, DoAcceleration bool, DoThreshold bool) []byte { size := 12 b := 0 @@ -13411,29 +13836,31 @@ func changePointerControlRequest(c *xgb.Conn, AccelerationNumerator int16, Accel return buf } -// Request GetPointerControl -// size: 4 +// GetPointerControlCookie is a cookie used only for GetPointerControl requests. type GetPointerControlCookie struct { *xgb.Cookie } +// GetPointerControl sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPointerControlCookie.Reply() func GetPointerControl(c *xgb.Conn) GetPointerControlCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPointerControlRequest(c), cookie) return GetPointerControlCookie{cookie} } +// GetPointerControlUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPointerControlUnchecked(c *xgb.Conn) GetPointerControlCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPointerControlRequest(c), cookie) return GetPointerControlCookie{cookie} } -// Request reply for GetPointerControl -// size: 32 +// GetPointerControlReply represents the data returned from a GetPointerControl request. type GetPointerControlReply 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 AccelerationNumerator uint16 AccelerationDenominator uint16 @@ -13441,7 +13868,7 @@ type GetPointerControlReply struct { // padding: 18 bytes } -// Waits and reads reply data from request GetPointerControl +// Reply blocks and returns the reply data for a GetPointerControl request. func (cook GetPointerControlCookie) Reply() (*GetPointerControlReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -13453,7 +13880,7 @@ func (cook GetPointerControlCookie) Reply() (*GetPointerControlReply, error) { return getPointerControlReply(buf), nil } -// Read reply into structure from buffer for GetPointerControl +// getPointerControlReply reads a byte slice into a GetPointerControlReply value. func getPointerControlReply(buf []byte) *GetPointerControlReply { v := new(GetPointerControlReply) b := 1 // skip reply determinant @@ -13481,6 +13908,7 @@ func getPointerControlReply(buf []byte) *GetPointerControlReply { } // Write request to wire for GetPointerControl +// getPointerControlRequest writes a GetPointerControl request to a byte slice. func getPointerControlRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -13496,30 +13924,35 @@ func getPointerControlRequest(c *xgb.Conn) []byte { return buf } -// Request SetScreenSaver -// size: 12 +// SetScreenSaverCookie is a cookie used only for SetScreenSaver requests. type SetScreenSaverCookie struct { *xgb.Cookie } -// Write request to wire for SetScreenSaver +// SetScreenSaver sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetScreenSaver(c *xgb.Conn, Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) SetScreenSaverCookie { cookie := c.NewCookie(false, false) c.NewRequest(setScreenSaverRequest(c, Timeout, Interval, PreferBlanking, AllowExposures), cookie) return SetScreenSaverCookie{cookie} } +// SetScreenSaverChecked sends a checked request. +// If an error occurs, it can be retrieved using SetScreenSaverCookie.Check() func SetScreenSaverChecked(c *xgb.Conn, Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) SetScreenSaverCookie { cookie := c.NewCookie(true, false) c.NewRequest(setScreenSaverRequest(c, Timeout, Interval, PreferBlanking, AllowExposures), cookie) return SetScreenSaverCookie{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 SetScreenSaverCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetScreenSaver +// setScreenSaverRequest writes a SetScreenSaver request to a byte slice. func setScreenSaverRequest(c *xgb.Conn, Timeout int16, Interval int16, PreferBlanking byte, AllowExposures byte) []byte { size := 12 b := 0 @@ -13548,29 +13981,31 @@ func setScreenSaverRequest(c *xgb.Conn, Timeout int16, Interval int16, PreferBla return buf } -// Request GetScreenSaver -// size: 4 +// GetScreenSaverCookie is a cookie used only for GetScreenSaver requests. type GetScreenSaverCookie struct { *xgb.Cookie } +// GetScreenSaver sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetScreenSaverCookie.Reply() func GetScreenSaver(c *xgb.Conn) GetScreenSaverCookie { cookie := c.NewCookie(true, true) c.NewRequest(getScreenSaverRequest(c), cookie) return GetScreenSaverCookie{cookie} } +// GetScreenSaverUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetScreenSaverUnchecked(c *xgb.Conn) GetScreenSaverCookie { cookie := c.NewCookie(false, true) c.NewRequest(getScreenSaverRequest(c), cookie) return GetScreenSaverCookie{cookie} } -// Request reply for GetScreenSaver -// size: 32 +// GetScreenSaverReply represents the data returned from a GetScreenSaver request. type GetScreenSaverReply 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 Timeout uint16 Interval uint16 @@ -13579,7 +14014,7 @@ type GetScreenSaverReply struct { // padding: 18 bytes } -// Waits and reads reply data from request GetScreenSaver +// Reply blocks and returns the reply data for a GetScreenSaver request. func (cook GetScreenSaverCookie) Reply() (*GetScreenSaverReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -13591,7 +14026,7 @@ func (cook GetScreenSaverCookie) Reply() (*GetScreenSaverReply, error) { return getScreenSaverReply(buf), nil } -// Read reply into structure from buffer for GetScreenSaver +// getScreenSaverReply reads a byte slice into a GetScreenSaverReply value. func getScreenSaverReply(buf []byte) *GetScreenSaverReply { v := new(GetScreenSaverReply) b := 1 // skip reply determinant @@ -13622,6 +14057,7 @@ func getScreenSaverReply(buf []byte) *GetScreenSaverReply { } // Write request to wire for GetScreenSaver +// getScreenSaverRequest writes a GetScreenSaver request to a byte slice. func getScreenSaverRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -13637,30 +14073,35 @@ func getScreenSaverRequest(c *xgb.Conn) []byte { return buf } -// Request ChangeHosts -// size: xgb.Pad((8 + xgb.Pad((int(AddressLen) * 1)))) +// ChangeHostsCookie is a cookie used only for ChangeHosts requests. type ChangeHostsCookie struct { *xgb.Cookie } -// Write request to wire for ChangeHosts +// ChangeHosts sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeHosts(c *xgb.Conn, Mode byte, Family byte, AddressLen uint16, Address []byte) ChangeHostsCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeHostsRequest(c, Mode, Family, AddressLen, Address), cookie) return ChangeHostsCookie{cookie} } +// ChangeHostsChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeHostsCookie.Check() func ChangeHostsChecked(c *xgb.Conn, Mode byte, Family byte, AddressLen uint16, Address []byte) ChangeHostsCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeHostsRequest(c, Mode, Family, AddressLen, Address), cookie) return ChangeHostsCookie{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 ChangeHostsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeHosts +// changeHostsRequest writes a ChangeHosts request to a byte slice. func changeHostsRequest(c *xgb.Conn, Mode byte, Family byte, AddressLen uint16, Address []byte) []byte { size := xgb.Pad((8 + xgb.Pad((int(AddressLen) * 1)))) b := 0 @@ -13689,36 +14130,38 @@ func changeHostsRequest(c *xgb.Conn, Mode byte, Family byte, AddressLen uint16, return buf } -// Request ListHosts -// size: 4 +// ListHostsCookie is a cookie used only for ListHosts requests. type ListHostsCookie struct { *xgb.Cookie } +// ListHosts sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListHostsCookie.Reply() func ListHosts(c *xgb.Conn) ListHostsCookie { cookie := c.NewCookie(true, true) c.NewRequest(listHostsRequest(c), cookie) return ListHostsCookie{cookie} } +// ListHostsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListHostsUnchecked(c *xgb.Conn) ListHostsCookie { cookie := c.NewCookie(false, true) c.NewRequest(listHostsRequest(c), cookie) return ListHostsCookie{cookie} } -// Request reply for ListHosts -// size: (32 + HostListSize(Hosts)) +// ListHostsReply represents the data returned from a ListHosts request. type ListHostsReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Mode byte HostsLen uint16 // padding: 22 bytes Hosts []Host // size: HostListSize(Hosts) } -// Waits and reads reply data from request ListHosts +// Reply blocks and returns the reply data for a ListHosts request. func (cook ListHostsCookie) Reply() (*ListHostsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -13730,7 +14173,7 @@ func (cook ListHostsCookie) Reply() (*ListHostsReply, error) { return listHostsReply(buf), nil } -// Read reply into structure from buffer for ListHosts +// listHostsReply reads a byte slice into a ListHostsReply value. func listHostsReply(buf []byte) *ListHostsReply { v := new(ListHostsReply) b := 1 // skip reply determinant @@ -13756,6 +14199,7 @@ func listHostsReply(buf []byte) *ListHostsReply { } // Write request to wire for ListHosts +// listHostsRequest writes a ListHosts request to a byte slice. func listHostsRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -13771,30 +14215,35 @@ func listHostsRequest(c *xgb.Conn) []byte { return buf } -// Request SetAccessControl -// size: 4 +// SetAccessControlCookie is a cookie used only for SetAccessControl requests. type SetAccessControlCookie struct { *xgb.Cookie } -// Write request to wire for SetAccessControl +// SetAccessControl sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetAccessControl(c *xgb.Conn, Mode byte) SetAccessControlCookie { cookie := c.NewCookie(false, false) c.NewRequest(setAccessControlRequest(c, Mode), cookie) return SetAccessControlCookie{cookie} } +// SetAccessControlChecked sends a checked request. +// If an error occurs, it can be retrieved using SetAccessControlCookie.Check() func SetAccessControlChecked(c *xgb.Conn, Mode byte) SetAccessControlCookie { cookie := c.NewCookie(true, false) c.NewRequest(setAccessControlRequest(c, Mode), cookie) return SetAccessControlCookie{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 SetAccessControlCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetAccessControl +// setAccessControlRequest writes a SetAccessControl request to a byte slice. func setAccessControlRequest(c *xgb.Conn, Mode byte) []byte { size := 4 b := 0 @@ -13812,30 +14261,35 @@ func setAccessControlRequest(c *xgb.Conn, Mode byte) []byte { return buf } -// Request SetCloseDownMode -// size: 4 +// SetCloseDownModeCookie is a cookie used only for SetCloseDownMode requests. type SetCloseDownModeCookie struct { *xgb.Cookie } -// Write request to wire for SetCloseDownMode +// SetCloseDownMode sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetCloseDownMode(c *xgb.Conn, Mode byte) SetCloseDownModeCookie { cookie := c.NewCookie(false, false) c.NewRequest(setCloseDownModeRequest(c, Mode), cookie) return SetCloseDownModeCookie{cookie} } +// SetCloseDownModeChecked sends a checked request. +// If an error occurs, it can be retrieved using SetCloseDownModeCookie.Check() func SetCloseDownModeChecked(c *xgb.Conn, Mode byte) SetCloseDownModeCookie { cookie := c.NewCookie(true, false) c.NewRequest(setCloseDownModeRequest(c, Mode), cookie) return SetCloseDownModeCookie{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 SetCloseDownModeCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetCloseDownMode +// setCloseDownModeRequest writes a SetCloseDownMode request to a byte slice. func setCloseDownModeRequest(c *xgb.Conn, Mode byte) []byte { size := 4 b := 0 @@ -13853,30 +14307,35 @@ func setCloseDownModeRequest(c *xgb.Conn, Mode byte) []byte { return buf } -// Request KillClient -// size: 8 +// KillClientCookie is a cookie used only for KillClient requests. type KillClientCookie struct { *xgb.Cookie } -// Write request to wire for KillClient +// KillClient sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func KillClient(c *xgb.Conn, Resource uint32) KillClientCookie { cookie := c.NewCookie(false, false) c.NewRequest(killClientRequest(c, Resource), cookie) return KillClientCookie{cookie} } +// KillClientChecked sends a checked request. +// If an error occurs, it can be retrieved using KillClientCookie.Check() func KillClientChecked(c *xgb.Conn, Resource uint32) KillClientCookie { cookie := c.NewCookie(true, false) c.NewRequest(killClientRequest(c, Resource), cookie) return KillClientCookie{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 KillClientCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for KillClient +// killClientRequest writes a KillClient request to a byte slice. func killClientRequest(c *xgb.Conn, Resource uint32) []byte { size := 8 b := 0 @@ -13896,30 +14355,35 @@ func killClientRequest(c *xgb.Conn, Resource uint32) []byte { return buf } -// Request RotateProperties -// size: xgb.Pad((12 + xgb.Pad((int(AtomsLen) * 4)))) +// RotatePropertiesCookie is a cookie used only for RotateProperties requests. type RotatePropertiesCookie struct { *xgb.Cookie } -// Write request to wire for RotateProperties +// RotateProperties sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func RotateProperties(c *xgb.Conn, Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) RotatePropertiesCookie { cookie := c.NewCookie(false, false) c.NewRequest(rotatePropertiesRequest(c, Window, AtomsLen, Delta, Atoms), cookie) return RotatePropertiesCookie{cookie} } +// RotatePropertiesChecked sends a checked request. +// If an error occurs, it can be retrieved using RotatePropertiesCookie.Check() func RotatePropertiesChecked(c *xgb.Conn, Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) RotatePropertiesCookie { cookie := c.NewCookie(true, false) c.NewRequest(rotatePropertiesRequest(c, Window, AtomsLen, Delta, Atoms), cookie) return RotatePropertiesCookie{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 RotatePropertiesCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for RotateProperties +// rotatePropertiesRequest writes a RotateProperties request to a byte slice. func rotatePropertiesRequest(c *xgb.Conn, Window Window, AtomsLen uint16, Delta int16, Atoms []Atom) []byte { size := xgb.Pad((12 + xgb.Pad((int(AtomsLen) * 4)))) b := 0 @@ -13951,30 +14415,35 @@ func rotatePropertiesRequest(c *xgb.Conn, Window Window, AtomsLen uint16, Delta return buf } -// Request ForceScreenSaver -// size: 4 +// ForceScreenSaverCookie is a cookie used only for ForceScreenSaver requests. type ForceScreenSaverCookie struct { *xgb.Cookie } -// Write request to wire for ForceScreenSaver +// ForceScreenSaver sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ForceScreenSaver(c *xgb.Conn, Mode byte) ForceScreenSaverCookie { cookie := c.NewCookie(false, false) c.NewRequest(forceScreenSaverRequest(c, Mode), cookie) return ForceScreenSaverCookie{cookie} } +// ForceScreenSaverChecked sends a checked request. +// If an error occurs, it can be retrieved using ForceScreenSaverCookie.Check() func ForceScreenSaverChecked(c *xgb.Conn, Mode byte) ForceScreenSaverCookie { cookie := c.NewCookie(true, false) c.NewRequest(forceScreenSaverRequest(c, Mode), cookie) return ForceScreenSaverCookie{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 ForceScreenSaverCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ForceScreenSaver +// forceScreenSaverRequest writes a ForceScreenSaver request to a byte slice. func forceScreenSaverRequest(c *xgb.Conn, Mode byte) []byte { size := 4 b := 0 @@ -13992,33 +14461,35 @@ func forceScreenSaverRequest(c *xgb.Conn, Mode byte) []byte { return buf } -// Request SetPointerMapping -// size: xgb.Pad((4 + xgb.Pad((int(MapLen) * 1)))) +// SetPointerMappingCookie is a cookie used only for SetPointerMapping requests. type SetPointerMappingCookie struct { *xgb.Cookie } +// SetPointerMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetPointerMappingCookie.Reply() func SetPointerMapping(c *xgb.Conn, MapLen byte, Map []byte) SetPointerMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(setPointerMappingRequest(c, MapLen, Map), cookie) return SetPointerMappingCookie{cookie} } +// SetPointerMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetPointerMappingUnchecked(c *xgb.Conn, MapLen byte, Map []byte) SetPointerMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(setPointerMappingRequest(c, MapLen, Map), cookie) return SetPointerMappingCookie{cookie} } -// Request reply for SetPointerMapping -// size: 8 +// SetPointerMappingReply represents the data returned from a SetPointerMapping request. type SetPointerMappingReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Status byte } -// Waits and reads reply data from request SetPointerMapping +// Reply blocks and returns the reply data for a SetPointerMapping request. func (cook SetPointerMappingCookie) Reply() (*SetPointerMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -14030,7 +14501,7 @@ func (cook SetPointerMappingCookie) Reply() (*SetPointerMappingReply, error) { return setPointerMappingReply(buf), nil } -// Read reply into structure from buffer for SetPointerMapping +// setPointerMappingReply reads a byte slice into a SetPointerMappingReply value. func setPointerMappingReply(buf []byte) *SetPointerMappingReply { v := new(SetPointerMappingReply) b := 1 // skip reply determinant @@ -14048,6 +14519,7 @@ func setPointerMappingReply(buf []byte) *SetPointerMappingReply { } // Write request to wire for SetPointerMapping +// setPointerMappingRequest writes a SetPointerMapping request to a byte slice. func setPointerMappingRequest(c *xgb.Conn, MapLen byte, Map []byte) []byte { size := xgb.Pad((4 + xgb.Pad((int(MapLen) * 1)))) b := 0 @@ -14068,35 +14540,37 @@ func setPointerMappingRequest(c *xgb.Conn, MapLen byte, Map []byte) []byte { return buf } -// Request GetPointerMapping -// size: 4 +// GetPointerMappingCookie is a cookie used only for GetPointerMapping requests. type GetPointerMappingCookie struct { *xgb.Cookie } +// GetPointerMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetPointerMappingCookie.Reply() func GetPointerMapping(c *xgb.Conn) GetPointerMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(getPointerMappingRequest(c), cookie) return GetPointerMappingCookie{cookie} } +// GetPointerMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetPointerMappingUnchecked(c *xgb.Conn) GetPointerMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(getPointerMappingRequest(c), cookie) return GetPointerMappingCookie{cookie} } -// Request reply for GetPointerMapping -// size: (32 + xgb.Pad((int(MapLen) * 1))) +// GetPointerMappingReply represents the data returned from a GetPointerMapping request. type GetPointerMappingReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply MapLen byte // padding: 24 bytes Map []byte // size: xgb.Pad((int(MapLen) * 1)) } -// Waits and reads reply data from request GetPointerMapping +// Reply blocks and returns the reply data for a GetPointerMapping request. func (cook GetPointerMappingCookie) Reply() (*GetPointerMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -14108,7 +14582,7 @@ func (cook GetPointerMappingCookie) Reply() (*GetPointerMappingReply, error) { return getPointerMappingReply(buf), nil } -// Read reply into structure from buffer for GetPointerMapping +// getPointerMappingReply reads a byte slice into a GetPointerMappingReply value. func getPointerMappingReply(buf []byte) *GetPointerMappingReply { v := new(GetPointerMappingReply) b := 1 // skip reply determinant @@ -14132,6 +14606,7 @@ func getPointerMappingReply(buf []byte) *GetPointerMappingReply { } // Write request to wire for GetPointerMapping +// getPointerMappingRequest writes a GetPointerMapping request to a byte slice. func getPointerMappingRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -14147,33 +14622,35 @@ func getPointerMappingRequest(c *xgb.Conn) []byte { return buf } -// Request SetModifierMapping -// size: xgb.Pad((4 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)))) +// SetModifierMappingCookie is a cookie used only for SetModifierMapping requests. type SetModifierMappingCookie struct { *xgb.Cookie } +// SetModifierMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetModifierMappingCookie.Reply() func SetModifierMapping(c *xgb.Conn, KeycodesPerModifier byte, Keycodes []Keycode) SetModifierMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(setModifierMappingRequest(c, KeycodesPerModifier, Keycodes), cookie) return SetModifierMappingCookie{cookie} } +// SetModifierMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetModifierMappingUnchecked(c *xgb.Conn, KeycodesPerModifier byte, Keycodes []Keycode) SetModifierMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(setModifierMappingRequest(c, KeycodesPerModifier, Keycodes), cookie) return SetModifierMappingCookie{cookie} } -// Request reply for SetModifierMapping -// size: 8 +// SetModifierMappingReply represents the data returned from a SetModifierMapping request. type SetModifierMappingReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply Status byte } -// Waits and reads reply data from request SetModifierMapping +// Reply blocks and returns the reply data for a SetModifierMapping request. func (cook SetModifierMappingCookie) Reply() (*SetModifierMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -14185,7 +14662,7 @@ func (cook SetModifierMappingCookie) Reply() (*SetModifierMappingReply, error) { return setModifierMappingReply(buf), nil } -// Read reply into structure from buffer for SetModifierMapping +// setModifierMappingReply reads a byte slice into a SetModifierMappingReply value. func setModifierMappingReply(buf []byte) *SetModifierMappingReply { v := new(SetModifierMappingReply) b := 1 // skip reply determinant @@ -14203,6 +14680,7 @@ func setModifierMappingReply(buf []byte) *SetModifierMappingReply { } // Write request to wire for SetModifierMapping +// setModifierMappingRequest writes a SetModifierMapping request to a byte slice. func setModifierMappingRequest(c *xgb.Conn, KeycodesPerModifier byte, Keycodes []Keycode) []byte { size := xgb.Pad((4 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)))) b := 0 @@ -14226,35 +14704,37 @@ func setModifierMappingRequest(c *xgb.Conn, KeycodesPerModifier byte, Keycodes [ return buf } -// Request GetModifierMapping -// size: 4 +// GetModifierMappingCookie is a cookie used only for GetModifierMapping requests. type GetModifierMappingCookie struct { *xgb.Cookie } +// GetModifierMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetModifierMappingCookie.Reply() func GetModifierMapping(c *xgb.Conn) GetModifierMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(getModifierMappingRequest(c), cookie) return GetModifierMappingCookie{cookie} } +// GetModifierMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetModifierMappingUnchecked(c *xgb.Conn) GetModifierMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(getModifierMappingRequest(c), cookie) return GetModifierMappingCookie{cookie} } -// Request reply for GetModifierMapping -// size: (32 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1))) +// GetModifierMappingReply represents the data returned from a GetModifierMapping request. type GetModifierMappingReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply KeycodesPerModifier byte // padding: 24 bytes Keycodes []Keycode // size: xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)) } -// Waits and reads reply data from request GetModifierMapping +// Reply blocks and returns the reply data for a GetModifierMapping request. func (cook GetModifierMappingCookie) Reply() (*GetModifierMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -14266,7 +14746,7 @@ func (cook GetModifierMappingCookie) Reply() (*GetModifierMappingReply, error) { return getModifierMappingReply(buf), nil } -// Read reply into structure from buffer for GetModifierMapping +// getModifierMappingReply reads a byte slice into a GetModifierMappingReply value. func getModifierMappingReply(buf []byte) *GetModifierMappingReply { v := new(GetModifierMappingReply) b := 1 // skip reply determinant @@ -14293,6 +14773,7 @@ func getModifierMappingReply(buf []byte) *GetModifierMappingReply { } // Write request to wire for GetModifierMapping +// getModifierMappingRequest writes a GetModifierMapping request to a byte slice. func getModifierMappingRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -14308,30 +14789,35 @@ func getModifierMappingRequest(c *xgb.Conn) []byte { return buf } -// Request NoOperation -// size: 4 +// NoOperationCookie is a cookie used only for NoOperation requests. type NoOperationCookie struct { *xgb.Cookie } -// Write request to wire for NoOperation +// NoOperation sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func NoOperation(c *xgb.Conn) NoOperationCookie { cookie := c.NewCookie(false, false) c.NewRequest(noOperationRequest(c), cookie) return NoOperationCookie{cookie} } +// NoOperationChecked sends a checked request. +// If an error occurs, it can be retrieved using NoOperationCookie.Check() func NoOperationChecked(c *xgb.Conn) NoOperationCookie { cookie := c.NewCookie(true, false) c.NewRequest(noOperationRequest(c), cookie) return NoOperationCookie{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 NoOperationCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for NoOperation +// noOperationRequest writes a NoOperation request to a byte slice. func noOperationRequest(c *xgb.Conn) []byte { size := 4 b := 0 -- cgit v1.2.3