diff options
Diffstat (limited to 'nexgb/auto_damage.go')
-rw-r--r-- | nexgb/auto_damage.go | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/nexgb/auto_damage.go b/nexgb/auto_damage.go index c875016..8339e6a 100644 --- a/nexgb/auto_damage.go +++ b/nexgb/auto_damage.go @@ -1,7 +1,7 @@ package xgb /* - This file was generated by damage.xml on May 6 2012 3:00:43am EDT. + This file was generated by damage.xml on May 6 2012 5:48:47pm EDT. This file is automatically generated. Edit at your peril! */ @@ -10,13 +10,29 @@ package xgb // import "xproto" // import "xfixes" -// Skipping definition for base type 'Card16' +// DamageInit must be called before using the DAMAGE extension. +func (c *Conn) DamageInit() error { + reply, err := c.QueryExtension(6, "DAMAGE").Reply() + switch { + case err != nil: + return err + case !reply.Present: + return newError("No extension named DAMAGE could be found on on the server.") + } -// Skipping definition for base type 'Char' + c.extLock.Lock() + c.extensions["DAMAGE"] = reply.MajorOpcode + for evNum, fun := range newExtEventFuncs["DAMAGE"] { + newEventFuncs[int(reply.FirstEvent)+evNum] = fun + } + c.extLock.Unlock() -// Skipping definition for base type 'Card32' + return nil +} -// Skipping definition for base type 'Double' +func init() { + newExtEventFuncs["DAMAGE"] = make(map[int]newEventFun) +} // Skipping definition for base type 'Bool' @@ -36,6 +52,14 @@ package xgb // Skipping definition for base type 'Int8' +// Skipping definition for base type 'Card16' + +// Skipping definition for base type 'Char' + +// Skipping definition for base type 'Card32' + +// Skipping definition for base type 'Double' + const ( DamageReportLevelRawRectangles = 0 DamageReportLevelDeltaRectangles = 1 @@ -144,7 +168,7 @@ func (v DamageNotifyEvent) String() string { } func init() { - newEventFuncs[0] = NewDamageNotifyEvent + newExtEventFuncs["DAMAGE"][0] = NewDamageNotifyEvent } // Error definition DamageBadDamage (0) |