func GlyphinfoRead(buf []byte, v *Glyphinfo) int {
	b := 0
	v.Width = xgb.Get16(buf[b:])
	b += 2
	v.Height = xgb.Get16(buf[b:])
	b += 2
	v.X = int16(xgb.Get16(buf[b:]))
	b += 2
	v.Y = int16(xgb.Get16(buf[b:]))
	b += 2
	v.XOff = int16(xgb.Get16(buf[b:]))
	b += 2
	v.YOff = int16(xgb.Get16(buf[b:]))
	b += 2
	return b
}
GlyphinfoRead reads a byte slice into a Glyphinfo value.
package render
import (
	"github.com/BurntSushi/xgb"
	"github.com/BurntSushi/xgb/xproto"
)
func Init(c *xgb.Conn) error {
	reply, err := xproto.QueryExtension(c, 6, "RENDER").Reply()
	switch {
	case err != nil:
		return err
	case !reply.Present:
		return xgb.Errorf("No extension named RENDER could be found on on the server.")
	}
	c.ExtLock.Lock()
	c.Extensions["RENDER"] = reply.MajorOpcode
	c.ExtLock.Unlock()
	for evNum, fun := range xgb.NewExtEventFuncs["RENDER"] {
		xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun
	}
	for errNum, fun := range xgb.NewExtErrorFuncs["RENDER"] {
		xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun
	}
	return nil
}
func init() {
	xgb.NewExtEventFuncs["RENDER"] = make(map[int]xgb.NewEventFun)
	xgb.NewExtErrorFuncs["RENDER"] = make(map[int]xgb.NewErrorFun)
}
type Animcursorelt struct {
	Cursor xproto.Cursor
	Delay  uint32
}
func AnimcursoreltRead(buf []byte, v *Animcursorelt) int {
	b := 0
	v.Cursor = xproto.Cursor(xgb.Get32(buf[b:]))
	b += 4
	v.Delay = xgb.Get32(buf[b:])
	b += 4
	return b
}
func AnimcursoreltReadList(buf []byte, dest []Animcursorelt) int {
	b := 0
	for i := 0; i < len(dest); i++ {
		dest[i] = Animcursorelt{}
		b += AnimcursoreltRead(buf[b:], &dest[i])
	}
	return xgb.Pad(b)
}
func (v Animcursorelt) Bytes() []byte {
	buf := make([]byte, 8)
	b := 0
	xgb.Put32(buf[b:], uint32(v.Cursor))
	b += 4
	xgb.Put32(buf[b:], v.Delay)
	b += 4
	return buf[:b]
}
func AnimcursoreltListBytes(buf []byte, list []Animcursorelt) int {
	b := 0
	var structBytes []byte
	for _, item := range list {
		structBytes = item.Bytes()
		copy(buf[b:], structBytes)
		b += len(structBytes)
	}
	return xgb.Pad(b)
}
type Color struct {
	Red   uint16
	Green uint16
	Blue  uint16
	Alpha uint16
}
func ColorRead(buf []byte, v *Color) int {
	b := 0
	v.Red = xgb.Get16(buf[b:])
	b += 2
	v.Green = xgb.Get16(buf[b:])
	b += 2
	v.Blue = xgb.Get16(buf[b:])
	b += 2
	v.Alpha = xgb.Get16(buf[b:])
	b += 2
	return b
}
func ColorReadList(buf []byte, dest []Color) int {
	b := 0
	for i := 0; i < len(dest); i++ {
		dest[i] = Color{}
		b += ColorRead(buf[b:], &dest[i])
	}
	return xgb.Pad(b)
}
func (v Color) Bytes() []byte {
	buf := make([]byte, 8)
	b := 0
	xgb.Put16(buf[b:], v.Red)
	b += 2
	xgb.Put16(buf[b:], v.Green)
	b += 2
	xgb.Put16(buf[b:], v.Blue)
	b += 2
	xgb.Put16(buf[b:], v.Alpha)
	b += 2
	return buf[:b]
}
func ColorListBytes(buf []byte, list []Color) int {
	b := 0
	var structBytes []byte
	for _, item := range list {
		structBytes = item.Bytes()
		copy(buf[b:], structBytes)
		b += len(structBytes)
	}
	return xgb.Pad(b)
}
const (
	CpRepeat           = 1
	CpAlphaMap         = 2
	CpAlphaXOrigin     = 4
	CpAlphaYOrigin     = 8
	CpClipXOrigin      = 16
	CpClipYOrigin      = 32
	CpClipMask         = 64
	CpGraphicsExposure = 128
	CpSubwindowMode    = 256
	CpPolyEdge         = 512
	CpPolyMode         = 1024
	CpDither           = 2048
	CpComponentAlpha   = 4096
)
type Directformat struct {
	RedShift   uint16
	RedMask    uint16
	GreenShift uint16
	GreenMask  uint16
	BlueShift  uint16
	BlueMask   uint16
	AlphaShift uint16
	AlphaMask  uint16
}
func DirectformatRead(buf []byte, v *Directformat) int {
	b := 0
	v.RedShift = xgb.Get16(buf[b:])
	b += 2
	v.RedMask = xgb.Get16(buf[b:])
	b += 2
	v.GreenShift = xgb.Get16(buf[b:])
	b += 2
	v.GreenMask = xgb.Get16(buf[b:])
	b += 2
	v.BlueShift = xgb.Get16(buf[b:])
	b += 2
	v.BlueMask = xgb.Get16(buf[b:])
	b += 2
	v.AlphaShift = xgb.Get16(buf[b:])
	b += 2
	v.AlphaMask = xgb.Get16(buf[b:])
	b += 2
	return b
}
func DirectformatReadList(buf []byte, dest []Directformat) int {
	b := 0
	for i := 0; i < len(dest); i++ {
		dest[i] = Directformat{}
		b += DirectformatRead(buf[b:], &dest[i])
	}
	return xgb.Pad(b)
}
func (v Directformat) Bytes() []byte {
	buf := make([]byte, 16)
	b := 0
	xgb.Put16(buf[b:], v.RedShift)
	b += 2
	xgb.Put16(buf[b:], v.RedMask)
	b += 2
	xgb.Put16(buf[b:], v.GreenShift)
	b += 2
	xgb.Put16(buf[b:], v.GreenMask)
	b += 2
	xgb.Put16(buf[b:], v.BlueShift)
	b += 2
	xgb.Put16(buf[b:], v.BlueMask)
	b += 2
	xgb.Put16(buf[b:], v.AlphaShift)
	b += 2
	xgb.Put16(buf[b:], v.AlphaMask)
	b += 2
	return buf[:b]
}
func DirectformatListBytes(buf []byte, list []Directformat) int {
	b := 0
	var structBytes []byte
	for _, item := range list {
		structBytes = item.Bytes()
		copy(buf[b:], structBytes)
		b += len(structBytes)
	}
	return xgb.Pad(b)
}
type Fixed int32
type Glyph uint32
const BadGlyph = 4
type GlyphError struct {
	Sequence uint16
	NiceName string
}
func GlyphErrorNew(buf []byte) xgb.Error {
	v := GlyphError{}
	v.NiceName = "Glyph"
	b := 1  
	b += 1  
	v.Sequence = xgb.Get16(buf[b:])
	b += 2
	return v
}
func (err GlyphError) SequenceId() uint16 {
	return err.Sequence
}
func (err GlyphError) BadId() uint32 {
	return 0
}
func (err GlyphError) Error() string {
	fieldVals := make([]string, 0, 0)
	fieldVals = append(fieldVals, "NiceName: "+err.NiceName)
	fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence))
	return "BadGlyph {" + xgb.StringsJoin(fieldVals, ", ") + "}"
}
func init() {
	xgb.NewExtErrorFuncs["RENDER"][4] = GlyphErrorNew
}
const BadGlyphSet = 3
type GlyphSetError struct {
	Sequence uint16
	NiceName string
}
func GlyphSetErrorNew(buf []byte) xgb.Error {
	v := GlyphSetError{}
	v.NiceName = "GlyphSet"
	b := 1  
	b += 1  
	v.Sequence = xgb.Get16(buf[b:])
	b += 2
	return v
}
func (err GlyphSetError) SequenceId() uint16 {
	return err.Sequence
}
func (err GlyphSetError) BadId() uint32 {
	return 0
}
func (err GlyphSetError) Error() string {
	fieldVals := make([]string, 0, 0)
	fieldVals = append(fieldVals, "NiceName: "+err.NiceName)
	fieldVals = append(fieldVals, xgb.Sprintf("Sequence: %d", err.Sequence))
	return "BadGlyphSet {" + xgb.StringsJoin(fieldVals, ", ") + "}"
}
func init() {
	xgb.NewExtErrorFuncs["RENDER"][3] = GlyphSetErrorNew
}
type Glyphinfo struct {
	Width  uint16
	Height uint16
	X      int16
	Y      int16
	XOff   int16
	YOff   int16
}