aboutsummaryrefslogtreecommitdiff
path: root/nexgb/auto_shm.go
diff options
context:
space:
mode:
authorAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-10 12:47:19 -0400
committerAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-10 12:47:19 -0400
commite239bb3c68a4981a3916534203c2fbd6b96f593c (patch)
treeebb9b1a4a4659d09edaf57ec39a744ff4bc15ff0 /nexgb/auto_shm.go
parent00c6217ca905b08ce0acda9a90492b5c1dc358e8 (diff)
downloadhaven-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_shm.go')
-rw-r--r--nexgb/auto_shm.go78
1 files changed, 42 insertions, 36 deletions
diff --git a/nexgb/auto_shm.go b/nexgb/auto_shm.go
index a3dfcf7..392c5ff 100644
--- a/nexgb/auto_shm.go
+++ b/nexgb/auto_shm.go
@@ -1,7 +1,7 @@
package xgb
/*
- This file was generated by shm.xml on May 8 2012 11:03:24pm EDT.
+ This file was generated by shm.xml on May 10 2012 12:39:34pm EDT.
This file is automatically generated. Edit at your peril!
*/
@@ -37,18 +37,6 @@ func init() {
newExtErrorFuncs["MIT-SHM"] = make(map[int]newErrorFun)
}
-// 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'
-
-// Skipping definition for base type 'Int8'
-
// Skipping definition for base type 'Card16'
// Skipping definition for base type 'Char'
@@ -61,9 +49,27 @@ func init() {
// Skipping definition for base type 'Float'
-// Skipping definition for base type 'Id'
+// Skipping definition for base type 'Card8'
-// Skipping resource definition of 'Seg'
+// Skipping definition for base type 'Int16'
+
+// Skipping definition for base type 'Int32'
+
+// Skipping definition for base type 'Void'
+
+// Skipping definition for base type 'Byte'
+
+// Skipping definition for base type 'Int8'
+
+type ShmSeg uint32
+
+func (c *Conn) NewShmSegId() (ShmSeg, error) {
+ id, err := c.NewId()
+ if err != nil {
+ return 0, err
+ }
+ return ShmSeg(id), nil
+}
// Event definition ShmCompletion (0)
// Size: 32
@@ -73,11 +79,11 @@ const ShmCompletion = 0
type ShmCompletionEvent struct {
Sequence uint16
// padding: 1 bytes
- Drawable Id
+ Drawable Drawable
MinorEvent uint16
MajorEvent byte
// padding: 1 bytes
- Shmseg Id
+ Shmseg ShmSeg
Offset uint32
}
@@ -91,7 +97,7 @@ func NewShmCompletionEvent(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.MinorEvent = Get16(buf[b:])
@@ -102,7 +108,7 @@ func NewShmCompletionEvent(buf []byte) Event {
b += 1 // padding
- v.Shmseg = Id(Get32(buf[b:]))
+ v.Shmseg = ShmSeg(Get32(buf[b:]))
b += 4
v.Offset = Get32(buf[b:])
@@ -183,8 +189,8 @@ func (err ShmBadSegError) SequenceId() uint16 {
return err.Sequence
}
-func (err ShmBadSegError) BadId() Id {
- return Id(err.BadValue)
+func (err ShmBadSegError) BadId() uint32 {
+ return 0
}
func (err ShmBadSegError) Error() string {
@@ -312,13 +318,13 @@ type ShmAttachCookie struct {
}
// Write request to wire for ShmAttach
-func (c *Conn) ShmAttach(Shmseg Id, Shmid uint32, ReadOnly bool) ShmAttachCookie {
+func (c *Conn) ShmAttach(Shmseg ShmSeg, Shmid uint32, ReadOnly bool) ShmAttachCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.shmAttachRequest(Shmseg, Shmid, ReadOnly), cookie)
return ShmAttachCookie{cookie}
}
-func (c *Conn) ShmAttachChecked(Shmseg Id, Shmid uint32, ReadOnly bool) ShmAttachCookie {
+func (c *Conn) ShmAttachChecked(Shmseg ShmSeg, Shmid uint32, ReadOnly bool) ShmAttachCookie {
cookie := c.newCookie(true, false)
c.newRequest(c.shmAttachRequest(Shmseg, Shmid, ReadOnly), cookie)
return ShmAttachCookie{cookie}
@@ -329,7 +335,7 @@ func (cook ShmAttachCookie) Check() error {
}
// Write request to wire for ShmAttach
-func (c *Conn) shmAttachRequest(Shmseg Id, Shmid uint32, ReadOnly bool) []byte {
+func (c *Conn) shmAttachRequest(Shmseg ShmSeg, Shmid uint32, ReadOnly bool) []byte {
size := 16
b := 0
buf := make([]byte, size)
@@ -368,13 +374,13 @@ type ShmDetachCookie struct {
}
// Write request to wire for ShmDetach
-func (c *Conn) ShmDetach(Shmseg Id) ShmDetachCookie {
+func (c *Conn) ShmDetach(Shmseg ShmSeg) ShmDetachCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.shmDetachRequest(Shmseg), cookie)
return ShmDetachCookie{cookie}
}
-func (c *Conn) ShmDetachChecked(Shmseg Id) ShmDetachCookie {
+func (c *Conn) ShmDetachChecked(Shmseg ShmSeg) ShmDetachCookie {
cookie := c.newCookie(true, false)
c.newRequest(c.shmDetachRequest(Shmseg), cookie)
return ShmDetachCookie{cookie}
@@ -385,7 +391,7 @@ func (cook ShmDetachCookie) Check() error {
}
// Write request to wire for ShmDetach
-func (c *Conn) shmDetachRequest(Shmseg Id) []byte {
+func (c *Conn) shmDetachRequest(Shmseg ShmSeg) []byte {
size := 8
b := 0
buf := make([]byte, size)
@@ -412,13 +418,13 @@ type ShmPutImageCookie struct {
}
// Write request to wire for ShmPutImage
-func (c *Conn) ShmPutImage(Drawable Id, Gc Id, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Id, Offset uint32) ShmPutImageCookie {
+func (c *Conn) ShmPutImage(Drawable Drawable, Gc Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg ShmSeg, Offset uint32) ShmPutImageCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.shmPutImageRequest(Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie)
return ShmPutImageCookie{cookie}
}
-func (c *Conn) ShmPutImageChecked(Drawable Id, Gc Id, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Id, Offset uint32) ShmPutImageCookie {
+func (c *Conn) ShmPutImageChecked(Drawable Drawable, Gc Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg ShmSeg, Offset uint32) ShmPutImageCookie {
cookie := c.newCookie(true, false)
c.newRequest(c.shmPutImageRequest(Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset), cookie)
return ShmPutImageCookie{cookie}
@@ -429,7 +435,7 @@ func (cook ShmPutImageCookie) Check() error {
}
// Write request to wire for ShmPutImage
-func (c *Conn) shmPutImageRequest(Drawable Id, Gc Id, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Id, Offset uint32) []byte {
+func (c *Conn) shmPutImageRequest(Drawable Drawable, Gc Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg ShmSeg, Offset uint32) []byte {
size := 40
b := 0
buf := make([]byte, size)
@@ -499,13 +505,13 @@ type ShmGetImageCookie struct {
*cookie
}
-func (c *Conn) ShmGetImage(Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Id, Offset uint32) ShmGetImageCookie {
+func (c *Conn) ShmGetImage(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg ShmSeg, Offset uint32) ShmGetImageCookie {
cookie := c.newCookie(true, true)
c.newRequest(c.shmGetImageRequest(Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie)
return ShmGetImageCookie{cookie}
}
-func (c *Conn) ShmGetImageUnchecked(Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Id, Offset uint32) ShmGetImageCookie {
+func (c *Conn) ShmGetImageUnchecked(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg ShmSeg, Offset uint32) ShmGetImageCookie {
cookie := c.newCookie(false, true)
c.newRequest(c.shmGetImageRequest(Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset), cookie)
return ShmGetImageCookie{cookie}
@@ -561,7 +567,7 @@ func (cook ShmGetImageCookie) Check() error {
}
// Write request to wire for ShmGetImage
-func (c *Conn) shmGetImageRequest(Drawable Id, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Id, Offset uint32) []byte {
+func (c *Conn) shmGetImageRequest(Drawable Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg ShmSeg, Offset uint32) []byte {
size := 32
b := 0
buf := make([]byte, size)
@@ -614,13 +620,13 @@ type ShmCreatePixmapCookie struct {
}
// Write request to wire for ShmCreatePixmap
-func (c *Conn) ShmCreatePixmap(Pid Id, Drawable Id, Width uint16, Height uint16, Depth byte, Shmseg Id, Offset uint32) ShmCreatePixmapCookie {
+func (c *Conn) ShmCreatePixmap(Pid Pixmap, Drawable Drawable, Width uint16, Height uint16, Depth byte, Shmseg ShmSeg, Offset uint32) ShmCreatePixmapCookie {
cookie := c.newCookie(false, false)
c.newRequest(c.shmCreatePixmapRequest(Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie)
return ShmCreatePixmapCookie{cookie}
}
-func (c *Conn) ShmCreatePixmapChecked(Pid Id, Drawable Id, Width uint16, Height uint16, Depth byte, Shmseg Id, Offset uint32) ShmCreatePixmapCookie {
+func (c *Conn) ShmCreatePixmapChecked(Pid Pixmap, Drawable Drawable, Width uint16, Height uint16, Depth byte, Shmseg ShmSeg, Offset uint32) ShmCreatePixmapCookie {
cookie := c.newCookie(true, false)
c.newRequest(c.shmCreatePixmapRequest(Pid, Drawable, Width, Height, Depth, Shmseg, Offset), cookie)
return ShmCreatePixmapCookie{cookie}
@@ -631,7 +637,7 @@ func (cook ShmCreatePixmapCookie) Check() error {
}
// Write request to wire for ShmCreatePixmap
-func (c *Conn) shmCreatePixmapRequest(Pid Id, Drawable Id, Width uint16, Height uint16, Depth byte, Shmseg Id, Offset uint32) []byte {
+func (c *Conn) shmCreatePixmapRequest(Pid Pixmap, Drawable Drawable, Width uint16, Height uint16, Depth byte, Shmseg ShmSeg, Offset uint32) []byte {
size := 28
b := 0
buf := make([]byte, size)