aboutsummaryrefslogtreecommitdiff
path: root/nexgb/xgbgen/request_reply.go
diff options
context:
space:
mode:
authoraarzilli <alessandro.arzilli@gmail.com>2017-01-18 09:53:26 +0100
committerPřemysl Janouch <p@janouch.name>2018-09-08 16:49:26 +0200
commit1c01d79ba14a802c603ca2e5bbd35156e3363b85 (patch)
tree5ba818deb4c33dd44df9b5c66dc9d45f3b1672e5 /nexgb/xgbgen/request_reply.go
parenta102c4056f6b01035772cf79060012ff800c9669 (diff)
downloadhaven-1c01d79ba14a802c603ca2e5bbd35156e3363b85.tar.gz
haven-1c01d79ba14a802c603ca2e5bbd35156e3363b85.tar.xz
haven-1c01d79ba14a802c603ca2e5bbd35156e3363b85.zip
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
Diffstat (limited to 'nexgb/xgbgen/request_reply.go')
-rw-r--r--nexgb/xgbgen/request_reply.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/nexgb/xgbgen/request_reply.go b/nexgb/xgbgen/request_reply.go
index ae4eccb..5032e31 100644
--- a/nexgb/xgbgen/request_reply.go
+++ b/nexgb/xgbgen/request_reply.go
@@ -105,17 +105,15 @@ func (r *Request) Size(c *Context) Size {
}
for _, field := range r.Fields {
- switch field.(type) {
+ switch field := field.(type) {
case *LocalField: // local fields don't go over the wire
continue
case *SingleField:
- // mofos!!!
- if r.SrcName() == "ConfigureWindow" &&
- field.SrcName() == "ValueMask" {
-
- continue
+ fsz := field.Size()
+ if _, isstruct := field.Type.(*Struct); isstruct {
+ fsz.Expression = fsz.Expression.Specialize(field.SrcName())
}
- size = size.Add(field.Size())
+ size = size.Add(fsz)
default:
size = size.Add(field.Size())
}