From 1c01d79ba14a802c603ca2e5bbd35156e3363b85 Mon Sep 17 00:00:00 2001 From: aarzilli Date: Wed, 18 Jan 2017 09:53:26 +0100 Subject: Changed xgbgen to support xcb-proto 1.12 * Added minimal support for switch fields. * Changed the way Size is calculated to accomodate for lists inside structs (added to randr) * Removed heuristic to place alignment gaps, they are now explicitly described in xml --- nexgb/xgbgen/context.go | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'nexgb/xgbgen/context.go') 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.", -- cgit v1.2.3-70-g09d2