diff options
author | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-10 12:47:19 -0400 |
---|---|---|
committer | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-10 12:47:19 -0400 |
commit | e239bb3c68a4981a3916534203c2fbd6b96f593c (patch) | |
tree | ebb9b1a4a4659d09edaf57ec39a744ff4bc15ff0 /nexgb/auto_damage.go | |
parent | 00c6217ca905b08ce0acda9a90492b5c1dc358e8 (diff) | |
download | haven-e239bb3c68a4981a3916534203c2fbd6b96f593c.tar.gz haven-e239bb3c68a4981a3916534203c2fbd6b96f593c.tar.xz haven-e239bb3c68a4981a3916534203c2fbd6b96f593c.zip |
make resource ids their own individual types. last commit before overhaul to sub-packages
Diffstat (limited to 'nexgb/auto_damage.go')
-rw-r--r-- | nexgb/auto_damage.go | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/nexgb/auto_damage.go b/nexgb/auto_damage.go index b3130d9..97c76b4 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 8 2012 11:03:23pm EDT. + This file was generated by damage.xml on May 10 2012 12:39:33pm EDT. This file is automatically generated. Edit at your peril! */ @@ -38,10 +38,6 @@ func init() { newExtErrorFuncs["DAMAGE"] = make(map[int]newErrorFun) } -// Skipping definition for base type 'Id' - -// Skipping definition for base type 'Card8' - // Skipping definition for base type 'Int16' // Skipping definition for base type 'Int32' @@ -64,6 +60,8 @@ func init() { // Skipping definition for base type 'Float' +// Skipping definition for base type 'Card8' + const ( DamageReportLevelRawRectangles = 0 DamageReportLevelDeltaRectangles = 1 @@ -71,7 +69,15 @@ const ( DamageReportLevelNonEmpty = 3 ) -// Skipping resource definition of 'Damage' +type DamageDamage uint32 + +func (c *Conn) NewDamageDamageId() (DamageDamage, error) { + id, err := c.NewId() + if err != nil { + return 0, err + } + return DamageDamage(id), nil +} // Event definition DamageNotify (0) // Size: 32 @@ -81,8 +87,8 @@ const DamageNotify = 0 type DamageNotifyEvent struct { Sequence uint16 Level byte - Drawable Id - Damage Id + Drawable Drawable + Damage DamageDamage Timestamp Timestamp Area Rectangle Geometry Rectangle @@ -99,10 +105,10 @@ func NewDamageNotifyEvent(buf []byte) Event { v.Sequence = Get16(buf[b:]) b += 2 - v.Drawable = Id(Get32(buf[b:])) + v.Drawable = Drawable(Get32(buf[b:])) b += 4 - v.Damage = Id(Get32(buf[b:])) + v.Damage = DamageDamage(Get32(buf[b:])) b += 4 v.Timestamp = Timestamp(Get32(buf[b:])) @@ -205,7 +211,7 @@ func (err DamageBadDamageError) SequenceId() uint16 { return err.Sequence } -func (err DamageBadDamageError) BadId() Id { +func (err DamageBadDamageError) BadId() uint32 { return 0 } @@ -320,13 +326,13 @@ type DamageCreateCookie struct { } // Write request to wire for DamageCreate -func (c *Conn) DamageCreate(Damage Id, Drawable Id, Level byte) DamageCreateCookie { +func (c *Conn) DamageCreate(Damage DamageDamage, Drawable Drawable, Level byte) DamageCreateCookie { cookie := c.newCookie(false, false) c.newRequest(c.damageCreateRequest(Damage, Drawable, Level), cookie) return DamageCreateCookie{cookie} } -func (c *Conn) DamageCreateChecked(Damage Id, Drawable Id, Level byte) DamageCreateCookie { +func (c *Conn) DamageCreateChecked(Damage DamageDamage, Drawable Drawable, Level byte) DamageCreateCookie { cookie := c.newCookie(true, false) c.newRequest(c.damageCreateRequest(Damage, Drawable, Level), cookie) return DamageCreateCookie{cookie} @@ -337,7 +343,7 @@ func (cook DamageCreateCookie) Check() error { } // Write request to wire for DamageCreate -func (c *Conn) damageCreateRequest(Damage Id, Drawable Id, Level byte) []byte { +func (c *Conn) damageCreateRequest(Damage DamageDamage, Drawable Drawable, Level byte) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -372,13 +378,13 @@ type DamageDestroyCookie struct { } // Write request to wire for DamageDestroy -func (c *Conn) DamageDestroy(Damage Id) DamageDestroyCookie { +func (c *Conn) DamageDestroy(Damage DamageDamage) DamageDestroyCookie { cookie := c.newCookie(false, false) c.newRequest(c.damageDestroyRequest(Damage), cookie) return DamageDestroyCookie{cookie} } -func (c *Conn) DamageDestroyChecked(Damage Id) DamageDestroyCookie { +func (c *Conn) DamageDestroyChecked(Damage DamageDamage) DamageDestroyCookie { cookie := c.newCookie(true, false) c.newRequest(c.damageDestroyRequest(Damage), cookie) return DamageDestroyCookie{cookie} @@ -389,7 +395,7 @@ func (cook DamageDestroyCookie) Check() error { } // Write request to wire for DamageDestroy -func (c *Conn) damageDestroyRequest(Damage Id) []byte { +func (c *Conn) damageDestroyRequest(Damage DamageDamage) []byte { size := 8 b := 0 buf := make([]byte, size) @@ -416,13 +422,13 @@ type DamageSubtractCookie struct { } // Write request to wire for DamageSubtract -func (c *Conn) DamageSubtract(Damage Id, Repair Id, Parts Id) DamageSubtractCookie { +func (c *Conn) DamageSubtract(Damage DamageDamage, Repair XfixesRegion, Parts XfixesRegion) DamageSubtractCookie { cookie := c.newCookie(false, false) c.newRequest(c.damageSubtractRequest(Damage, Repair, Parts), cookie) return DamageSubtractCookie{cookie} } -func (c *Conn) DamageSubtractChecked(Damage Id, Repair Id, Parts Id) DamageSubtractCookie { +func (c *Conn) DamageSubtractChecked(Damage DamageDamage, Repair XfixesRegion, Parts XfixesRegion) DamageSubtractCookie { cookie := c.newCookie(true, false) c.newRequest(c.damageSubtractRequest(Damage, Repair, Parts), cookie) return DamageSubtractCookie{cookie} @@ -433,7 +439,7 @@ func (cook DamageSubtractCookie) Check() error { } // Write request to wire for DamageSubtract -func (c *Conn) damageSubtractRequest(Damage Id, Repair Id, Parts Id) []byte { +func (c *Conn) damageSubtractRequest(Damage DamageDamage, Repair XfixesRegion, Parts XfixesRegion) []byte { size := 16 b := 0 buf := make([]byte, size) @@ -466,13 +472,13 @@ type DamageAddCookie struct { } // Write request to wire for DamageAdd -func (c *Conn) DamageAdd(Drawable Id, Region Id) DamageAddCookie { +func (c *Conn) DamageAdd(Drawable Drawable, Region XfixesRegion) DamageAddCookie { cookie := c.newCookie(false, false) c.newRequest(c.damageAddRequest(Drawable, Region), cookie) return DamageAddCookie{cookie} } -func (c *Conn) DamageAddChecked(Drawable Id, Region Id) DamageAddCookie { +func (c *Conn) DamageAddChecked(Drawable Drawable, Region XfixesRegion) DamageAddCookie { cookie := c.newCookie(true, false) c.newRequest(c.damageAddRequest(Drawable, Region), cookie) return DamageAddCookie{cookie} @@ -483,7 +489,7 @@ func (cook DamageAddCookie) Check() error { } // Write request to wire for DamageAdd -func (c *Conn) damageAddRequest(Drawable Id, Region Id) []byte { +func (c *Conn) damageAddRequest(Drawable Drawable, Region XfixesRegion) []byte { size := 12 b := 0 buf := make([]byte, size) |