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/xinput/xinput.go | 1169 +++++++++++++++++++++++++----------------------- 1 file changed, 611 insertions(+), 558 deletions(-) (limited to 'nexgb/xinput') diff --git a/nexgb/xinput/xinput.go b/nexgb/xinput/xinput.go index cdb0fec..2c2247c 100644 --- a/nexgb/xinput/xinput.go +++ b/nexgb/xinput/xinput.go @@ -2,7 +2,7 @@ package xinput /* - This file was generated by xinput.xml on May 10 2012 8:04:32pm EDT. + This file was generated by xinput.xml on May 10 2012 11:56:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -114,8 +114,6 @@ type KeyCode byte type EventClass uint32 -// 'DeviceInfo' struct definition -// Size: 8 type DeviceInfo struct { DeviceType xproto.Atom DeviceId byte @@ -124,7 +122,7 @@ type DeviceInfo struct { // padding: 1 bytes } -// Struct read DeviceInfo +// DeviceInfoRead reads a byte slice into a DeviceInfo value. func DeviceInfoRead(buf []byte, v *DeviceInfo) int { b := 0 @@ -145,7 +143,7 @@ func DeviceInfoRead(buf []byte, v *DeviceInfo) int { return b } -// Struct list read DeviceInfo +// DeviceInfoReadList reads a byte slice into a list of DeviceInfo values. func DeviceInfoReadList(buf []byte, dest []DeviceInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -155,7 +153,7 @@ func DeviceInfoReadList(buf []byte, dest []DeviceInfo) int { return xgb.Pad(b) } -// Struct write DeviceInfo +// Bytes writes a DeviceInfo value to a byte slice. func (v DeviceInfo) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -177,7 +175,7 @@ func (v DeviceInfo) Bytes() []byte { return buf } -// Write struct list DeviceInfo +// DeviceInfoListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceInfoListBytes(buf []byte, list []DeviceInfo) int { b := 0 var structBytes []byte @@ -189,14 +187,12 @@ func DeviceInfoListBytes(buf []byte, list []DeviceInfo) int { return b } -// 'InputInfo' struct definition -// Size: 2 type InputInfo struct { ClassId byte Len byte } -// Struct read InputInfo +// InputInfoRead reads a byte slice into a InputInfo value. func InputInfoRead(buf []byte, v *InputInfo) int { b := 0 @@ -209,7 +205,7 @@ func InputInfoRead(buf []byte, v *InputInfo) int { return b } -// Struct list read InputInfo +// InputInfoReadList reads a byte slice into a list of InputInfo values. func InputInfoReadList(buf []byte, dest []InputInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -219,7 +215,7 @@ func InputInfoReadList(buf []byte, dest []InputInfo) int { return xgb.Pad(b) } -// Struct write InputInfo +// Bytes writes a InputInfo value to a byte slice. func (v InputInfo) Bytes() []byte { buf := make([]byte, 2) b := 0 @@ -233,7 +229,7 @@ func (v InputInfo) Bytes() []byte { return buf } -// Write struct list InputInfo +// InputInfoListBytes writes a list of %s(MISSING) values to a byte slice. func InputInfoListBytes(buf []byte, list []InputInfo) int { b := 0 var structBytes []byte @@ -245,8 +241,6 @@ func InputInfoListBytes(buf []byte, list []InputInfo) int { return b } -// 'KeyInfo' struct definition -// Size: 8 type KeyInfo struct { ClassId byte Len byte @@ -256,7 +250,7 @@ type KeyInfo struct { // padding: 2 bytes } -// Struct read KeyInfo +// KeyInfoRead reads a byte slice into a KeyInfo value. func KeyInfoRead(buf []byte, v *KeyInfo) int { b := 0 @@ -280,7 +274,7 @@ func KeyInfoRead(buf []byte, v *KeyInfo) int { return b } -// Struct list read KeyInfo +// KeyInfoReadList reads a byte slice into a list of KeyInfo values. func KeyInfoReadList(buf []byte, dest []KeyInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -290,7 +284,7 @@ func KeyInfoReadList(buf []byte, dest []KeyInfo) int { return xgb.Pad(b) } -// Struct write KeyInfo +// Bytes writes a KeyInfo value to a byte slice. func (v KeyInfo) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -315,7 +309,7 @@ func (v KeyInfo) Bytes() []byte { return buf } -// Write struct list KeyInfo +// KeyInfoListBytes writes a list of %s(MISSING) values to a byte slice. func KeyInfoListBytes(buf []byte, list []KeyInfo) int { b := 0 var structBytes []byte @@ -327,15 +321,13 @@ func KeyInfoListBytes(buf []byte, list []KeyInfo) int { return b } -// 'ButtonInfo' struct definition -// Size: 4 type ButtonInfo struct { ClassId byte Len byte NumButtons uint16 } -// Struct read ButtonInfo +// ButtonInfoRead reads a byte slice into a ButtonInfo value. func ButtonInfoRead(buf []byte, v *ButtonInfo) int { b := 0 @@ -351,7 +343,7 @@ func ButtonInfoRead(buf []byte, v *ButtonInfo) int { return b } -// Struct list read ButtonInfo +// ButtonInfoReadList reads a byte slice into a list of ButtonInfo values. func ButtonInfoReadList(buf []byte, dest []ButtonInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -361,7 +353,7 @@ func ButtonInfoReadList(buf []byte, dest []ButtonInfo) int { return xgb.Pad(b) } -// Struct write ButtonInfo +// Bytes writes a ButtonInfo value to a byte slice. func (v ButtonInfo) Bytes() []byte { buf := make([]byte, 4) b := 0 @@ -378,7 +370,7 @@ func (v ButtonInfo) Bytes() []byte { return buf } -// Write struct list ButtonInfo +// ButtonInfoListBytes writes a list of %s(MISSING) values to a byte slice. func ButtonInfoListBytes(buf []byte, list []ButtonInfo) int { b := 0 var structBytes []byte @@ -390,15 +382,13 @@ func ButtonInfoListBytes(buf []byte, list []ButtonInfo) int { return b } -// 'AxisInfo' struct definition -// Size: 12 type AxisInfo struct { Resolution uint32 Minimum int32 Maximum int32 } -// Struct read AxisInfo +// AxisInfoRead reads a byte slice into a AxisInfo value. func AxisInfoRead(buf []byte, v *AxisInfo) int { b := 0 @@ -414,7 +404,7 @@ func AxisInfoRead(buf []byte, v *AxisInfo) int { return b } -// Struct list read AxisInfo +// AxisInfoReadList reads a byte slice into a list of AxisInfo values. func AxisInfoReadList(buf []byte, dest []AxisInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -424,7 +414,7 @@ func AxisInfoReadList(buf []byte, dest []AxisInfo) int { return xgb.Pad(b) } -// Struct write AxisInfo +// Bytes writes a AxisInfo value to a byte slice. func (v AxisInfo) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -441,7 +431,7 @@ func (v AxisInfo) Bytes() []byte { return buf } -// Write struct list AxisInfo +// AxisInfoListBytes writes a list of %s(MISSING) values to a byte slice. func AxisInfoListBytes(buf []byte, list []AxisInfo) int { b := 0 var structBytes []byte @@ -453,8 +443,6 @@ func AxisInfoListBytes(buf []byte, list []AxisInfo) int { return b } -// 'ValuatorInfo' struct definition -// Size: (8 + xgb.Pad((int(AxesLen) * 12))) type ValuatorInfo struct { ClassId byte Len byte @@ -464,7 +452,7 @@ type ValuatorInfo struct { Axes []AxisInfo // size: xgb.Pad((int(AxesLen) * 12)) } -// Struct read ValuatorInfo +// ValuatorInfoRead reads a byte slice into a ValuatorInfo value. func ValuatorInfoRead(buf []byte, v *ValuatorInfo) int { b := 0 @@ -489,7 +477,7 @@ func ValuatorInfoRead(buf []byte, v *ValuatorInfo) int { return b } -// Struct list read ValuatorInfo +// ValuatorInfoReadList reads a byte slice into a list of ValuatorInfo values. func ValuatorInfoReadList(buf []byte, dest []ValuatorInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -499,7 +487,7 @@ func ValuatorInfoReadList(buf []byte, dest []ValuatorInfo) int { return xgb.Pad(b) } -// Struct write ValuatorInfo +// Bytes writes a ValuatorInfo value to a byte slice. func (v ValuatorInfo) Bytes() []byte { buf := make([]byte, (8 + xgb.Pad((int(v.AxesLen) * 12)))) b := 0 @@ -524,7 +512,7 @@ func (v ValuatorInfo) Bytes() []byte { return buf } -// Write struct list ValuatorInfo +// ValuatorInfoListBytes writes a list of %s(MISSING) values to a byte slice. func ValuatorInfoListBytes(buf []byte, list []ValuatorInfo) int { b := 0 var structBytes []byte @@ -536,7 +524,7 @@ func ValuatorInfoListBytes(buf []byte, list []ValuatorInfo) int { return b } -// Struct list size ValuatorInfo +// ValuatorInfoListSize computes the size (bytes) of a list of ValuatorInfo values. func ValuatorInfoListSize(list []ValuatorInfo) int { size := 0 for _, item := range list { @@ -545,14 +533,12 @@ func ValuatorInfoListSize(list []ValuatorInfo) int { return size } -// 'InputClassInfo' struct definition -// Size: 2 type InputClassInfo struct { ClassId byte EventTypeBase byte } -// Struct read InputClassInfo +// InputClassInfoRead reads a byte slice into a InputClassInfo value. func InputClassInfoRead(buf []byte, v *InputClassInfo) int { b := 0 @@ -565,7 +551,7 @@ func InputClassInfoRead(buf []byte, v *InputClassInfo) int { return b } -// Struct list read InputClassInfo +// InputClassInfoReadList reads a byte slice into a list of InputClassInfo values. func InputClassInfoReadList(buf []byte, dest []InputClassInfo) int { b := 0 for i := 0; i < len(dest); i++ { @@ -575,7 +561,7 @@ func InputClassInfoReadList(buf []byte, dest []InputClassInfo) int { return xgb.Pad(b) } -// Struct write InputClassInfo +// Bytes writes a InputClassInfo value to a byte slice. func (v InputClassInfo) Bytes() []byte { buf := make([]byte, 2) b := 0 @@ -589,7 +575,7 @@ func (v InputClassInfo) Bytes() []byte { return buf } -// Write struct list InputClassInfo +// InputClassInfoListBytes writes a list of %s(MISSING) values to a byte slice. func InputClassInfoListBytes(buf []byte, list []InputClassInfo) int { b := 0 var structBytes []byte @@ -601,13 +587,11 @@ func InputClassInfoListBytes(buf []byte, list []InputClassInfo) int { return b } -// 'DeviceTimeCoord' struct definition -// Size: 4 type DeviceTimeCoord struct { Time xproto.Timestamp } -// Struct read DeviceTimeCoord +// DeviceTimeCoordRead reads a byte slice into a DeviceTimeCoord value. func DeviceTimeCoordRead(buf []byte, v *DeviceTimeCoord) int { b := 0 @@ -617,7 +601,7 @@ func DeviceTimeCoordRead(buf []byte, v *DeviceTimeCoord) int { return b } -// Struct list read DeviceTimeCoord +// DeviceTimeCoordReadList reads a byte slice into a list of DeviceTimeCoord values. func DeviceTimeCoordReadList(buf []byte, dest []DeviceTimeCoord) int { b := 0 for i := 0; i < len(dest); i++ { @@ -627,7 +611,7 @@ func DeviceTimeCoordReadList(buf []byte, dest []DeviceTimeCoord) int { return xgb.Pad(b) } -// Struct write DeviceTimeCoord +// Bytes writes a DeviceTimeCoord value to a byte slice. func (v DeviceTimeCoord) Bytes() []byte { buf := make([]byte, 4) b := 0 @@ -638,7 +622,7 @@ func (v DeviceTimeCoord) Bytes() []byte { return buf } -// Write struct list DeviceTimeCoord +// DeviceTimeCoordListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceTimeCoordListBytes(buf []byte, list []DeviceTimeCoord) int { b := 0 var structBytes []byte @@ -650,15 +634,13 @@ func DeviceTimeCoordListBytes(buf []byte, list []DeviceTimeCoord) int { return b } -// 'FeedbackState' struct definition -// Size: 4 type FeedbackState struct { ClassId byte Id byte Len uint16 } -// Struct read FeedbackState +// FeedbackStateRead reads a byte slice into a FeedbackState value. func FeedbackStateRead(buf []byte, v *FeedbackState) int { b := 0 @@ -674,7 +656,7 @@ func FeedbackStateRead(buf []byte, v *FeedbackState) int { return b } -// Struct list read FeedbackState +// FeedbackStateReadList reads a byte slice into a list of FeedbackState values. func FeedbackStateReadList(buf []byte, dest []FeedbackState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -684,7 +666,7 @@ func FeedbackStateReadList(buf []byte, dest []FeedbackState) int { return xgb.Pad(b) } -// Struct write FeedbackState +// Bytes writes a FeedbackState value to a byte slice. func (v FeedbackState) Bytes() []byte { buf := make([]byte, 4) b := 0 @@ -701,7 +683,7 @@ func (v FeedbackState) Bytes() []byte { return buf } -// Write struct list FeedbackState +// FeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. func FeedbackStateListBytes(buf []byte, list []FeedbackState) int { b := 0 var structBytes []byte @@ -713,8 +695,6 @@ func FeedbackStateListBytes(buf []byte, list []FeedbackState) int { return b } -// 'KbdFeedbackState' struct definition -// Size: 52 type KbdFeedbackState struct { ClassId byte Id byte @@ -730,7 +710,7 @@ type KbdFeedbackState struct { AutoRepeats []byte // size: 32 } -// Struct read KbdFeedbackState +// KbdFeedbackStateRead reads a byte slice into a KbdFeedbackState value. func KbdFeedbackStateRead(buf []byte, v *KbdFeedbackState) int { b := 0 @@ -777,7 +757,7 @@ func KbdFeedbackStateRead(buf []byte, v *KbdFeedbackState) int { return b } -// Struct list read KbdFeedbackState +// KbdFeedbackStateReadList reads a byte slice into a list of KbdFeedbackState values. func KbdFeedbackStateReadList(buf []byte, dest []KbdFeedbackState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -787,7 +767,7 @@ func KbdFeedbackStateReadList(buf []byte, dest []KbdFeedbackState) int { return xgb.Pad(b) } -// Struct write KbdFeedbackState +// Bytes writes a KbdFeedbackState value to a byte slice. func (v KbdFeedbackState) Bytes() []byte { buf := make([]byte, 52) b := 0 @@ -834,7 +814,7 @@ func (v KbdFeedbackState) Bytes() []byte { return buf } -// Write struct list KbdFeedbackState +// KbdFeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. func KbdFeedbackStateListBytes(buf []byte, list []KbdFeedbackState) int { b := 0 var structBytes []byte @@ -846,7 +826,7 @@ func KbdFeedbackStateListBytes(buf []byte, list []KbdFeedbackState) int { return b } -// Struct list size KbdFeedbackState +// KbdFeedbackStateListSize computes the size (bytes) of a list of KbdFeedbackState values. func KbdFeedbackStateListSize(list []KbdFeedbackState) int { size := 0 for _ = range list { @@ -855,8 +835,6 @@ func KbdFeedbackStateListSize(list []KbdFeedbackState) int { return size } -// 'PtrFeedbackState' struct definition -// Size: 12 type PtrFeedbackState struct { ClassId byte Id byte @@ -867,7 +845,7 @@ type PtrFeedbackState struct { Threshold uint16 } -// Struct read PtrFeedbackState +// PtrFeedbackStateRead reads a byte slice into a PtrFeedbackState value. func PtrFeedbackStateRead(buf []byte, v *PtrFeedbackState) int { b := 0 @@ -894,7 +872,7 @@ func PtrFeedbackStateRead(buf []byte, v *PtrFeedbackState) int { return b } -// Struct list read PtrFeedbackState +// PtrFeedbackStateReadList reads a byte slice into a list of PtrFeedbackState values. func PtrFeedbackStateReadList(buf []byte, dest []PtrFeedbackState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -904,7 +882,7 @@ func PtrFeedbackStateReadList(buf []byte, dest []PtrFeedbackState) int { return xgb.Pad(b) } -// Struct write PtrFeedbackState +// Bytes writes a PtrFeedbackState value to a byte slice. func (v PtrFeedbackState) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -932,7 +910,7 @@ func (v PtrFeedbackState) Bytes() []byte { return buf } -// Write struct list PtrFeedbackState +// PtrFeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. func PtrFeedbackStateListBytes(buf []byte, list []PtrFeedbackState) int { b := 0 var structBytes []byte @@ -944,8 +922,6 @@ func PtrFeedbackStateListBytes(buf []byte, list []PtrFeedbackState) int { return b } -// 'IntegerFeedbackState' struct definition -// Size: 16 type IntegerFeedbackState struct { ClassId byte Id byte @@ -955,7 +931,7 @@ type IntegerFeedbackState struct { MaxValue int32 } -// Struct read IntegerFeedbackState +// IntegerFeedbackStateRead reads a byte slice into a IntegerFeedbackState value. func IntegerFeedbackStateRead(buf []byte, v *IntegerFeedbackState) int { b := 0 @@ -980,7 +956,7 @@ func IntegerFeedbackStateRead(buf []byte, v *IntegerFeedbackState) int { return b } -// Struct list read IntegerFeedbackState +// IntegerFeedbackStateReadList reads a byte slice into a list of IntegerFeedbackState values. func IntegerFeedbackStateReadList(buf []byte, dest []IntegerFeedbackState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -990,7 +966,7 @@ func IntegerFeedbackStateReadList(buf []byte, dest []IntegerFeedbackState) int { return xgb.Pad(b) } -// Struct write IntegerFeedbackState +// Bytes writes a IntegerFeedbackState value to a byte slice. func (v IntegerFeedbackState) Bytes() []byte { buf := make([]byte, 16) b := 0 @@ -1016,7 +992,7 @@ func (v IntegerFeedbackState) Bytes() []byte { return buf } -// Write struct list IntegerFeedbackState +// IntegerFeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. func IntegerFeedbackStateListBytes(buf []byte, list []IntegerFeedbackState) int { b := 0 var structBytes []byte @@ -1028,8 +1004,6 @@ func IntegerFeedbackStateListBytes(buf []byte, list []IntegerFeedbackState) int return b } -// 'StringFeedbackState' struct definition -// Size: (8 + xgb.Pad((int(NumKeysyms) * 4))) type StringFeedbackState struct { ClassId byte Id byte @@ -1039,7 +1013,7 @@ type StringFeedbackState struct { Keysyms []xproto.Keysym // size: xgb.Pad((int(NumKeysyms) * 4)) } -// Struct read StringFeedbackState +// StringFeedbackStateRead reads a byte slice into a StringFeedbackState value. func StringFeedbackStateRead(buf []byte, v *StringFeedbackState) int { b := 0 @@ -1068,7 +1042,7 @@ func StringFeedbackStateRead(buf []byte, v *StringFeedbackState) int { return b } -// Struct list read StringFeedbackState +// StringFeedbackStateReadList reads a byte slice into a list of StringFeedbackState values. func StringFeedbackStateReadList(buf []byte, dest []StringFeedbackState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1078,7 +1052,7 @@ func StringFeedbackStateReadList(buf []byte, dest []StringFeedbackState) int { return xgb.Pad(b) } -// Struct write StringFeedbackState +// Bytes writes a StringFeedbackState value to a byte slice. func (v StringFeedbackState) Bytes() []byte { buf := make([]byte, (8 + xgb.Pad((int(v.NumKeysyms) * 4)))) b := 0 @@ -1107,7 +1081,7 @@ func (v StringFeedbackState) Bytes() []byte { return buf } -// Write struct list StringFeedbackState +// StringFeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. func StringFeedbackStateListBytes(buf []byte, list []StringFeedbackState) int { b := 0 var structBytes []byte @@ -1119,7 +1093,7 @@ func StringFeedbackStateListBytes(buf []byte, list []StringFeedbackState) int { return b } -// Struct list size StringFeedbackState +// StringFeedbackStateListSize computes the size (bytes) of a list of StringFeedbackState values. func StringFeedbackStateListSize(list []StringFeedbackState) int { size := 0 for _, item := range list { @@ -1128,8 +1102,6 @@ func StringFeedbackStateListSize(list []StringFeedbackState) int { return size } -// 'BellFeedbackState' struct definition -// Size: 12 type BellFeedbackState struct { ClassId byte Id byte @@ -1140,7 +1112,7 @@ type BellFeedbackState struct { Duration uint16 } -// Struct read BellFeedbackState +// BellFeedbackStateRead reads a byte slice into a BellFeedbackState value. func BellFeedbackStateRead(buf []byte, v *BellFeedbackState) int { b := 0 @@ -1167,7 +1139,7 @@ func BellFeedbackStateRead(buf []byte, v *BellFeedbackState) int { return b } -// Struct list read BellFeedbackState +// BellFeedbackStateReadList reads a byte slice into a list of BellFeedbackState values. func BellFeedbackStateReadList(buf []byte, dest []BellFeedbackState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1177,7 +1149,7 @@ func BellFeedbackStateReadList(buf []byte, dest []BellFeedbackState) int { return xgb.Pad(b) } -// Struct write BellFeedbackState +// Bytes writes a BellFeedbackState value to a byte slice. func (v BellFeedbackState) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -1205,7 +1177,7 @@ func (v BellFeedbackState) Bytes() []byte { return buf } -// Write struct list BellFeedbackState +// BellFeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. func BellFeedbackStateListBytes(buf []byte, list []BellFeedbackState) int { b := 0 var structBytes []byte @@ -1217,8 +1189,6 @@ func BellFeedbackStateListBytes(buf []byte, list []BellFeedbackState) int { return b } -// 'LedFeedbackState' struct definition -// Size: 12 type LedFeedbackState struct { ClassId byte Id byte @@ -1227,7 +1197,7 @@ type LedFeedbackState struct { LedValues uint32 } -// Struct read LedFeedbackState +// LedFeedbackStateRead reads a byte slice into a LedFeedbackState value. func LedFeedbackStateRead(buf []byte, v *LedFeedbackState) int { b := 0 @@ -1249,7 +1219,7 @@ func LedFeedbackStateRead(buf []byte, v *LedFeedbackState) int { return b } -// Struct list read LedFeedbackState +// LedFeedbackStateReadList reads a byte slice into a list of LedFeedbackState values. func LedFeedbackStateReadList(buf []byte, dest []LedFeedbackState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1259,7 +1229,7 @@ func LedFeedbackStateReadList(buf []byte, dest []LedFeedbackState) int { return xgb.Pad(b) } -// Struct write LedFeedbackState +// Bytes writes a LedFeedbackState value to a byte slice. func (v LedFeedbackState) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -1282,7 +1252,7 @@ func (v LedFeedbackState) Bytes() []byte { return buf } -// Write struct list LedFeedbackState +// LedFeedbackStateListBytes writes a list of %s(MISSING) values to a byte slice. func LedFeedbackStateListBytes(buf []byte, list []LedFeedbackState) int { b := 0 var structBytes []byte @@ -1294,15 +1264,13 @@ func LedFeedbackStateListBytes(buf []byte, list []LedFeedbackState) int { return b } -// 'FeedbackCtl' struct definition -// Size: 4 type FeedbackCtl struct { ClassId byte Id byte Len uint16 } -// Struct read FeedbackCtl +// FeedbackCtlRead reads a byte slice into a FeedbackCtl value. func FeedbackCtlRead(buf []byte, v *FeedbackCtl) int { b := 0 @@ -1318,7 +1286,7 @@ func FeedbackCtlRead(buf []byte, v *FeedbackCtl) int { return b } -// Struct list read FeedbackCtl +// FeedbackCtlReadList reads a byte slice into a list of FeedbackCtl values. func FeedbackCtlReadList(buf []byte, dest []FeedbackCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1328,7 +1296,7 @@ func FeedbackCtlReadList(buf []byte, dest []FeedbackCtl) int { return xgb.Pad(b) } -// Struct write FeedbackCtl +// Bytes writes a FeedbackCtl value to a byte slice. func (v FeedbackCtl) Bytes() []byte { buf := make([]byte, 4) b := 0 @@ -1345,7 +1313,7 @@ func (v FeedbackCtl) Bytes() []byte { return buf } -// Write struct list FeedbackCtl +// FeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. func FeedbackCtlListBytes(buf []byte, list []FeedbackCtl) int { b := 0 var structBytes []byte @@ -1357,8 +1325,6 @@ func FeedbackCtlListBytes(buf []byte, list []FeedbackCtl) int { return b } -// 'KbdFeedbackCtl' struct definition -// Size: 20 type KbdFeedbackCtl struct { ClassId byte Id byte @@ -1373,7 +1339,7 @@ type KbdFeedbackCtl struct { LedValues uint32 } -// Struct read KbdFeedbackCtl +// KbdFeedbackCtlRead reads a byte slice into a KbdFeedbackCtl value. func KbdFeedbackCtlRead(buf []byte, v *KbdFeedbackCtl) int { b := 0 @@ -1413,7 +1379,7 @@ func KbdFeedbackCtlRead(buf []byte, v *KbdFeedbackCtl) int { return b } -// Struct list read KbdFeedbackCtl +// KbdFeedbackCtlReadList reads a byte slice into a list of KbdFeedbackCtl values. func KbdFeedbackCtlReadList(buf []byte, dest []KbdFeedbackCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1423,7 +1389,7 @@ func KbdFeedbackCtlReadList(buf []byte, dest []KbdFeedbackCtl) int { return xgb.Pad(b) } -// Struct write KbdFeedbackCtl +// Bytes writes a KbdFeedbackCtl value to a byte slice. func (v KbdFeedbackCtl) Bytes() []byte { buf := make([]byte, 20) b := 0 @@ -1464,7 +1430,7 @@ func (v KbdFeedbackCtl) Bytes() []byte { return buf } -// Write struct list KbdFeedbackCtl +// KbdFeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. func KbdFeedbackCtlListBytes(buf []byte, list []KbdFeedbackCtl) int { b := 0 var structBytes []byte @@ -1476,8 +1442,6 @@ func KbdFeedbackCtlListBytes(buf []byte, list []KbdFeedbackCtl) int { return b } -// 'PtrFeedbackCtl' struct definition -// Size: 12 type PtrFeedbackCtl struct { ClassId byte Id byte @@ -1488,7 +1452,7 @@ type PtrFeedbackCtl struct { Threshold int16 } -// Struct read PtrFeedbackCtl +// PtrFeedbackCtlRead reads a byte slice into a PtrFeedbackCtl value. func PtrFeedbackCtlRead(buf []byte, v *PtrFeedbackCtl) int { b := 0 @@ -1515,7 +1479,7 @@ func PtrFeedbackCtlRead(buf []byte, v *PtrFeedbackCtl) int { return b } -// Struct list read PtrFeedbackCtl +// PtrFeedbackCtlReadList reads a byte slice into a list of PtrFeedbackCtl values. func PtrFeedbackCtlReadList(buf []byte, dest []PtrFeedbackCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1525,7 +1489,7 @@ func PtrFeedbackCtlReadList(buf []byte, dest []PtrFeedbackCtl) int { return xgb.Pad(b) } -// Struct write PtrFeedbackCtl +// Bytes writes a PtrFeedbackCtl value to a byte slice. func (v PtrFeedbackCtl) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -1553,7 +1517,7 @@ func (v PtrFeedbackCtl) Bytes() []byte { return buf } -// Write struct list PtrFeedbackCtl +// PtrFeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. func PtrFeedbackCtlListBytes(buf []byte, list []PtrFeedbackCtl) int { b := 0 var structBytes []byte @@ -1565,8 +1529,6 @@ func PtrFeedbackCtlListBytes(buf []byte, list []PtrFeedbackCtl) int { return b } -// 'IntegerFeedbackCtl' struct definition -// Size: 8 type IntegerFeedbackCtl struct { ClassId byte Id byte @@ -1574,7 +1536,7 @@ type IntegerFeedbackCtl struct { IntToDisplay int32 } -// Struct read IntegerFeedbackCtl +// IntegerFeedbackCtlRead reads a byte slice into a IntegerFeedbackCtl value. func IntegerFeedbackCtlRead(buf []byte, v *IntegerFeedbackCtl) int { b := 0 @@ -1593,7 +1555,7 @@ func IntegerFeedbackCtlRead(buf []byte, v *IntegerFeedbackCtl) int { return b } -// Struct list read IntegerFeedbackCtl +// IntegerFeedbackCtlReadList reads a byte slice into a list of IntegerFeedbackCtl values. func IntegerFeedbackCtlReadList(buf []byte, dest []IntegerFeedbackCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1603,7 +1565,7 @@ func IntegerFeedbackCtlReadList(buf []byte, dest []IntegerFeedbackCtl) int { return xgb.Pad(b) } -// Struct write IntegerFeedbackCtl +// Bytes writes a IntegerFeedbackCtl value to a byte slice. func (v IntegerFeedbackCtl) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -1623,7 +1585,7 @@ func (v IntegerFeedbackCtl) Bytes() []byte { return buf } -// Write struct list IntegerFeedbackCtl +// IntegerFeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. func IntegerFeedbackCtlListBytes(buf []byte, list []IntegerFeedbackCtl) int { b := 0 var structBytes []byte @@ -1635,8 +1597,6 @@ func IntegerFeedbackCtlListBytes(buf []byte, list []IntegerFeedbackCtl) int { return b } -// 'StringFeedbackCtl' struct definition -// Size: (8 + xgb.Pad((int(NumKeysyms) * 4))) type StringFeedbackCtl struct { ClassId byte Id byte @@ -1646,7 +1606,7 @@ type StringFeedbackCtl struct { Keysyms []xproto.Keysym // size: xgb.Pad((int(NumKeysyms) * 4)) } -// Struct read StringFeedbackCtl +// StringFeedbackCtlRead reads a byte slice into a StringFeedbackCtl value. func StringFeedbackCtlRead(buf []byte, v *StringFeedbackCtl) int { b := 0 @@ -1674,7 +1634,7 @@ func StringFeedbackCtlRead(buf []byte, v *StringFeedbackCtl) int { return b } -// Struct list read StringFeedbackCtl +// StringFeedbackCtlReadList reads a byte slice into a list of StringFeedbackCtl values. func StringFeedbackCtlReadList(buf []byte, dest []StringFeedbackCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1684,7 +1644,7 @@ func StringFeedbackCtlReadList(buf []byte, dest []StringFeedbackCtl) int { return xgb.Pad(b) } -// Struct write StringFeedbackCtl +// Bytes writes a StringFeedbackCtl value to a byte slice. func (v StringFeedbackCtl) Bytes() []byte { buf := make([]byte, (8 + xgb.Pad((int(v.NumKeysyms) * 4)))) b := 0 @@ -1712,7 +1672,7 @@ func (v StringFeedbackCtl) Bytes() []byte { return buf } -// Write struct list StringFeedbackCtl +// StringFeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. func StringFeedbackCtlListBytes(buf []byte, list []StringFeedbackCtl) int { b := 0 var structBytes []byte @@ -1724,7 +1684,7 @@ func StringFeedbackCtlListBytes(buf []byte, list []StringFeedbackCtl) int { return b } -// Struct list size StringFeedbackCtl +// StringFeedbackCtlListSize computes the size (bytes) of a list of StringFeedbackCtl values. func StringFeedbackCtlListSize(list []StringFeedbackCtl) int { size := 0 for _, item := range list { @@ -1733,8 +1693,6 @@ func StringFeedbackCtlListSize(list []StringFeedbackCtl) int { return size } -// 'BellFeedbackCtl' struct definition -// Size: 12 type BellFeedbackCtl struct { ClassId byte Id byte @@ -1745,7 +1703,7 @@ type BellFeedbackCtl struct { Duration int16 } -// Struct read BellFeedbackCtl +// BellFeedbackCtlRead reads a byte slice into a BellFeedbackCtl value. func BellFeedbackCtlRead(buf []byte, v *BellFeedbackCtl) int { b := 0 @@ -1772,7 +1730,7 @@ func BellFeedbackCtlRead(buf []byte, v *BellFeedbackCtl) int { return b } -// Struct list read BellFeedbackCtl +// BellFeedbackCtlReadList reads a byte slice into a list of BellFeedbackCtl values. func BellFeedbackCtlReadList(buf []byte, dest []BellFeedbackCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1782,7 +1740,7 @@ func BellFeedbackCtlReadList(buf []byte, dest []BellFeedbackCtl) int { return xgb.Pad(b) } -// Struct write BellFeedbackCtl +// Bytes writes a BellFeedbackCtl value to a byte slice. func (v BellFeedbackCtl) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -1810,7 +1768,7 @@ func (v BellFeedbackCtl) Bytes() []byte { return buf } -// Write struct list BellFeedbackCtl +// BellFeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. func BellFeedbackCtlListBytes(buf []byte, list []BellFeedbackCtl) int { b := 0 var structBytes []byte @@ -1822,8 +1780,6 @@ func BellFeedbackCtlListBytes(buf []byte, list []BellFeedbackCtl) int { return b } -// 'LedFeedbackCtl' struct definition -// Size: 12 type LedFeedbackCtl struct { ClassId byte Id byte @@ -1832,7 +1788,7 @@ type LedFeedbackCtl struct { LedValues uint32 } -// Struct read LedFeedbackCtl +// LedFeedbackCtlRead reads a byte slice into a LedFeedbackCtl value. func LedFeedbackCtlRead(buf []byte, v *LedFeedbackCtl) int { b := 0 @@ -1854,7 +1810,7 @@ func LedFeedbackCtlRead(buf []byte, v *LedFeedbackCtl) int { return b } -// Struct list read LedFeedbackCtl +// LedFeedbackCtlReadList reads a byte slice into a list of LedFeedbackCtl values. func LedFeedbackCtlReadList(buf []byte, dest []LedFeedbackCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1864,7 +1820,7 @@ func LedFeedbackCtlReadList(buf []byte, dest []LedFeedbackCtl) int { return xgb.Pad(b) } -// Struct write LedFeedbackCtl +// Bytes writes a LedFeedbackCtl value to a byte slice. func (v LedFeedbackCtl) Bytes() []byte { buf := make([]byte, 12) b := 0 @@ -1887,7 +1843,7 @@ func (v LedFeedbackCtl) Bytes() []byte { return buf } -// Write struct list LedFeedbackCtl +// LedFeedbackCtlListBytes writes a list of %s(MISSING) values to a byte slice. func LedFeedbackCtlListBytes(buf []byte, list []LedFeedbackCtl) int { b := 0 var structBytes []byte @@ -1899,15 +1855,13 @@ func LedFeedbackCtlListBytes(buf []byte, list []LedFeedbackCtl) int { return b } -// 'InputState' struct definition -// Size: 3 type InputState struct { ClassId byte Len byte NumItems byte } -// Struct read InputState +// InputStateRead reads a byte slice into a InputState value. func InputStateRead(buf []byte, v *InputState) int { b := 0 @@ -1923,7 +1877,7 @@ func InputStateRead(buf []byte, v *InputState) int { return b } -// Struct list read InputState +// InputStateReadList reads a byte slice into a list of InputState values. func InputStateReadList(buf []byte, dest []InputState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -1933,7 +1887,7 @@ func InputStateReadList(buf []byte, dest []InputState) int { return xgb.Pad(b) } -// Struct write InputState +// Bytes writes a InputState value to a byte slice. func (v InputState) Bytes() []byte { buf := make([]byte, 3) b := 0 @@ -1950,7 +1904,7 @@ func (v InputState) Bytes() []byte { return buf } -// Write struct list InputState +// InputStateListBytes writes a list of %s(MISSING) values to a byte slice. func InputStateListBytes(buf []byte, list []InputState) int { b := 0 var structBytes []byte @@ -1962,8 +1916,6 @@ func InputStateListBytes(buf []byte, list []InputState) int { return b } -// 'KeyState' struct definition -// Size: 36 type KeyState struct { ClassId byte Len byte @@ -1972,7 +1924,7 @@ type KeyState struct { Keys []byte // size: 32 } -// Struct read KeyState +// KeyStateRead reads a byte slice into a KeyState value. func KeyStateRead(buf []byte, v *KeyState) int { b := 0 @@ -1994,7 +1946,7 @@ func KeyStateRead(buf []byte, v *KeyState) int { return b } -// Struct list read KeyState +// KeyStateReadList reads a byte slice into a list of KeyState values. func KeyStateReadList(buf []byte, dest []KeyState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2004,7 +1956,7 @@ func KeyStateReadList(buf []byte, dest []KeyState) int { return xgb.Pad(b) } -// Struct write KeyState +// Bytes writes a KeyState value to a byte slice. func (v KeyState) Bytes() []byte { buf := make([]byte, 36) b := 0 @@ -2026,7 +1978,7 @@ func (v KeyState) Bytes() []byte { return buf } -// Write struct list KeyState +// KeyStateListBytes writes a list of %s(MISSING) values to a byte slice. func KeyStateListBytes(buf []byte, list []KeyState) int { b := 0 var structBytes []byte @@ -2038,7 +1990,7 @@ func KeyStateListBytes(buf []byte, list []KeyState) int { return b } -// Struct list size KeyState +// KeyStateListSize computes the size (bytes) of a list of KeyState values. func KeyStateListSize(list []KeyState) int { size := 0 for _ = range list { @@ -2047,8 +1999,6 @@ func KeyStateListSize(list []KeyState) int { return size } -// 'ButtonState' struct definition -// Size: 36 type ButtonState struct { ClassId byte Len byte @@ -2057,7 +2007,7 @@ type ButtonState struct { Buttons []byte // size: 32 } -// Struct read ButtonState +// ButtonStateRead reads a byte slice into a ButtonState value. func ButtonStateRead(buf []byte, v *ButtonState) int { b := 0 @@ -2079,7 +2029,7 @@ func ButtonStateRead(buf []byte, v *ButtonState) int { return b } -// Struct list read ButtonState +// ButtonStateReadList reads a byte slice into a list of ButtonState values. func ButtonStateReadList(buf []byte, dest []ButtonState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2089,7 +2039,7 @@ func ButtonStateReadList(buf []byte, dest []ButtonState) int { return xgb.Pad(b) } -// Struct write ButtonState +// Bytes writes a ButtonState value to a byte slice. func (v ButtonState) Bytes() []byte { buf := make([]byte, 36) b := 0 @@ -2111,7 +2061,7 @@ func (v ButtonState) Bytes() []byte { return buf } -// Write struct list ButtonState +// ButtonStateListBytes writes a list of %s(MISSING) values to a byte slice. func ButtonStateListBytes(buf []byte, list []ButtonState) int { b := 0 var structBytes []byte @@ -2123,7 +2073,7 @@ func ButtonStateListBytes(buf []byte, list []ButtonState) int { return b } -// Struct list size ButtonState +// ButtonStateListSize computes the size (bytes) of a list of ButtonState values. func ButtonStateListSize(list []ButtonState) int { size := 0 for _ = range list { @@ -2132,8 +2082,6 @@ func ButtonStateListSize(list []ButtonState) int { return size } -// 'ValuatorState' struct definition -// Size: (4 + xgb.Pad((int(NumValuators) * 4))) type ValuatorState struct { ClassId byte Len byte @@ -2142,7 +2090,7 @@ type ValuatorState struct { Valuators []uint32 // size: xgb.Pad((int(NumValuators) * 4)) } -// Struct read ValuatorState +// ValuatorStateRead reads a byte slice into a ValuatorState value. func ValuatorStateRead(buf []byte, v *ValuatorState) int { b := 0 @@ -2168,7 +2116,7 @@ func ValuatorStateRead(buf []byte, v *ValuatorState) int { return b } -// Struct list read ValuatorState +// ValuatorStateReadList reads a byte slice into a list of ValuatorState values. func ValuatorStateReadList(buf []byte, dest []ValuatorState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2178,7 +2126,7 @@ func ValuatorStateReadList(buf []byte, dest []ValuatorState) int { return xgb.Pad(b) } -// Struct write ValuatorState +// Bytes writes a ValuatorState value to a byte slice. func (v ValuatorState) Bytes() []byte { buf := make([]byte, (4 + xgb.Pad((int(v.NumValuators) * 4)))) b := 0 @@ -2204,7 +2152,7 @@ func (v ValuatorState) Bytes() []byte { return buf } -// Write struct list ValuatorState +// ValuatorStateListBytes writes a list of %s(MISSING) values to a byte slice. func ValuatorStateListBytes(buf []byte, list []ValuatorState) int { b := 0 var structBytes []byte @@ -2216,7 +2164,7 @@ func ValuatorStateListBytes(buf []byte, list []ValuatorState) int { return b } -// Struct list size ValuatorState +// ValuatorStateListSize computes the size (bytes) of a list of ValuatorState values. func ValuatorStateListSize(list []ValuatorState) int { size := 0 for _, item := range list { @@ -2225,14 +2173,12 @@ func ValuatorStateListSize(list []ValuatorState) int { return size } -// 'DeviceState' struct definition -// Size: 4 type DeviceState struct { ControlId uint16 Len uint16 } -// Struct read DeviceState +// DeviceStateRead reads a byte slice into a DeviceState value. func DeviceStateRead(buf []byte, v *DeviceState) int { b := 0 @@ -2245,7 +2191,7 @@ func DeviceStateRead(buf []byte, v *DeviceState) int { return b } -// Struct list read DeviceState +// DeviceStateReadList reads a byte slice into a list of DeviceState values. func DeviceStateReadList(buf []byte, dest []DeviceState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2255,7 +2201,7 @@ func DeviceStateReadList(buf []byte, dest []DeviceState) int { return xgb.Pad(b) } -// Struct write DeviceState +// Bytes writes a DeviceState value to a byte slice. func (v DeviceState) Bytes() []byte { buf := make([]byte, 4) b := 0 @@ -2269,7 +2215,7 @@ func (v DeviceState) Bytes() []byte { return buf } -// Write struct list DeviceState +// DeviceStateListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceStateListBytes(buf []byte, list []DeviceState) int { b := 0 var structBytes []byte @@ -2281,8 +2227,6 @@ func DeviceStateListBytes(buf []byte, list []DeviceState) int { return b } -// 'DeviceResolutionState' struct definition -// Size: (((8 + xgb.Pad((int(NumValuators) * 4))) + xgb.Pad((int(NumValuators) * 4))) + xgb.Pad((int(NumValuators) * 4))) type DeviceResolutionState struct { ControlId uint16 Len uint16 @@ -2292,7 +2236,7 @@ type DeviceResolutionState struct { ResolutionMax []uint32 // size: xgb.Pad((int(NumValuators) * 4)) } -// Struct read DeviceResolutionState +// DeviceResolutionStateRead reads a byte slice into a DeviceResolutionState value. func DeviceResolutionStateRead(buf []byte, v *DeviceResolutionState) int { b := 0 @@ -2329,7 +2273,7 @@ func DeviceResolutionStateRead(buf []byte, v *DeviceResolutionState) int { return b } -// Struct list read DeviceResolutionState +// DeviceResolutionStateReadList reads a byte slice into a list of DeviceResolutionState values. func DeviceResolutionStateReadList(buf []byte, dest []DeviceResolutionState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2339,7 +2283,7 @@ func DeviceResolutionStateReadList(buf []byte, dest []DeviceResolutionState) int return xgb.Pad(b) } -// Struct write DeviceResolutionState +// Bytes writes a DeviceResolutionState value to a byte slice. func (v DeviceResolutionState) Bytes() []byte { buf := make([]byte, (((8 + xgb.Pad((int(v.NumValuators) * 4))) + xgb.Pad((int(v.NumValuators) * 4))) + xgb.Pad((int(v.NumValuators) * 4)))) b := 0 @@ -2374,7 +2318,7 @@ func (v DeviceResolutionState) Bytes() []byte { return buf } -// Write struct list DeviceResolutionState +// DeviceResolutionStateListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceResolutionStateListBytes(buf []byte, list []DeviceResolutionState) int { b := 0 var structBytes []byte @@ -2386,7 +2330,7 @@ func DeviceResolutionStateListBytes(buf []byte, list []DeviceResolutionState) in return b } -// Struct list size DeviceResolutionState +// DeviceResolutionStateListSize computes the size (bytes) of a list of DeviceResolutionState values. func DeviceResolutionStateListSize(list []DeviceResolutionState) int { size := 0 for _, item := range list { @@ -2395,8 +2339,6 @@ func DeviceResolutionStateListSize(list []DeviceResolutionState) int { return size } -// 'DeviceAbsCalibState' struct definition -// Size: 36 type DeviceAbsCalibState struct { ControlId uint16 Len uint16 @@ -2410,7 +2352,7 @@ type DeviceAbsCalibState struct { ButtonThreshold uint32 } -// Struct read DeviceAbsCalibState +// DeviceAbsCalibStateRead reads a byte slice into a DeviceAbsCalibState value. func DeviceAbsCalibStateRead(buf []byte, v *DeviceAbsCalibState) int { b := 0 @@ -2447,7 +2389,7 @@ func DeviceAbsCalibStateRead(buf []byte, v *DeviceAbsCalibState) int { return b } -// Struct list read DeviceAbsCalibState +// DeviceAbsCalibStateReadList reads a byte slice into a list of DeviceAbsCalibState values. func DeviceAbsCalibStateReadList(buf []byte, dest []DeviceAbsCalibState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2457,7 +2399,7 @@ func DeviceAbsCalibStateReadList(buf []byte, dest []DeviceAbsCalibState) int { return xgb.Pad(b) } -// Struct write DeviceAbsCalibState +// Bytes writes a DeviceAbsCalibState value to a byte slice. func (v DeviceAbsCalibState) Bytes() []byte { buf := make([]byte, 36) b := 0 @@ -2495,7 +2437,7 @@ func (v DeviceAbsCalibState) Bytes() []byte { return buf } -// Write struct list DeviceAbsCalibState +// DeviceAbsCalibStateListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceAbsCalibStateListBytes(buf []byte, list []DeviceAbsCalibState) int { b := 0 var structBytes []byte @@ -2507,8 +2449,6 @@ func DeviceAbsCalibStateListBytes(buf []byte, list []DeviceAbsCalibState) int { return b } -// 'DeviceAbsAreaState' struct definition -// Size: 28 type DeviceAbsAreaState struct { ControlId uint16 Len uint16 @@ -2520,7 +2460,7 @@ type DeviceAbsAreaState struct { Following uint32 } -// Struct read DeviceAbsAreaState +// DeviceAbsAreaStateRead reads a byte slice into a DeviceAbsAreaState value. func DeviceAbsAreaStateRead(buf []byte, v *DeviceAbsAreaState) int { b := 0 @@ -2551,7 +2491,7 @@ func DeviceAbsAreaStateRead(buf []byte, v *DeviceAbsAreaState) int { return b } -// Struct list read DeviceAbsAreaState +// DeviceAbsAreaStateReadList reads a byte slice into a list of DeviceAbsAreaState values. func DeviceAbsAreaStateReadList(buf []byte, dest []DeviceAbsAreaState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2561,7 +2501,7 @@ func DeviceAbsAreaStateReadList(buf []byte, dest []DeviceAbsAreaState) int { return xgb.Pad(b) } -// Struct write DeviceAbsAreaState +// Bytes writes a DeviceAbsAreaState value to a byte slice. func (v DeviceAbsAreaState) Bytes() []byte { buf := make([]byte, 28) b := 0 @@ -2593,7 +2533,7 @@ func (v DeviceAbsAreaState) Bytes() []byte { return buf } -// Write struct list DeviceAbsAreaState +// DeviceAbsAreaStateListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceAbsAreaStateListBytes(buf []byte, list []DeviceAbsAreaState) int { b := 0 var structBytes []byte @@ -2605,8 +2545,6 @@ func DeviceAbsAreaStateListBytes(buf []byte, list []DeviceAbsAreaState) int { return b } -// 'DeviceCoreState' struct definition -// Size: 8 type DeviceCoreState struct { ControlId uint16 Len uint16 @@ -2615,7 +2553,7 @@ type DeviceCoreState struct { // padding: 2 bytes } -// Struct read DeviceCoreState +// DeviceCoreStateRead reads a byte slice into a DeviceCoreState value. func DeviceCoreStateRead(buf []byte, v *DeviceCoreState) int { b := 0 @@ -2636,7 +2574,7 @@ func DeviceCoreStateRead(buf []byte, v *DeviceCoreState) int { return b } -// Struct list read DeviceCoreState +// DeviceCoreStateReadList reads a byte slice into a list of DeviceCoreState values. func DeviceCoreStateReadList(buf []byte, dest []DeviceCoreState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2646,7 +2584,7 @@ func DeviceCoreStateReadList(buf []byte, dest []DeviceCoreState) int { return xgb.Pad(b) } -// Struct write DeviceCoreState +// Bytes writes a DeviceCoreState value to a byte slice. func (v DeviceCoreState) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -2668,7 +2606,7 @@ func (v DeviceCoreState) Bytes() []byte { return buf } -// Write struct list DeviceCoreState +// DeviceCoreStateListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceCoreStateListBytes(buf []byte, list []DeviceCoreState) int { b := 0 var structBytes []byte @@ -2680,8 +2618,6 @@ func DeviceCoreStateListBytes(buf []byte, list []DeviceCoreState) int { return b } -// 'DeviceEnableState' struct definition -// Size: 8 type DeviceEnableState struct { ControlId uint16 Len uint16 @@ -2689,7 +2625,7 @@ type DeviceEnableState struct { // padding: 3 bytes } -// Struct read DeviceEnableState +// DeviceEnableStateRead reads a byte slice into a DeviceEnableState value. func DeviceEnableStateRead(buf []byte, v *DeviceEnableState) int { b := 0 @@ -2707,7 +2643,7 @@ func DeviceEnableStateRead(buf []byte, v *DeviceEnableState) int { return b } -// Struct list read DeviceEnableState +// DeviceEnableStateReadList reads a byte slice into a list of DeviceEnableState values. func DeviceEnableStateReadList(buf []byte, dest []DeviceEnableState) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2717,7 +2653,7 @@ func DeviceEnableStateReadList(buf []byte, dest []DeviceEnableState) int { return xgb.Pad(b) } -// Struct write DeviceEnableState +// Bytes writes a DeviceEnableState value to a byte slice. func (v DeviceEnableState) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -2736,7 +2672,7 @@ func (v DeviceEnableState) Bytes() []byte { return buf } -// Write struct list DeviceEnableState +// DeviceEnableStateListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceEnableStateListBytes(buf []byte, list []DeviceEnableState) int { b := 0 var structBytes []byte @@ -2748,14 +2684,12 @@ func DeviceEnableStateListBytes(buf []byte, list []DeviceEnableState) int { return b } -// 'DeviceCtl' struct definition -// Size: 4 type DeviceCtl struct { ControlId uint16 Len uint16 } -// Struct read DeviceCtl +// DeviceCtlRead reads a byte slice into a DeviceCtl value. func DeviceCtlRead(buf []byte, v *DeviceCtl) int { b := 0 @@ -2768,7 +2702,7 @@ func DeviceCtlRead(buf []byte, v *DeviceCtl) int { return b } -// Struct list read DeviceCtl +// DeviceCtlReadList reads a byte slice into a list of DeviceCtl values. func DeviceCtlReadList(buf []byte, dest []DeviceCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2778,7 +2712,7 @@ func DeviceCtlReadList(buf []byte, dest []DeviceCtl) int { return xgb.Pad(b) } -// Struct write DeviceCtl +// Bytes writes a DeviceCtl value to a byte slice. func (v DeviceCtl) Bytes() []byte { buf := make([]byte, 4) b := 0 @@ -2792,7 +2726,7 @@ func (v DeviceCtl) Bytes() []byte { return buf } -// Write struct list DeviceCtl +// DeviceCtlListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceCtlListBytes(buf []byte, list []DeviceCtl) int { b := 0 var structBytes []byte @@ -2804,8 +2738,6 @@ func DeviceCtlListBytes(buf []byte, list []DeviceCtl) int { return b } -// 'DeviceResolutionCtl' struct definition -// Size: (6 + xgb.Pad((int(NumValuators) * 4))) type DeviceResolutionCtl struct { ControlId uint16 Len uint16 @@ -2814,7 +2746,7 @@ type DeviceResolutionCtl struct { ResolutionValues []uint32 // size: xgb.Pad((int(NumValuators) * 4)) } -// Struct read DeviceResolutionCtl +// DeviceResolutionCtlRead reads a byte slice into a DeviceResolutionCtl value. func DeviceResolutionCtlRead(buf []byte, v *DeviceResolutionCtl) int { b := 0 @@ -2840,7 +2772,7 @@ func DeviceResolutionCtlRead(buf []byte, v *DeviceResolutionCtl) int { return b } -// Struct list read DeviceResolutionCtl +// DeviceResolutionCtlReadList reads a byte slice into a list of DeviceResolutionCtl values. func DeviceResolutionCtlReadList(buf []byte, dest []DeviceResolutionCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2850,7 +2782,7 @@ func DeviceResolutionCtlReadList(buf []byte, dest []DeviceResolutionCtl) int { return xgb.Pad(b) } -// Struct write DeviceResolutionCtl +// Bytes writes a DeviceResolutionCtl value to a byte slice. func (v DeviceResolutionCtl) Bytes() []byte { buf := make([]byte, (6 + xgb.Pad((int(v.NumValuators) * 4)))) b := 0 @@ -2876,7 +2808,7 @@ func (v DeviceResolutionCtl) Bytes() []byte { return buf } -// Write struct list DeviceResolutionCtl +// DeviceResolutionCtlListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceResolutionCtlListBytes(buf []byte, list []DeviceResolutionCtl) int { b := 0 var structBytes []byte @@ -2888,7 +2820,7 @@ func DeviceResolutionCtlListBytes(buf []byte, list []DeviceResolutionCtl) int { return b } -// Struct list size DeviceResolutionCtl +// DeviceResolutionCtlListSize computes the size (bytes) of a list of DeviceResolutionCtl values. func DeviceResolutionCtlListSize(list []DeviceResolutionCtl) int { size := 0 for _, item := range list { @@ -2897,8 +2829,6 @@ func DeviceResolutionCtlListSize(list []DeviceResolutionCtl) int { return size } -// 'DeviceAbsCalibCtl' struct definition -// Size: 36 type DeviceAbsCalibCtl struct { ControlId uint16 Len uint16 @@ -2912,7 +2842,7 @@ type DeviceAbsCalibCtl struct { ButtonThreshold uint32 } -// Struct read DeviceAbsCalibCtl +// DeviceAbsCalibCtlRead reads a byte slice into a DeviceAbsCalibCtl value. func DeviceAbsCalibCtlRead(buf []byte, v *DeviceAbsCalibCtl) int { b := 0 @@ -2949,7 +2879,7 @@ func DeviceAbsCalibCtlRead(buf []byte, v *DeviceAbsCalibCtl) int { return b } -// Struct list read DeviceAbsCalibCtl +// DeviceAbsCalibCtlReadList reads a byte slice into a list of DeviceAbsCalibCtl values. func DeviceAbsCalibCtlReadList(buf []byte, dest []DeviceAbsCalibCtl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -2959,7 +2889,7 @@ func DeviceAbsCalibCtlReadList(buf []byte, dest []DeviceAbsCalibCtl) int { return xgb.Pad(b) } -// Struct write DeviceAbsCalibCtl +// Bytes writes a DeviceAbsCalibCtl value to a byte slice. func (v DeviceAbsCalibCtl) Bytes() []byte { buf := make([]byte, 36) b := 0 @@ -2997,7 +2927,7 @@ func (v DeviceAbsCalibCtl) Bytes() []byte { return buf } -// Write struct list DeviceAbsCalibCtl +// DeviceAbsCalibCtlListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceAbsCalibCtlListBytes(buf []byte, list []DeviceAbsCalibCtl) int { b := 0 var structBytes []byte @@ -3009,8 +2939,6 @@ func DeviceAbsCalibCtlListBytes(buf []byte, list []DeviceAbsCalibCtl) int { return b } -// 'DeviceAbsAreaCtrl' struct definition -// Size: 28 type DeviceAbsAreaCtrl struct { ControlId uint16 Len uint16 @@ -3022,7 +2950,7 @@ type DeviceAbsAreaCtrl struct { Following uint32 } -// Struct read DeviceAbsAreaCtrl +// DeviceAbsAreaCtrlRead reads a byte slice into a DeviceAbsAreaCtrl value. func DeviceAbsAreaCtrlRead(buf []byte, v *DeviceAbsAreaCtrl) int { b := 0 @@ -3053,7 +2981,7 @@ func DeviceAbsAreaCtrlRead(buf []byte, v *DeviceAbsAreaCtrl) int { return b } -// Struct list read DeviceAbsAreaCtrl +// DeviceAbsAreaCtrlReadList reads a byte slice into a list of DeviceAbsAreaCtrl values. func DeviceAbsAreaCtrlReadList(buf []byte, dest []DeviceAbsAreaCtrl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -3063,7 +2991,7 @@ func DeviceAbsAreaCtrlReadList(buf []byte, dest []DeviceAbsAreaCtrl) int { return xgb.Pad(b) } -// Struct write DeviceAbsAreaCtrl +// Bytes writes a DeviceAbsAreaCtrl value to a byte slice. func (v DeviceAbsAreaCtrl) Bytes() []byte { buf := make([]byte, 28) b := 0 @@ -3095,7 +3023,7 @@ func (v DeviceAbsAreaCtrl) Bytes() []byte { return buf } -// Write struct list DeviceAbsAreaCtrl +// DeviceAbsAreaCtrlListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceAbsAreaCtrlListBytes(buf []byte, list []DeviceAbsAreaCtrl) int { b := 0 var structBytes []byte @@ -3107,8 +3035,6 @@ func DeviceAbsAreaCtrlListBytes(buf []byte, list []DeviceAbsAreaCtrl) int { return b } -// 'DeviceCoreCtrl' struct definition -// Size: 8 type DeviceCoreCtrl struct { ControlId uint16 Len uint16 @@ -3116,7 +3042,7 @@ type DeviceCoreCtrl struct { // padding: 3 bytes } -// Struct read DeviceCoreCtrl +// DeviceCoreCtrlRead reads a byte slice into a DeviceCoreCtrl value. func DeviceCoreCtrlRead(buf []byte, v *DeviceCoreCtrl) int { b := 0 @@ -3134,7 +3060,7 @@ func DeviceCoreCtrlRead(buf []byte, v *DeviceCoreCtrl) int { return b } -// Struct list read DeviceCoreCtrl +// DeviceCoreCtrlReadList reads a byte slice into a list of DeviceCoreCtrl values. func DeviceCoreCtrlReadList(buf []byte, dest []DeviceCoreCtrl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -3144,7 +3070,7 @@ func DeviceCoreCtrlReadList(buf []byte, dest []DeviceCoreCtrl) int { return xgb.Pad(b) } -// Struct write DeviceCoreCtrl +// Bytes writes a DeviceCoreCtrl value to a byte slice. func (v DeviceCoreCtrl) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -3163,7 +3089,7 @@ func (v DeviceCoreCtrl) Bytes() []byte { return buf } -// Write struct list DeviceCoreCtrl +// DeviceCoreCtrlListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceCoreCtrlListBytes(buf []byte, list []DeviceCoreCtrl) int { b := 0 var structBytes []byte @@ -3175,8 +3101,6 @@ func DeviceCoreCtrlListBytes(buf []byte, list []DeviceCoreCtrl) int { return b } -// 'DeviceEnableCtrl' struct definition -// Size: 8 type DeviceEnableCtrl struct { ControlId uint16 Len uint16 @@ -3184,7 +3108,7 @@ type DeviceEnableCtrl struct { // padding: 3 bytes } -// Struct read DeviceEnableCtrl +// DeviceEnableCtrlRead reads a byte slice into a DeviceEnableCtrl value. func DeviceEnableCtrlRead(buf []byte, v *DeviceEnableCtrl) int { b := 0 @@ -3202,7 +3126,7 @@ func DeviceEnableCtrlRead(buf []byte, v *DeviceEnableCtrl) int { return b } -// Struct list read DeviceEnableCtrl +// DeviceEnableCtrlReadList reads a byte slice into a list of DeviceEnableCtrl values. func DeviceEnableCtrlReadList(buf []byte, dest []DeviceEnableCtrl) int { b := 0 for i := 0; i < len(dest); i++ { @@ -3212,7 +3136,7 @@ func DeviceEnableCtrlReadList(buf []byte, dest []DeviceEnableCtrl) int { return xgb.Pad(b) } -// Struct write DeviceEnableCtrl +// Bytes writes a DeviceEnableCtrl value to a byte slice. func (v DeviceEnableCtrl) Bytes() []byte { buf := make([]byte, 8) b := 0 @@ -3231,7 +3155,7 @@ func (v DeviceEnableCtrl) Bytes() []byte { return buf } -// Write struct list DeviceEnableCtrl +// DeviceEnableCtrlListBytes writes a list of %s(MISSING) values to a byte slice. func DeviceEnableCtrlListBytes(buf []byte, list []DeviceEnableCtrl) int { b := 0 var structBytes []byte @@ -3243,9 +3167,7 @@ func DeviceEnableCtrlListBytes(buf []byte, list []DeviceEnableCtrl) int { return b } -// Event definition DeviceValuator (0) -// Size: 32 - +// DeviceValuator is the event number for a DeviceValuatorEvent. const DeviceValuator = 0 type DeviceValuatorEvent struct { @@ -3257,7 +3179,7 @@ type DeviceValuatorEvent struct { Valuators []int32 // size: 24 } -// Event read DeviceValuator +// DeviceValuatorEventNew constructs a DeviceValuatorEvent value that implements xgb.Event from a byte slice. func DeviceValuatorEventNew(buf []byte) xgb.Event { v := DeviceValuatorEvent{} b := 1 // don't read event number @@ -3287,7 +3209,7 @@ func DeviceValuatorEventNew(buf []byte) xgb.Event { return v } -// Event write DeviceValuator +// Bytes writes a DeviceValuatorEvent value to a byte slice. func (v DeviceValuatorEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3319,12 +3241,14 @@ func (v DeviceValuatorEvent) Bytes() []byte { return buf } -func (v DeviceValuatorEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceValuator event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceValuatorEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of DeviceValuatorEvent. func (v DeviceValuatorEvent) String() string { fieldVals := make([]string, 0, 5) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3339,9 +3263,7 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][0] = DeviceValuatorEventNew } -// Event definition DeviceKeyPress (1) -// Size: 32 - +// DeviceKeyPress is the event number for a DeviceKeyPressEvent. const DeviceKeyPress = 1 type DeviceKeyPressEvent struct { @@ -3360,7 +3282,7 @@ type DeviceKeyPressEvent struct { DeviceId byte } -// Event read DeviceKeyPress +// DeviceKeyPressEventNew constructs a DeviceKeyPressEvent value that implements xgb.Event from a byte slice. func DeviceKeyPressEventNew(buf []byte) xgb.Event { v := DeviceKeyPressEvent{} b := 1 // don't read event number @@ -3411,7 +3333,7 @@ func DeviceKeyPressEventNew(buf []byte) xgb.Event { return v } -// Event write DeviceKeyPress +// Bytes writes a DeviceKeyPressEvent value to a byte slice. func (v DeviceKeyPressEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3465,12 +3387,14 @@ func (v DeviceKeyPressEvent) Bytes() []byte { return buf } -func (v DeviceKeyPressEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceKeyPress event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceKeyPressEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of DeviceKeyPressEvent. func (v DeviceKeyPressEvent) String() string { fieldVals := make([]string, 0, 12) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3493,9 +3417,7 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][1] = DeviceKeyPressEventNew } -// Event definition FocusIn (6) -// Size: 32 - +// FocusIn is the event number for a FocusInEvent. const FocusIn = 6 type FocusInEvent struct { @@ -3508,7 +3430,7 @@ type FocusInEvent struct { // padding: 18 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 @@ -3536,7 +3458,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 @@ -3567,12 +3489,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, 6) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3588,9 +3512,7 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][6] = FocusInEventNew } -// Event definition DeviceStateNotify (10) -// Size: 32 - +// DeviceStateNotify is the event number for a DeviceStateNotifyEvent. const DeviceStateNotify = 10 type DeviceStateNotifyEvent struct { @@ -3606,7 +3528,7 @@ type DeviceStateNotifyEvent struct { Valuators []uint32 // size: 12 } -// Event read DeviceStateNotify +// DeviceStateNotifyEventNew constructs a DeviceStateNotifyEvent value that implements xgb.Event from a byte slice. func DeviceStateNotifyEventNew(buf []byte) xgb.Event { v := DeviceStateNotifyEvent{} b := 1 // don't read event number @@ -3650,7 +3572,7 @@ func DeviceStateNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write DeviceStateNotify +// Bytes writes a DeviceStateNotifyEvent value to a byte slice. func (v DeviceStateNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3694,12 +3616,14 @@ func (v DeviceStateNotifyEvent) Bytes() []byte { return buf } -func (v DeviceStateNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceStateNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceStateNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of DeviceStateNotifyEvent. func (v DeviceStateNotifyEvent) String() string { fieldVals := make([]string, 0, 9) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3716,9 +3640,7 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][10] = DeviceStateNotifyEventNew } -// Event definition DeviceMappingNotify (11) -// Size: 32 - +// DeviceMappingNotify is the event number for a DeviceMappingNotifyEvent. const DeviceMappingNotify = 11 type DeviceMappingNotifyEvent struct { @@ -3732,7 +3654,7 @@ type DeviceMappingNotifyEvent struct { // padding: 20 bytes } -// Event read DeviceMappingNotify +// DeviceMappingNotifyEventNew constructs a DeviceMappingNotifyEvent value that implements xgb.Event from a byte slice. func DeviceMappingNotifyEventNew(buf []byte) xgb.Event { v := DeviceMappingNotifyEvent{} b := 1 // don't read event number @@ -3762,7 +3684,7 @@ func DeviceMappingNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write DeviceMappingNotify +// Bytes writes a DeviceMappingNotifyEvent value to a byte slice. func (v DeviceMappingNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3795,12 +3717,14 @@ func (v DeviceMappingNotifyEvent) Bytes() []byte { return buf } -func (v DeviceMappingNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceMappingNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceMappingNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of DeviceMappingNotifyEvent. func (v DeviceMappingNotifyEvent) String() string { fieldVals := make([]string, 0, 7) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3816,9 +3740,7 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][11] = DeviceMappingNotifyEventNew } -// Event definition ChangeDeviceNotify (12) -// Size: 32 - +// ChangeDeviceNotify is the event number for a ChangeDeviceNotifyEvent. const ChangeDeviceNotify = 12 type ChangeDeviceNotifyEvent struct { @@ -3829,7 +3751,7 @@ type ChangeDeviceNotifyEvent struct { // padding: 23 bytes } -// Event read ChangeDeviceNotify +// ChangeDeviceNotifyEventNew constructs a ChangeDeviceNotifyEvent value that implements xgb.Event from a byte slice. func ChangeDeviceNotifyEventNew(buf []byte) xgb.Event { v := ChangeDeviceNotifyEvent{} b := 1 // don't read event number @@ -3851,7 +3773,7 @@ func ChangeDeviceNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write ChangeDeviceNotify +// Bytes writes a ChangeDeviceNotifyEvent value to a byte slice. func (v ChangeDeviceNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3876,12 +3798,14 @@ func (v ChangeDeviceNotifyEvent) Bytes() []byte { return buf } -func (v ChangeDeviceNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ChangeDeviceNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ChangeDeviceNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of ChangeDeviceNotifyEvent. func (v ChangeDeviceNotifyEvent) String() string { fieldVals := make([]string, 0, 4) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3895,9 +3819,7 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][12] = ChangeDeviceNotifyEventNew } -// Event definition DeviceKeyStateNotify (13) -// Size: 32 - +// DeviceKeyStateNotify is the event number for a DeviceKeyStateNotifyEvent. const DeviceKeyStateNotify = 13 type DeviceKeyStateNotifyEvent struct { @@ -3906,7 +3828,7 @@ type DeviceKeyStateNotifyEvent struct { Keys []byte // size: 28 } -// Event read DeviceKeyStateNotify +// DeviceKeyStateNotifyEventNew constructs a DeviceKeyStateNotifyEvent value that implements xgb.Event from a byte slice. func DeviceKeyStateNotifyEventNew(buf []byte) xgb.Event { v := DeviceKeyStateNotifyEvent{} b := 1 // don't read event number @@ -3924,7 +3846,7 @@ func DeviceKeyStateNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write DeviceKeyStateNotify +// Bytes writes a DeviceKeyStateNotifyEvent value to a byte slice. func (v DeviceKeyStateNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -3944,12 +3866,14 @@ func (v DeviceKeyStateNotifyEvent) Bytes() []byte { return buf } -func (v DeviceKeyStateNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceKeyStateNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceKeyStateNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of DeviceKeyStateNotifyEvent. func (v DeviceKeyStateNotifyEvent) String() string { fieldVals := make([]string, 0, 2) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -3961,9 +3885,7 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][13] = DeviceKeyStateNotifyEventNew } -// Event definition DeviceButtonStateNotify (14) -// Size: 32 - +// DeviceButtonStateNotify is the event number for a DeviceButtonStateNotifyEvent. const DeviceButtonStateNotify = 14 type DeviceButtonStateNotifyEvent struct { @@ -3972,7 +3894,7 @@ type DeviceButtonStateNotifyEvent struct { Buttons []byte // size: 28 } -// Event read DeviceButtonStateNotify +// DeviceButtonStateNotifyEventNew constructs a DeviceButtonStateNotifyEvent value that implements xgb.Event from a byte slice. func DeviceButtonStateNotifyEventNew(buf []byte) xgb.Event { v := DeviceButtonStateNotifyEvent{} b := 1 // don't read event number @@ -3990,7 +3912,7 @@ func DeviceButtonStateNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write DeviceButtonStateNotify +// Bytes writes a DeviceButtonStateNotifyEvent value to a byte slice. func (v DeviceButtonStateNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4010,12 +3932,14 @@ func (v DeviceButtonStateNotifyEvent) Bytes() []byte { return buf } -func (v DeviceButtonStateNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceButtonStateNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceButtonStateNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of DeviceButtonStateNotifyEvent. func (v DeviceButtonStateNotifyEvent) String() string { fieldVals := make([]string, 0, 2) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4027,9 +3951,7 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][14] = DeviceButtonStateNotifyEventNew } -// Event definition DevicePresenceNotify (15) -// Size: 32 - +// DevicePresenceNotify is the event number for a DevicePresenceNotifyEvent. const DevicePresenceNotify = 15 type DevicePresenceNotifyEvent struct { @@ -4042,7 +3964,7 @@ type DevicePresenceNotifyEvent struct { // padding: 20 bytes } -// Event read DevicePresenceNotify +// DevicePresenceNotifyEventNew constructs a DevicePresenceNotifyEvent value that implements xgb.Event from a byte slice. func DevicePresenceNotifyEventNew(buf []byte) xgb.Event { v := DevicePresenceNotifyEvent{} b := 1 // don't read event number @@ -4069,7 +3991,7 @@ func DevicePresenceNotifyEventNew(buf []byte) xgb.Event { return v } -// Event write DevicePresenceNotify +// Bytes writes a DevicePresenceNotifyEvent value to a byte slice. func (v DevicePresenceNotifyEvent) Bytes() []byte { buf := make([]byte, 32) b := 0 @@ -4099,12 +4021,14 @@ func (v DevicePresenceNotifyEvent) Bytes() []byte { return buf } -func (v DevicePresenceNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DevicePresenceNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DevicePresenceNotifyEvent) SequenceId() uint16 { return v.Sequence } +// String is a rudimentary string representation of DevicePresenceNotifyEvent. func (v DevicePresenceNotifyEvent) String() string { fieldVals := make([]string, 0, 6) fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", v.Sequence)) @@ -4119,22 +4043,24 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][15] = DevicePresenceNotifyEventNew } -// EventCopy definition DeviceKeyRelease (2) - +// DeviceKeyRelease is the event number for a DeviceKeyReleaseEvent. const DeviceKeyRelease = 2 type DeviceKeyReleaseEvent DeviceKeyPressEvent +// DeviceKeyReleaseEventNew constructs a DeviceKeyReleaseEvent value that implements xgb.Event from a byte slice. func DeviceKeyReleaseEventNew(buf []byte) xgb.Event { return DeviceKeyReleaseEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) } +// Bytes writes a DeviceKeyReleaseEvent value to a byte slice. func (v DeviceKeyReleaseEvent) Bytes() []byte { return DeviceKeyPressEvent(v).Bytes() } -func (v DeviceKeyReleaseEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceKeyRelease event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceKeyReleaseEvent) SequenceId() uint16 { return v.Sequence } @@ -4161,22 +4087,24 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][2] = DeviceKeyReleaseEventNew } -// EventCopy definition DeviceButtonPress (3) - +// DeviceButtonPress is the event number for a DeviceButtonPressEvent. const DeviceButtonPress = 3 type DeviceButtonPressEvent DeviceKeyPressEvent +// DeviceButtonPressEventNew constructs a DeviceButtonPressEvent value that implements xgb.Event from a byte slice. func DeviceButtonPressEventNew(buf []byte) xgb.Event { return DeviceButtonPressEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) } +// Bytes writes a DeviceButtonPressEvent value to a byte slice. func (v DeviceButtonPressEvent) Bytes() []byte { return DeviceKeyPressEvent(v).Bytes() } -func (v DeviceButtonPressEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceButtonPress event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceButtonPressEvent) SequenceId() uint16 { return v.Sequence } @@ -4203,22 +4131,24 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][3] = DeviceButtonPressEventNew } -// EventCopy definition DeviceButtonRelease (4) - +// DeviceButtonRelease is the event number for a DeviceButtonReleaseEvent. const DeviceButtonRelease = 4 type DeviceButtonReleaseEvent DeviceKeyPressEvent +// DeviceButtonReleaseEventNew constructs a DeviceButtonReleaseEvent value that implements xgb.Event from a byte slice. func DeviceButtonReleaseEventNew(buf []byte) xgb.Event { return DeviceButtonReleaseEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) } +// Bytes writes a DeviceButtonReleaseEvent value to a byte slice. func (v DeviceButtonReleaseEvent) Bytes() []byte { return DeviceKeyPressEvent(v).Bytes() } -func (v DeviceButtonReleaseEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceButtonRelease event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceButtonReleaseEvent) SequenceId() uint16 { return v.Sequence } @@ -4245,22 +4175,24 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][4] = DeviceButtonReleaseEventNew } -// EventCopy definition DeviceMotionNotify (5) - +// DeviceMotionNotify is the event number for a DeviceMotionNotifyEvent. const DeviceMotionNotify = 5 type DeviceMotionNotifyEvent DeviceKeyPressEvent +// DeviceMotionNotifyEventNew constructs a DeviceMotionNotifyEvent value that implements xgb.Event from a byte slice. func DeviceMotionNotifyEventNew(buf []byte) xgb.Event { return DeviceMotionNotifyEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) } +// Bytes writes a DeviceMotionNotifyEvent value to a byte slice. func (v DeviceMotionNotifyEvent) Bytes() []byte { return DeviceKeyPressEvent(v).Bytes() } -func (v DeviceMotionNotifyEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the DeviceMotionNotify event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v DeviceMotionNotifyEvent) SequenceId() uint16 { return v.Sequence } @@ -4287,22 +4219,24 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][5] = DeviceMotionNotifyEventNew } -// EventCopy definition ProximityIn (8) - +// ProximityIn is the event number for a ProximityInEvent. const ProximityIn = 8 type ProximityInEvent DeviceKeyPressEvent +// ProximityInEventNew constructs a ProximityInEvent value that implements xgb.Event from a byte slice. func ProximityInEventNew(buf []byte) xgb.Event { return ProximityInEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) } +// Bytes writes a ProximityInEvent value to a byte slice. func (v ProximityInEvent) Bytes() []byte { return DeviceKeyPressEvent(v).Bytes() } -func (v ProximityInEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ProximityIn event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ProximityInEvent) SequenceId() uint16 { return v.Sequence } @@ -4329,22 +4263,24 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][8] = ProximityInEventNew } -// EventCopy definition ProximityOut (9) - +// ProximityOut is the event number for a ProximityOutEvent. const ProximityOut = 9 type ProximityOutEvent DeviceKeyPressEvent +// ProximityOutEventNew constructs a ProximityOutEvent value that implements xgb.Event from a byte slice. func ProximityOutEventNew(buf []byte) xgb.Event { return ProximityOutEvent(DeviceKeyPressEventNew(buf).(DeviceKeyPressEvent)) } +// Bytes writes a ProximityOutEvent value to a byte slice. func (v ProximityOutEvent) Bytes() []byte { return DeviceKeyPressEvent(v).Bytes() } -func (v ProximityOutEvent) ImplementsEvent() {} - +// SequenceId returns the sequence id attached to the ProximityOut event. +// Events without a sequence number (KeymapNotify) return 0. +// This is mostly used internally. func (v ProximityOutEvent) SequenceId() uint16 { return v.Sequence } @@ -4371,22 +4307,24 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][9] = ProximityOutEventNew } -// EventCopy definition FocusOut (7) - +// FocusOut is the event number for a FocusOutEvent. const FocusOut = 7 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 } @@ -4406,9 +4344,7 @@ func init() { xgb.NewExtEventFuncs["XInputExtension"][7] = FocusOutEventNew } -// Error definition Device (0) -// Size: 32 - +// BadDevice is the error number for a BadDevice. const BadDevice = 0 type DeviceError struct { @@ -4416,7 +4352,7 @@ type DeviceError struct { NiceName string } -// Error read Device +// DeviceErrorNew constructs a DeviceError value that implements xgb.Error from a byte slice. func DeviceErrorNew(buf []byte) xgb.Error { v := DeviceError{} v.NiceName = "Device" @@ -4430,8 +4366,8 @@ func DeviceErrorNew(buf []byte) xgb.Error { return v } -func (err DeviceError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadDevice error. +// This is mostly used internally. func (err DeviceError) SequenceId() uint16 { return err.Sequence } @@ -4451,9 +4387,7 @@ func init() { xgb.NewExtErrorFuncs["XInputExtension"][0] = DeviceErrorNew } -// Error definition Event (1) -// Size: 32 - +// BadEvent is the error number for a BadEvent. const BadEvent = 1 type EventError struct { @@ -4461,7 +4395,7 @@ type EventError struct { NiceName string } -// Error read Event +// EventErrorNew constructs a EventError value that implements xgb.Error from a byte slice. func EventErrorNew(buf []byte) xgb.Error { v := EventError{} v.NiceName = "Event" @@ -4475,8 +4409,8 @@ func EventErrorNew(buf []byte) xgb.Error { return v } -func (err EventError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadEvent error. +// This is mostly used internally. func (err EventError) SequenceId() uint16 { return err.Sequence } @@ -4496,9 +4430,7 @@ func init() { xgb.NewExtErrorFuncs["XInputExtension"][1] = EventErrorNew } -// Error definition Mode (2) -// Size: 32 - +// BadMode is the error number for a BadMode. const BadMode = 2 type ModeError struct { @@ -4506,7 +4438,7 @@ type ModeError struct { NiceName string } -// Error read Mode +// ModeErrorNew constructs a ModeError value that implements xgb.Error from a byte slice. func ModeErrorNew(buf []byte) xgb.Error { v := ModeError{} v.NiceName = "Mode" @@ -4520,8 +4452,8 @@ func ModeErrorNew(buf []byte) xgb.Error { return v } -func (err ModeError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadMode error. +// This is mostly used internally. func (err ModeError) SequenceId() uint16 { return err.Sequence } @@ -4541,9 +4473,7 @@ func init() { xgb.NewExtErrorFuncs["XInputExtension"][2] = ModeErrorNew } -// Error definition DeviceBusy (3) -// Size: 32 - +// BadDeviceBusy is the error number for a BadDeviceBusy. const BadDeviceBusy = 3 type DeviceBusyError struct { @@ -4551,7 +4481,7 @@ type DeviceBusyError struct { NiceName string } -// Error read DeviceBusy +// DeviceBusyErrorNew constructs a DeviceBusyError value that implements xgb.Error from a byte slice. func DeviceBusyErrorNew(buf []byte) xgb.Error { v := DeviceBusyError{} v.NiceName = "DeviceBusy" @@ -4565,8 +4495,8 @@ func DeviceBusyErrorNew(buf []byte) xgb.Error { return v } -func (err DeviceBusyError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadDeviceBusy error. +// This is mostly used internally. func (err DeviceBusyError) SequenceId() uint16 { return err.Sequence } @@ -4586,9 +4516,7 @@ func init() { xgb.NewExtErrorFuncs["XInputExtension"][3] = DeviceBusyErrorNew } -// Error definition Class (4) -// Size: 32 - +// BadClass is the error number for a BadClass. const BadClass = 4 type ClassError struct { @@ -4596,7 +4524,7 @@ type ClassError struct { NiceName string } -// Error read Class +// ClassErrorNew constructs a ClassError value that implements xgb.Error from a byte slice. func ClassErrorNew(buf []byte) xgb.Error { v := ClassError{} v.NiceName = "Class" @@ -4610,8 +4538,8 @@ func ClassErrorNew(buf []byte) xgb.Error { return v } -func (err ClassError) ImplementsError() {} - +// SequenceId returns the sequence id attached to the BadClass error. +// This is mostly used internally. func (err ClassError) SequenceId() uint16 { return err.Sequence } @@ -4631,29 +4559,31 @@ func init() { xgb.NewExtErrorFuncs["XInputExtension"][4] = ClassErrorNew } -// Request GetExtensionVersion -// size: xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) +// GetExtensionVersionCookie is a cookie used only for GetExtensionVersion requests. type GetExtensionVersionCookie struct { *xgb.Cookie } +// GetExtensionVersion sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetExtensionVersionCookie.Reply() func GetExtensionVersion(c *xgb.Conn, NameLen uint16, Name string) GetExtensionVersionCookie { cookie := c.NewCookie(true, true) c.NewRequest(getExtensionVersionRequest(c, NameLen, Name), cookie) return GetExtensionVersionCookie{cookie} } +// GetExtensionVersionUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetExtensionVersionUnchecked(c *xgb.Conn, NameLen uint16, Name string) GetExtensionVersionCookie { cookie := c.NewCookie(false, true) c.NewRequest(getExtensionVersionRequest(c, NameLen, Name), cookie) return GetExtensionVersionCookie{cookie} } -// Request reply for GetExtensionVersion -// size: 32 +// GetExtensionVersionReply represents the data returned from a GetExtensionVersion request. type GetExtensionVersionReply struct { - Sequence uint16 - Length uint32 + Sequence uint16 // sequence number of the request for this reply + Length uint32 // number of bytes in this reply // padding: 1 bytes ServerMajor uint16 ServerMinor uint16 @@ -4661,7 +4591,7 @@ type GetExtensionVersionReply struct { // padding: 19 bytes } -// Waits and reads reply data from request GetExtensionVersion +// Reply blocks and returns the reply data for a GetExtensionVersion request. func (cook GetExtensionVersionCookie) Reply() (*GetExtensionVersionReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -4673,7 +4603,7 @@ func (cook GetExtensionVersionCookie) Reply() (*GetExtensionVersionReply, error) return getExtensionVersionReply(buf), nil } -// Read reply into structure from buffer for GetExtensionVersion +// getExtensionVersionReply reads a byte slice into a GetExtensionVersionReply value. func getExtensionVersionReply(buf []byte) *GetExtensionVersionReply { v := new(GetExtensionVersionReply) b := 1 // skip reply determinant @@ -4705,6 +4635,7 @@ func getExtensionVersionReply(buf []byte) *GetExtensionVersionReply { } // Write request to wire for GetExtensionVersion +// getExtensionVersionRequest writes a GetExtensionVersion request to a byte slice. func getExtensionVersionRequest(c *xgb.Conn, NameLen uint16, Name string) []byte { size := xgb.Pad((8 + xgb.Pad((int(NameLen) * 1)))) b := 0 @@ -4730,36 +4661,38 @@ func getExtensionVersionRequest(c *xgb.Conn, NameLen uint16, Name string) []byte return buf } -// Request ListInputDevices -// size: 4 +// ListInputDevicesCookie is a cookie used only for ListInputDevices requests. type ListInputDevicesCookie struct { *xgb.Cookie } +// ListInputDevices sends a checked request. +// If an error occurs, it will be returned with the reply by calling ListInputDevicesCookie.Reply() func ListInputDevices(c *xgb.Conn) ListInputDevicesCookie { cookie := c.NewCookie(true, true) c.NewRequest(listInputDevicesRequest(c), cookie) return ListInputDevicesCookie{cookie} } +// ListInputDevicesUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ListInputDevicesUnchecked(c *xgb.Conn) ListInputDevicesCookie { cookie := c.NewCookie(false, true) c.NewRequest(listInputDevicesRequest(c), cookie) return ListInputDevicesCookie{cookie} } -// Request reply for ListInputDevices -// size: (32 + xgb.Pad((int(DevicesLen) * 8))) +// ListInputDevicesReply represents the data returned from a ListInputDevices request. type ListInputDevicesReply 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 DevicesLen byte // padding: 23 bytes Devices []DeviceInfo // size: xgb.Pad((int(DevicesLen) * 8)) } -// Waits and reads reply data from request ListInputDevices +// Reply blocks and returns the reply data for a ListInputDevices request. func (cook ListInputDevicesCookie) Reply() (*ListInputDevicesReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -4771,7 +4704,7 @@ func (cook ListInputDevicesCookie) Reply() (*ListInputDevicesReply, error) { return listInputDevicesReply(buf), nil } -// Read reply into structure from buffer for ListInputDevices +// listInputDevicesReply reads a byte slice into a ListInputDevicesReply value. func listInputDevicesReply(buf []byte) *ListInputDevicesReply { v := new(ListInputDevicesReply) b := 1 // skip reply determinant @@ -4796,6 +4729,7 @@ func listInputDevicesReply(buf []byte) *ListInputDevicesReply { } // Write request to wire for ListInputDevices +// listInputDevicesRequest writes a ListInputDevices request to a byte slice. func listInputDevicesRequest(c *xgb.Conn) []byte { size := 4 b := 0 @@ -4813,36 +4747,38 @@ func listInputDevicesRequest(c *xgb.Conn) []byte { return buf } -// Request OpenDevice -// size: 8 +// OpenDeviceCookie is a cookie used only for OpenDevice requests. type OpenDeviceCookie struct { *xgb.Cookie } +// OpenDevice sends a checked request. +// If an error occurs, it will be returned with the reply by calling OpenDeviceCookie.Reply() func OpenDevice(c *xgb.Conn, DeviceId byte) OpenDeviceCookie { cookie := c.NewCookie(true, true) c.NewRequest(openDeviceRequest(c, DeviceId), cookie) return OpenDeviceCookie{cookie} } +// OpenDeviceUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func OpenDeviceUnchecked(c *xgb.Conn, DeviceId byte) OpenDeviceCookie { cookie := c.NewCookie(false, true) c.NewRequest(openDeviceRequest(c, DeviceId), cookie) return OpenDeviceCookie{cookie} } -// Request reply for OpenDevice -// size: (32 + xgb.Pad((int(NumClasses) * 2))) +// OpenDeviceReply represents the data returned from a OpenDevice request. type OpenDeviceReply 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 NumClasses byte // padding: 23 bytes ClassInfo []InputClassInfo // size: xgb.Pad((int(NumClasses) * 2)) } -// Waits and reads reply data from request OpenDevice +// Reply blocks and returns the reply data for a OpenDevice request. func (cook OpenDeviceCookie) Reply() (*OpenDeviceReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -4854,7 +4790,7 @@ func (cook OpenDeviceCookie) Reply() (*OpenDeviceReply, error) { return openDeviceReply(buf), nil } -// Read reply into structure from buffer for OpenDevice +// openDeviceReply reads a byte slice into a OpenDeviceReply value. func openDeviceReply(buf []byte) *OpenDeviceReply { v := new(OpenDeviceReply) b := 1 // skip reply determinant @@ -4879,6 +4815,7 @@ func openDeviceReply(buf []byte) *OpenDeviceReply { } // Write request to wire for OpenDevice +// openDeviceRequest writes a OpenDevice request to a byte slice. func openDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { size := 8 b := 0 @@ -4901,30 +4838,35 @@ func openDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { return buf } -// Request CloseDevice -// size: 8 +// CloseDeviceCookie is a cookie used only for CloseDevice requests. type CloseDeviceCookie struct { *xgb.Cookie } -// Write request to wire for CloseDevice +// CloseDevice sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func CloseDevice(c *xgb.Conn, DeviceId byte) CloseDeviceCookie { cookie := c.NewCookie(false, false) c.NewRequest(closeDeviceRequest(c, DeviceId), cookie) return CloseDeviceCookie{cookie} } +// CloseDeviceChecked sends a checked request. +// If an error occurs, it can be retrieved using CloseDeviceCookie.Check() func CloseDeviceChecked(c *xgb.Conn, DeviceId byte) CloseDeviceCookie { cookie := c.NewCookie(true, false) c.NewRequest(closeDeviceRequest(c, DeviceId), cookie) return CloseDeviceCookie{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 CloseDeviceCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for CloseDevice +// closeDeviceRequest writes a CloseDevice request to a byte slice. func closeDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { size := 8 b := 0 @@ -4947,35 +4889,37 @@ func closeDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { return buf } -// Request SetDeviceMode -// size: 8 +// SetDeviceModeCookie is a cookie used only for SetDeviceMode requests. type SetDeviceModeCookie struct { *xgb.Cookie } +// SetDeviceMode sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetDeviceModeCookie.Reply() func SetDeviceMode(c *xgb.Conn, DeviceId byte, Mode byte) SetDeviceModeCookie { cookie := c.NewCookie(true, true) c.NewRequest(setDeviceModeRequest(c, DeviceId, Mode), cookie) return SetDeviceModeCookie{cookie} } +// SetDeviceModeUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceModeUnchecked(c *xgb.Conn, DeviceId byte, Mode byte) SetDeviceModeCookie { cookie := c.NewCookie(false, true) c.NewRequest(setDeviceModeRequest(c, DeviceId, Mode), cookie) return SetDeviceModeCookie{cookie} } -// Request reply for SetDeviceMode -// size: 32 +// SetDeviceModeReply represents the data returned from a SetDeviceMode request. type SetDeviceModeReply 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 Status byte // padding: 23 bytes } -// Waits and reads reply data from request SetDeviceMode +// Reply blocks and returns the reply data for a SetDeviceMode request. func (cook SetDeviceModeCookie) Reply() (*SetDeviceModeReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -4987,7 +4931,7 @@ func (cook SetDeviceModeCookie) Reply() (*SetDeviceModeReply, error) { return setDeviceModeReply(buf), nil } -// Read reply into structure from buffer for SetDeviceMode +// setDeviceModeReply reads a byte slice into a SetDeviceModeReply value. func setDeviceModeReply(buf []byte) *SetDeviceModeReply { v := new(SetDeviceModeReply) b := 1 // skip reply determinant @@ -5009,6 +4953,7 @@ func setDeviceModeReply(buf []byte) *SetDeviceModeReply { } // Write request to wire for SetDeviceMode +// setDeviceModeRequest writes a SetDeviceMode request to a byte slice. func setDeviceModeRequest(c *xgb.Conn, DeviceId byte, Mode byte) []byte { size := 8 b := 0 @@ -5034,30 +4979,35 @@ func setDeviceModeRequest(c *xgb.Conn, DeviceId byte, Mode byte) []byte { return buf } -// Request SelectExtensionEvent -// size: xgb.Pad((12 + xgb.Pad((int(NumClasses) * 4)))) +// SelectExtensionEventCookie is a cookie used only for SelectExtensionEvent requests. type SelectExtensionEventCookie struct { *xgb.Cookie } -// Write request to wire for SelectExtensionEvent +// SelectExtensionEvent sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SelectExtensionEvent(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) SelectExtensionEventCookie { cookie := c.NewCookie(false, false) c.NewRequest(selectExtensionEventRequest(c, Window, NumClasses, Classes), cookie) return SelectExtensionEventCookie{cookie} } +// SelectExtensionEventChecked sends a checked request. +// If an error occurs, it can be retrieved using SelectExtensionEventCookie.Check() func SelectExtensionEventChecked(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) SelectExtensionEventCookie { cookie := c.NewCookie(true, false) c.NewRequest(selectExtensionEventRequest(c, Window, NumClasses, Classes), cookie) return SelectExtensionEventCookie{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 SelectExtensionEventCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SelectExtensionEvent +// selectExtensionEventRequest writes a SelectExtensionEvent request to a byte slice. func selectExtensionEventRequest(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Classes []EventClass) []byte { size := xgb.Pad((12 + xgb.Pad((int(NumClasses) * 4)))) b := 0 @@ -5089,29 +5039,31 @@ func selectExtensionEventRequest(c *xgb.Conn, Window xproto.Window, NumClasses u return buf } -// Request GetSelectedExtensionEvents -// size: 8 +// GetSelectedExtensionEventsCookie is a cookie used only for GetSelectedExtensionEvents requests. type GetSelectedExtensionEventsCookie struct { *xgb.Cookie } +// GetSelectedExtensionEvents sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetSelectedExtensionEventsCookie.Reply() func GetSelectedExtensionEvents(c *xgb.Conn, Window xproto.Window) GetSelectedExtensionEventsCookie { cookie := c.NewCookie(true, true) c.NewRequest(getSelectedExtensionEventsRequest(c, Window), cookie) return GetSelectedExtensionEventsCookie{cookie} } +// GetSelectedExtensionEventsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetSelectedExtensionEventsUnchecked(c *xgb.Conn, Window xproto.Window) GetSelectedExtensionEventsCookie { cookie := c.NewCookie(false, true) c.NewRequest(getSelectedExtensionEventsRequest(c, Window), cookie) return GetSelectedExtensionEventsCookie{cookie} } -// Request reply for GetSelectedExtensionEvents -// size: ((32 + xgb.Pad((int(NumThisClasses) * 4))) + xgb.Pad((int(NumAllClasses) * 4))) +// GetSelectedExtensionEventsReply represents the data returned from a GetSelectedExtensionEvents request. type GetSelectedExtensionEventsReply 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 NumThisClasses uint16 NumAllClasses uint16 @@ -5120,7 +5072,7 @@ type GetSelectedExtensionEventsReply struct { AllClasses []EventClass // size: xgb.Pad((int(NumAllClasses) * 4)) } -// Waits and reads reply data from request GetSelectedExtensionEvents +// Reply blocks and returns the reply data for a GetSelectedExtensionEvents request. func (cook GetSelectedExtensionEventsCookie) Reply() (*GetSelectedExtensionEventsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5132,7 +5084,7 @@ func (cook GetSelectedExtensionEventsCookie) Reply() (*GetSelectedExtensionEvent return getSelectedExtensionEventsReply(buf), nil } -// Read reply into structure from buffer for GetSelectedExtensionEvents +// getSelectedExtensionEventsReply reads a byte slice into a GetSelectedExtensionEventsReply value. func getSelectedExtensionEventsReply(buf []byte) *GetSelectedExtensionEventsReply { v := new(GetSelectedExtensionEventsReply) b := 1 // skip reply determinant @@ -5171,6 +5123,7 @@ func getSelectedExtensionEventsReply(buf []byte) *GetSelectedExtensionEventsRepl } // Write request to wire for GetSelectedExtensionEvents +// getSelectedExtensionEventsRequest writes a GetSelectedExtensionEvents request to a byte slice. func getSelectedExtensionEventsRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 @@ -5191,30 +5144,35 @@ func getSelectedExtensionEventsRequest(c *xgb.Conn, Window xproto.Window) []byte return buf } -// Request ChangeDeviceDontPropagateList -// size: xgb.Pad((12 + xgb.Pad((int(NumClasses) * 4)))) +// ChangeDeviceDontPropagateListCookie is a cookie used only for ChangeDeviceDontPropagateList requests. type ChangeDeviceDontPropagateListCookie struct { *xgb.Cookie } -// Write request to wire for ChangeDeviceDontPropagateList +// ChangeDeviceDontPropagateList sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeDeviceDontPropagateList(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Mode byte, Classes []EventClass) ChangeDeviceDontPropagateListCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeDeviceDontPropagateListRequest(c, Window, NumClasses, Mode, Classes), cookie) return ChangeDeviceDontPropagateListCookie{cookie} } +// ChangeDeviceDontPropagateListChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeDeviceDontPropagateListCookie.Check() func ChangeDeviceDontPropagateListChecked(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Mode byte, Classes []EventClass) ChangeDeviceDontPropagateListCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeDeviceDontPropagateListRequest(c, Window, NumClasses, Mode, Classes), cookie) return ChangeDeviceDontPropagateListCookie{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 ChangeDeviceDontPropagateListCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeDeviceDontPropagateList +// changeDeviceDontPropagateListRequest writes a ChangeDeviceDontPropagateList request to a byte slice. func changeDeviceDontPropagateListRequest(c *xgb.Conn, Window xproto.Window, NumClasses uint16, Mode byte, Classes []EventClass) []byte { size := xgb.Pad((12 + xgb.Pad((int(NumClasses) * 4)))) b := 0 @@ -5249,36 +5207,38 @@ func changeDeviceDontPropagateListRequest(c *xgb.Conn, Window xproto.Window, Num return buf } -// Request GetDeviceDontPropagateList -// size: 8 +// GetDeviceDontPropagateListCookie is a cookie used only for GetDeviceDontPropagateList requests. type GetDeviceDontPropagateListCookie struct { *xgb.Cookie } +// GetDeviceDontPropagateList sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceDontPropagateListCookie.Reply() func GetDeviceDontPropagateList(c *xgb.Conn, Window xproto.Window) GetDeviceDontPropagateListCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceDontPropagateListRequest(c, Window), cookie) return GetDeviceDontPropagateListCookie{cookie} } +// GetDeviceDontPropagateListUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceDontPropagateListUnchecked(c *xgb.Conn, Window xproto.Window) GetDeviceDontPropagateListCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceDontPropagateListRequest(c, Window), cookie) return GetDeviceDontPropagateListCookie{cookie} } -// Request reply for GetDeviceDontPropagateList -// size: (32 + xgb.Pad((int(NumClasses) * 4))) +// GetDeviceDontPropagateListReply represents the data returned from a GetDeviceDontPropagateList request. type GetDeviceDontPropagateListReply 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 NumClasses uint16 // padding: 22 bytes Classes []EventClass // size: xgb.Pad((int(NumClasses) * 4)) } -// Waits and reads reply data from request GetDeviceDontPropagateList +// Reply blocks and returns the reply data for a GetDeviceDontPropagateList request. func (cook GetDeviceDontPropagateListCookie) Reply() (*GetDeviceDontPropagateListReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5290,7 +5250,7 @@ func (cook GetDeviceDontPropagateListCookie) Reply() (*GetDeviceDontPropagateLis return getDeviceDontPropagateListReply(buf), nil } -// Read reply into structure from buffer for GetDeviceDontPropagateList +// getDeviceDontPropagateListReply reads a byte slice into a GetDeviceDontPropagateListReply value. func getDeviceDontPropagateListReply(buf []byte) *GetDeviceDontPropagateListReply { v := new(GetDeviceDontPropagateListReply) b := 1 // skip reply determinant @@ -5319,6 +5279,7 @@ func getDeviceDontPropagateListReply(buf []byte) *GetDeviceDontPropagateListRepl } // Write request to wire for GetDeviceDontPropagateList +// getDeviceDontPropagateListRequest writes a GetDeviceDontPropagateList request to a byte slice. func getDeviceDontPropagateListRequest(c *xgb.Conn, Window xproto.Window) []byte { size := 8 b := 0 @@ -5339,29 +5300,31 @@ func getDeviceDontPropagateListRequest(c *xgb.Conn, Window xproto.Window) []byte return buf } -// Request GetDeviceMotionEvents -// size: 16 +// GetDeviceMotionEventsCookie is a cookie used only for GetDeviceMotionEvents requests. type GetDeviceMotionEventsCookie struct { *xgb.Cookie } +// GetDeviceMotionEvents sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceMotionEventsCookie.Reply() func GetDeviceMotionEvents(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) GetDeviceMotionEventsCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceMotionEventsRequest(c, Start, Stop, DeviceId), cookie) return GetDeviceMotionEventsCookie{cookie} } +// GetDeviceMotionEventsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceMotionEventsUnchecked(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) GetDeviceMotionEventsCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceMotionEventsRequest(c, Start, Stop, DeviceId), cookie) return GetDeviceMotionEventsCookie{cookie} } -// Request reply for GetDeviceMotionEvents -// size: 32 +// GetDeviceMotionEventsReply represents the data returned from a GetDeviceMotionEvents request. type GetDeviceMotionEventsReply 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 NumCoords uint32 NumAxes byte @@ -5369,7 +5332,7 @@ type GetDeviceMotionEventsReply struct { // padding: 18 bytes } -// Waits and reads reply data from request GetDeviceMotionEvents +// Reply blocks and returns the reply data for a GetDeviceMotionEvents request. func (cook GetDeviceMotionEventsCookie) Reply() (*GetDeviceMotionEventsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5381,7 +5344,7 @@ func (cook GetDeviceMotionEventsCookie) Reply() (*GetDeviceMotionEventsReply, er return getDeviceMotionEventsReply(buf), nil } -// Read reply into structure from buffer for GetDeviceMotionEvents +// getDeviceMotionEventsReply reads a byte slice into a GetDeviceMotionEventsReply value. func getDeviceMotionEventsReply(buf []byte) *GetDeviceMotionEventsReply { v := new(GetDeviceMotionEventsReply) b := 1 // skip reply determinant @@ -5409,6 +5372,7 @@ func getDeviceMotionEventsReply(buf []byte) *GetDeviceMotionEventsReply { } // Write request to wire for GetDeviceMotionEvents +// getDeviceMotionEventsRequest writes a GetDeviceMotionEvents request to a byte slice. func getDeviceMotionEventsRequest(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Timestamp, DeviceId byte) []byte { size := 16 b := 0 @@ -5435,35 +5399,37 @@ func getDeviceMotionEventsRequest(c *xgb.Conn, Start xproto.Timestamp, Stop xpro return buf } -// Request ChangeKeyboardDevice -// size: 8 +// ChangeKeyboardDeviceCookie is a cookie used only for ChangeKeyboardDevice requests. type ChangeKeyboardDeviceCookie struct { *xgb.Cookie } +// ChangeKeyboardDevice sends a checked request. +// If an error occurs, it will be returned with the reply by calling ChangeKeyboardDeviceCookie.Reply() func ChangeKeyboardDevice(c *xgb.Conn, DeviceId byte) ChangeKeyboardDeviceCookie { cookie := c.NewCookie(true, true) c.NewRequest(changeKeyboardDeviceRequest(c, DeviceId), cookie) return ChangeKeyboardDeviceCookie{cookie} } +// ChangeKeyboardDeviceUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeKeyboardDeviceUnchecked(c *xgb.Conn, DeviceId byte) ChangeKeyboardDeviceCookie { cookie := c.NewCookie(false, true) c.NewRequest(changeKeyboardDeviceRequest(c, DeviceId), cookie) return ChangeKeyboardDeviceCookie{cookie} } -// Request reply for ChangeKeyboardDevice -// size: 32 +// ChangeKeyboardDeviceReply represents the data returned from a ChangeKeyboardDevice request. type ChangeKeyboardDeviceReply 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 Status byte // padding: 23 bytes } -// Waits and reads reply data from request ChangeKeyboardDevice +// Reply blocks and returns the reply data for a ChangeKeyboardDevice request. func (cook ChangeKeyboardDeviceCookie) Reply() (*ChangeKeyboardDeviceReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5475,7 +5441,7 @@ func (cook ChangeKeyboardDeviceCookie) Reply() (*ChangeKeyboardDeviceReply, erro return changeKeyboardDeviceReply(buf), nil } -// Read reply into structure from buffer for ChangeKeyboardDevice +// changeKeyboardDeviceReply reads a byte slice into a ChangeKeyboardDeviceReply value. func changeKeyboardDeviceReply(buf []byte) *ChangeKeyboardDeviceReply { v := new(ChangeKeyboardDeviceReply) b := 1 // skip reply determinant @@ -5497,6 +5463,7 @@ func changeKeyboardDeviceReply(buf []byte) *ChangeKeyboardDeviceReply { } // Write request to wire for ChangeKeyboardDevice +// changeKeyboardDeviceRequest writes a ChangeKeyboardDevice request to a byte slice. func changeKeyboardDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { size := 8 b := 0 @@ -5519,35 +5486,37 @@ func changeKeyboardDeviceRequest(c *xgb.Conn, DeviceId byte) []byte { return buf } -// Request ChangePointerDevice -// size: 8 +// ChangePointerDeviceCookie is a cookie used only for ChangePointerDevice requests. type ChangePointerDeviceCookie struct { *xgb.Cookie } +// ChangePointerDevice sends a checked request. +// If an error occurs, it will be returned with the reply by calling ChangePointerDeviceCookie.Reply() func ChangePointerDevice(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId byte) ChangePointerDeviceCookie { cookie := c.NewCookie(true, true) c.NewRequest(changePointerDeviceRequest(c, XAxis, YAxis, DeviceId), cookie) return ChangePointerDeviceCookie{cookie} } +// ChangePointerDeviceUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangePointerDeviceUnchecked(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId byte) ChangePointerDeviceCookie { cookie := c.NewCookie(false, true) c.NewRequest(changePointerDeviceRequest(c, XAxis, YAxis, DeviceId), cookie) return ChangePointerDeviceCookie{cookie} } -// Request reply for ChangePointerDevice -// size: 32 +// ChangePointerDeviceReply represents the data returned from a ChangePointerDevice request. type ChangePointerDeviceReply 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 Status byte // padding: 23 bytes } -// Waits and reads reply data from request ChangePointerDevice +// Reply blocks and returns the reply data for a ChangePointerDevice request. func (cook ChangePointerDeviceCookie) Reply() (*ChangePointerDeviceReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5559,7 +5528,7 @@ func (cook ChangePointerDeviceCookie) Reply() (*ChangePointerDeviceReply, error) return changePointerDeviceReply(buf), nil } -// Read reply into structure from buffer for ChangePointerDevice +// changePointerDeviceReply reads a byte slice into a ChangePointerDeviceReply value. func changePointerDeviceReply(buf []byte) *ChangePointerDeviceReply { v := new(ChangePointerDeviceReply) b := 1 // skip reply determinant @@ -5581,6 +5550,7 @@ func changePointerDeviceReply(buf []byte) *ChangePointerDeviceReply { } // Write request to wire for ChangePointerDevice +// changePointerDeviceRequest writes a ChangePointerDevice request to a byte slice. func changePointerDeviceRequest(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId byte) []byte { size := 8 b := 0 @@ -5609,35 +5579,37 @@ func changePointerDeviceRequest(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId by return buf } -// Request GrabDevice -// size: xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) +// GrabDeviceCookie is a cookie used only for GrabDevice requests. type GrabDeviceCookie struct { *xgb.Cookie } +// GrabDevice sends a checked request. +// If an error occurs, it will be returned with the reply by calling GrabDeviceCookie.Reply() func GrabDevice(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []EventClass) GrabDeviceCookie { cookie := c.NewCookie(true, true) c.NewRequest(grabDeviceRequest(c, GrabWindow, Time, NumClasses, ThisDeviceMode, OtherDeviceMode, OwnerEvents, DeviceId, Classes), cookie) return GrabDeviceCookie{cookie} } +// GrabDeviceUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabDeviceUnchecked(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []EventClass) GrabDeviceCookie { cookie := c.NewCookie(false, true) c.NewRequest(grabDeviceRequest(c, GrabWindow, Time, NumClasses, ThisDeviceMode, OtherDeviceMode, OwnerEvents, DeviceId, Classes), cookie) return GrabDeviceCookie{cookie} } -// Request reply for GrabDevice -// size: 32 +// GrabDeviceReply represents the data returned from a GrabDevice request. type GrabDeviceReply 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 Status byte // padding: 23 bytes } -// Waits and reads reply data from request GrabDevice +// Reply blocks and returns the reply data for a GrabDevice request. func (cook GrabDeviceCookie) Reply() (*GrabDeviceReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -5649,7 +5621,7 @@ func (cook GrabDeviceCookie) Reply() (*GrabDeviceReply, error) { return grabDeviceReply(buf), nil } -// Read reply into structure from buffer for GrabDevice +// grabDeviceReply reads a byte slice into a GrabDeviceReply value. func grabDeviceReply(buf []byte) *GrabDeviceReply { v := new(GrabDeviceReply) b := 1 // skip reply determinant @@ -5671,6 +5643,7 @@ func grabDeviceReply(buf []byte) *GrabDeviceReply { } // Write request to wire for GrabDevice +// grabDeviceRequest writes a GrabDevice request to a byte slice. func grabDeviceRequest(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timestamp, NumClasses uint16, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, DeviceId byte, Classes []EventClass) []byte { size := xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) b := 0 @@ -5721,30 +5694,35 @@ func grabDeviceRequest(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timest return buf } -// Request UngrabDevice -// size: 12 +// UngrabDeviceCookie is a cookie used only for UngrabDevice requests. type UngrabDeviceCookie struct { *xgb.Cookie } -// Write request to wire for UngrabDevice +// UngrabDevice sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabDevice(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) UngrabDeviceCookie { cookie := c.NewCookie(false, false) c.NewRequest(ungrabDeviceRequest(c, Time, DeviceId), cookie) return UngrabDeviceCookie{cookie} } +// UngrabDeviceChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabDeviceCookie.Check() func UngrabDeviceChecked(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) UngrabDeviceCookie { cookie := c.NewCookie(true, false) c.NewRequest(ungrabDeviceRequest(c, Time, DeviceId), cookie) return UngrabDeviceCookie{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 UngrabDeviceCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UngrabDevice +// ungrabDeviceRequest writes a UngrabDevice request to a byte slice. func ungrabDeviceRequest(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) []byte { size := 12 b := 0 @@ -5768,30 +5746,35 @@ func ungrabDeviceRequest(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) []by return buf } -// Request GrabDeviceKey -// size: xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) +// GrabDeviceKeyCookie is a cookie used only for GrabDeviceKey requests. type GrabDeviceKeyCookie struct { *xgb.Cookie } -// Write request to wire for GrabDeviceKey +// GrabDeviceKey sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabDeviceKey(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []EventClass) GrabDeviceKeyCookie { cookie := c.NewCookie(false, false) c.NewRequest(grabDeviceKeyRequest(c, GrabWindow, NumClasses, Modifiers, ModifierDevice, GrabbedDevice, Key, ThisDeviceMode, OtherDeviceMode, OwnerEvents, Classes), cookie) return GrabDeviceKeyCookie{cookie} } +// GrabDeviceKeyChecked sends a checked request. +// If an error occurs, it can be retrieved using GrabDeviceKeyCookie.Check() func GrabDeviceKeyChecked(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []EventClass) GrabDeviceKeyCookie { cookie := c.NewCookie(true, false) c.NewRequest(grabDeviceKeyRequest(c, GrabWindow, NumClasses, Modifiers, ModifierDevice, GrabbedDevice, Key, ThisDeviceMode, OtherDeviceMode, OwnerEvents, Classes), cookie) return GrabDeviceKeyCookie{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 GrabDeviceKeyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for GrabDeviceKey +// grabDeviceKeyRequest writes a GrabDeviceKey request to a byte slice. func grabDeviceKeyRequest(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint16, Modifiers uint16, ModifierDevice byte, GrabbedDevice byte, Key byte, ThisDeviceMode byte, OtherDeviceMode byte, OwnerEvents bool, Classes []EventClass) []byte { size := xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) b := 0 @@ -5848,30 +5831,35 @@ func grabDeviceKeyRequest(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint return buf } -// Request UngrabDeviceKey -// size: 16 +// UngrabDeviceKeyCookie is a cookie used only for UngrabDeviceKey requests. type UngrabDeviceKeyCookie struct { *xgb.Cookie } -// Write request to wire for UngrabDeviceKey +// UngrabDeviceKey sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabDeviceKey(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) UngrabDeviceKeyCookie { cookie := c.NewCookie(false, false) c.NewRequest(ungrabDeviceKeyRequest(c, GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) return UngrabDeviceKeyCookie{cookie} } +// UngrabDeviceKeyChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabDeviceKeyCookie.Check() func UngrabDeviceKeyChecked(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) UngrabDeviceKeyCookie { cookie := c.NewCookie(true, false) c.NewRequest(ungrabDeviceKeyRequest(c, GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) return UngrabDeviceKeyCookie{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 UngrabDeviceKeyCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UngrabDeviceKey +// ungrabDeviceKeyRequest writes a UngrabDeviceKey request to a byte slice. func ungrabDeviceKeyRequest(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Key byte, GrabbedDevice byte) []byte { size := 16 b := 0 @@ -5904,30 +5892,35 @@ func ungrabDeviceKeyRequest(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uin return buf } -// Request GrabDeviceButton -// size: xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) +// GrabDeviceButtonCookie is a cookie used only for GrabDeviceButton requests. type GrabDeviceButtonCookie struct { *xgb.Cookie } -// Write request to wire for GrabDeviceButton +// GrabDeviceButton sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GrabDeviceButton(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) GrabDeviceButtonCookie { cookie := c.NewCookie(false, false) c.NewRequest(grabDeviceButtonRequest(c, GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) return GrabDeviceButtonCookie{cookie} } +// GrabDeviceButtonChecked sends a checked request. +// If an error occurs, it can be retrieved using GrabDeviceButtonCookie.Check() func GrabDeviceButtonChecked(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) GrabDeviceButtonCookie { cookie := c.NewCookie(true, false) c.NewRequest(grabDeviceButtonRequest(c, GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) return GrabDeviceButtonCookie{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 GrabDeviceButtonCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for GrabDeviceButton +// grabDeviceButtonRequest writes a GrabDeviceButton request to a byte slice. func grabDeviceButtonRequest(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, ModifierDevice byte, NumClasses uint16, Modifiers uint16, ThisDeviceMode byte, OtherDeviceMode byte, Button byte, OwnerEvents byte, Classes []EventClass) []byte { size := xgb.Pad((20 + xgb.Pad((int(NumClasses) * 4)))) b := 0 @@ -5980,30 +5973,35 @@ func grabDeviceButtonRequest(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevic return buf } -// Request UngrabDeviceButton -// size: 16 +// UngrabDeviceButtonCookie is a cookie used only for UngrabDeviceButton requests. type UngrabDeviceButtonCookie struct { *xgb.Cookie } -// Write request to wire for UngrabDeviceButton +// UngrabDeviceButton sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func UngrabDeviceButton(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) UngrabDeviceButtonCookie { cookie := c.NewCookie(false, false) c.NewRequest(ungrabDeviceButtonRequest(c, GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) return UngrabDeviceButtonCookie{cookie} } +// UngrabDeviceButtonChecked sends a checked request. +// If an error occurs, it can be retrieved using UngrabDeviceButtonCookie.Check() func UngrabDeviceButtonChecked(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) UngrabDeviceButtonCookie { cookie := c.NewCookie(true, false) c.NewRequest(ungrabDeviceButtonRequest(c, GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) return UngrabDeviceButtonCookie{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 UngrabDeviceButtonCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for UngrabDeviceButton +// ungrabDeviceButtonRequest writes a UngrabDeviceButton request to a byte slice. func ungrabDeviceButtonRequest(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, ModifierDevice byte, Button byte, GrabbedDevice byte) []byte { size := 16 b := 0 @@ -6036,30 +6034,35 @@ func ungrabDeviceButtonRequest(c *xgb.Conn, GrabWindow xproto.Window, Modifiers return buf } -// Request AllowDeviceEvents -// size: 12 +// AllowDeviceEventsCookie is a cookie used only for AllowDeviceEvents requests. type AllowDeviceEventsCookie struct { *xgb.Cookie } -// Write request to wire for AllowDeviceEvents +// AllowDeviceEvents sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func AllowDeviceEvents(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) AllowDeviceEventsCookie { cookie := c.NewCookie(false, false) c.NewRequest(allowDeviceEventsRequest(c, Time, Mode, DeviceId), cookie) return AllowDeviceEventsCookie{cookie} } +// AllowDeviceEventsChecked sends a checked request. +// If an error occurs, it can be retrieved using AllowDeviceEventsCookie.Check() func AllowDeviceEventsChecked(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) AllowDeviceEventsCookie { cookie := c.NewCookie(true, false) c.NewRequest(allowDeviceEventsRequest(c, Time, Mode, DeviceId), cookie) return AllowDeviceEventsCookie{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 AllowDeviceEventsCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for AllowDeviceEvents +// allowDeviceEventsRequest writes a AllowDeviceEvents request to a byte slice. func allowDeviceEventsRequest(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId byte) []byte { size := 12 b := 0 @@ -6086,29 +6089,31 @@ func allowDeviceEventsRequest(c *xgb.Conn, Time xproto.Timestamp, Mode byte, Dev return buf } -// Request GetDeviceFocus -// size: 8 +// GetDeviceFocusCookie is a cookie used only for GetDeviceFocus requests. type GetDeviceFocusCookie struct { *xgb.Cookie } +// GetDeviceFocus sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceFocusCookie.Reply() func GetDeviceFocus(c *xgb.Conn, DeviceId byte) GetDeviceFocusCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceFocusRequest(c, DeviceId), cookie) return GetDeviceFocusCookie{cookie} } +// GetDeviceFocusUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceFocusUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceFocusCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceFocusRequest(c, DeviceId), cookie) return GetDeviceFocusCookie{cookie} } -// Request reply for GetDeviceFocus -// size: 32 +// GetDeviceFocusReply represents the data returned from a GetDeviceFocus request. type GetDeviceFocusReply 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 Focus xproto.Window Time xproto.Timestamp @@ -6116,7 +6121,7 @@ type GetDeviceFocusReply struct { // padding: 15 bytes } -// Waits and reads reply data from request GetDeviceFocus +// Reply blocks and returns the reply data for a GetDeviceFocus request. func (cook GetDeviceFocusCookie) Reply() (*GetDeviceFocusReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6128,7 +6133,7 @@ func (cook GetDeviceFocusCookie) Reply() (*GetDeviceFocusReply, error) { return getDeviceFocusReply(buf), nil } -// Read reply into structure from buffer for GetDeviceFocus +// getDeviceFocusReply reads a byte slice into a GetDeviceFocusReply value. func getDeviceFocusReply(buf []byte) *GetDeviceFocusReply { v := new(GetDeviceFocusReply) b := 1 // skip reply determinant @@ -6156,6 +6161,7 @@ func getDeviceFocusReply(buf []byte) *GetDeviceFocusReply { } // Write request to wire for GetDeviceFocus +// getDeviceFocusRequest writes a GetDeviceFocus request to a byte slice. func getDeviceFocusRequest(c *xgb.Conn, DeviceId byte) []byte { size := 8 b := 0 @@ -6178,30 +6184,35 @@ func getDeviceFocusRequest(c *xgb.Conn, DeviceId byte) []byte { return buf } -// Request SetDeviceFocus -// size: 16 +// SetDeviceFocusCookie is a cookie used only for SetDeviceFocus requests. type SetDeviceFocusCookie struct { *xgb.Cookie } -// Write request to wire for SetDeviceFocus +// SetDeviceFocus sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceFocus(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) SetDeviceFocusCookie { cookie := c.NewCookie(false, false) c.NewRequest(setDeviceFocusRequest(c, Focus, Time, RevertTo, DeviceId), cookie) return SetDeviceFocusCookie{cookie} } +// SetDeviceFocusChecked sends a checked request. +// If an error occurs, it can be retrieved using SetDeviceFocusCookie.Check() func SetDeviceFocusChecked(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) SetDeviceFocusCookie { cookie := c.NewCookie(true, false) c.NewRequest(setDeviceFocusRequest(c, Focus, Time, RevertTo, DeviceId), cookie) return SetDeviceFocusCookie{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 SetDeviceFocusCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SetDeviceFocus +// setDeviceFocusRequest writes a SetDeviceFocus request to a byte slice. func setDeviceFocusRequest(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, RevertTo byte, DeviceId byte) []byte { size := 16 b := 0 @@ -6231,35 +6242,37 @@ func setDeviceFocusRequest(c *xgb.Conn, Focus xproto.Window, Time xproto.Timesta return buf } -// Request GetFeedbackControl -// size: 8 +// GetFeedbackControlCookie is a cookie used only for GetFeedbackControl requests. type GetFeedbackControlCookie struct { *xgb.Cookie } +// GetFeedbackControl sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetFeedbackControlCookie.Reply() func GetFeedbackControl(c *xgb.Conn, DeviceId byte) GetFeedbackControlCookie { cookie := c.NewCookie(true, true) c.NewRequest(getFeedbackControlRequest(c, DeviceId), cookie) return GetFeedbackControlCookie{cookie} } +// GetFeedbackControlUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetFeedbackControlUnchecked(c *xgb.Conn, DeviceId byte) GetFeedbackControlCookie { cookie := c.NewCookie(false, true) c.NewRequest(getFeedbackControlRequest(c, DeviceId), cookie) return GetFeedbackControlCookie{cookie} } -// Request reply for GetFeedbackControl -// size: 32 +// GetFeedbackControlReply represents the data returned from a GetFeedbackControl request. type GetFeedbackControlReply 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 NumFeedback uint16 // padding: 22 bytes } -// Waits and reads reply data from request GetFeedbackControl +// Reply blocks and returns the reply data for a GetFeedbackControl request. func (cook GetFeedbackControlCookie) Reply() (*GetFeedbackControlReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6271,7 +6284,7 @@ func (cook GetFeedbackControlCookie) Reply() (*GetFeedbackControlReply, error) { return getFeedbackControlReply(buf), nil } -// Read reply into structure from buffer for GetFeedbackControl +// getFeedbackControlReply reads a byte slice into a GetFeedbackControlReply value. func getFeedbackControlReply(buf []byte) *GetFeedbackControlReply { v := new(GetFeedbackControlReply) b := 1 // skip reply determinant @@ -6293,6 +6306,7 @@ func getFeedbackControlReply(buf []byte) *GetFeedbackControlReply { } // Write request to wire for GetFeedbackControl +// getFeedbackControlRequest writes a GetFeedbackControl request to a byte slice. func getFeedbackControlRequest(c *xgb.Conn, DeviceId byte) []byte { size := 8 b := 0 @@ -6315,36 +6329,38 @@ func getFeedbackControlRequest(c *xgb.Conn, DeviceId byte) []byte { return buf } -// Request GetDeviceKeyMapping -// size: 8 +// GetDeviceKeyMappingCookie is a cookie used only for GetDeviceKeyMapping requests. type GetDeviceKeyMappingCookie struct { *xgb.Cookie } +// GetDeviceKeyMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceKeyMappingCookie.Reply() func GetDeviceKeyMapping(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) GetDeviceKeyMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, Count), cookie) return GetDeviceKeyMappingCookie{cookie} } +// GetDeviceKeyMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceKeyMappingUnchecked(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) GetDeviceKeyMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, Count), cookie) return GetDeviceKeyMappingCookie{cookie} } -// Request reply for GetDeviceKeyMapping -// size: (32 + xgb.Pad((int(Length) * 4))) +// GetDeviceKeyMappingReply represents the data returned from a GetDeviceKeyMapping request. type GetDeviceKeyMappingReply 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 KeysymsPerKeycode byte // padding: 23 bytes Keysyms []xproto.Keysym // size: xgb.Pad((int(Length) * 4)) } -// Waits and reads reply data from request GetDeviceKeyMapping +// Reply blocks and returns the reply data for a GetDeviceKeyMapping request. func (cook GetDeviceKeyMappingCookie) Reply() (*GetDeviceKeyMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6356,7 +6372,7 @@ func (cook GetDeviceKeyMappingCookie) Reply() (*GetDeviceKeyMappingReply, error) return getDeviceKeyMappingReply(buf), nil } -// Read reply into structure from buffer for GetDeviceKeyMapping +// getDeviceKeyMappingReply reads a byte slice into a GetDeviceKeyMappingReply value. func getDeviceKeyMappingReply(buf []byte) *GetDeviceKeyMappingReply { v := new(GetDeviceKeyMappingReply) b := 1 // skip reply determinant @@ -6385,6 +6401,7 @@ func getDeviceKeyMappingReply(buf []byte) *GetDeviceKeyMappingReply { } // Write request to wire for GetDeviceKeyMapping +// getDeviceKeyMappingRequest writes a GetDeviceKeyMapping request to a byte slice. func getDeviceKeyMappingRequest(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count byte) []byte { size := 8 b := 0 @@ -6411,30 +6428,35 @@ func getDeviceKeyMappingRequest(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode return buf } -// Request ChangeDeviceKeyMapping -// size: xgb.Pad((8 + xgb.Pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) +// ChangeDeviceKeyMappingCookie is a cookie used only for ChangeDeviceKeyMapping requests. type ChangeDeviceKeyMappingCookie struct { *xgb.Cookie } -// Write request to wire for ChangeDeviceKeyMapping +// ChangeDeviceKeyMapping sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func ChangeDeviceKeyMapping(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) ChangeDeviceKeyMappingCookie { cookie := c.NewCookie(false, false) c.NewRequest(changeDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) return ChangeDeviceKeyMappingCookie{cookie} } +// ChangeDeviceKeyMappingChecked sends a checked request. +// If an error occurs, it can be retrieved using ChangeDeviceKeyMappingCookie.Check() func ChangeDeviceKeyMappingChecked(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) ChangeDeviceKeyMappingCookie { cookie := c.NewCookie(true, false) c.NewRequest(changeDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) return ChangeDeviceKeyMappingCookie{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 ChangeDeviceKeyMappingCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for ChangeDeviceKeyMapping +// changeDeviceKeyMappingRequest writes a ChangeDeviceKeyMapping request to a byte slice. func changeDeviceKeyMappingRequest(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, KeysymsPerKeycode byte, KeycodeCount byte, Keysyms []xproto.Keysym) []byte { size := xgb.Pad((8 + xgb.Pad(((int(KeycodeCount) * int(KeysymsPerKeycode)) * 4)))) b := 0 @@ -6470,36 +6492,38 @@ func changeDeviceKeyMappingRequest(c *xgb.Conn, DeviceId byte, FirstKeycode KeyC return buf } -// Request GetDeviceModifierMapping -// size: 8 +// GetDeviceModifierMappingCookie is a cookie used only for GetDeviceModifierMapping requests. type GetDeviceModifierMappingCookie struct { *xgb.Cookie } +// GetDeviceModifierMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceModifierMappingCookie.Reply() func GetDeviceModifierMapping(c *xgb.Conn, DeviceId byte) GetDeviceModifierMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceModifierMappingRequest(c, DeviceId), cookie) return GetDeviceModifierMappingCookie{cookie} } +// GetDeviceModifierMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceModifierMappingUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceModifierMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceModifierMappingRequest(c, DeviceId), cookie) return GetDeviceModifierMappingCookie{cookie} } -// Request reply for GetDeviceModifierMapping -// size: (32 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1))) +// GetDeviceModifierMappingReply represents the data returned from a GetDeviceModifierMapping request. type GetDeviceModifierMappingReply 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 KeycodesPerModifier byte // padding: 23 bytes Keymaps []byte // size: xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)) } -// Waits and reads reply data from request GetDeviceModifierMapping +// Reply blocks and returns the reply data for a GetDeviceModifierMapping request. func (cook GetDeviceModifierMappingCookie) Reply() (*GetDeviceModifierMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6511,7 +6535,7 @@ func (cook GetDeviceModifierMappingCookie) Reply() (*GetDeviceModifierMappingRep return getDeviceModifierMappingReply(buf), nil } -// Read reply into structure from buffer for GetDeviceModifierMapping +// getDeviceModifierMappingReply reads a byte slice into a GetDeviceModifierMappingReply value. func getDeviceModifierMappingReply(buf []byte) *GetDeviceModifierMappingReply { v := new(GetDeviceModifierMappingReply) b := 1 // skip reply determinant @@ -6537,6 +6561,7 @@ func getDeviceModifierMappingReply(buf []byte) *GetDeviceModifierMappingReply { } // Write request to wire for GetDeviceModifierMapping +// getDeviceModifierMappingRequest writes a GetDeviceModifierMapping request to a byte slice. func getDeviceModifierMappingRequest(c *xgb.Conn, DeviceId byte) []byte { size := 8 b := 0 @@ -6559,35 +6584,37 @@ func getDeviceModifierMappingRequest(c *xgb.Conn, DeviceId byte) []byte { return buf } -// Request SetDeviceModifierMapping -// size: xgb.Pad((7 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)))) +// SetDeviceModifierMappingCookie is a cookie used only for SetDeviceModifierMapping requests. type SetDeviceModifierMappingCookie struct { *xgb.Cookie } +// SetDeviceModifierMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetDeviceModifierMappingCookie.Reply() func SetDeviceModifierMapping(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) SetDeviceModifierMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(setDeviceModifierMappingRequest(c, DeviceId, KeycodesPerModifier, Keymaps), cookie) return SetDeviceModifierMappingCookie{cookie} } +// SetDeviceModifierMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceModifierMappingUnchecked(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) SetDeviceModifierMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(setDeviceModifierMappingRequest(c, DeviceId, KeycodesPerModifier, Keymaps), cookie) return SetDeviceModifierMappingCookie{cookie} } -// Request reply for SetDeviceModifierMapping -// size: 32 +// SetDeviceModifierMappingReply represents the data returned from a SetDeviceModifierMapping request. type SetDeviceModifierMappingReply 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 Status byte // padding: 23 bytes } -// Waits and reads reply data from request SetDeviceModifierMapping +// Reply blocks and returns the reply data for a SetDeviceModifierMapping request. func (cook SetDeviceModifierMappingCookie) Reply() (*SetDeviceModifierMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6599,7 +6626,7 @@ func (cook SetDeviceModifierMappingCookie) Reply() (*SetDeviceModifierMappingRep return setDeviceModifierMappingReply(buf), nil } -// Read reply into structure from buffer for SetDeviceModifierMapping +// setDeviceModifierMappingReply reads a byte slice into a SetDeviceModifierMappingReply value. func setDeviceModifierMappingReply(buf []byte) *SetDeviceModifierMappingReply { v := new(SetDeviceModifierMappingReply) b := 1 // skip reply determinant @@ -6621,6 +6648,7 @@ func setDeviceModifierMappingReply(buf []byte) *SetDeviceModifierMappingReply { } // Write request to wire for SetDeviceModifierMapping +// setDeviceModifierMappingRequest writes a SetDeviceModifierMapping request to a byte slice. func setDeviceModifierMappingRequest(c *xgb.Conn, DeviceId byte, KeycodesPerModifier byte, Keymaps []byte) []byte { size := xgb.Pad((7 + xgb.Pad(((int(KeycodesPerModifier) * 8) * 1)))) b := 0 @@ -6649,36 +6677,38 @@ func setDeviceModifierMappingRequest(c *xgb.Conn, DeviceId byte, KeycodesPerModi return buf } -// Request GetDeviceButtonMapping -// size: 8 +// GetDeviceButtonMappingCookie is a cookie used only for GetDeviceButtonMapping requests. type GetDeviceButtonMappingCookie struct { *xgb.Cookie } +// GetDeviceButtonMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceButtonMappingCookie.Reply() func GetDeviceButtonMapping(c *xgb.Conn, DeviceId byte) GetDeviceButtonMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceButtonMappingRequest(c, DeviceId), cookie) return GetDeviceButtonMappingCookie{cookie} } +// GetDeviceButtonMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceButtonMappingUnchecked(c *xgb.Conn, DeviceId byte) GetDeviceButtonMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceButtonMappingRequest(c, DeviceId), cookie) return GetDeviceButtonMappingCookie{cookie} } -// Request reply for GetDeviceButtonMapping -// size: (32 + xgb.Pad((int(MapSize) * 1))) +// GetDeviceButtonMappingReply represents the data returned from a GetDeviceButtonMapping request. type GetDeviceButtonMappingReply 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 MapSize byte // padding: 23 bytes Map []byte // size: xgb.Pad((int(MapSize) * 1)) } -// Waits and reads reply data from request GetDeviceButtonMapping +// Reply blocks and returns the reply data for a GetDeviceButtonMapping request. func (cook GetDeviceButtonMappingCookie) Reply() (*GetDeviceButtonMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6690,7 +6720,7 @@ func (cook GetDeviceButtonMappingCookie) Reply() (*GetDeviceButtonMappingReply, return getDeviceButtonMappingReply(buf), nil } -// Read reply into structure from buffer for GetDeviceButtonMapping +// getDeviceButtonMappingReply reads a byte slice into a GetDeviceButtonMappingReply value. func getDeviceButtonMappingReply(buf []byte) *GetDeviceButtonMappingReply { v := new(GetDeviceButtonMappingReply) b := 1 // skip reply determinant @@ -6716,6 +6746,7 @@ func getDeviceButtonMappingReply(buf []byte) *GetDeviceButtonMappingReply { } // Write request to wire for GetDeviceButtonMapping +// getDeviceButtonMappingRequest writes a GetDeviceButtonMapping request to a byte slice. func getDeviceButtonMappingRequest(c *xgb.Conn, DeviceId byte) []byte { size := 8 b := 0 @@ -6738,35 +6769,37 @@ func getDeviceButtonMappingRequest(c *xgb.Conn, DeviceId byte) []byte { return buf } -// Request SetDeviceButtonMapping -// size: xgb.Pad((8 + xgb.Pad((int(MapSize) * 1)))) +// SetDeviceButtonMappingCookie is a cookie used only for SetDeviceButtonMapping requests. type SetDeviceButtonMappingCookie struct { *xgb.Cookie } +// SetDeviceButtonMapping sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetDeviceButtonMappingCookie.Reply() func SetDeviceButtonMapping(c *xgb.Conn, DeviceId byte, MapSize byte, Map []byte) SetDeviceButtonMappingCookie { cookie := c.NewCookie(true, true) c.NewRequest(setDeviceButtonMappingRequest(c, DeviceId, MapSize, Map), cookie) return SetDeviceButtonMappingCookie{cookie} } +// SetDeviceButtonMappingUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceButtonMappingUnchecked(c *xgb.Conn, DeviceId byte, MapSize byte, Map []byte) SetDeviceButtonMappingCookie { cookie := c.NewCookie(false, true) c.NewRequest(setDeviceButtonMappingRequest(c, DeviceId, MapSize, Map), cookie) return SetDeviceButtonMappingCookie{cookie} } -// Request reply for SetDeviceButtonMapping -// size: 32 +// SetDeviceButtonMappingReply represents the data returned from a SetDeviceButtonMapping request. type SetDeviceButtonMappingReply 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 Status byte // padding: 23 bytes } -// Waits and reads reply data from request SetDeviceButtonMapping +// Reply blocks and returns the reply data for a SetDeviceButtonMapping request. func (cook SetDeviceButtonMappingCookie) Reply() (*SetDeviceButtonMappingReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6778,7 +6811,7 @@ func (cook SetDeviceButtonMappingCookie) Reply() (*SetDeviceButtonMappingReply, return setDeviceButtonMappingReply(buf), nil } -// Read reply into structure from buffer for SetDeviceButtonMapping +// setDeviceButtonMappingReply reads a byte slice into a SetDeviceButtonMappingReply value. func setDeviceButtonMappingReply(buf []byte) *SetDeviceButtonMappingReply { v := new(SetDeviceButtonMappingReply) b := 1 // skip reply determinant @@ -6800,6 +6833,7 @@ func setDeviceButtonMappingReply(buf []byte) *SetDeviceButtonMappingReply { } // Write request to wire for SetDeviceButtonMapping +// setDeviceButtonMappingRequest writes a SetDeviceButtonMapping request to a byte slice. func setDeviceButtonMappingRequest(c *xgb.Conn, DeviceId byte, MapSize byte, Map []byte) []byte { size := xgb.Pad((8 + xgb.Pad((int(MapSize) * 1)))) b := 0 @@ -6828,35 +6862,37 @@ func setDeviceButtonMappingRequest(c *xgb.Conn, DeviceId byte, MapSize byte, Map return buf } -// Request QueryDeviceState -// size: 8 +// QueryDeviceStateCookie is a cookie used only for QueryDeviceState requests. type QueryDeviceStateCookie struct { *xgb.Cookie } +// QueryDeviceState sends a checked request. +// If an error occurs, it will be returned with the reply by calling QueryDeviceStateCookie.Reply() func QueryDeviceState(c *xgb.Conn, DeviceId byte) QueryDeviceStateCookie { cookie := c.NewCookie(true, true) c.NewRequest(queryDeviceStateRequest(c, DeviceId), cookie) return QueryDeviceStateCookie{cookie} } +// QueryDeviceStateUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func QueryDeviceStateUnchecked(c *xgb.Conn, DeviceId byte) QueryDeviceStateCookie { cookie := c.NewCookie(false, true) c.NewRequest(queryDeviceStateRequest(c, DeviceId), cookie) return QueryDeviceStateCookie{cookie} } -// Request reply for QueryDeviceState -// size: 32 +// QueryDeviceStateReply represents the data returned from a QueryDeviceState request. type QueryDeviceStateReply 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 NumClasses byte // padding: 23 bytes } -// Waits and reads reply data from request QueryDeviceState +// Reply blocks and returns the reply data for a QueryDeviceState request. func (cook QueryDeviceStateCookie) Reply() (*QueryDeviceStateReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -6868,7 +6904,7 @@ func (cook QueryDeviceStateCookie) Reply() (*QueryDeviceStateReply, error) { return queryDeviceStateReply(buf), nil } -// Read reply into structure from buffer for QueryDeviceState +// queryDeviceStateReply reads a byte slice into a QueryDeviceStateReply value. func queryDeviceStateReply(buf []byte) *QueryDeviceStateReply { v := new(QueryDeviceStateReply) b := 1 // skip reply determinant @@ -6890,6 +6926,7 @@ func queryDeviceStateReply(buf []byte) *QueryDeviceStateReply { } // Write request to wire for QueryDeviceState +// queryDeviceStateRequest writes a QueryDeviceState request to a byte slice. func queryDeviceStateRequest(c *xgb.Conn, DeviceId byte) []byte { size := 8 b := 0 @@ -6912,30 +6949,35 @@ func queryDeviceStateRequest(c *xgb.Conn, DeviceId byte) []byte { return buf } -// Request SendExtensionEvent -// size: xgb.Pad(((16 + xgb.Pad(((int(NumEvents) * 32) * 1))) + xgb.Pad((int(NumClasses) * 4)))) +// SendExtensionEventCookie is a cookie used only for SendExtensionEvent requests. type SendExtensionEventCookie struct { *xgb.Cookie } -// Write request to wire for SendExtensionEvent +// SendExtensionEvent sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SendExtensionEvent(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) SendExtensionEventCookie { cookie := c.NewCookie(false, false) c.NewRequest(sendExtensionEventRequest(c, Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) return SendExtensionEventCookie{cookie} } +// SendExtensionEventChecked sends a checked request. +// If an error occurs, it can be retrieved using SendExtensionEventCookie.Check() func SendExtensionEventChecked(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) SendExtensionEventCookie { cookie := c.NewCookie(true, false) c.NewRequest(sendExtensionEventRequest(c, Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) return SendExtensionEventCookie{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 SendExtensionEventCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for SendExtensionEvent +// sendExtensionEventRequest writes a SendExtensionEvent request to a byte slice. func sendExtensionEventRequest(c *xgb.Conn, Destination xproto.Window, DeviceId byte, Propagate bool, NumClasses uint16, NumEvents byte, Events string, Classes []EventClass) []byte { size := xgb.Pad(((16 + xgb.Pad(((int(NumEvents) * 32) * 1))) + xgb.Pad((int(NumClasses) * 4)))) b := 0 @@ -6983,30 +7025,35 @@ func sendExtensionEventRequest(c *xgb.Conn, Destination xproto.Window, DeviceId return buf } -// Request DeviceBell -// size: 8 +// DeviceBellCookie is a cookie used only for DeviceBell requests. type DeviceBellCookie struct { *xgb.Cookie } -// Write request to wire for DeviceBell +// DeviceBell sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func DeviceBell(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) DeviceBellCookie { cookie := c.NewCookie(false, false) c.NewRequest(deviceBellRequest(c, DeviceId, FeedbackId, FeedbackClass, Percent), cookie) return DeviceBellCookie{cookie} } +// DeviceBellChecked sends a checked request. +// If an error occurs, it can be retrieved using DeviceBellCookie.Check() func DeviceBellChecked(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) DeviceBellCookie { cookie := c.NewCookie(true, false) c.NewRequest(deviceBellRequest(c, DeviceId, FeedbackId, FeedbackClass, Percent), cookie) return DeviceBellCookie{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 DeviceBellCookie) Check() error { return cook.Cookie.Check() } // Write request to wire for DeviceBell +// deviceBellRequest writes a DeviceBell request to a byte slice. func deviceBellRequest(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, Percent int8) []byte { size := 8 b := 0 @@ -7036,35 +7083,37 @@ func deviceBellRequest(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClas return buf } -// Request SetDeviceValuators -// size: xgb.Pad((8 + xgb.Pad((int(NumValuators) * 4)))) +// SetDeviceValuatorsCookie is a cookie used only for SetDeviceValuators requests. type SetDeviceValuatorsCookie struct { *xgb.Cookie } +// SetDeviceValuators sends a checked request. +// If an error occurs, it will be returned with the reply by calling SetDeviceValuatorsCookie.Reply() func SetDeviceValuators(c *xgb.Conn, DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) SetDeviceValuatorsCookie { cookie := c.NewCookie(true, true) c.NewRequest(setDeviceValuatorsRequest(c, DeviceId, FirstValuator, NumValuators, Valuators), cookie) return SetDeviceValuatorsCookie{cookie} } +// SetDeviceValuatorsUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func SetDeviceValuatorsUnchecked(c *xgb.Conn, DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) SetDeviceValuatorsCookie { cookie := c.NewCookie(false, true) c.NewRequest(setDeviceValuatorsRequest(c, DeviceId, FirstValuator, NumValuators, Valuators), cookie) return SetDeviceValuatorsCookie{cookie} } -// Request reply for SetDeviceValuators -// size: 32 +// SetDeviceValuatorsReply represents the data returned from a SetDeviceValuators request. type SetDeviceValuatorsReply 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 Status byte // padding: 23 bytes } -// Waits and reads reply data from request SetDeviceValuators +// Reply blocks and returns the reply data for a SetDeviceValuators request. func (cook SetDeviceValuatorsCookie) Reply() (*SetDeviceValuatorsReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7076,7 +7125,7 @@ func (cook SetDeviceValuatorsCookie) Reply() (*SetDeviceValuatorsReply, error) { return setDeviceValuatorsReply(buf), nil } -// Read reply into structure from buffer for SetDeviceValuators +// setDeviceValuatorsReply reads a byte slice into a SetDeviceValuatorsReply value. func setDeviceValuatorsReply(buf []byte) *SetDeviceValuatorsReply { v := new(SetDeviceValuatorsReply) b := 1 // skip reply determinant @@ -7098,6 +7147,7 @@ func setDeviceValuatorsReply(buf []byte) *SetDeviceValuatorsReply { } // Write request to wire for SetDeviceValuators +// setDeviceValuatorsRequest writes a SetDeviceValuators request to a byte slice. func setDeviceValuatorsRequest(c *xgb.Conn, DeviceId byte, FirstValuator byte, NumValuators byte, Valuators []int32) []byte { size := xgb.Pad((8 + xgb.Pad((int(NumValuators) * 4)))) b := 0 @@ -7132,35 +7182,37 @@ func setDeviceValuatorsRequest(c *xgb.Conn, DeviceId byte, FirstValuator byte, N return buf } -// Request GetDeviceControl -// size: 8 +// GetDeviceControlCookie is a cookie used only for GetDeviceControl requests. type GetDeviceControlCookie struct { *xgb.Cookie } +// GetDeviceControl sends a checked request. +// If an error occurs, it will be returned with the reply by calling GetDeviceControlCookie.Reply() func GetDeviceControl(c *xgb.Conn, ControlId uint16, DeviceId byte) GetDeviceControlCookie { cookie := c.NewCookie(true, true) c.NewRequest(getDeviceControlRequest(c, ControlId, DeviceId), cookie) return GetDeviceControlCookie{cookie} } +// GetDeviceControlUnchecked sends an unchecked request. +// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetDeviceControlUnchecked(c *xgb.Conn, ControlId uint16, DeviceId byte) GetDeviceControlCookie { cookie := c.NewCookie(false, true) c.NewRequest(getDeviceControlRequest(c, ControlId, DeviceId), cookie) return GetDeviceControlCookie{cookie} } -// Request reply for GetDeviceControl -// size: 32 +// GetDeviceControlReply represents the data returned from a GetDeviceControl request. type GetDeviceControlReply 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 Status byte // padding: 23 bytes } -// Waits and reads reply data from request GetDeviceControl +// Reply blocks and returns the reply data for a GetDeviceControl request. func (cook GetDeviceControlCookie) Reply() (*GetDeviceControlReply, error) { buf, err := cook.Cookie.Reply() if err != nil { @@ -7172,7 +7224,7 @@ func (cook GetDeviceControlCookie) Reply() (*GetDeviceControlReply, error) { return getDeviceControlReply(buf), nil } -// Read reply into structure from buffer for GetDeviceControl +// getDeviceControlReply reads a byte slice into a GetDeviceControlReply value. func getDeviceControlReply(buf []byte) *GetDeviceControlReply { v := new(GetDeviceControlReply) b := 1 // skip reply determinant @@ -7194,6 +7246,7 @@ func getDeviceControlReply(buf []byte) *GetDeviceControlReply { } // Write request to wire for GetDeviceControl +// getDeviceControlRequest writes a GetDeviceControl request to a byte slice. func getDeviceControlRequest(c *xgb.Conn, ControlId uint16, DeviceId byte) []byte { size := 8 b := 0 -- cgit v1.2.3-54-g00ecf