From 29942bf078c92fea681e42ca5029592526f00718 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Fri, 11 May 2012 23:58:52 -0400 Subject: panic when an extension request is issued before an extension has been initialized. but give a nice error message for the happy people. --- nexgb/xinput/xinput.go | 216 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 207 insertions(+), 9 deletions(-) (limited to 'nexgb/xinput/xinput.go') diff --git a/nexgb/xinput/xinput.go b/nexgb/xinput/xinput.go index 0cb711b..2ed45b8 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 11 2012 1:58:36am EDT. + This file was generated by xinput.xml on May 11 2012 11:57:20pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,14 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XInputExtension"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - // Skipping definition for base type 'Void' // Skipping definition for base type 'Byte' @@ -64,6 +56,14 @@ func init() { // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + const ( ValuatorModeRelative = 0 ValuatorModeAbsolute = 1 @@ -4582,6 +4582,9 @@ type GetExtensionVersionCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetExtensionVersion' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getExtensionVersionRequest(c, NameLen, Name), cookie) return GetExtensionVersionCookie{cookie} @@ -4590,6 +4593,9 @@ func GetExtensionVersion(c *xgb.Conn, NameLen uint16, Name string) GetExtensionV // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetExtensionVersion' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getExtensionVersionRequest(c, NameLen, Name), cookie) return GetExtensionVersionCookie{cookie} @@ -4684,6 +4690,9 @@ type ListInputDevicesCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ListInputDevices' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(listInputDevicesRequest(c), cookie) return ListInputDevicesCookie{cookie} @@ -4692,6 +4701,9 @@ func ListInputDevices(c *xgb.Conn) ListInputDevicesCookie { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ListInputDevices' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(listInputDevicesRequest(c), cookie) return ListInputDevicesCookie{cookie} @@ -4770,6 +4782,9 @@ type OpenDeviceCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'OpenDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(openDeviceRequest(c, DeviceId), cookie) return OpenDeviceCookie{cookie} @@ -4778,6 +4793,9 @@ func OpenDevice(c *xgb.Conn, DeviceId byte) OpenDeviceCookie { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'OpenDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(openDeviceRequest(c, DeviceId), cookie) return OpenDeviceCookie{cookie} @@ -4861,6 +4879,9 @@ type CloseDeviceCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'CloseDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(closeDeviceRequest(c, DeviceId), cookie) return CloseDeviceCookie{cookie} @@ -4869,6 +4890,9 @@ func CloseDevice(c *xgb.Conn, DeviceId byte) CloseDeviceCookie { // CloseDeviceChecked sends a checked request. // If an error occurs, it can be retrieved using CloseDeviceCookie.Check() func CloseDeviceChecked(c *xgb.Conn, DeviceId byte) CloseDeviceCookie { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'CloseDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(closeDeviceRequest(c, DeviceId), cookie) return CloseDeviceCookie{cookie} @@ -4912,6 +4936,9 @@ type SetDeviceModeCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceMode' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(setDeviceModeRequest(c, DeviceId, Mode), cookie) return SetDeviceModeCookie{cookie} @@ -4920,6 +4947,9 @@ func SetDeviceMode(c *xgb.Conn, DeviceId byte, Mode byte) SetDeviceModeCookie { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceMode' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(setDeviceModeRequest(c, DeviceId, Mode), cookie) return SetDeviceModeCookie{cookie} @@ -5002,6 +5032,9 @@ type SelectExtensionEventCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SelectExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(selectExtensionEventRequest(c, Window, NumClasses, Classes), cookie) return SelectExtensionEventCookie{cookie} @@ -5010,6 +5043,9 @@ func SelectExtensionEvent(c *xgb.Conn, Window xproto.Window, NumClasses uint16, // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SelectExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(selectExtensionEventRequest(c, Window, NumClasses, Classes), cookie) return SelectExtensionEventCookie{cookie} @@ -5062,6 +5098,9 @@ type GetSelectedExtensionEventsCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetSelectedExtensionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getSelectedExtensionEventsRequest(c, Window), cookie) return GetSelectedExtensionEventsCookie{cookie} @@ -5070,6 +5109,9 @@ func GetSelectedExtensionEvents(c *xgb.Conn, Window xproto.Window) GetSelectedEx // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetSelectedExtensionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getSelectedExtensionEventsRequest(c, Window), cookie) return GetSelectedExtensionEventsCookie{cookie} @@ -5167,6 +5209,9 @@ type ChangeDeviceDontPropagateListCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ChangeDeviceDontPropagateList' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(changeDeviceDontPropagateListRequest(c, Window, NumClasses, Mode, Classes), cookie) return ChangeDeviceDontPropagateListCookie{cookie} @@ -5175,6 +5220,9 @@ func ChangeDeviceDontPropagateList(c *xgb.Conn, Window xproto.Window, NumClasses // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ChangeDeviceDontPropagateList' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(changeDeviceDontPropagateListRequest(c, Window, NumClasses, Mode, Classes), cookie) return ChangeDeviceDontPropagateListCookie{cookie} @@ -5230,6 +5278,9 @@ type GetDeviceDontPropagateListCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceDontPropagateList' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDeviceDontPropagateListRequest(c, Window), cookie) return GetDeviceDontPropagateListCookie{cookie} @@ -5238,6 +5289,9 @@ func GetDeviceDontPropagateList(c *xgb.Conn, Window xproto.Window) GetDeviceDont // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceDontPropagateList' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDeviceDontPropagateListRequest(c, Window), cookie) return GetDeviceDontPropagateListCookie{cookie} @@ -5323,6 +5377,9 @@ type GetDeviceMotionEventsCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceMotionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDeviceMotionEventsRequest(c, Start, Stop, DeviceId), cookie) return GetDeviceMotionEventsCookie{cookie} @@ -5331,6 +5388,9 @@ func GetDeviceMotionEvents(c *xgb.Conn, Start xproto.Timestamp, Stop xproto.Time // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceMotionEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDeviceMotionEventsRequest(c, Start, Stop, DeviceId), cookie) return GetDeviceMotionEventsCookie{cookie} @@ -5422,6 +5482,9 @@ type ChangeKeyboardDeviceCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ChangeKeyboardDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(changeKeyboardDeviceRequest(c, DeviceId), cookie) return ChangeKeyboardDeviceCookie{cookie} @@ -5430,6 +5493,9 @@ func ChangeKeyboardDevice(c *xgb.Conn, DeviceId byte) ChangeKeyboardDeviceCookie // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ChangeKeyboardDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(changeKeyboardDeviceRequest(c, DeviceId), cookie) return ChangeKeyboardDeviceCookie{cookie} @@ -5509,6 +5575,9 @@ type ChangePointerDeviceCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ChangePointerDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(changePointerDeviceRequest(c, XAxis, YAxis, DeviceId), cookie) return ChangePointerDeviceCookie{cookie} @@ -5517,6 +5586,9 @@ func ChangePointerDevice(c *xgb.Conn, XAxis byte, YAxis byte, DeviceId byte) Cha // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ChangePointerDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(changePointerDeviceRequest(c, XAxis, YAxis, DeviceId), cookie) return ChangePointerDeviceCookie{cookie} @@ -5602,6 +5674,9 @@ type GrabDeviceCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GrabDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(grabDeviceRequest(c, GrabWindow, Time, NumClasses, ThisDeviceMode, OtherDeviceMode, OwnerEvents, DeviceId, Classes), cookie) return GrabDeviceCookie{cookie} @@ -5610,6 +5685,9 @@ func GrabDevice(c *xgb.Conn, GrabWindow xproto.Window, Time xproto.Timestamp, Nu // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GrabDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(grabDeviceRequest(c, GrabWindow, Time, NumClasses, ThisDeviceMode, OtherDeviceMode, OwnerEvents, DeviceId, Classes), cookie) return GrabDeviceCookie{cookie} @@ -5717,6 +5795,9 @@ type UngrabDeviceCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'UngrabDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(ungrabDeviceRequest(c, Time, DeviceId), cookie) return UngrabDeviceCookie{cookie} @@ -5725,6 +5806,9 @@ func UngrabDevice(c *xgb.Conn, Time xproto.Timestamp, DeviceId byte) UngrabDevic // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'UngrabDevice' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(ungrabDeviceRequest(c, Time, DeviceId), cookie) return UngrabDeviceCookie{cookie} @@ -5769,6 +5853,9 @@ type GrabDeviceKeyCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GrabDeviceKey' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(grabDeviceKeyRequest(c, GrabWindow, NumClasses, Modifiers, ModifierDevice, GrabbedDevice, Key, ThisDeviceMode, OtherDeviceMode, OwnerEvents, Classes), cookie) return GrabDeviceKeyCookie{cookie} @@ -5777,6 +5864,9 @@ func GrabDeviceKey(c *xgb.Conn, GrabWindow xproto.Window, NumClasses uint16, Mod // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GrabDeviceKey' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(grabDeviceKeyRequest(c, GrabWindow, NumClasses, Modifiers, ModifierDevice, GrabbedDevice, Key, ThisDeviceMode, OtherDeviceMode, OwnerEvents, Classes), cookie) return GrabDeviceKeyCookie{cookie} @@ -5854,6 +5944,9 @@ type UngrabDeviceKeyCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'UngrabDeviceKey' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(ungrabDeviceKeyRequest(c, GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) return UngrabDeviceKeyCookie{cookie} @@ -5862,6 +5955,9 @@ func UngrabDeviceKey(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, Mo // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'UngrabDeviceKey' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(ungrabDeviceKeyRequest(c, GrabWindow, Modifiers, ModifierDevice, Key, GrabbedDevice), cookie) return UngrabDeviceKeyCookie{cookie} @@ -5915,6 +6011,9 @@ type GrabDeviceButtonCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(grabDeviceButtonRequest(c, GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) return GrabDeviceButtonCookie{cookie} @@ -5923,6 +6022,9 @@ func GrabDeviceButton(c *xgb.Conn, GrabWindow xproto.Window, GrabbedDevice byte, // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(grabDeviceButtonRequest(c, GrabWindow, GrabbedDevice, ModifierDevice, NumClasses, Modifiers, ThisDeviceMode, OtherDeviceMode, Button, OwnerEvents, Classes), cookie) return GrabDeviceButtonCookie{cookie} @@ -5996,6 +6098,9 @@ type UngrabDeviceButtonCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'UngrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(ungrabDeviceButtonRequest(c, GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) return UngrabDeviceButtonCookie{cookie} @@ -6004,6 +6109,9 @@ func UngrabDeviceButton(c *xgb.Conn, GrabWindow xproto.Window, Modifiers uint16, // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'UngrabDeviceButton' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(ungrabDeviceButtonRequest(c, GrabWindow, Modifiers, ModifierDevice, Button, GrabbedDevice), cookie) return UngrabDeviceButtonCookie{cookie} @@ -6057,6 +6165,9 @@ type AllowDeviceEventsCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'AllowDeviceEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(allowDeviceEventsRequest(c, Time, Mode, DeviceId), cookie) return AllowDeviceEventsCookie{cookie} @@ -6065,6 +6176,9 @@ func AllowDeviceEvents(c *xgb.Conn, Time xproto.Timestamp, Mode byte, DeviceId b // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'AllowDeviceEvents' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(allowDeviceEventsRequest(c, Time, Mode, DeviceId), cookie) return AllowDeviceEventsCookie{cookie} @@ -6112,6 +6226,9 @@ type GetDeviceFocusCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDeviceFocusRequest(c, DeviceId), cookie) return GetDeviceFocusCookie{cookie} @@ -6120,6 +6237,9 @@ func GetDeviceFocus(c *xgb.Conn, DeviceId byte) GetDeviceFocusCookie { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDeviceFocusRequest(c, DeviceId), cookie) return GetDeviceFocusCookie{cookie} @@ -6207,6 +6327,9 @@ type SetDeviceFocusCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(setDeviceFocusRequest(c, Focus, Time, RevertTo, DeviceId), cookie) return SetDeviceFocusCookie{cookie} @@ -6215,6 +6338,9 @@ func SetDeviceFocus(c *xgb.Conn, Focus xproto.Window, Time xproto.Timestamp, Rev // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceFocus' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(setDeviceFocusRequest(c, Focus, Time, RevertTo, DeviceId), cookie) return SetDeviceFocusCookie{cookie} @@ -6265,6 +6391,9 @@ type GetFeedbackControlCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetFeedbackControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getFeedbackControlRequest(c, DeviceId), cookie) return GetFeedbackControlCookie{cookie} @@ -6273,6 +6402,9 @@ func GetFeedbackControl(c *xgb.Conn, DeviceId byte) GetFeedbackControlCookie { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetFeedbackControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getFeedbackControlRequest(c, DeviceId), cookie) return GetFeedbackControlCookie{cookie} @@ -6352,6 +6484,9 @@ type GetDeviceKeyMappingCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, Count), cookie) return GetDeviceKeyMappingCookie{cookie} @@ -6360,6 +6495,9 @@ func GetDeviceKeyMapping(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Count // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, Count), cookie) return GetDeviceKeyMappingCookie{cookie} @@ -6451,6 +6589,9 @@ type ChangeDeviceKeyMappingCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ChangeDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(changeDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) return ChangeDeviceKeyMappingCookie{cookie} @@ -6459,6 +6600,9 @@ func ChangeDeviceKeyMapping(c *xgb.Conn, DeviceId byte, FirstKeycode KeyCode, Ke // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'ChangeDeviceKeyMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(changeDeviceKeyMappingRequest(c, DeviceId, FirstKeycode, KeysymsPerKeycode, KeycodeCount, Keysyms), cookie) return ChangeDeviceKeyMappingCookie{cookie} @@ -6515,6 +6659,9 @@ type GetDeviceModifierMappingCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDeviceModifierMappingRequest(c, DeviceId), cookie) return GetDeviceModifierMappingCookie{cookie} @@ -6523,6 +6670,9 @@ func GetDeviceModifierMapping(c *xgb.Conn, DeviceId byte) GetDeviceModifierMappi // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDeviceModifierMappingRequest(c, DeviceId), cookie) return GetDeviceModifierMappingCookie{cookie} @@ -6607,6 +6757,9 @@ type SetDeviceModifierMappingCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(setDeviceModifierMappingRequest(c, DeviceId, KeycodesPerModifier, Keymaps), cookie) return SetDeviceModifierMappingCookie{cookie} @@ -6615,6 +6768,9 @@ func SetDeviceModifierMapping(c *xgb.Conn, DeviceId byte, KeycodesPerModifier by // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceModifierMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(setDeviceModifierMappingRequest(c, DeviceId, KeycodesPerModifier, Keymaps), cookie) return SetDeviceModifierMappingCookie{cookie} @@ -6700,6 +6856,9 @@ type GetDeviceButtonMappingCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceButtonMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDeviceButtonMappingRequest(c, DeviceId), cookie) return GetDeviceButtonMappingCookie{cookie} @@ -6708,6 +6867,9 @@ func GetDeviceButtonMapping(c *xgb.Conn, DeviceId byte) GetDeviceButtonMappingCo // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceButtonMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDeviceButtonMappingRequest(c, DeviceId), cookie) return GetDeviceButtonMappingCookie{cookie} @@ -6792,6 +6954,9 @@ type SetDeviceButtonMappingCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceButtonMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(setDeviceButtonMappingRequest(c, DeviceId, MapSize, Map), cookie) return SetDeviceButtonMappingCookie{cookie} @@ -6800,6 +6965,9 @@ func SetDeviceButtonMapping(c *xgb.Conn, DeviceId byte, MapSize byte, Map []byte // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceButtonMapping' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(setDeviceButtonMappingRequest(c, DeviceId, MapSize, Map), cookie) return SetDeviceButtonMappingCookie{cookie} @@ -6885,6 +7053,9 @@ type QueryDeviceStateCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'QueryDeviceState' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(queryDeviceStateRequest(c, DeviceId), cookie) return QueryDeviceStateCookie{cookie} @@ -6893,6 +7064,9 @@ func QueryDeviceState(c *xgb.Conn, DeviceId byte) QueryDeviceStateCookie { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'QueryDeviceState' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(queryDeviceStateRequest(c, DeviceId), cookie) return QueryDeviceStateCookie{cookie} @@ -6972,6 +7146,9 @@ type SendExtensionEventCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SendExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(sendExtensionEventRequest(c, Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) return SendExtensionEventCookie{cookie} @@ -6980,6 +7157,9 @@ func SendExtensionEvent(c *xgb.Conn, Destination xproto.Window, DeviceId byte, P // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SendExtensionEvent' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(sendExtensionEventRequest(c, Destination, DeviceId, Propagate, NumClasses, NumEvents, Events, Classes), cookie) return SendExtensionEventCookie{cookie} @@ -7048,6 +7228,9 @@ type DeviceBellCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'DeviceBell' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, false) c.NewRequest(deviceBellRequest(c, DeviceId, FeedbackId, FeedbackClass, Percent), cookie) return DeviceBellCookie{cookie} @@ -7056,6 +7239,9 @@ func DeviceBell(c *xgb.Conn, DeviceId byte, FeedbackId byte, FeedbackClass byte, // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'DeviceBell' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, false) c.NewRequest(deviceBellRequest(c, DeviceId, FeedbackId, FeedbackClass, Percent), cookie) return DeviceBellCookie{cookie} @@ -7106,6 +7292,9 @@ type SetDeviceValuatorsCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceValuators' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(setDeviceValuatorsRequest(c, DeviceId, FirstValuator, NumValuators, Valuators), cookie) return SetDeviceValuatorsCookie{cookie} @@ -7114,6 +7303,9 @@ func SetDeviceValuators(c *xgb.Conn, DeviceId byte, FirstValuator byte, NumValua // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'SetDeviceValuators' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(setDeviceValuatorsRequest(c, DeviceId, FirstValuator, NumValuators, Valuators), cookie) return SetDeviceValuatorsCookie{cookie} @@ -7205,6 +7397,9 @@ type GetDeviceControlCookie struct { // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getDeviceControlRequest(c, ControlId, DeviceId), cookie) return GetDeviceControlCookie{cookie} @@ -7213,6 +7408,9 @@ func GetDeviceControl(c *xgb.Conn, ControlId uint16, DeviceId byte) GetDeviceCon // 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 { + if _, ok := c.Extensions["XINPUTEXTENSION"]; !ok { + panic("Cannot issue request 'GetDeviceControl' using the uninitialized extension 'XInputExtension'. xinput.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getDeviceControlRequest(c, ControlId, DeviceId), cookie) return GetDeviceControlCookie{cookie} -- cgit v1.2.3