diff options
| author | Alessandro Arzilli <[email protected]> | 2022-10-29 21:44:00 +0200 |
|---|---|---|
| committer | Milan Nikolic <[email protected]> | 2022-10-29 21:44:00 +0200 |
| commit | 54fbc6f8722629e1bd14c432e9e17499d2925ac7 (patch) | |
| tree | 325e5c0a0747963e2b9804ee03a577b594731c3f /xgbgen/context.go | |
| parent | 7effddcf465f2b8e142c828c90951614922d9b32 (diff) | |
Changed xgbgen to support xcb-proto >= 1.12
Diffstat (limited to 'xgbgen/context.go')
| -rw-r--r-- | xgbgen/context.go | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/xgbgen/context.go b/xgbgen/context.go index 755cf6e..2e31598 100644 --- a/xgbgen/context.go +++ b/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.", |
