summaryrefslogtreecommitdiff
path: root/xgbgen/context.go
diff options
context:
space:
mode:
authorjEzEk <[email protected]>2022-11-05 21:22:59 +0100
committerGitHub <[email protected]>2022-11-05 21:22:59 +0100
commita57abb570aeba12f867c58afe22ce49ac5db4872 (patch)
tree41f7f8fdc1ec903272515c18a0751041702da69e /xgbgen/context.go
parent7effddcf465f2b8e142c828c90951614922d9b32 (diff)
parentba0b8dd42f220cde96737bbd61d87f1bc136824e (diff)
Merge pull request #10 from gen2brain/masterv1.1.0
Support for xcb-proto version 1.15.2, #issue 9
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.",