diff options
Diffstat (limited to 'nexgb/xgbgen/context.go')
-rw-r--r-- | nexgb/xgbgen/context.go | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go index f18fd67..0728b64 100644 --- a/nexgb/xgbgen/context.go +++ b/nexgb/xgbgen/context.go @@ -49,8 +49,23 @@ func (c *Context) Morph(xmlBytes []byte) { // Translate XML types to nice types c.protocol = parsedXml.Translate(nil) - - c.protocol.AddAlignGaps() + + // For backwards compatibility we patch the type of the send_event field of + // PutImage to be byte + if c.protocol.Name == "shm" { + for _, req := range c.protocol.Requests { + if req.xmlName != "PutImage" { + continue + } + for _, ifield := range req.Fields { + field, ok := ifield.(*SingleField) + if !ok || field.xmlName != "send_event" { + continue + } + field.Type = &Base{ srcName: "byte", xmlName: "CARD8", size: newFixedSize(1, true) } + } + } + } // Start with Go header. c.Putln("// Package %s is the X client API for the %s extension.", |