aboutsummaryrefslogtreecommitdiff
path: root/nexgb/auto_xinput.go
diff options
context:
space:
mode:
authorAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-07 01:00:45 -0400
committerAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-07 01:00:45 -0400
commitfd30f1512a713ae5b3cbacddfe9f29dfccc82047 (patch)
tree5801b9fe74106d9780efa23cd1b2c238ba5ffad9 /nexgb/auto_xinput.go
parent6d545e723a7e972998a0e77adcf2219a31a9b800 (diff)
downloadhaven-fd30f1512a713ae5b3cbacddfe9f29dfccc82047.tar.gz
haven-fd30f1512a713ae5b3cbacddfe9f29dfccc82047.tar.xz
haven-fd30f1512a713ae5b3cbacddfe9f29dfccc82047.zip
added tests
Diffstat (limited to 'nexgb/auto_xinput.go')
-rw-r--r--nexgb/auto_xinput.go78
1 files changed, 51 insertions, 27 deletions
diff --git a/nexgb/auto_xinput.go b/nexgb/auto_xinput.go
index d300bca..ae122b8 100644
--- a/nexgb/auto_xinput.go
+++ b/nexgb/auto_xinput.go
@@ -1,7 +1,7 @@
package xgb
/*
- This file was generated by xinput.xml on May 6 2012 3:00:45am EDT.
+ This file was generated by xinput.xml on May 6 2012 5:48:48pm EDT.
This file is automatically generated. Edit at your peril!
*/
@@ -9,19 +9,29 @@ package xgb
// in one package. They are still listed here for reference.
// import "xproto"
-// Skipping definition for base type 'Float'
-
-// Skipping definition for base type 'Id'
-
-// Skipping definition for base type 'Card8'
-
-// Skipping definition for base type 'Int16'
+// XinputInit must be called before using the XInputExtension extension.
+func (c *Conn) XinputInit() error {
+ reply, err := c.QueryExtension(15, "XInputExtension").Reply()
+ switch {
+ case err != nil:
+ return err
+ case !reply.Present:
+ return newError("No extension named XInputExtension could be found on on the server.")
+ }
-// Skipping definition for base type 'Int32'
+ c.extLock.Lock()
+ c.extensions["XInputExtension"] = reply.MajorOpcode
+ for evNum, fun := range newExtEventFuncs["XInputExtension"] {
+ newEventFuncs[int(reply.FirstEvent)+evNum] = fun
+ }
+ c.extLock.Unlock()
-// Skipping definition for base type 'Void'
+ return nil
+}
-// Skipping definition for base type 'Byte'
+func init() {
+ newExtEventFuncs["XInputExtension"] = make(map[int]newEventFun)
+}
// Skipping definition for base type 'Int8'
@@ -35,6 +45,20 @@ package xgb
// Skipping definition for base type 'Bool'
+// Skipping definition for base type 'Float'
+
+// Skipping definition for base type 'Id'
+
+// Skipping definition for base type 'Card8'
+
+// Skipping definition for base type 'Int16'
+
+// Skipping definition for base type 'Int32'
+
+// Skipping definition for base type 'Void'
+
+// Skipping definition for base type 'Byte'
+
const (
XinputValuatorModeRelative = 0
XinputValuatorModeAbsolute = 1
@@ -3307,7 +3331,7 @@ func (v XinputDeviceValuatorEvent) String() string {
}
func init() {
- newEventFuncs[0] = NewXinputDeviceValuatorEvent
+ newExtEventFuncs["XInputExtension"][0] = NewXinputDeviceValuatorEvent
}
// Event definition XinputDeviceKeyPress (1)
@@ -3461,7 +3485,7 @@ func (v XinputDeviceKeyPressEvent) String() string {
}
func init() {
- newEventFuncs[1] = NewXinputDeviceKeyPressEvent
+ newExtEventFuncs["XInputExtension"][1] = NewXinputDeviceKeyPressEvent
}
// Event definition XinputFocusIn (6)
@@ -3556,7 +3580,7 @@ func (v XinputFocusInEvent) String() string {
}
func init() {
- newEventFuncs[6] = NewXinputFocusInEvent
+ newExtEventFuncs["XInputExtension"][6] = NewXinputFocusInEvent
}
// Event definition XinputDeviceStateNotify (10)
@@ -3684,7 +3708,7 @@ func (v XinputDeviceStateNotifyEvent) String() string {
}
func init() {
- newEventFuncs[10] = NewXinputDeviceStateNotifyEvent
+ newExtEventFuncs["XInputExtension"][10] = NewXinputDeviceStateNotifyEvent
}
// Event definition XinputDeviceMappingNotify (11)
@@ -3784,7 +3808,7 @@ func (v XinputDeviceMappingNotifyEvent) String() string {
}
func init() {
- newEventFuncs[11] = NewXinputDeviceMappingNotifyEvent
+ newExtEventFuncs["XInputExtension"][11] = NewXinputDeviceMappingNotifyEvent
}
// Event definition XinputChangeDeviceNotify (12)
@@ -3863,7 +3887,7 @@ func (v XinputChangeDeviceNotifyEvent) String() string {
}
func init() {
- newEventFuncs[12] = NewXinputChangeDeviceNotifyEvent
+ newExtEventFuncs["XInputExtension"][12] = NewXinputChangeDeviceNotifyEvent
}
// Event definition XinputDeviceKeyStateNotify (13)
@@ -3929,7 +3953,7 @@ func (v XinputDeviceKeyStateNotifyEvent) String() string {
}
func init() {
- newEventFuncs[13] = NewXinputDeviceKeyStateNotifyEvent
+ newExtEventFuncs["XInputExtension"][13] = NewXinputDeviceKeyStateNotifyEvent
}
// Event definition XinputDeviceButtonStateNotify (14)
@@ -3995,7 +4019,7 @@ func (v XinputDeviceButtonStateNotifyEvent) String() string {
}
func init() {
- newEventFuncs[14] = NewXinputDeviceButtonStateNotifyEvent
+ newExtEventFuncs["XInputExtension"][14] = NewXinputDeviceButtonStateNotifyEvent
}
// Event definition XinputDevicePresenceNotify (15)
@@ -4087,7 +4111,7 @@ func (v XinputDevicePresenceNotifyEvent) String() string {
}
func init() {
- newEventFuncs[15] = NewXinputDevicePresenceNotifyEvent
+ newExtEventFuncs["XInputExtension"][15] = NewXinputDevicePresenceNotifyEvent
}
// EventCopy definition XinputDeviceKeyRelease (2)
@@ -4129,7 +4153,7 @@ func (v XinputDeviceKeyReleaseEvent) String() string {
}
func init() {
- newEventFuncs[2] = NewXinputDeviceKeyReleaseEvent
+ newExtEventFuncs["XInputExtension"][2] = NewXinputDeviceKeyReleaseEvent
}
// EventCopy definition XinputDeviceButtonPress (3)
@@ -4171,7 +4195,7 @@ func (v XinputDeviceButtonPressEvent) String() string {
}
func init() {
- newEventFuncs[3] = NewXinputDeviceButtonPressEvent
+ newExtEventFuncs["XInputExtension"][3] = NewXinputDeviceButtonPressEvent
}
// EventCopy definition XinputDeviceButtonRelease (4)
@@ -4213,7 +4237,7 @@ func (v XinputDeviceButtonReleaseEvent) String() string {
}
func init() {
- newEventFuncs[4] = NewXinputDeviceButtonReleaseEvent
+ newExtEventFuncs["XInputExtension"][4] = NewXinputDeviceButtonReleaseEvent
}
// EventCopy definition XinputDeviceMotionNotify (5)
@@ -4255,7 +4279,7 @@ func (v XinputDeviceMotionNotifyEvent) String() string {
}
func init() {
- newEventFuncs[5] = NewXinputDeviceMotionNotifyEvent
+ newExtEventFuncs["XInputExtension"][5] = NewXinputDeviceMotionNotifyEvent
}
// EventCopy definition XinputProximityIn (8)
@@ -4297,7 +4321,7 @@ func (v XinputProximityInEvent) String() string {
}
func init() {
- newEventFuncs[8] = NewXinputProximityInEvent
+ newExtEventFuncs["XInputExtension"][8] = NewXinputProximityInEvent
}
// EventCopy definition XinputProximityOut (9)
@@ -4339,7 +4363,7 @@ func (v XinputProximityOutEvent) String() string {
}
func init() {
- newEventFuncs[9] = NewXinputProximityOutEvent
+ newExtEventFuncs["XInputExtension"][9] = NewXinputProximityOutEvent
}
// EventCopy definition XinputFocusOut (7)
@@ -4374,7 +4398,7 @@ func (v XinputFocusOutEvent) String() string {
}
func init() {
- newEventFuncs[7] = NewXinputFocusOutEvent
+ newExtEventFuncs["XInputExtension"][7] = NewXinputFocusOutEvent
}
// Error definition XinputDevice (0)