summaryrefslogtreecommitdiff
path: root/xgbgen/context.go
diff options
context:
space:
mode:
authorAlessandro Arzilli <[email protected]>2022-10-29 21:44:00 +0200
committerMilan Nikolic <[email protected]>2022-10-29 21:44:00 +0200
commit54fbc6f8722629e1bd14c432e9e17499d2925ac7 (patch)
tree325e5c0a0747963e2b9804ee03a577b594731c3f /xgbgen/context.go
parent7effddcf465f2b8e142c828c90951614922d9b32 (diff)
Changed xgbgen to support xcb-proto >= 1.12
Diffstat (limited to 'xgbgen/context.go')
-rw-r--r--xgbgen/context.go19
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.",